Public Member Functions | |
FieldInfo (XSType type, String name) | |
void | createJavaField (JClass jClass) |
void | createAccessMethods (JClass jClass) |
void | createGetterComment (JDocComment jDocComment) |
void | createSetterComment (JDocComment jDocComment) |
String | getDefaultValue () |
String | getFixedValue () |
String | getDeleteMethodName () |
String | getHasMethodName () |
String | getReadMethodName () |
String | getValidator () |
String | getWriteMethodName () |
String | getXMLFieldHandler () |
void | generateInitializerCode (JSourceCode jsc) |
String | getComment () |
String | getName () |
boolean | isBound () |
boolean | isContainer () |
boolean | isNillable () |
boolean | isTransient () |
void | setComment (String comment) |
ClassInfo | getDeclaringClassInfo () |
void | setBound (boolean bound) |
void | setContainer (boolean isContainer) |
void | setDeclaringClassInfo (ClassInfo declaringClassInfo) |
void | setDefaultValue (String defaultValue) |
void | setFinal (boolean isFinal) |
void | setFixedValue (String fixedValue) |
void | setNillable (boolean nillable) |
void | setStatic (boolean isStatic) |
void | setTransient (boolean isTransient) |
void | setValidator (String validator) |
void | setXMLFieldHandler (String handler) |
Protected Member Functions | |
String | methodSuffix () |
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.
org.exolab.castor.builder.FieldInfo.FieldInfo | ( | XSType | type, | |
String | name | |||
) |
Creates a new FieldInfo with the given XML Schema type and the given member name
XSType | the XML Schema type of this member | |
name | the name of the member |
References org.exolab.castor.builder.XMLInfo.setSchemaType().
Referenced by org.exolab.castor.builder.CollectionInfo.CollectionInfo().
void org.exolab.castor.builder.FieldInfo.createAccessMethods | ( | JClass | jClass | ) |
Creates the access methods for this FieldInfo
jClass | the JClass to add the methods to |
Reimplemented in org.exolab.castor.builder.CollectionInfo, and org.exolab.castor.builder.CollectionInfoJ2.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JClass.addMethod(), org.exolab.javasource.JMethod.addParameter(), org.exolab.castor.builder.FieldInfo.createGetterComment(), org.exolab.castor.builder.FieldInfo.createSetterComment(), org.exolab.castor.builder.types.XSType.createToJavaObjectCode(), org.exolab.javasource.JMethod.getJDocComment(), org.exolab.castor.builder.types.XSType.getJType(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.castor.builder.XMLInfo.getSchemaType(), org.exolab.javasource.JMethod.getSourceCode(), org.exolab.castor.builder.types.XSType.isEnumerated(), org.exolab.javasource.JType.isPrimitive(), and org.exolab.castor.builder.FieldInfo.methodSuffix().
Referenced by org.exolab.castor.builder.SourceFactory.createSourceCode().
void org.exolab.castor.builder.FieldInfo.createGetterComment | ( | JDocComment | jDocComment | ) |
Creates the Javadoc comments for the getter method associated with this FieldInfo.
jDocComment | the JDocComment to add the Javadoc comments to. |
References org.exolab.javasource.JDocComment.addDescriptor(), and org.exolab.javasource.JDocComment.setComment().
Referenced by org.exolab.castor.builder.FieldInfo.createAccessMethods().
void org.exolab.castor.builder.FieldInfo.createJavaField | ( | JClass | jClass | ) |
Creates the JMembers for this FieldInfo, sometimes a "field" requires more than one java field
References org.exolab.javasource.JClass.addField(), org.exolab.castor.builder.types.XSType.getJType(), org.exolab.javasource.JField.getModifiers(), org.exolab.castor.builder.XMLInfo.getSchemaType(), org.exolab.castor.builder.types.XSType.isEnumerated(), org.exolab.javasource.JType.isPrimitive(), org.exolab.javasource.JField.setComment(), org.exolab.javasource.JModifiers.setFinal(), org.exolab.javasource.JField.setInitString(), and org.exolab.javasource.JModifiers.setStatic().
Referenced by org.exolab.castor.builder.SourceFactory.createSourceCode().
void org.exolab.castor.builder.FieldInfo.createSetterComment | ( | JDocComment | jDocComment | ) |
Creates the Javadoc comments for the setter method associated with this FieldInfo.
jDocComment | the JDocComment to add the Javadoc comments to. |
References org.exolab.javasource.JDocComment.addDescriptor(), org.exolab.javasource.JDocDescriptor.createParamDesc(), org.exolab.javasource.JDocComment.getParamDescriptor(), org.exolab.javasource.JDocComment.setComment(), and org.exolab.javasource.JDocDescriptor.setDescription().
Referenced by org.exolab.castor.builder.FieldInfo.createAccessMethods().
void org.exolab.castor.builder.FieldInfo.generateInitializerCode | ( | JSourceCode | jsc | ) |
Creates code for initialization of this Member
jsc | the JSourceCode in which to add the source to |
Reimplemented in org.exolab.castor.builder.CollectionInfo, org.exolab.castor.builder.CollectionInfoJ2, and org.exolab.castor.builder.CollectionInfoODMG30.
References org.exolab.javasource.JSourceCode.add(), org.exolab.castor.builder.FieldInfo.getDefaultValue(), org.exolab.castor.builder.FieldInfo.getFixedValue(), org.exolab.castor.builder.XMLInfo.getSchemaType(), org.exolab.javasource.JSourceCode.indent(), org.exolab.castor.builder.types.XSType.isDateTime(), org.exolab.castor.builder.FieldInfo.methodSuffix(), and org.exolab.javasource.JSourceCode.unindent().
Referenced by org.exolab.castor.builder.SourceFactory.createSourceCode().
String org.exolab.castor.builder.FieldInfo.getComment | ( | ) |
Returns the comment associated with this Member
ClassInfo org.exolab.castor.builder.FieldInfo.getDeclaringClassInfo | ( | ) |
Returns the ClassInfo to which this Member was declared, for inheritance reasons
String org.exolab.castor.builder.FieldInfo.getDefaultValue | ( | ) |
Returns the default value for this FieldInfo
Referenced by org.exolab.castor.builder.FieldInfo.generateInitializerCode().
String org.exolab.castor.builder.FieldInfo.getDeleteMethodName | ( | ) |
Returns the name of the delete method for this FieldInfo.
References org.exolab.castor.builder.FieldInfo.methodSuffix().
String org.exolab.castor.builder.FieldInfo.getFixedValue | ( | ) |
Returns the fixed production for this FieldInfo, or null if no fixed value has been specified.
Referenced by org.exolab.castor.builder.FieldInfo.generateInitializerCode().
String org.exolab.castor.builder.FieldInfo.getHasMethodName | ( | ) |
Returns the name of the has method for this FieldInfo
References org.exolab.castor.builder.FieldInfo.methodSuffix().
String org.exolab.castor.builder.FieldInfo.getName | ( | ) |
Returns the name of this FieldInfo
Referenced by org.exolab.castor.builder.IdentityInfo.createAccessMethods(), org.exolab.castor.builder.FieldInfo.createAccessMethods(), org.exolab.castor.builder.CollectionInfoODMG30.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfo.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createAddMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfoJ2.createClearMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createEnumerateMethod(), org.exolab.castor.builder.CollectionInfoJ2.createEnumerateMethod(), org.exolab.castor.builder.CollectionInfo.createEnumerateMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createGetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createGetCountMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetMethod(), org.exolab.castor.builder.CollectionInfo.createGetMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfo.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfoODMG30.generateInitializerCode(), org.exolab.castor.builder.CollectionInfoJ2.generateInitializerCode(), org.exolab.castor.builder.CollectionInfo.generateInitializerCode(), and org.exolab.castor.builder.CollectionInfo.getReadMethod().
String org.exolab.castor.builder.FieldInfo.getReadMethodName | ( | ) |
Returns the name of the read method for this FieldInfo
Reimplemented in org.exolab.castor.builder.CollectionInfo.
References org.exolab.castor.builder.FieldInfo.methodSuffix().
String org.exolab.castor.builder.FieldInfo.getValidator | ( | ) |
Returns the fully qualified name of the Validator to use.
String org.exolab.castor.builder.FieldInfo.getWriteMethodName | ( | ) |
Returns the name of the write method for this FieldInfo
Reimplemented in org.exolab.castor.builder.CollectionInfo.
References org.exolab.castor.builder.XMLInfo.isMultivalued(), and org.exolab.castor.builder.FieldInfo.methodSuffix().
String org.exolab.castor.builder.FieldInfo.getXMLFieldHandler | ( | ) |
Returns the fully qualified name of the XMLFieldHandler to use.
boolean org.exolab.castor.builder.FieldInfo.isBound | ( | ) |
Returns true if this FieldInfo represents a bound property
Referenced by org.exolab.castor.builder.CollectionInfoODMG30.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfo.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createAddMethod(), org.exolab.castor.builder.CollectionInfoJ2.createClearMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfo.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionReferenceMethod(), and org.exolab.castor.builder.CollectionInfo.createSetCollectionReferenceMethod().
boolean org.exolab.castor.builder.FieldInfo.isContainer | ( | ) |
boolean org.exolab.castor.builder.FieldInfo.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).
boolean org.exolab.castor.builder.FieldInfo.isTransient | ( | ) |
Returns true if this FieldInfo is a transient member. Transient members are members which should be ignored by the Marshalling framework
Referenced by org.exolab.castor.builder.DescriptorSourceFactory.createSource().
String org.exolab.castor.builder.FieldInfo.methodSuffix | ( | ) | [protected] |
Returns the method suffix for creating method names.
Referenced by org.exolab.castor.builder.IdentityInfo.createAccessMethods(), org.exolab.castor.builder.FieldInfo.createAccessMethods(), org.exolab.castor.builder.FieldInfo.generateInitializerCode(), org.exolab.castor.builder.FieldInfo.getDeleteMethodName(), org.exolab.castor.builder.FieldInfo.getHasMethodName(), org.exolab.castor.builder.FieldInfo.getReadMethodName(), and org.exolab.castor.builder.FieldInfo.getWriteMethodName().
void org.exolab.castor.builder.FieldInfo.setBound | ( | boolean | bound | ) |
Sets whether or not this FieldInfo represents a bound property
bound | the flag when true indicates that this FieldInfo represents a bound property |
Referenced by org.exolab.castor.builder.FieldInfoFactory.createCollection(), org.exolab.castor.builder.FieldInfoFactory.createFieldInfo(), and org.exolab.castor.builder.FieldInfoFactory.createIdentity().
void org.exolab.castor.builder.FieldInfo.setComment | ( | String | comment | ) |
Sets the comment for this Member
comment | the comment or description for this Member |
Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo(), and org.exolab.castor.builder.MemberFactory.createFieldInfoForContent().
void org.exolab.castor.builder.FieldInfo.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.
isContainer | the boolean value when true indicates this class should be a container class. |
Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo(), and org.exolab.castor.builder.SourceFactory.createSourceCode().
void org.exolab.castor.builder.FieldInfo.setDeclaringClassInfo | ( | ClassInfo | declaringClassInfo | ) |
void org.exolab.castor.builder.FieldInfo.setDefaultValue | ( | String | defaultValue | ) |
Sets the default value for this FieldInfo
defaultValue | the default value |
Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo(), and org.exolab.castor.builder.MemberFactory.createFieldInfoForContent().
void org.exolab.castor.builder.FieldInfo.setFinal | ( | boolean | isFinal | ) |
void org.exolab.castor.builder.FieldInfo.setFixedValue | ( | String | fixedValue | ) |
Sets the fixed value in which instances of this field type must lexically match
fixedValue | the fixed production for this FieldInfo NOTE: This is not the same as default value! |
Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().
void org.exolab.castor.builder.FieldInfo.setNillable | ( | boolean | nillable | ) |
Sets whether or not this field can be nillable.
nillable | a boolean that when true means the field may be nil. |
Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().
void org.exolab.castor.builder.FieldInfo.setStatic | ( | boolean | isStatic | ) |
void org.exolab.castor.builder.FieldInfo.setTransient | ( | boolean | isTransient | ) |
void org.exolab.castor.builder.FieldInfo.setValidator | ( | String | validator | ) |
Sets the name of the Validator to use.
validator | the fully qualified name of the validator to use. |
Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().
void org.exolab.castor.builder.FieldInfo.setXMLFieldHandler | ( | String | handler | ) |
Sets the name of the XMLfieldHandler to use.
handler | the fully qualified name of the handler to use. |
Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().