org.exolab.castor.mapping.xml
Class BindXml

java.lang.Object
  extended by org.exolab.castor.mapping.xml.BindXml
All Implemented Interfaces:
java.io.Serializable

public class BindXml
extends java.lang.Object
implements java.io.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:
Serialized Form

Constructor Summary
BindXml()
           
 
Method Summary
 void addProperty(int index, Property vProperty)
           
 void addProperty(Property vProperty)
           
 void deleteReference()
           
 void deleteTransient()
           
 java.util.Enumeration<? extends Property> enumerateProperty()
          Method enumerateProperty.
 BindXmlAutoNamingType getAutoNaming()
          Returns the value of field 'autoNaming'.
 ClassMapping getClassMapping()
          Returns the value of field 'classMapping'.
 java.lang.String getLocation()
          Returns the value of field 'location'.
 java.lang.String getMatches()
          Returns the value of field 'matches'.
 java.lang.String getName()
          Returns the value of field 'name'.
 BindXmlNodeType getNode()
          Returns the value of field 'node'.
 Property[] getProperty()
          Method getProperty.Returns the contents of the collection in an Array.
 Property getProperty(int index)
          Method getProperty.
 int getPropertyCount()
          Method getPropertyCount.
 java.lang.String getQNamePrefix()
          Returns the value of field 'QNamePrefix'.
 boolean getReference()
          Returns the value of field 'reference'.
 boolean getTransient()
          Returns the value of field 'transient'.
 java.lang.String getType()
          Returns the value of field 'type'.
 boolean hasReference()
          Method hasReference.
 boolean hasTransient()
          Method hasTransient.
 boolean isReference()
          Returns the value of field 'reference'.
 boolean isTransient()
          Returns the value of field 'transient'.
 boolean isValid()
          Method isValid.
 java.util.Iterator<? extends Property> iterateProperty()
          Method iterateProperty.
 void marshal(org.xml.sax.ContentHandler handler)
           
 void marshal(java.io.Writer out)
           
 void removeAllProperty()
           
 boolean removeProperty(Property vProperty)
          Method removeProperty.
 Property 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(java.lang.String location)
          Sets the value of field 'location'.
 void setMatches(java.lang.String matches)
          Sets the value of field 'matches'.
 void setName(java.lang.String name)
          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(java.lang.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 setType(java.lang.String type)
          Sets the value of field 'type'.
static BindXml unmarshal(java.io.Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindXml

public BindXml()
Method Detail

addProperty

public void addProperty(Property vProperty)
                 throws java.lang.IndexOutOfBoundsException
Parameters:
vProperty -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addProperty

public void addProperty(int index,
                        Property vProperty)
                 throws java.lang.IndexOutOfBoundsException
Parameters:
index -
vProperty -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

deleteReference

public void deleteReference()

deleteTransient

public void deleteTransient()

enumerateProperty

public java.util.Enumeration<? extends Property> enumerateProperty()
Method enumerateProperty.

Returns:
an Enumeration over all possible elements of this collection

getAutoNaming

public BindXmlAutoNamingType 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

public ClassMapping 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

public java.lang.String 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

public java.lang.String getMatches()
Returns the value of field 'matches'.

Returns:
the value of field 'Matches'.

getName

public java.lang.String 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

public BindXmlNodeType getNode()
Returns the value of field 'node'.

Returns:
the value of field 'Node'.

getProperty

public Property getProperty(int index)
                     throws java.lang.IndexOutOfBoundsException
Method getProperty.

Parameters:
index -
Returns:
the value of the org.exolab.castor.mapping.xml.Property at the given index
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getProperty

public Property[] 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

public java.lang.String 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

public java.lang.String 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

public java.util.Iterator<? extends Property> iterateProperty()
Method iterateProperty.

Returns:
an Iterator over all possible elements in this collection

marshal

public void marshal(java.io.Writer out)
             throws MarshalException,
                    ValidationException
Parameters:
out -
Throws:
MarshalException - if object is null or if any SAXException is thrown during marshaling
ValidationException - if this object is an invalid instance according to the schema

marshal

public void marshal(org.xml.sax.ContentHandler handler)
             throws java.io.IOException,
                    MarshalException,
                    ValidationException
Parameters:
handler -
Throws:
java.io.IOException - if an IOException occurs during marshaling
ValidationException - if this object is an invalid instance according to the schema
MarshalException - if object is null or if any SAXException is thrown during marshaling

removeAllProperty

public void removeAllProperty()

removeProperty

public boolean removeProperty(Property vProperty)
Method removeProperty.

Parameters:
vProperty -
Returns:
true if the object was removed from the collection.

removePropertyAt

public Property removePropertyAt(int index)
Method removePropertyAt.

Parameters:
index -
Returns:
the element removed from the collection

setAutoNaming

public void setAutoNaming(BindXmlAutoNamingType autoNaming)
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

public void setClassMapping(ClassMapping classMapping)
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

public void setLocation(java.lang.String location)
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

public void setMatches(java.lang.String matches)
Sets the value of field 'matches'.

Parameters:
matches - the value of field 'matches'.

setName

public void setName(java.lang.String name)
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

public void setNode(BindXmlNodeType node)
Sets the value of field 'node'.

Parameters:
node - the value of field 'node'.

setProperty

public void setProperty(int index,
                        Property vProperty)
                 throws java.lang.IndexOutOfBoundsException
Parameters:
index -
vProperty -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setProperty

public void setProperty(Property[] vPropertyArray)
Parameters:
vPropertyArray -

setQNamePrefix

public void setQNamePrefix(java.lang.String QNamePrefix)
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

public void setType(java.lang.String type)
Sets the value of field 'type'.

Parameters:
type - the value of field 'type'.

unmarshal

public static BindXml unmarshal(java.io.Reader reader)
                         throws MarshalException,
                                ValidationException
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 marshaling
ValidationException - if this object is an invalid instance according to the schema

validate

public void validate()
              throws ValidationException
Throws:
ValidationException - if this object is an invalid instance according to the schema


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com