org.objectweb.fractal.fraclet
Class AttributeControllerPlugin

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.AttributeControllerPlugin
All Implemented Interfaces:
org.picocontainer.Startable
Direct Known Subclasses:
PrimitiveComponentPlugin

public class AttributeControllerPlugin
extends FractalPlugin

XDoclet plugin applied in conjunction with the FractalAttributePlugin.vm template to generate the AttributeController interface associated to a component.

Version:
$Revision: 1.2 $
Author:
Romain Rouvoy

Field Summary
 
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
AttributeControllerPlugin(VelocityTemplateEngine velocity, QDoxCapableMetadataProvider qdox, WriterMapper writer)
          Attribute controller generator using the Velocity template engine.
 
Method Summary
 String attributeMethod(JavaField fld)
          Provides the name of the attribute for the getter/setter methods.
 boolean hasPackage(JavaClass cls)
          Checks if the class defines a package.
 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
 

Constructor Detail

AttributeControllerPlugin

public AttributeControllerPlugin(VelocityTemplateEngine velocity,
                                 QDoxCapableMetadataProvider qdox,
                                 WriterMapper writer)
Attribute controller generator using the Velocity template engine.

Parameters:
velocity - the Java 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

hasPackage

public boolean hasPackage(JavaClass cls)
Checks if the class defines a package.

Parameters:
cls - the class to check.
Returns:
true if a package is defined.

attributeMethod

public String attributeMethod(JavaField fld)
Provides the name of the attribute for the getter/setter methods.

Parameters:
fld - the java field source file parsed.
Returns:
the name of the associated attribute (first character is upper case).