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.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.2 $
Author:
Romain Rouvoy

Field Summary
protected static String ADL_PREFIX
           
protected static String CONTENT_PREFIX
           
protected static String DEFINITION_SEPARATOR
          Definition list separator.
 
Fields inherited from class org.objectweb.fractal.fraclet.FractalPlugin
AC_NAME, ATTR_CTRL, ATTR_NAME, BC_NAME, FC_CONTROL, ITF_NAME, LIFECYCLE_NAME, LOG_NAME, OBJECT, RC_NAME, 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 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.
 String parameters(JavaClass cls)
          Provides the parameters of the component definition.
 String primitiveDefinition(JavaClass cls)
          Returns the fully qualified name of the definition associated to the class.
 boolean shouldGenerate(Object obj)
           
 
Methods inherited from class org.objectweb.fractal.fraclet.FractalPlugin
attributeController, attributeName, attributes, bindingName, bindings, bindingSignature, extend, failure, fields, fullname, hasAttributes, hasBindings, hasGlue, hasLifecycles, hasLogger, hasReflects, isAttributeController, isComponent, isController, isData, isInterface, isPrimitive, lifecycles, loggerName, loggers, methods, name, packagePrefix, reflects, superAttributeController
 
Methods inherited from class org.generama.defaults.QDoxPlugin
getMetadata, getMetadataProvider, setRestrictedpath
 
Methods inherited from class org.generama.Plugin
assertTrue, getContextObjects, getDestdirFile, getDestinationFilename, getDestinationPackage, 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_SEPARATOR

protected static final String DEFINITION_SEPARATOR
Definition list separator.

See Also:
Constant Field Values

CONTENT_PREFIX

protected static final String CONTENT_PREFIX
See Also:
Constant Field Values

ADL_PREFIX

protected static final String ADL_PREFIX
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 FractalPlugin

primitiveDefinition

public String primitiveDefinition(JavaClass cls)
Returns the fully qualified name of the definition associated to the class.

Parameters:
cls - the class considered.
Returns:
the fully qualified name of the associated definition.

parameters

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

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

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).

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.