Package org.exolab.castor.mapping.xml
Class BindXml
java.lang.Object
org.exolab.castor.mapping.xml.BindXml
- All Implemented Interfaces:
Serializable
The 'bind-xml' element is used for specifying XML specific
databinding
properties and behavior for a specific field. 'bind-xml' may
only appear
as a child of a 'field' element.
- Version:
- $Revision$ $Date$
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProperty
(int index, Property vProperty) void
addProperty
(Property vProperty) void
void
Enumeration<? extends Property>
Method enumerateProperty.Returns the value of field 'autoNaming'.Returns the value of field 'classMapping'.Returns the value of field 'location'.Returns the value of field 'matches'.getName()
Returns the value of field 'name'.getNode()
Returns the value of field 'node'.Property[]
Method getProperty.Returns the contents of the collection in an Array.getProperty
(int index) Method getProperty.int
Method getPropertyCount.Returns the value of field 'QNamePrefix'.boolean
Returns the value of field 'reference'.boolean
Returns the value of field 'transient'.getType()
Returns the value of field 'type'.boolean
Method hasReference.boolean
Method hasTransient.boolean
Returns the value of field 'reference'.boolean
Returns the value of field 'transient'.boolean
isValid()
Method isValid.Method iterateProperty.void
void
marshal
(ContentHandler handler) void
boolean
removeProperty
(Property vProperty) Method removeProperty.removePropertyAt
(int index) Method removePropertyAt.void
setAutoNaming
(BindXmlAutoNamingType autoNaming) Sets the value of field 'autoNaming'.void
setClassMapping
(ClassMapping classMapping) Sets the value of field 'classMapping'.void
setLocation
(String location) Sets the value of field 'location'.void
setMatches
(String matches) Sets the value of field 'matches'.void
Sets the value of field 'name'.void
setNode
(BindXmlNodeType node) Sets the value of field 'node'.void
setProperty
(int index, Property vProperty) void
setProperty
(Property[] vPropertyArray) void
setQNamePrefix
(String QNamePrefix) Sets the value of field 'QNamePrefix'.void
setReference
(boolean reference) Sets the value of field 'reference'.void
setTransient
(boolean _transient) Sets the value of field 'transient'.void
Sets the value of field 'type'.static BindXml
Method unmarshal.void
validate()
-
Constructor Details
-
BindXml
public BindXml()
-
-
Method Details
-
addProperty
- Parameters:
vProperty
-- Throws:
IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
addProperty
- Parameters:
index
-vProperty
-- Throws:
IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
deleteReference
public void deleteReference() -
deleteTransient
public void deleteTransient() -
enumerateProperty
Method enumerateProperty.- Returns:
- an Enumeration over all possible elements of this collection
-
getAutoNaming
Returns the value of field 'autoNaming'. The field 'autoNaming' has the following description: Allows specifying how Castor should automatically determines the XML name of this field when no name has been specified. In most cases the XML name is determined by using the field name, but in some cases the user may want to use the Class name of the field type. This attribute allows choosing between the two approaches. If this attribute is not specified, the field name is used as the XML name.- Returns:
- the value of field 'AutoNaming'.
-
getClassMapping
Returns the value of field 'classMapping'. The field 'classMapping' has the following description: The 'class' element is used to store information about mapping of a class.- Returns:
- the value of field 'ClassMapping'.
-
getLocation
Returns the value of field 'location'. The field 'location' has the following description: Allows specifying a nested location path for this field, the value should just be a simplified XPath like value where names are separated by "/".- Returns:
- the value of field 'Location'.
-
getMatches
Returns the value of field 'matches'.- Returns:
- the value of field 'Matches'.
-
getName
Returns the value of field 'name'. The field 'name' has the following description: An optional attribute used for specifying the XML name for the field associated with the 'bind-xml' element.- Returns:
- the value of field 'Name'.
-
getNode
Returns the value of field 'node'.- Returns:
- the value of field 'Node'.
-
getProperty
Method getProperty.- Parameters:
index
-- Returns:
- the value of the org.exolab.castor.mapping.xml.Property at the given index
- Throws:
IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
getProperty
Method getProperty.Returns the contents of the collection in an Array.Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.
- Returns:
- this collection as an Array
-
getPropertyCount
public int getPropertyCount()Method getPropertyCount.- Returns:
- the size of this collection
-
getQNamePrefix
Returns the value of field 'QNamePrefix'.- Returns:
- the value of field 'QNamePrefix'.
-
getReference
public boolean getReference()Returns the value of field 'reference'.- Returns:
- the value of field 'Reference'.
-
getTransient
public boolean getTransient()Returns the value of field 'transient'.- Returns:
- the value of field 'Transient'.
-
getType
Returns the value of field 'type'.- Returns:
- the value of field 'Type'.
-
hasReference
public boolean hasReference()Method hasReference.- Returns:
- true if at least one Reference has been added
-
hasTransient
public boolean hasTransient()Method hasTransient.- Returns:
- true if at least one Transient has been added
-
isReference
public boolean isReference()Returns the value of field 'reference'.- Returns:
- the value of field 'Reference'.
-
isTransient
public boolean isTransient()Returns the value of field 'transient'.- Returns:
- the value of field 'Transient'.
-
isValid
public boolean isValid()Method isValid.- Returns:
- true if this object is valid according to the schema
-
iterateProperty
Method iterateProperty.- Returns:
- an Iterator over all possible elements in this collection
-
marshal
- Parameters:
out
-- Throws:
MarshalException
- if object is null or if any SAXException is thrown during marshalingValidationException
- if this object is an invalid instance according to the schema
-
marshal
public void marshal(ContentHandler handler) throws IOException, MarshalException, ValidationException - Parameters:
handler
-- Throws:
IOException
- if an IOException occurs during marshalingValidationException
- if this object is an invalid instance according to the schemaMarshalException
- if object is null or if any SAXException is thrown during marshaling
-
removeAllProperty
public void removeAllProperty() -
removeProperty
Method removeProperty.- Parameters:
vProperty
-- Returns:
- true if the object was removed from the collection.
-
removePropertyAt
Method removePropertyAt.- Parameters:
index
-- Returns:
- the element removed from the collection
-
setAutoNaming
Sets the value of field 'autoNaming'. The field 'autoNaming' has the following description: Allows specifying how Castor should automatically determines the XML name of this field when no name has been specified. In most cases the XML name is determined by using the field name, but in some cases the user may want to use the Class name of the field type. This attribute allows choosing between the two approaches. If this attribute is not specified, the field name is used as the XML name.- Parameters:
autoNaming
- the value of field 'autoNaming'.
-
setClassMapping
Sets the value of field 'classMapping'. The field 'classMapping' has the following description: The 'class' element is used to store information about mapping of a class.- Parameters:
classMapping
- the value of field 'classMapping'.
-
setLocation
Sets the value of field 'location'. The field 'location' has the following description: Allows specifying a nested location path for this field, the value should just be a simplified XPath like value where names are separated by "/".- Parameters:
location
- the value of field 'location'.
-
setMatches
Sets the value of field 'matches'.- Parameters:
matches
- the value of field 'matches'.
-
setName
Sets the value of field 'name'. The field 'name' has the following description: An optional attribute used for specifying the XML name for the field associated with the 'bind-xml' element.- Parameters:
name
- the value of field 'name'.
-
setNode
Sets the value of field 'node'.- Parameters:
node
- the value of field 'node'.
-
setProperty
- Parameters:
index
-vProperty
-- Throws:
IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
setProperty
- Parameters:
vPropertyArray
-
-
setQNamePrefix
Sets the value of field 'QNamePrefix'.- Parameters:
QNamePrefix
- the value of field 'QNamePrefix'.
-
setReference
public void setReference(boolean reference) Sets the value of field 'reference'.- Parameters:
reference
- the value of field 'reference'.
-
setTransient
public void setTransient(boolean _transient) Sets the value of field 'transient'.- Parameters:
_transient
-transient
- the value of field 'transient'.
-
setType
Sets the value of field 'type'.- Parameters:
type
- the value of field 'type'.
-
unmarshal
Method unmarshal.- Parameters:
reader
-- Returns:
- the unmarshaled org.exolab.castor.mapping.xml.BindXml
- Throws:
MarshalException
- if object is null or if any SAXException is thrown during marshalingValidationException
- if this object is an invalid instance according to the schema
-
validate
- Throws:
ValidationException
- if this object is an invalid instance according to the schema
-