org.bibalex.daf.entities.phase
Class DatabaseDef

java.lang.Object
  extended by org.bibalex.daf.entities.phase.DatabaseDef

public class DatabaseDef
extends java.lang.Object

Represents the database section of a phase.

Author:
Shehab.Kamal

Field Summary
 java.util.ArrayList<DatabaseElement> elements
          Holds the elements defined within this section
 
Constructor Summary
DatabaseDef()
          Creates a new instance of DatabaseDef.
DatabaseDef(org.w3c.dom.Node node)
          Creates a new instance of DatabaseDef.
DatabaseDef(java.lang.String nodeRep)
          Creates a new instance of DatabaseDef.
 
Method Summary
private  void createElementFromNode(org.w3c.dom.Node node)
          Creates the DatabaseDef element by supplying its XmlNode represenation.
 DatabaseElement[] getElements()
          Gets the elements defined within this section.
 java.lang.String toString()
          Returns the string representation of this object.
 java.lang.String toXmlString()
          Returns a String representing the DatabaseDef in xml format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

elements

public java.util.ArrayList<DatabaseElement> elements
Holds the elements defined within this section

Constructor Detail

DatabaseDef

public DatabaseDef()
Creates a new instance of DatabaseDef.


DatabaseDef

public DatabaseDef(org.w3c.dom.Node node)
            throws PhaseDefinitionException
Creates a new instance of DatabaseDef.

Parameters:
node - The Xml node that representd the element.
Throws:
PhaseDefinitionException - If the given node couldn't be parsed.

DatabaseDef

public DatabaseDef(java.lang.String nodeRep)
            throws PhaseDefinitionException
Creates a new instance of DatabaseDef.

Parameters:
nodeRep - The Xml String representing this element.
Throws:
PhaseDefinitionException - If the given String couldn't be parsed.
Method Detail

createElementFromNode

private void createElementFromNode(org.w3c.dom.Node node)
                            throws PhaseDefinitionException
Creates the DatabaseDef element by supplying its XmlNode represenation.

Parameters:
node - The Xml Node representing this element.
Throws:
PhaseDefinitionException - If the node name is not 'Database' or child couldn't be added.

getElements

public DatabaseElement[] getElements()
Gets the elements defined within this section.

Returns:
An array of type DatabaseElement containing the elements or an empty array if there is no elements.

toString

public java.lang.String toString()
Returns the string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this object.

toXmlString

public java.lang.String toXmlString()
Returns a String representing the DatabaseDef in xml format.

Returns:
A String representing the DatabaseDef in xml format.