org.objectweb.fractal.fraclet
Class CompositeDefinitionPlugin

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
                      extended by org.objectweb.fractal.fraclet.CompositeDefinitionPlugin
All Implemented Interfaces:
org.picocontainer.Startable

public class CompositeDefinitionPlugin
extends PrimitiveDefinitionPlugin

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 ASSEMBLY_SUFFIX
           
 
Fields inherited from class org.objectweb.fractal.fraclet.PrimitiveDefinitionPlugin
DEFINITION_SEP
 
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
CompositeDefinitionPlugin(JellyTemplateEngine jelly, QDoxCapableMetadataProvider qdox, WriterMapper writer)
          Composite definition generator for abstract composite.
 
Method Summary
 String abstractInterfaceName(JavaField fld)
          Provides the name of a server interface compatible with its reference.
 String argumentsDefinition(JavaClass cls)
          Provides the list of arguments required by the component.
 String asArgument(JavaField f)
           
 String componentParameters(JavaClass cls)
          Provides the parameters of the component definition.
 String compositeFullname(JavaClass cls)
           
 String compositeName(JavaClass cls)
           
protected  String extendsElement(JavaClass cls)
          Adds a definition extended.
 JavaClass interfaceClass(String name)
          Provides the instance of the class element named name.
 boolean shouldGenerate(Object obj)
          param cls the java class source file parsed.
 
Methods inherited from class org.objectweb.fractal.fraclet.PrimitiveDefinitionPlugin
attributeValue, contentClass, definitionFullname, definitionName, definitionParameters, extendsDefinition, interfaceName, interfaceSignature
 
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

ASSEMBLY_SUFFIX

protected static final String ASSEMBLY_SUFFIX
See Also:
Constant Field Values
Constructor Detail

CompositeDefinitionPlugin

public CompositeDefinitionPlugin(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)
param cls the java class source file parsed.

Overrides:
shouldGenerate in class PrimitiveDefinitionPlugin
Returns:
true if a FractalADL file should be generated.

compositeName

public String compositeName(JavaClass cls)

compositeFullname

public String compositeFullname(JavaClass cls)

extendsElement

protected String extendsElement(JavaClass cls)
Description copied from class: PrimitiveDefinitionPlugin
Adds a definition extended.

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

interfaceClass

public JavaClass interfaceClass(String name)
Provides the instance of the class element named name.

Parameters:
name - the name of the class to find.
Returns:
the associated Java model element (null if not found).

abstractInterfaceName

public String abstractInterfaceName(JavaField fld)
Provides the name of a server interface compatible with its reference.

Parameters:
fld - the reference of a server interface.
Returns:
the name of the server interface.

componentParameters

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

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

argumentsDefinition

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

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

asArgument

public String asArgument(JavaField f)