Class EnumBindingType
java.lang.Object
org.exolab.castor.builder.binding.xml.EnumBindingType
- All Implemented Interfaces:
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEnumMember
(int index, EnumMember vEnumMember) void
addEnumMember
(EnumMember vEnumMember) Method enumerateEnumMember.Returns the value of field 'enumClassName'.Method getEnumMember.Returns the contents of the collection in an Array.getEnumMember
(int index) Method getEnumMember.int
Method getEnumMemberCount.boolean
isValid()
Method isValid.Method iterateEnumMember.void
void
marshal
(ContentHandler handler) void
boolean
removeEnumMember
(EnumMember vEnumMember) Method removeEnumMember.removeEnumMemberAt
(int index) Method removeEnumMemberAt.void
setEnumClassName
(EnumClassName enumClassName) Sets the value of field 'enumClassName'.void
setEnumMember
(int index, EnumMember vEnumMember) void
setEnumMember
(EnumMember[] vEnumMemberArray) static EnumBindingType
unmarshalEnumBindingType
(Reader reader) Method unmarshalEnumBindingType.void
validate()
-
Constructor Details
-
EnumBindingType
public EnumBindingType()
-
-
Method Details
-
addEnumMember
- Parameters:
vEnumMember
-- Throws:
IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
addEnumMember
- Parameters:
index
-vEnumMember
-- Throws:
IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
enumerateEnumMember
Method enumerateEnumMember.- Returns:
- an Enumeration over all possible elements of this collection
-
getEnumClassName
Returns the value of field 'enumClassName'.- Returns:
- the value of field 'EnumClassName'.
-
getEnumMember
Method getEnumMember.- Parameters:
index
-- Returns:
- the value of the org.exolab.castor.builder.binding.xml.EnumMember at the given index
- Throws:
IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
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
Method iterateEnumMember.- 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
-
removeAllEnumMember
public void removeAllEnumMember() -
removeEnumMember
Method removeEnumMember.- Parameters:
vEnumMember
-- Returns:
- true if the object was removed from the collection.
-
removeEnumMemberAt
Method removeEnumMemberAt.- Parameters:
index
-- Returns:
- the element removed from the collection
-
setEnumClassName
Sets the value of field 'enumClassName'.- Parameters:
enumClassName
- the value of field 'enumClassName'.
-
setEnumMember
- Parameters:
index
-vEnumMember
-- Throws:
IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
setEnumMember
- Parameters:
vEnumMemberArray
-
-
unmarshalEnumBindingType
public static EnumBindingType unmarshalEnumBindingType(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 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
-