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)

UNKNOWN: Feb 5, 2002 display-name = "Value Object" name = "valueobject" parent = "xdoclet.modules.ejb.EjbDocletTask" file = "valueobject-custom.xdt" relates-to = "{0}Value.java" description = "A text file containing * custom template and/or java code to include in the value object class."

Field Summary
protected XTagcurrentDataObjectTag
Form tag being processed right now
static StringDEFAULT_DATAOBJECT_CLASS_PATTERN
protected static StringDEFAULT_TEMPLATE_FILE
protected StringvalueObjectClassPattern
A configuration parameter for specifying the data object class name pattern.
Constructor Summary
ValueObjectSubTask()
Describe what the ValueObjectSubTask constructor does
Method Summary
protected voidengineStarted()
Describe what the method does
protected voidgenerateForClass(XClass clazz)
Describe what the method does
static StringgetCurrentValueObjectClass()
Gets the CurrentValueObjectClass attribute of the ValueObjectSubTask class
static StringgetCurrentValueObjectExtends()
static StringgetCurrentValueObjectImplements()
static StringgetCurrentValueObjectMatch()
Gets the CurrentValueObjectMatch attribute of the ValueObjectSubTask class
static StringgetCurrentValueObjectName()
Gets the CurrentValueObjectName attribute of the ValueObjectSubTask class
protected StringgetGeneratedFileName(XClass clazz)
Gets the GeneratedFileName attribute of the ValueObjectSubTask object
booleangetGeneratePKConstructor()
StringgetValueObjectClassPattern()
Returns the configuration parameter for specifying the data object class name pattern.
protected booleanmatchesGenerationRules(XClass clazz)
Describe what the method does
voidsetGeneratePKConstructor(String generatePKConstructor)
Whether to generate a single-parameter constructor in the ValueObject, which only sets up the PK.
voidsetPattern(String new_pattern)
The pattern by which the value object classes are named.
voidvalidateOptions()
Called to validate configuration parameters.

Field Detail

currentDataObjectTag

protected XTag currentDataObjectTag
Form tag being processed right now

DEFAULT_DATAOBJECT_CLASS_PATTERN

public static final String DEFAULT_DATAOBJECT_CLASS_PATTERN

DEFAULT_TEMPLATE_FILE

protected static final String DEFAULT_TEMPLATE_FILE

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.

See Also: getValueObjectClassPattern

Constructor Detail

ValueObjectSubTask

public ValueObjectSubTask()
Describe what the ValueObjectSubTask constructor does

Method Detail

engineStarted

protected void engineStarted()
Describe what the method does

Throws: XDocletException

generateForClass

protected void generateForClass(XClass clazz)
Describe what the method does

Parameters: clazz Describe what the parameter does

Throws: 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

getGeneratedFileName

protected String getGeneratedFileName(XClass clazz)
Gets the GeneratedFileName attribute of the ValueObjectSubTask object

Parameters: clazz Describe what the parameter does

Returns: The GeneratedFileName value

Throws: XDocletException

getGeneratePKConstructor

public boolean getGeneratePKConstructor()

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

See Also: valueObjectClassPattern

matchesGenerationRules

protected boolean matchesGenerationRules(XClass clazz)
Describe what the method does

Parameters: clazz Describe what the parameter does

Returns: Describe the return value

Throws: 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

UNKNOWN: 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

UNKNOWN: "No, default is '{0}Value'"

validateOptions

public void validateOptions()
Called to validate configuration parameters.

Throws: XDocletException