org.exolab.castor.builder.binding.xml
Class EnumBindingType

java.lang.Object
  extended by org.exolab.castor.builder.binding.xml.EnumBindingType
All Implemented Interfaces:
java.io.Serializable

public class EnumBindingType
extends java.lang.Object
implements java.io.Serializable

This type allows the mapping between an XML schema enumeration and a java class that follows the type-safe enumeration paradigm. Additionally, it allows the specify the name of the Java constant definition for a given enumeraton value.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
EnumBindingType()
           
 
Method Summary
 void addEnumMember(EnumMember vEnumMember)
           
 void addEnumMember(int index, EnumMember vEnumMember)
           
 java.util.Enumeration enumerateEnumMember()
          Method enumerateEnumMember.
 EnumClassName getEnumClassName()
          Returns the value of field 'enumClassName'.
 EnumMember[] getEnumMember()
          Method getEnumMember.Returns the contents of the collection in an Array.
 EnumMember getEnumMember(int index)
          Method getEnumMember.
 int getEnumMemberCount()
          Method getEnumMemberCount.
 boolean isValid()
          Method isValid.
 java.util.Iterator iterateEnumMember()
          Method iterateEnumMember.
 void marshal(org.xml.sax.ContentHandler handler)
           
 void marshal(java.io.Writer out)
           
 void removeAllEnumMember()
           
 boolean removeEnumMember(EnumMember vEnumMember)
          Method removeEnumMember.
 EnumMember removeEnumMemberAt(int index)
          Method removeEnumMemberAt.
 void setEnumClassName(EnumClassName enumClassName)
          Sets the value of field 'enumClassName'.
 void setEnumMember(EnumMember[] vEnumMemberArray)
           
 void setEnumMember(int index, EnumMember vEnumMember)
           
static EnumBindingType unmarshalEnumBindingType(java.io.Reader reader)
          Method unmarshalEnumBindingType.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumBindingType

public EnumBindingType()
Method Detail

addEnumMember

public void addEnumMember(EnumMember vEnumMember)
                   throws java.lang.IndexOutOfBoundsException
Parameters:
vEnumMember -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addEnumMember

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

enumerateEnumMember

public java.util.Enumeration enumerateEnumMember()
Method enumerateEnumMember.

Returns:
an Enumeration over all possible elements of this collection

getEnumClassName

public EnumClassName getEnumClassName()
Returns the value of field 'enumClassName'.

Returns:
the value of field 'EnumClassName'.

getEnumMember

public EnumMember getEnumMember(int index)
                         throws java.lang.IndexOutOfBoundsException
Method getEnumMember.

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

getEnumMember

public EnumMember[] getEnumMember()
Method getEnumMember.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

getEnumMemberCount

public int getEnumMemberCount()
Method getEnumMemberCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

iterateEnumMember

public java.util.Iterator iterateEnumMember()
Method iterateEnumMember.

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

removeAllEnumMember

public void removeAllEnumMember()

removeEnumMember

public boolean removeEnumMember(EnumMember vEnumMember)
Method removeEnumMember.

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

removeEnumMemberAt

public EnumMember removeEnumMemberAt(int index)
Method removeEnumMemberAt.

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

setEnumClassName

public void setEnumClassName(EnumClassName enumClassName)
Sets the value of field 'enumClassName'.

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

setEnumMember

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

setEnumMember

public void setEnumMember(EnumMember[] vEnumMemberArray)
Parameters:
vEnumMemberArray -

unmarshalEnumBindingType

public static EnumBindingType unmarshalEnumBindingType(java.io.Reader reader)
                                                throws MarshalException,
                                                       ValidationException
Method unmarshalEnumBindingType.

Parameters:
reader -
Returns:
the unmarshaled org.exolab.castor.builder.binding.xml.EnumBindingType
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