org.exolab.castor.builder

Class FieldInfo

public class FieldInfo extends XMLInfo

A class for representing field members of a Class. FieldInfo objects hold all the information required about a member in order to be able to produce marshal/unmarshal and validation code.

Version: $Revision: 1.2 $ $Date: 2003/03/08 07:35:42 $

Author: Keith Visco

Constructor Summary
FieldInfo(XSType type, String name)
Creates a new FieldInfo with the given XML Schema type and the given member name
Method Summary
voidcreateAccessMethods(JClass jClass)
Creates the access methods for this FieldInfo
voidcreateGetterComment(JDocComment jDocComment)
Creates the Javadoc comments for the getter method associated with this FieldInfo.
voidcreateJavaField(JClass jClass)
Creates the JMembers for this FieldInfo, sometimes a "field" requires more than one java field
voidcreateSetterComment(JDocComment jDocComment)
Creates the Javadoc comments for the setter method associated with this FieldInfo.
voidgenerateInitializerCode(JSourceCode jsc)
Creates code for initialization of this Member
StringgetComment()
Returns the comment associated with this Member
ClassInfogetDeclaringClassInfo()
Returns the ClassInfo to which this Member was declared, for inheritance reasons
StringgetDefaultValue()
Returns the default value for this FieldInfo
StringgetDeleteMethodName()
Returns the name of the delete method for this FieldInfo.
StringgetFixedValue()
Returns the fixed production for this FieldInfo, or null if no fixed value has been specified.
StringgetHasMethodName()
Returns the name of the has method for this FieldInfo
StringgetName()
Returns the name of this FieldInfo
StringgetReadMethodName()
Returns the name of the read method for this FieldInfo
StringgetValidator()
Returns the fully qualified name of the Validator to use.
StringgetWriteMethodName()
Returns the name of the write method for this FieldInfo
StringgetXMLFieldHandler()
Returns the fully qualified name of the XMLFieldHandler to use.
booleanisBound()
Returns true if this FieldInfo represents a bound property
booleanisContainer()
Returns true if this FieldInfo describes a container class.
booleanisTransient()
Returns true if this FieldInfo is a transient member.
protected StringmethodSuffix()
Returns the method suffix for creating method names.
voidsetBound(boolean bound)
Sets whether or not this FieldInfo represents a bound property
voidsetComment(String comment)
Sets the comment for this Member
voidsetContainer(boolean isContainer)
Sets whether or not this FieldInfo describes a container field.
voidsetDeclaringClassInfo(ClassInfo declaringClassInfo)
voidsetDefaultValue(String defaultValue)
Sets the default value for this FieldInfo
voidsetFinal(boolean isFinal)
Sets the "final" status of this FieldInfo.
voidsetFixedValue(String fixedValue)
Sets the fixed value in which instances of this field type must lexically match
voidsetStatic(boolean isStatic)
Sets the "static" status of this FieldInfo.
voidsetTransient(boolean isTransient)
Sets the transient status of this FieldInfo.
voidsetValidator(String validator)
Sets the name of the Validator to use.
voidsetXMLFieldHandler(String handler)
Sets the name of the XMLfieldHandler to use.

Constructor Detail

FieldInfo

public FieldInfo(XSType type, String name)
Creates a new FieldInfo with the given XML Schema type and the given member name

Parameters: XSType the XML Schema type of this member name the name of the member

Method Detail

createAccessMethods

public void createAccessMethods(JClass jClass)
Creates the access methods for this FieldInfo

Parameters: jClass the JClass to add the methods to

createGetterComment

public void createGetterComment(JDocComment jDocComment)
Creates the Javadoc comments for the getter method associated with this FieldInfo.

Parameters: jDocComment the JDocComment to add the Javadoc comments to.

createJavaField

public void createJavaField(JClass jClass)
Creates the JMembers for this FieldInfo, sometimes a "field" requires more than one java field

Returns: a JMember which has the appropriate type and name for this FieldInfo

createSetterComment

public void createSetterComment(JDocComment jDocComment)
Creates the Javadoc comments for the setter method associated with this FieldInfo.

Parameters: jDocComment the JDocComment to add the Javadoc comments to.

generateInitializerCode

public void generateInitializerCode(JSourceCode jsc)
Creates code for initialization of this Member

