Public Member Functions | Static Public Attributes

org.exolab.castor.xml.XMLFieldDescriptor Interface Reference

Inheritance diagram for org.exolab.castor.xml.XMLFieldDescriptor:
org.exolab.castor.mapping.FieldDescriptor org.exolab.castor.xml.util.XMLFieldDescriptorImpl org.exolab.castor.xml.XMLMappingLoader.ContainerElementFieldDescriptor

List of all members.

Public Member Functions

int getConstructorArgumentIndex ()
String getNameSpacePrefix ()
String getNameSpaceURI ()
NodeType getNodeType ()
String getProperty (String propertyName)
FieldValidator getValidator ()
String getXMLName ()
String getLocationPath ()
String getSchemaType ()
boolean isConstructorArgument ()
boolean isIncremental ()
boolean isMultivalued ()
boolean isMapped ()
boolean isNillable ()
boolean isReference ()
boolean isContainer ()
boolean matches (String xmlName)
boolean matches (String xmlName, String namespace)

Static Public Attributes

static final String PROPERTY_XML_SPACE = "xml:space"
static final String PROPERTY_XML_LANG = "xml:lang"

Detailed Description

XML field descriptor. Wraps FieldDescriptor and adds XML-related information, type conversion, etc.

Author:
Assaf Arkin
Keith Visco
Version:
Revision:
1.7
Date:
2004/09/17 06:47:41

Member Function Documentation

int org.exolab.castor.xml.XMLFieldDescriptor.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.

Returns:
the index within the constructor argument array for this field.
See also:
isConstructorArgument

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

String org.exolab.castor.xml.XMLFieldDescriptor.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"

Returns:
the "relative" XML path for the field being described.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.MarshalFramework.hasFieldsAtLocation().

String org.exolab.castor.xml.XMLFieldDescriptor.getNameSpacePrefix (  ) 

Return the "suggested" namespace prefix to use when marshalling as XML.

Returns:
the "suggested" namespace prefix.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

String org.exolab.castor.xml.XMLFieldDescriptor.getNameSpaceURI (  ) 

Returns the namespace URI to be used when marshalling and unmarshalling as XML.

Returns:
the namespace URI.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

NodeType org.exolab.castor.xml.XMLFieldDescriptor.getNodeType (  ) 
String org.exolab.castor.xml.XMLFieldDescriptor.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.

Parameters:
propertyName the name of the property whose value should be returned.
Returns:
the value of the property, or null.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

String org.exolab.castor.xml.XMLFieldDescriptor.getSchemaType (  ) 

Returns the XML Schema type of the XML field being described.

Returns:
the XML Schema type of the XML field being described.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.UnmarshalHandler.endElement().

FieldValidator org.exolab.castor.xml.XMLFieldDescriptor.getValidator (  ) 

Returns a specific validator for the field described by this descriptor. A null value may be returned if no specific validator exists.

Returns:
the field validator for the described field

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.util.XMLClassDescriptorImpl.canAccept(), org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(), and org.exolab.castor.xml.Validator.validate().

boolean org.exolab.castor.xml.XMLFieldDescriptor.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.

Returns:
true if the value of the field represented by this descriptor should be set via the constructor of the containing class.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

boolean org.exolab.castor.xml.XMLFieldDescriptor.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.

Returns:
true if the field is a container

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.util.XMLClassDescriptorImpl.canAccept(), org.exolab.castor.xml.UnmarshalHandler.endElement(), org.exolab.castor.xml.util.XMLClassDescriptorImpl.getFieldDescriptor(), org.exolab.castor.xml.util.XMLClassDescriptorImpl.removeFieldDescriptor(), and org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate().

boolean org.exolab.castor.xml.XMLFieldDescriptor.isIncremental (  ) 

Returns the incremental flag which when true indicates that this member may be safely added before the unmarshaller is finished unmarshalling it.

Returns:
true if the Object can safely be added before the unmarshaller is finished unmarshalling the Object.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.UnmarshalHandler.endElement().

boolean org.exolab.castor.xml.XMLFieldDescriptor.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.

Returns:
true if the field described by this desciptor is a Map or Hashtable, otherwise false.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.UnmarshalHandler.endElement().

boolean org.exolab.castor.xml.XMLFieldDescriptor.isMultivalued (  ) 

Returns true if the field described by this descriptor can contain more than one value

Returns:
true if the field described by this descriptor can contain more than one value

Implements org.exolab.castor.mapping.FieldDescriptor.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.util.XMLClassDescriptorImpl.canAccept(), org.exolab.castor.xml.UnmarshalHandler.endElement(), and org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate().

boolean org.exolab.castor.xml.XMLFieldDescriptor.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.

Returns:
true if the field may be nillable.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.FieldValidator.validate().

boolean org.exolab.castor.xml.XMLFieldDescriptor.isReference (  ) 

Returns true if the field described by this descriptor is a reference (ie. IDREF) to another object in the "Object Model" (XML tree)

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.UnmarshalHandler.endElement(), and org.exolab.castor.xml.FieldValidator.validate().

boolean org.exolab.castor.xml.XMLFieldDescriptor.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.

Parameters:
xmlName the XML name to compare
namespace the namespace URI
Returns:
true if this descriptor can be used to handle elements or attributes with the given XML name.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

boolean org.exolab.castor.xml.XMLFieldDescriptor.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.

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.

Implemented in org.exolab.castor.xml.util.XMLFieldDescriptorImpl.

Referenced by org.exolab.castor.xml.util.XMLClassDescriptorImpl.getFieldDescriptor(), org.exolab.castor.xml.descriptors.VectorClassDescriptor.getFieldDescriptor(), and org.exolab.castor.xml.descriptors.ListClassDescriptor.getFieldDescriptor().


Member Data Documentation

The xml:lang property

The xml:space property


The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties