xdoclet.modules.ejb.entity

Class ValueObjectSubTask


public class ValueObjectSubTask
extends AbstractEjbCodeGeneratorSubTask

Creates "value objects" for Entity EJBs. This task replaces Data Object .
Version:
$Revision: 1.16 $
Author:
Vincent Harcq (vincent.harcq@hubmethods.com)
ant.element
display-name = "Value Object" name = "valueobject" parent = "xdoclet.modules.ejb.EjbDocletTask"
created
Feb 5, 2002

Field Summary

static String
DEFAULT_DATAOBJECT_CLASS_PATTERN
protected static String
DEFAULT_TEMPLATE_FILE
protected XTag
currentDataObjectTag
Form tag being processed right now
protected String
valueObjectClassPattern
A configuration parameter for specifying the data object class name pattern.

Constructor Summary

ValueObjectSubTask()
Describe what the ValueObjectSubTask constructor does

Method Summary

protected void
engineStarted()
Describe what the method does
protected void
generateForClass(XClass clazz)
Describe what the method does
static String
getCurrentValueObjectClass()
Gets the CurrentValueObjectClass attribute of the ValueObjectSubTask class
static String
getCurrentValueObjectExtends()
static String
getCurrentValueObjectImplements()
static String
getCurrentValueObjectMatch()
Gets the CurrentValueObjectMatch attribute of the ValueObjectSubTask class
static String
getCurrentValueObjectName()
Gets the CurrentValueObjectName attribute of the ValueObjectSubTask class
boolean
getGeneratePKConstructor()
protected String
getGeneratedFileName(XClass clazz)
Gets the GeneratedFileName attribute of the ValueObjectSubTask object
String
getValueObjectClassPattern()
Returns the configuration parameter for specifying the data object class name pattern.
protected boolean
matchesGenerationRules(XClass clazz)
Describe what the method does
void
setGeneratePKConstructor(String generatePKConstructor)
Whether to generate a single-parameter constructor in the ValueObject, which only sets up the PK.
void
setPattern(String new_pattern)
The pattern by which the value object classes are named.
void
validateOptions()
Called to validate configuration parameters.

Field Details

DEFAULT_DATAOBJECT_CLASS_PATTERN

public static final String DEFAULT_DATAOBJECT_CLASS_PATTERN

DEFAULT_TEMPLATE_FILE

protected static final String DEFAULT_TEMPLATE_FILE

currentDataObjectTag

protected XTag currentDataObjectTag
Form tag being processed right now

valueObjectClassPattern

protected String valueObjectClassPattern
A configuration parameter for specifying the data object class name pattern. By default the value is used for deciding the entity data object class name. The placeholder "{0}" in the value means the current class's symbolic name which for an EJBean is the EJB name.

Constructor Details

ValueObjectSubTask

public ValueObjectSubTask()
Describe what the ValueObjectSubTask constructor does

Method Details

engineStarted

protected void engineStarted()
            throws xdoclet.XDocletException
Describe what the method does
Throws:
xdoclet.XDocletException -

generateForClass

protected void generateForClass(XClass clazz)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
clazz - Describe what the parameter does
Throws:
xdoclet.XDocletException -

getCurrentValueObjectClass

public static String getCurrentValueObjectClass()
Gets the CurrentValueObjectClass attribute of the ValueObjectSubTask class
Returns:
The CurrentValueObjectClass value

getCurrentValueObjectExtends

public static String getCurrentValueObjectExtends()

getCurrentValueObjectImplements

public static String getCurrentValueObjectImplements()

getCurrentValueObjectMatch

public static String getCurrentValueObjectMatch()
Gets the CurrentValueObjectMatch attribute of the ValueObjectSubTask class
Returns:
The CurrentValueObjectMatch value

getCurrentValueObjectName

public static String getCurrentValueObjectName()
Gets the CurrentValueObjectName attribute of the ValueObjectSubTask class
Returns:
The CurrentValueObjectName value

getGeneratePKConstructor

public boolean getGeneratePKConstructor()

getGeneratedFileName

protected String getGeneratedFileName(XClass clazz)
            throws xdoclet.XDocletException
Gets the GeneratedFileName attribute of the ValueObjectSubTask object
Parameters:
clazz - Describe what the parameter does
Returns:
The GeneratedFileName value
Throws:
xdoclet.XDocletException -

getValueObjectClassPattern

public String getValueObjectClassPattern()
Returns the configuration parameter for specifying the data object class name pattern. By default the value is used for deciding the entity data object class name. The placeholder "{0}" in the value means the current class's symbolic name which for an EJBean is the EJB name. If nothing explicitly specified by user then "{0}Value" is used by default.
Returns:
The ValueObjectClassPattern value

matchesGenerationRules

protected boolean matchesGenerationRules(XClass clazz)
            throws xdoclet.XDocletException
Describe what the method does
Parameters:
clazz - Describe what the parameter does
Returns:
Describe the return value
Throws:
xdoclet.XDocletException -

setGeneratePKConstructor

public void setGeneratePKConstructor(String generatePKConstructor)
Whether to generate a single-parameter constructor in the ValueObject, which only sets up the PK.
Parameters:
generatePKConstructor - The new GeneratePKConstructor value
ant.not-required
No,defaultis false

setPattern

public void setPattern(String new_pattern)
The pattern by which the value object classes are named. The placeholder "{0}" designates the EJB name.
Parameters:
new_pattern - The new Pattern value
ant.not-required
"No, default is '{0}Value'"

validateOptions

public void validateOptions()
            throws xdoclet.XDocletException
Called to validate configuration parameters.
Throws:
xdoclet.XDocletException -