Parameters: jsc the JSourceCode in which to add the source to

getComment

public String getComment()
Returns the comment associated with this Member

Returns: the comment associated with this Member, or null if one has not been set.

getDeclaringClassInfo

public ClassInfo getDeclaringClassInfo()
Returns the ClassInfo to which this Member was declared, for inheritance reasons

getDefaultValue

public String getDefaultValue()
Returns the default value for this FieldInfo

Returns: the default value for this FieldInfo, or null if no default value was set;

getDeleteMethodName

public String getDeleteMethodName()
Returns the name of the delete method for this FieldInfo.

Returns: the name of the delete method for this FieldInfo

getFixedValue

public String getFixedValue()
Returns the fixed production for this FieldInfo, or null if no fixed value has been specified.

Returns: the fixed value for this FieldInfo
NOTE: Fixed values are NOT the same as default values

getHasMethodName

public String getHasMethodName()
Returns the name of the has method for this FieldInfo

Returns: the name of the has method for this FieldInfo

getName

public String getName()
Returns the name of this FieldInfo

Returns: the name of this FieldInfo

getReadMethodName

public String getReadMethodName()
Returns the name of the read method for this FieldInfo

Returns: the name of the read method for this FieldInfo

getValidator

public String getValidator()
Returns the fully qualified name of the Validator to use.

Returns: the fully qualified name of the Validator to use.

getWriteMethodName

public String getWriteMethodName()
Returns the name of the write method for this FieldInfo

Returns: the name of the write method for this FieldInfo

getXMLFieldHandler

public String getXMLFieldHandler()
Returns the fully qualified name of the XMLFieldHandler to use.

Returns: the fully qualified name of the XMLFieldHandler to use.

isBound

public boolean isBound()
Returns true if this FieldInfo represents a bound property

Returns: true if this FieldInfo represents a bound property

isContainer

public boolean isContainer()
Returns true if this FieldInfo describes a container class. A container class is a class which should not be marshalled as XML, but whose members should be.

Returns: true if this ClassInfo describes a container class.

isTransient

public boolean isTransient()
Returns true if this FieldInfo is a transient member. Transient members are members which should be ignored by the Marshalling framework

Returns: true if this FieldInfo is transient

methodSuffix

protected String methodSuffix()
Returns the method suffix for creating method names.

setBound

public void setBound(boolean bound)
Sets whether or not this FieldInfo represents a bound property

Parameters: bound the flag when true indicates that this FieldInfo represents a bound property

setComment

public void setComment(String comment)
Sets the comment for this Member

Parameters: comment the comment or description for this Member

setContainer

public void setContainer(boolean isContainer)
Sets whether or not this FieldInfo describes a container field. A container field is a field which should not be marshalled directly as XML, but whose members should be. By default this is false.

Parameters: isContainer the boolean value when true indicates this class should be a container class.

setDeclaringClassInfo

public void setDeclaringClassInfo(ClassInfo declaringClassInfo)

setDefaultValue

public void setDefaultValue(String defaultValue)
Sets the default value for this FieldInfo

Parameters: defaultValue the default value

setFinal

public void setFinal(boolean isFinal)
Sets the "final" status of this FieldInfo. Final members are also transient.

Parameters: isFinal the boolean indicating the final status, if true this FieldInfo will be treated as final.

setFixedValue

public void setFixedValue(String fixedValue)
Sets the fixed value in which instances of this field type must lexically match

Parameters: fixedValue the fixed production for this FieldInfo
NOTE: This is not the same as default value!

setStatic

public void setStatic(boolean isStatic)
Sets the "static" status of this FieldInfo. Static members are also transient.

Parameters: isStatic the boolean indicating the static status, if true this FieldInfo will be treated as static

setTransient

public void setTransient(boolean isTransient)
Sets the transient status of this FieldInfo.

Parameters: isTransient the boolean indicating the transient status, if true this FieldInfo will be treated as transient

setValidator

public void setValidator(String validator)
Sets the name of the Validator to use.

Parameters: validator the fully qualified name of the validator to use.

setXMLFieldHandler

public void setXMLFieldHandler(String handler)
Sets the name of the XMLfieldHandler to use.

Parameters: handler the fully qualified name of the handler to use.

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com