org.castor.jdo.conf
Class Database

java.lang.Object
  extended by org.castor.jdo.conf.Database
All Implemented Interfaces:
Serializable

public class Database
extends Object
implements Serializable

Class Database.

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

Constructor Summary
Database()
           
 
Method Summary
 void addMapping(int index, Mapping vMapping)
           
 void addMapping(Mapping vMapping)
           
 Enumeration<? extends Mapping> enumerateMapping()
          Method enumerateMapping.
 DatabaseChoice getDatabaseChoice()
          Returns the value of field 'databaseChoice'.
 String getEngine()
          Returns the value of field 'engine'.
 Mapping[] getMapping()
          Method getMapping.Returns the contents of the collection in an Array.
 Mapping getMapping(int index)
          Method getMapping.
 int getMappingCount()
          Method getMappingCount.
 String getName()
          Returns the value of field 'name'.
 boolean isValid()
          Method isValid.
 Iterator<? extends Mapping> iterateMapping()
          Method iterateMapping.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllMapping()
           
 boolean removeMapping(Mapping vMapping)
          Method removeMapping.
 Mapping removeMappingAt(int index)
          Method removeMappingAt.
 void setDatabaseChoice(DatabaseChoice databaseChoice)
          Sets the value of field 'databaseChoice'.
 void setEngine(String engine)
          Sets the value of field 'engine'.
 void setMapping(int index, Mapping vMapping)
           
 void setMapping(Mapping[] vMappingArray)
           
 void setName(String name)
          Sets the value of field 'name'.
static Database unmarshal(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

Database

public Database()
Method Detail

addMapping

public void addMapping(Mapping vMapping)
                throws IndexOutOfBoundsException
Parameters:
vMapping -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addMapping

public void addMapping(int index,
                       Mapping vMapping)
                throws IndexOutOfBoundsException
Parameters:
index -
vMapping -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateMapping

public Enumeration<? extends Mapping> enumerateMapping()
Method enumerateMapping.

Returns:
an Enumeration over all possible elements of this collection

getDatabaseChoice

public DatabaseChoice getDatabaseChoice()
Returns the value of field 'databaseChoice'.

Returns:
the value of field 'DatabaseChoice'.

getEngine

public String getEngine()
Returns the value of field 'engine'.

Returns:
the value of field 'Engine'.

getMapping

public Mapping getMapping(int index)
                   throws IndexOutOfBoundsException
Method getMapping.

Parameters:
index -
Returns:
the value of the org.castor.jdo.conf.Mapping at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getMapping

public Mapping[] getMapping()
Method getMapping.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

getMappingCount

public int getMappingCount()
Method getMappingCount.

Returns:
the size of this collection

getName

public String getName()
Returns the value of field 'name'.

Returns:
the value of field 'Name'.

isValid

public boolean isValid()
Method isValid.

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

iterateMapping

public Iterator<? extends Mapping> iterateMapping()
Method iterateMapping.

Returns:
an Iterator over all possible elements in this collection

marshal

public void marshal(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(ContentHandler handler)
             throws IOException,
                    MarshalException,
                    ValidationException
Parameters:
handler -
Throws:
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

removeAllMapping

public void removeAllMapping()

removeMapping

public boolean removeMapping(Mapping vMapping)
Method removeMapping.

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

removeMappingAt

public Mapping removeMappingAt(int index)
Method removeMappingAt.

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

setDatabaseChoice

public void setDatabaseChoice(DatabaseChoice databaseChoice)
Sets the value of field 'databaseChoice'.

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

setEngine

public void setEngine(String engine)
Sets the value of field 'engine'.

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

setMapping

public void setMapping(int index,
                       Mapping vMapping)
                throws IndexOutOfBoundsException
Parameters:
index -
vMapping -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setMapping

public void setMapping(Mapping[] vMappingArray)
Parameters:
vMappingArray -

setName

public void setName(String name)
Sets the value of field 'name'.

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

unmarshal

public static Database unmarshal(Reader reader)
                          throws MarshalException,
                                 ValidationException
Method unmarshal.

Parameters:
reader -
Returns:
the unmarshaled org.castor.jdo.conf.Database
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


Copyright © 2010. All Rights Reserved.