org.exolab.castor.xml
Interface XMLFieldDescriptor
- FieldDescriptor
- XMLContainerElementFieldDescriptor, XMLFieldDescriptorImpl
public interface XMLFieldDescriptor
XML field descriptor. Wraps
FieldDescriptor
and adds
XML-related information, type conversion, etc.
$Revision: 6216 $ $Date: 2004-09-17 00:47:41 -0600 (Fri, 17 Sep 2004) $
int | getConstructorArgumentIndex() - Returns the index within the constructor argument array where the
value of this field should be.
|
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() - Returns the NodeType of the Field being described.
|
String | getProperty(String propertyName) - Returns the value property with the given name or null
if no such property exists.
|
String | getSchemaType() - Returns the XML Schema type of the XML field being described.
|
FieldValidator | getValidator() - Returns a specific validator for the field described by
this descriptor.
|
String | getXMLName() - Returns the XML Name for the field being described.
|
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 | 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 field described by this descriptor can
contain more than one value
|
boolean | isNillable() - Returns true if the field described by this descriptor
may be nillable.
|
boolean | isReference() - Returns true if the field described by this descriptor is
a reference (ie.
|
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.
|
PROPERTY_XML_LANG
public static final String PROPERTY_XML_LANG
The xml:lang property
PROPERTY_XML_SPACE
public static final String PROPERTY_XML_SPACE
The xml:space property
getConstructorArgumentIndex
public int getConstructorArgumentIndex()
Returns the index within the constructor argument array where the
value of this field should be. A value less than zero indicates
that the value of this field is set via a normal setter method
and not via the constructor.
Note: This only applies to attribute mapped fields at this time.
- the index within the constructor argument array for this field.
getLocationPath
public String getLocationPath()
Returns the "relative" XML path for the field being described.
In most cases, this will be null. However sometimes a
field may be mapped to a nested element. In which case
the value returned by this method should be the nested
element name. If more than one level of nesting is
needed each nested element name should be separated by
by a path separator (forward slash '/').
The location path name is "relative" to the parent Class. The
name of the parent should not be included in the path.
For example, give the following two classes:
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"
- The "relative" XML path for the field being described.
getNameSpacePrefix
public String getNameSpacePrefix()
Return the "suggested" namespace prefix to use when marshalling
as XML.
- the "suggested" namespace prefix.
getNameSpaceURI
public String getNameSpaceURI()
Returns the namespace URI to be used when marshalling and
unmarshalling as XML.
getNodeType
public NodeType getNodeType()
Returns the NodeType of the Field being described. The
NodeType represents the Type of Node that the Field will
be marshalled into XML as.
- the NodeType of the Field being described.
getProperty
public String getProperty(String propertyName)
Returns the value property with the given name or null
if no such property exists. This method is useful for
future evolutions of this interface as well as for
user-defined extensions. See class declared properties
for built-in properties.
propertyName
- the name of the property whose value
should be returned.
- the value of the property, or null.
getSchemaType
public String getSchemaType()
Returns the XML Schema type of the XML field being described.
- the XML Schema type of the XML field being described.
getValidator
public FieldValidator getValidator()
Returns a specific validator for the field described by
this descriptor. A null value may be returned
if no specific validator exists.
- the field validator for the described field
getXMLName
public String getXMLName()
Returns the XML Name for the field being described.
isConstructorArgument
public boolean isConstructorArgument()
Returns true if the value of the field represented by this
descriptor should be set via the constructor of the containing
class. This is only valid for attribute mapped fields.
- true if the value of the field represented by this
descriptor should be set via the constructor of the containing
class.
isContainer
public boolean isContainer()
Returns true if the field described by this descriptor is a container
field. A container is a field that is not a first-class object,
and should therefore have no XML representation.
- true if the field is a container
isIncremental
public boolean isIncremental()
Returns the incremental flag which when true indicates that this
member may be safely added before the unmarshaller is finished
unmarshalling it.
- true if the Object can safely be added before the unmarshaller
is finished unmarshalling the Object.
isMapped
public boolean isMapped()
Returns true if the field described by this descriptor
is Map or Hashtable. If this method returns true, it
must also return true for any call to #isMultivalued.
- true if the field described by this desciptor is
a Map or Hashtable, otherwise false.
isMultivalued
public boolean isMultivalued()
Returns true if the field described by this descriptor can
contain more than one value
- isMultivalued in interface FieldDescriptor
- true if the field described by this descriptor can
contain more than one value
isNillable
public boolean isNillable()
Returns true if the field described by this descriptor
may be nillable. A nillable field is one that may
have empty content and still be valid. Please see
the XML Schema 1.0 Recommendation for more information
on nillable.
- true if the field may be nillable.
isReference
public boolean isReference()
Returns true if the field described by this descriptor is
a reference (ie. IDREF) to another object in the
"Object Model" (XML tree)
matches
public boolean matches(String xmlName)
Returns true if this descriptor can be used to handle elements
or attributes with the given XML name. By default this method
simply compares the given XML name with the internal XML name.
This method can be overridden to provide more complex matching.
xmlName
- the XML name to compare
- true if this descriptor can be used to handle elements
or attributes with the given XML name.
matches
public boolean matches(String xmlName,
String namespace)
Returns true if this descriptor can be used to handle elements
or attributes with the given XML name. By default this method
simply compares the given XML name with the internal XML name.
This method can be overridden to provide more complex matching.
xmlName
- the XML name to comparenamespace
- the namespace URI
- true if this descriptor can be used to handle elements
or attributes with the given XML name.
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com