org.objectweb.fractal.fraclet
Class PrimitiveDefinitionPlugin

java.lang.Object
  extended by org.generama.Plugin
      extended by org.generama.defaults.QDoxPlugin
          extended by org.objectweb.fractal.fraclet.Plugin
              extended by org.objectweb.fractal.fraclet.FractalPlugin
                  extended by org.objectweb.fractal.fraclet.PrimitiveDefinitionPlugin
All Implemented Interfaces:
org.picocontainer.Startable
Direct Known Subclasses:
CompositeDefinitionPlugin

public class PrimitiveDefinitionPlugin
extends FractalPlugin

XDoclet plugin applied in conjunction with the FractalAdlPlugin.jelly template to generate primitive component descriptor file.

Version:
$Revision: 1.4 $
Author:
Romain Rouvoy

Field Summary
protected static String DEFINITION_SEP
          Definition list separator.
 
Fields inherited from class org.objectweb.fractal.fraclet.FractalPlugin
ATTR_CTRL, ATTR_NAME, ATTRIBUTE_NAME, COMP_PREFIX, COMPONENT, CONTROL, FC_CONTROL, LIFECYCLE, LOGGER_NAME, PROVIDES, REQUIRES
 
Fields inherited from class org.objectweb.fractal.fraclet.Plugin
OBJECT, shouldGenerate
 
Fields inherited from class org.generama.defaults.QDoxPlugin
metadataProvider
 
Fields inherited from class org.generama.Plugin
DONTEDIT, writerMapper
 
Constructor Summary
PrimitiveDefinitionPlugin(JellyTemplateEngine jelly, QDoxCapableMetadataProvider qdox, WriterMapper writer)
          Composite definition generator for abstract composite.
 
Method Summary
 String argumentsDefinition(JavaClass cls)
          Provides the list of arguments required by the component.
 String attributeValue(JavaField fld)
          Provides the ADL value of the component attribute.
 String contentClass(JavaClass cls)
          Provides the name of the content class implementing the component.
 String definitionFullname(JavaClass cls)
          Provides the fully qualified name of the component depending on the filename.
 String definitionName(JavaClass cls)
          Provides the short name of the component depending on the filename.
 String definitionParameters(JavaClass cls)
          Provides the parameters of the component definition.
 String extendsDefinition(JavaClass cls)
          Provides the list of extended definitions.
protected  String extendsElement(JavaClass cls)
          Adds a definition extended.
 String interfaceName(JavaClass cls, ProvidesTag tag)
          Provides the name of the associated interface.
 String interfaceSignature(JavaClass cls, ProvidesTag tag)
          Provides the signature of the associated interface.
 boolean shouldGenerate(Object obj)
           
 
Methods inherited from class org.objectweb.fractal.fraclet.FractalPlugin
attributeController, attributeControllerFullname, attributeControllerName, attributeName, attributes, bindingName, bindings, bindingSignature, componentFullname, componentName, componentPackage, extend, hasAttributes, hasBindings, hasGlue, hasLifecycles, hasLogger, hasPackage, hasReflects, isAttributeController, isComponent, isController, isData, isInterface, isPrimitive, lifecycles, loggerName, loggers, packagePrefix, reflects, superAttributeController
 
Methods inherited from class org.objectweb.fractal.fraclet.Plugin
debug, failure, fields, getDestinationFilename, getDestinationPackage, methods, setDestination, toInt
 
Methods inherited from class org.generama.defaults.QDoxPlugin
getMetadata, getMetadataProvider, setRestrictedpath
 
Methods inherited from class org.generama.Plugin
assertTrue, getContextObjects, getDestdirFile, getEncoding, getOutputValidator, getPackageName, getWriterMapper, isEmpty, isMultioutput, isValidate, populateContextMap, preGenerate, setDestdir, setEncoding, setFileregex, setFilereplace, setMultioutput, setOutputValidator, setPackageregex, setPackagereplace, setValidate, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFINITION_SEP

protected static final String DEFINITION_SEP
Definition list separator.

See Also:
Constant Field Values
Constructor Detail

PrimitiveDefinitionPlugin

public PrimitiveDefinitionPlugin(JellyTemplateEngine jelly,
                                 QDoxCapableMetadataProvider qdox,
                                 WriterMapper writer)
Composite definition generator for abstract composite.

Parameters:
jelly - the jelly XML template engine.
qdox - the qdox java model provider.
writer - the file writer mapper.
Method Detail

shouldGenerate

public boolean shouldGenerate(Object obj)
Overrides:
shouldGenerate in class Plugin

definitionName

public String definitionName(JavaClass cls)
Provides the short name of the component depending on the filename.

Parameters:
cls - the java class source file parsed.
Returns:
the fully qualified name of the associated definition.

definitionFullname

public String definitionFullname(JavaClass cls)
Provides the fully qualified name of the component depending on the filename.

Parameters:
cls - the java class source file parsed.
Returns:
the fully qualified name of the associated definition.

extendsElement

protected String extendsElement(JavaClass cls)
Adds a definition extended.

Parameters:
cls - the java class source file parsed.
Returns:
the associated extend clause (empty if no extend).

definitionParameters

public String definitionParameters(JavaClass cls)
Provides the parameters of the component definition.

Parameters:
cls - the class considered.
Returns:
the list of parameters.

extendsDefinition

public String extendsDefinition(JavaClass cls)
Provides the list of extended definitions.

Parameters:
cls - the java class source file parsed.
Returns:
a comma separated list of extended component definitions (null if no extended definition).

interfaceName

public String interfaceName(JavaClass cls,
                            ProvidesTag tag)
Provides the name of the associated interface.

Parameters:
cls - the java class source file parsed.
tag - the FractalItfTag associated.
Returns:
the name of the interface.

interfaceSignature

public String interfaceSignature(JavaClass cls,
                                 ProvidesTag tag)
Provides the signature of the associated interface.

Parameters:
cls - the java class source file parsed.
tag - the FractalItfTag associated.
Returns:
the signature of the interface.

argumentsDefinition

public String argumentsDefinition(JavaClass cls)
Provides the list of arguments required by the component.

Parameters:
cls - the java class source file parsed.
Returns:
a comma separated list of argument for the component (null if no arguments).

attributeValue

public String attributeValue(JavaField fld)
Provides the ADL value of the component attribute.

Parameters:
fld - the java field source file parsed.
Returns:
the name of the associated attribute.

contentClass

public String contentClass(JavaClass cls)
Provides the name of the content class implementing the component.

Returns:
the name of the primitive component definition.