Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.exolab.castor.builder.XMLInfo
org.exolab.castor.builder.FieldInfo
public class FieldInfo
extends XMLInfo
Field Summary | |
static int |
|
static int |
|
static int |
|
Fields inherited from class org.exolab.castor.builder.XMLInfo | |
ATTRIBUTE_TYPE , CHOICE_NODE_NAME_ERROR_INDICATION , ELEMENT_TYPE , TEXT_TYPE |
Constructor Summary | |
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
ClassInfo |
|
String |
|
String |
|
String |
|
String |
|
protected String |
|
int |
|
String |
|
String |
|
String |
|
String |
|
String |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class org.exolab.castor.builder.XMLInfo | |
getNamespacePrefix , getNamespaceURI , getNodeName , getNodeType , getNodeTypeName , getSchemaType , isElementDefinition , isMultivalued , isRequired , setElementDefinition , setMultivalued , setNamespacePrefix , setNamespaceURI , setNodeName , setNodeType , setRequired , setSchemaType |
public static final int READ_METHOD
The Read / Getter method flag
- Field Value:
- 1
public static final int READ_WRITE_METHODS
The Read and Write methods flags
- Field Value:
- 3
public static final int WRITE_METHOD
The Write / Setter method flag
- Field Value:
- 2
public FieldInfo(XSType type, String name)
Creates a new FieldInfo with the given XML Schema type and the given member name.
- Parameters:
type
- the XML Schema type of this membername
- the name of the member
public void createAccessMethods(JClass jClass, boolean useJava50)
Creates the access methods for field associated with this FieldInfo. The access methods include getters, setters, and "has" and "delete" methods if necessary.
- Parameters:
jClass
- the JClass to add the methods touseJava50
- true if source code is supposed to be generated for Java 5
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.
public void createGetterMethod(JClass jClass, boolean useJava50)
Creates the getter methods for this FieldInfo
- Parameters:
jClass
- the JClass to add the methods touseJava50
- true if source code is supposed to be generated for Java 5
public void createHasAndDeleteMethods(JClass jClass)
Creates the "has" and "delete" methods for this field associated with this FieldInfo. These methods are typically only needed for primitive types which cannot be assigned a null value.
- Parameters:
jClass
- the JClass to add the methods to
public void createJavaField(JClass jClass)
Creates the JMembers for this FieldInfo, sometimes a "field" requires more than one java field for this FieldInfo.
- Parameters:
jClass
- JClass object the Java Fields will be added to
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.
public void createSetterMethod(JClass jClass, boolean useJava50)
Creates the setter (mutator) method(s) for this FieldInfo
- Parameters:
jClass
- the JClass to add the methods touseJava50
- true if source code is supposed to be generated for Java 5
public void generateInitializerCode(JSourceCode jsc)
Creates code for initialization of this Member.
- Parameters:
jsc
- the JSourceCode in which to add the source to
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.
public ClassInfo getDeclaringClassInfo()
Returns the ClassInfo to which this Member was declared, for inheritance reasons.
- Returns:
- the ClassInfo to which this Member was declared.
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;
public String getDeleteMethodName()
Returns the name of the delete method for this FieldInfo.
- Returns:
- the name of the delete method for this FieldInfo.
public String getFixedValue()
Returns the fixed production for this FieldInfo, or null if no fixed value has been specified. NOTE: Fixed values are NOT the same as default values
- Returns:
- the fixed value for this FieldInfo
public String getHasMethodName()
Returns the name of the has method for this FieldInfo.
- Returns:
- the name of the has method for this FieldInfo.
protected String getMethodSuffix()
Returns the method suffix for creating method names.
- Returns:
- the method suffix used when creating method names.
public int getMethods()
Returns the methods flag that indicates which methods will be created
- Returns:
- the methods flag
public String getName()
Returns the name of this FieldInfo
- Returns:
- the name of this FieldInfo
public String getReadMethodName()
Returns the name of the read method for this FieldInfo.
- Returns:
- the name of the read method for this FieldInfo.
public String getValidator()
Returns the fully qualified name of the Validator to use.
- Returns:
- the fully qualified name of the Validator to use.
public String getWriteMethodName()
Returns the name of the write method for this FieldInfo.
- Returns:
- the name of the write method for this FieldInfo.
public String getXMLFieldHandler()
Returns the fully qualified name of the XMLFieldHandler to use.
- Returns:
- the fully qualified name of the XMLFieldHandler to use.
public boolean isBound()
Returns true if this FieldInfo represents a bound property
- Returns:
- true if this FieldInfo represents a bound property
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.
public boolean isHasAndDeleteMethods()
Returns true if the "has" and "delete" methods are needed for the field associated with this FieldInfo.
- Returns:
- true if the has and delete methods are needed.
public boolean isNillable()
Returns true if this field represents a nillable field. A nillable field is a field that can have null content (see XML Schema 1.0 definition of nillable).
- Returns:
- true if nillable, otherwise false.
- See Also:
setNillable(boolean)
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.
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
public void setComment(String comment)
Sets the comment for this Member.
- Parameters:
comment
- the comment or description for this Member
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.
public void setDefaultValue(String defaultValue)
Sets the default value for this FieldInfo.
- Parameters:
defaultValue
- the default value
public void setFieldInfoReference(FieldInfo fieldInfo)
Sets the name of the field within the same class that is a reference to this field.
- Parameters:
fieldInfo
-
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.
public void setFixedValue(String fixedValue)
Sets the fixed value in which instances of this field type must lexically match. NOTE: This is not the same as default value!
- Parameters:
fixedValue
- the fixed production for this FieldInfo
public void setMethods(int methods)
Sets which methods to create: READ_METHOD, WRITE_METHOD, READ_WRITE_METHODS
- Parameters:
methods
- a flag describing which methods to create.
public void setNillable(boolean nillable)
Sets whether or not this field can be nillable.
- Parameters:
nillable
- a boolean that when true means the field may be nil.
- See Also:
isNillable()
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
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
public void setValidator(String validator)
Sets the name of the Validator to use.
- Parameters:
validator
- the fully qualified name of the validator to use.
public void setXMLFieldHandler(String handler)
Sets the name of the XMLfieldHandler to use.
- Parameters:
handler
- the fully qualified name of the handler to use.