org.objectweb.fractal.fraclet
Class Plugin

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

public class Plugin
extends QDoxPlugin

Abstract Fractal plugin supporting Jelly and Velocity as template engines.

Version:
$Revision: 1.2 $
Author:
Romain Rouvoy

Field Summary
protected static String OBJECT
           
protected  boolean shouldGenerate
           
 
Fields inherited from class org.generama.defaults.QDoxPlugin
metadataProvider
 
Fields inherited from class org.generama.Plugin
DONTEDIT, writerMapper
 
Constructor Summary
Plugin(JellyTemplateEngine jelly, QDoxCapableMetadataProvider qdox, WriterMapper writer)
          Constructor used to generate XML files.
Plugin(VelocityTemplateEngine velocity, QDoxCapableMetadataProvider qdox, WriterMapper writer)
          Constructor used to generate Java or Property files.
 
Method Summary
protected  void debug(String message)
          Method used to abort the generation process.
protected  void failure(AbstractJavaEntity entity, String message)
          Method used to abort the generation process.
protected  Collection fields(JavaClass cls, String doclet, boolean all)
          Provides a list of filtered fields.
 String getDestinationFilename(Object metadata)
           
 String getDestinationPackage(Object metadata)
           
protected  Collection methods(JavaClass cls, String doclet, boolean all)
          Provides a list of filtered methods.
protected  void setDestination(String pkg, String file, String ext)
          Provides the destination characteristics of the artifact.
 boolean shouldGenerate(Object obj)
           
protected static int toInt(boolean bool)
          Converts a boolean to an array index.
 
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

OBJECT

protected static final String OBJECT
See Also:
Constant Field Values

shouldGenerate

protected boolean shouldGenerate
Constructor Detail

Plugin

public Plugin(JellyTemplateEngine jelly,
              QDoxCapableMetadataProvider qdox,
              WriterMapper writer)
Constructor used to generate XML files.

Parameters:
jelly - Jelly template engine used to generate artifacts.
qdox - QDox source code metadata provider.
writer - the output writer.

Plugin

public Plugin(VelocityTemplateEngine velocity,
              QDoxCapableMetadataProvider qdox,
              WriterMapper writer)
Constructor used to generate Java or Property files.

Parameters:
velocity - Velocity template engine used to generate artifacts.
qdox - QDox source code metadata provider.
writer - the output writer.
Method Detail

debug

protected void debug(String message)
Method used to abort the generation process.

Parameters:
message - the abort notification message.

failure

protected void failure(AbstractJavaEntity entity,
                       String message)
Method used to abort the generation process.

Parameters:
message - the abort notification message.

shouldGenerate

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

setDestination

protected void setDestination(String pkg,
                              String file,
                              String ext)
Provides the destination characteristics of the artifact.

Parameters:
pkg - the package
file - the file
ext - the extension

getDestinationPackage

public String getDestinationPackage(Object metadata)
Overrides:
getDestinationPackage in class Plugin

getDestinationFilename

public String getDestinationFilename(Object metadata)
Overrides:
getDestinationFilename in class Plugin

fields

protected Collection fields(JavaClass cls,
                            String doclet,
                            boolean all)
Provides a list of filtered fields.

Parameters:
cls - the java class source file parsed.
doclet - the name of the doclet to retrieve.
all - performs the search recursively.
Returns:
the list of fields having the doclet tag.

methods

protected Collection methods(JavaClass cls,
                             String doclet,
                             boolean all)
Provides a list of filtered methods.

Parameters:
cls - the java class source file parsed.
doclet - the name of the doclet to retrieve.
all - performs the search recursively.
Returns:
the list of methods having the doclet tag.

toInt

protected static int toInt(boolean bool)
Converts a boolean to an array index.

Parameters:
bool -
Returns:
1 if bool==true and 0 else.