|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.xml.util.XMLFieldDescriptorImpl
XML field descriptor. Wraps FieldDescriptor
and adds
XML-related information, type conversion, etc.
Field Summary | |
boolean |
_isReference
True if the field is a reference to another Object in the hierarchy. |
boolean |
_required
indicates a required field when true |
Constructor Summary | |
XMLFieldDescriptorImpl(java.lang.Class fieldType,
java.lang.String fieldName,
java.lang.String xmlName,
NodeType nodeType)
|
|
XMLFieldDescriptorImpl(FieldDescriptor fieldDesc,
java.lang.String xmlName,
NodeType nodeType)
Construct a new field descriptor for the specified field. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Returns true if two XMLFieldDescriptors should be treated as equal. |
ClassDescriptor |
getClassDescriptor()
Returns the class descriptor related to the field type. |
CollectionHandler |
getCollectionHandler()
Return the collection handler of this field type. |
ClassDescriptor |
getContainingClassDescriptor()
|
java.lang.String |
getFieldName()
Returns the name of the field. |
java.lang.Class |
getFieldType()
Returns the Java type of the field. |
FieldHandler |
getHandler()
Returns the handler of the field. |
java.lang.String |
getNameSpacePrefix()
Return the "suggested" namespace prefix to use when marshalling as XML. |
java.lang.String |
getNameSpaceURI()
Returns the namespace URI to be used when marshalling and unmarshalling as XML. |
NodeType |
getNodeType()
Returns the NodeType of the Field being described. |
java.lang.String |
getQNamePrefix()
Returns the prefix used in case the value of the field described by this descriptor is of type QName. |
java.lang.String |
getSchemaType()
Returns the XML Schema type of the value of the field described by this descriptor. |
FieldValidator |
getValidator()
Returns a specific validator for the field described by this descriptor. |
java.lang.String |
getXMLName()
Returns the XML Name for the field being described. |
protected boolean |
hasNonDefaultMatching()
Returns true if a call to #setMatches has been made with a non-null, or non-zero-length value. |
boolean |
isContainer()
Returns true if the field described by this descriptor is a container field. |
boolean |
isImmutable()
Returns true if the field type is immutable. |
boolean |
isIncremental()
Returns the incremental flag which when true indicates that this member may be safely added before the unmarshaller is finished unmarshalling it. |
boolean |
isMultivalued()
Returns true if the Object described by this descriptor can contain more than one value |
boolean |
isReference()
Returns true if the field described by this descriptor is a reference (ie. |
boolean |
isRequired()
Returns true if the field described by this descriptor is a required field |
boolean |
isTransient()
Returns true if the field is transient. |
boolean |
matches(java.lang.String xmlName)
Returns true if this descriptor can be used to handle elements or attributes with the given XML name. |
void |
setClassDescriptor(XMLClassDescriptor classDescriptor)
Sets the XMLClassDescriptor for the described field |
void |
setContainer(boolean b)
Set if the field is a container field or not. |
void |
setContainingClassDescriptor(ClassDescriptor contClsDesc)
Set the class which contains this field |
protected void |
setDescriptorResolver(MappingResolver resolver)
Sets the DescriptorResolver for following relationships among descriptors and types. |
void |
setHandler(FieldHandler handler)
Sets the FieldHandler for the field being described by this FieldDescriptor |
void |
setImmutable(boolean immutable)
Sets the immutable flag which indicates that changes to this Field result in a new Object to be created, such as java.lang.String. |
void |
setIncremental(boolean incremental)
Sets the incremental flag which indicates whether this member can be added before the unmarshaller is finished unmarshalling it. |
void |
setMatches(java.lang.String matchExpr)
This is a space separated list of xml names that this Field descriptor matches. |
void |
setMultivalued(boolean multivalued)
|
void |
setNameSpacePrefix(java.lang.String nsPrefix)
Sets the namespace prefix used when marshalling as XML. |
void |
setNameSpaceURI(java.lang.String nsURI)
Sets the namespace URI used when marshalling and unmarshalling as XML. |
void |
setNodeType(NodeType nodeType)
Sets the XML node type for the described field |
void |
setQNamePrefix(java.lang.String qNamePrefix)
Sets the prefix used in case the value of the field described by this descriptor is of type QName. |
void |
setReference(boolean isReference)
Sets the flag indicating that the field described by this descriptor is a reference to another field in the object model. |
void |
setRequired(boolean required)
Sets the whether or not the described field is required |
void |
setSchemaType(java.lang.String schemaType)
Sets the type of the XML Schema type of the value for the field being described. |
void |
setTransient(boolean isTransient)
Sets whether or not the describled field is transient |
void |
setValidator(FieldValidator validator)
|
void |
setXMLName(java.lang.String xmlName)
Sets the xml name for the described field |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public boolean _isReference
public boolean _required
Constructor Detail |
public XMLFieldDescriptorImpl(java.lang.Class fieldType, java.lang.String fieldName, java.lang.String xmlName, NodeType nodeType)
public XMLFieldDescriptorImpl(FieldDescriptor fieldDesc, java.lang.String xmlName, NodeType nodeType) throws MappingException
fieldDesc
- The field descriptorxmlName
- The XML name of the fieldnodeType
- The node type of this field
MappingException
- Invalid mapping informationMethod Detail |
public boolean equals(java.lang.Object obj)
public void setContainingClassDescriptor(ClassDescriptor contClsDesc)
setContainingClassDescriptor
in interface FieldDescriptor
public ClassDescriptor getContainingClassDescriptor()
getContainingClassDescriptor
in interface FieldDescriptor
public ClassDescriptor getClassDescriptor()
getClassDescriptor
in interface FieldDescriptor
public CollectionHandler getCollectionHandler()
public java.lang.String getFieldName()
getFieldName
in interface FieldDescriptor
public java.lang.Class getFieldType()
getFieldType
in interface FieldDescriptor
public FieldHandler getHandler()
getHandler
in interface FieldDescriptor
public java.lang.String getXMLName()
getXMLName
in interface XMLFieldDescriptor
public java.lang.String getNameSpacePrefix()
getNameSpacePrefix
in interface XMLFieldDescriptor
public java.lang.String getNameSpaceURI()
getNameSpaceURI
in interface XMLFieldDescriptor
public NodeType getNodeType()
XMLFieldDescriptor
getNodeType
in interface XMLFieldDescriptor
public java.lang.String getQNamePrefix()
public FieldValidator getValidator()
getValidator
in interface XMLFieldDescriptor
public java.lang.String getSchemaType()
getSchemaType
in interface XMLFieldDescriptor
public boolean isImmutable()
isImmutable
in interface FieldDescriptor
public boolean isIncremental()
isIncremental
in interface XMLFieldDescriptor
public boolean isMultivalued()
isMultivalued
in interface XMLFieldDescriptor
public boolean isReference()
isReference
in interface XMLFieldDescriptor
public boolean isRequired()
isRequired
in interface FieldDescriptor
public boolean isTransient()
isTransient
in interface FieldDescriptor
public boolean isContainer()
isContainer
in interface XMLFieldDescriptor
public void setContainer(boolean b)
public boolean matches(java.lang.String xmlName)
matches
in interface XMLFieldDescriptor
xmlName
- the XML name to compare
public void setClassDescriptor(XMLClassDescriptor classDescriptor)
classDescriptor
- the XMLClassDescriptor for the described field.public void setHandler(FieldHandler handler)
handler
- the FieldHandler for the field being described
by this FieldDescriptorpublic void setIncremental(boolean incremental)
incremental
- the boolean which if true indicated that this
member can safely be added before the unmarshaller is finished
unmarshalling it.public void setImmutable(boolean immutable)
immutable
- the boolean which if true indicated that this
described field is immutablepublic void setMatches(java.lang.String matchExpr)
matchExpr
- the space separated list of xml names, matched
by this descriptorpublic void setMultivalued(boolean multivalued)
public void setSchemaType(java.lang.String schemaType)
public void setQNamePrefix(java.lang.String qNamePrefix)
qNamePrefix
- public void setReference(boolean isReference)
public void setNameSpacePrefix(java.lang.String nsPrefix)
nsPrefix
- the namespace prefix used when marshalling
the "described" objectpublic void setNameSpaceURI(java.lang.String nsURI)
nsURI
- the namespace URI used when marshalling and
unmarshalling the "described" Object.public void setNodeType(NodeType nodeType)
nodeType
- the NodeType for the described fieldpublic void setRequired(boolean required)
required
- the flag indicating whether or not the
described field is requiredpublic void setTransient(boolean isTransient)
isTransient
- the flag indicating whether or not the
described field is "transient".isTransient()
public void setValidator(FieldValidator validator)
public void setXMLName(java.lang.String xmlName)
public java.lang.String toString()
protected boolean hasNonDefaultMatching()
protected void setDescriptorResolver(MappingResolver resolver)
resolver
- the DescriptorResolver to use
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |