org.exolab.castor.xml.util
public class XMLFieldDescriptorImpl extends Object implements XMLFieldDescriptor
Version: $Revision: 1.5 $ $Date: 2003/04/24 02:16:19 $
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(Class fieldType, String fieldName, String xmlName, NodeType nodeType) | |
XMLFieldDescriptorImpl(XMLFieldDescriptor fieldDesc)
Makes a new copy of the given XMLFieldDescriptorImpl
| |
XMLFieldDescriptorImpl(FieldDescriptor fieldDesc, String xmlName, NodeType nodeType)
Construct a new field descriptor for the specified field. | |
XMLFieldDescriptorImpl(FieldDescriptor fieldDesc, String xmlName, NodeType nodeType, NodeType primitiveNodeType)
Construct a new field descriptor for the specified field. |
Method Summary | |
---|---|
boolean | equals(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. |
int | getConstructorArgumentIndex()
Returns the index within the constructor argument array where the
value of this field should be. |
ClassDescriptor | getContainingClassDescriptor() |
String | getFieldName()
Returns the name of the field.
|
Class | getFieldType()
Returns the Java type of the field.
|
FieldHandler | getHandler()
Returns the handler of the field. |
String | getLocationPath()
Returns the "relative" XML path for the field being described.
|
String | getNameSpacePrefix()
Return the "suggested" namespace prefix to use when marshalling
as XML.
|
String | getNameSpaceURI()
Returns the namespace URI to be used when marshalling and
unmarshalling as XML.
|
NodeType | getNodeType() |
String | getQNamePrefix()
Returns the prefix used in case the value of the
field described by this descriptor is of type QName.
|
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. |
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 | isConstructorArgument()
Returns true if the value of the field represented by this
descriptor should be set via the constructor of the containing
class. |
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 | isMapped()
Returns true if the field described by this descriptor
is Map or Hashtable. |
boolean | isMultivalued()
Returns true if the Object described by this descriptor can
contain more than one value |
protected static boolean | isPrimitive(Class type)
Returns true if the given class should be treated as a primitive
type. |
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(String xmlName)
Returns true if this descriptor can be used to handle elements
or attributes with the given XML name. |
boolean | matches(String xmlName, String namespace)
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 | setConstructorArgumentIndex(int index)
Sets whether or not the value of the field represented by this
FieldDescriptor should be set via the constructor of the containing
ClassDescriptor. |
void | setContainer(boolean isContainer)
Set if the field is a container field or not.
|
void | setContainingClassDescriptor(ClassDescriptor contClsDesc)
Set the class which contains this field |
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 | setLocationPath(String path)
Sets the location path for the field being described.
|
void | setMapped(boolean mapped)
Sets whether or not this field has been mapped in a Map or
Hashtable.
|
void | setMatches(String matchExpr)
This is a space separated list of xml names that this
Field descriptor matches. |
void | setMultivalued(boolean multivalued) |
void | setNameSpacePrefix(String nsPrefix)
Sets the namespace prefix used when marshalling as XML. |
void | setNameSpaceURI(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(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(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(String xmlName)
Sets the xml name for the described field
|
String | toString() |
Parameters: fieldDesc The XMLFieldDescriptor to copy
Throws: MappingException Invalid mapping information
Parameters: fieldDesc The field descriptor xmlName The XML name of the field nodeType The node type of this field
Throws: MappingException Invalid mapping information
Parameters: fieldDesc The field descriptor xmlName The XML name of the field nodeType The node type of this field
Throws: MappingException Invalid mapping information
Returns: The class descriptor of the field type, or null
Returns: The collection handler
Returns: the index within the constructor argument array for this field.
Returns: the class which contains this field
Returns: Field name
Returns: Field type
Returns: The field handler
class Root {
Bar bar;
}
class Bar {
String value;
}
And the following XML:
<root>
<foo>
<bar> value of bar </bar>
</foo>
</root>
Since foo has no associated class, the path for 'bar'
would be: "foo"
UNKNOWN: the "relative" XML path for the field being described.
Returns: the "suggested" namespace prefix.
Returns: the namespace URI.
Returns: the prefix used in the QName value.
Returns: the type validator for the described field
Returns: the XML name.
Returns: true if a call to #setMatches has been made with a legal value.
Returns: true if the value of the field represented by this descriptor should be set via the constructor of the containing class.
Returns: true if the field is a container
Returns: True if the field type is immutable
Returns: true if the Object can safely be added before the unmarshaller is finished unmarshalling the Object.
Returns: true if the field described by this desciptor is a Map or Hashtable, otherwise false.
Returns: true if the Object described by this descriptor can contain more than one value
Returns: true if the given class should be treated as a primitive type
Returns: true if the field described by this descriptor is a required field
Returns: True if transient field
Parameters: xmlName the XML name to compare
Returns: true if this descriptor can be used to handle elements or attributes with the given XML name.
Parameters: xmlName the XML name to compare
Returns: true if this descriptor can be used to handle elements or attributes with the given XML name.
Parameters: classDescriptor the XMLClassDescriptor for the described field.
Parameters: index the index within the argument array. A value less than zero indicates that this field should not be part of the constructor arguments.
Parameters: isContainer a boolean indicating whether or not the field is a container field.
Parameters: handler the FieldHandler for the field being described by this FieldDescriptor
Parameters: immutable the boolean which if true indicated that this described field is immutable
Parameters: incremental the boolean which if true indicated that this member can safely be added before the unmarshaller is finished unmarshalling it.
class Root {
Bar bar;
}
class Bar {
String value;
}
And the following XML:
<root>
<foo>
<bar> value of bar </bar>
</foo>
</root>
Since foo has no associated class, the path for 'bar'
would be: "foo"
Parameters: path the "relative" location path for the field.
See Also: getLocationPath.
Parameters: mapped a boolean that when true indicates this field is a Hashtable or Map.
Parameters: matchExpr the space separated list of xml names, matched by this descriptor
Parameters: nsPrefix the namespace prefix used when marshalling the "described" object
Parameters: nsURI the namespace URI used when marshalling and unmarshalling the "described" Object.
Parameters: nodeType the NodeType for the described field
Parameters: qNamePrefix
Parameters: isReference, true if the field is a reference to another field.
Parameters: required the flag indicating whether or not the described field is required
Parameters: type the value type.
Parameters: isTransient the flag indicating whether or not the described field is "transient".
See Also: XMLFieldDescriptorImpl
Parameters: name the XML name for the described field