net.sf.xsnapshot.ant
Class XSnapshotDocletTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byxjavadoc.ant.XJavadocTask
              extended byxdoclet.DocletTask
                  extended bynet.sf.xsnapshot.ant.XSnapshotDocletTask
All Implemented Interfaces:
org.apache.tools.ant.DynamicAttribute, org.apache.tools.ant.DynamicConfigurator, org.apache.tools.ant.DynamicElement

public class XSnapshotDocletTask
extends xdoclet.DocletTask

This is the main Doclet Task for XSnapshot. It is the parent task for xsnapshot, helper, properties subtasks. It exposes several properties that can customize the code generation.

Author:
Daniel Kokotov
ant.element
name="xsnapshotdoclet" display-name="XSnapshot Task"

Field Summary
static String ALWAYS_USE_GET
           
static String ALWAYS_USE_IS
           
static String BOOLEAN_GETTER_STRATEGY_PARAM
           
static String COPY_TO_MODEL_PARAM
           
static String DEFAULT_CLASSNAME_PATTERN
           
static String DEFAULT_COPY_TO_MODEL_POLICY
           
static String SAME_AS_MODEL
           
static String SNAPSHOT_CLASSNAME_PATTERN_PARAM
           
 
Fields inherited from class xdoclet.DocletTask
XDOCLET_VERSION
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
XSnapshotDocletTask()
           
 
Method Summary
 String getBooleanGetterStrategy()
           
 String getCopyToModelPolicy()
          Get the copyToModelPolicy.
 String getSnapshotClassnamePattern()
          Get the snapshotClassnamePattern.
 void setBooleanGetterStrategy(String booleanGetterStrategy)
          Set the strategy for generating getter names for boolean-valued properties in snapshots.
 void setCopyToModelPolicy(String copyToModelPolicy)
          Sets the default copy to model policy for all properties of all snapshots being generated.
 void setSnapshotClassnamePattern(String snapshotClassnamePattern)
          Sets the pattern for generating class names for snapshot if no classname is specified explicitly in the xsnapshot.snapshot-class tag.
protected  void validateOptions()
          Called to validate configuration parameters.
 
Methods inherited from class xdoclet.DocletTask
addConfigParam, addFileset, addPackageSubstitution, addSubTask, addTemplate, addXmlTemplate, checkClass, createDynamicElement, getAddedTags, getConfigParams, getConfigParams, getConfigParamsAsMap, getDestDir, getExcludedTags, getMergeDir, getPackageSubstitutions, getSubTaskName, getSubTasks, isForce, isVerbose, setAddedTags, setDestDir, setDynamicAttribute, setExcludedTags, setExcludePackageNames, setForce, setMergeDir, setPackageNames, setPackageSubstitutions, setVerbose, start, validateSubTasks
 
Methods inherited from class xjavadoc.ant.XJavadocTask
createIgnoredtag, execute, getClasspath, getXJavaDoc, setDocencoding, setEncoding, setIgnoredtags, setValidating
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOLEAN_GETTER_STRATEGY_PARAM

public static final String BOOLEAN_GETTER_STRATEGY_PARAM
See Also:
Constant Field Values

ALWAYS_USE_IS

public static final String ALWAYS_USE_IS
See Also:
Constant Field Values

ALWAYS_USE_GET

public static final String ALWAYS_USE_GET
See Also:
Constant Field Values

SAME_AS_MODEL

public static final String SAME_AS_MODEL
See Also:
Constant Field Values

SNAPSHOT_CLASSNAME_PATTERN_PARAM

public static final String SNAPSHOT_CLASSNAME_PATTERN_PARAM
See Also:
Constant Field Values

DEFAULT_CLASSNAME_PATTERN

public static final String DEFAULT_CLASSNAME_PATTERN
See Also:
Constant Field Values

COPY_TO_MODEL_PARAM

public static final String COPY_TO_MODEL_PARAM
See Also:
Constant Field Values

DEFAULT_COPY_TO_MODEL_POLICY

public static final String DEFAULT_COPY_TO_MODEL_POLICY
See Also:
Constant Field Values
Constructor Detail

XSnapshotDocletTask

public XSnapshotDocletTask()
Method Detail

getBooleanGetterStrategy

public String getBooleanGetterStrategy()

setBooleanGetterStrategy

public void setBooleanGetterStrategy(String booleanGetterStrategy)
Set the strategy for generating getter names for boolean-valued properties in snapshots. Legal values are: If unspecified, the default value is "same-as-model"

Parameters:
booleanGetterStrategy -

getCopyToModelPolicy

public String getCopyToModelPolicy()
Get the copyToModelPolicy.

Returns:
Returns the copyToModelPolicy

setCopyToModelPolicy

public void setCopyToModelPolicy(String copyToModelPolicy)
Sets the default copy to model policy for all properties of all snapshots being generated. This can be overridden per each snapshot class and per individual snapshot property. Legal values are one of five keywords or the fully-qualified name of a class that implements net.sf.xsnapshot.CopyToModelPolicy. The five keywords are shorthands for the five predefined policies, as follows: See the javadoc for the classes above for explanations of what properties are copied to model when using that policy. If no policy is specified, the default policy is "conservative".

Parameters:
copyToModelPolicy - The copyToModelPolicy to set

getSnapshotClassnamePattern

public String getSnapshotClassnamePattern()
Get the snapshotClassnamePattern.

Returns:
Returns the snapshotClassnamePattern

setSnapshotClassnamePattern

public void setSnapshotClassnamePattern(String snapshotClassnamePattern)
Sets the pattern for generating class names for snapshot if no classname is specified explicitly in the xsnapshot.snapshot-class tag. This must be a java.util.MessageFormat-compliant pattern. If present, the {0} parameter will be replaced by the classname of the model class, and the {1} paramter will be replaced by the snapshot name, which is first made CamelCase compatible by removing instances of the '-' and '_' characters and capitalizing the letters coming after those characters as well as the first letter (for instance form-bean becomes FormBean). If no pattern is specified the default pattern is "{1}{0}Snapshot"

Parameters:
snapshotClassnamePattern - The snapshotClassnamePattern to set

validateOptions

protected void validateOptions()
                        throws org.apache.tools.ant.BuildException
Called to validate configuration parameters.

Throws:
org.apache.tools.ant.BuildException