org.bibalex.daf.entities.phase
Class DatabaseElement

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

public class DatabaseElement
extends java.lang.Object

Represents the field definition within the database section of a phase.

Author:
Shehab.Kamal

Field Summary
 java.lang.String defaultValue
          The 'DefaultValue' property of the element.
 java.lang.String displayName
          The 'DisplayName' property of the element.
 boolean mandatory
          The 'Mandatory' property of the element.
 java.lang.String name
          The 'Name' property of the element.
 java.lang.String predefinedValues
          The 'PredefinedValues' property of the element.
Multiple predefined values are assumed to be separated by semi-colon ';'.
 
Constructor Summary
DatabaseElement()
          Creates a new instance of DatabaseElement.
DatabaseElement(org.w3c.dom.Node node)
          Creates a new instance of DatabaseElement.
DatabaseElement(java.lang.String nodeRep)
          Creates a new instance of DatabaseElement.
DatabaseElement(java.lang.String name, java.lang.String displayName, java.lang.String predefinedValues, java.lang.String defaultValue, boolean mandatory)
          Creates a new instance of DatabaseElement.
 
Method Summary
private  void createElementFromNode(org.w3c.dom.Node node)
          Creates the file element by supplying its XmlNode represenation.
 java.lang.String[] getPredefinedValues()
          Gets a list of predefined values of this element.
 java.lang.String toString()
          Returns the string representation of this object.
 java.lang.String toXmlString()
          Converts this instance to a valid XML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
The 'Name' property of the element.


displayName

public java.lang.String displayName
The 'DisplayName' property of the element.


predefinedValues

public java.lang.String predefinedValues
The 'PredefinedValues' property of the element.
Multiple predefined values are assumed to be separated by semi-colon ';'.


defaultValue

public java.lang.String defaultValue
The 'DefaultValue' property of the element.


mandatory

public boolean mandatory
The 'Mandatory' property of the element.

Constructor Detail

DatabaseElement

public DatabaseElement()
Creates a new instance of DatabaseElement.


DatabaseElement

public DatabaseElement(java.lang.String name,
                       java.lang.String displayName,
                       java.lang.String predefinedValues,
                       java.lang.String defaultValue,
                       boolean mandatory)
Creates a new instance of DatabaseElement.

Parameters:
name - The 'Name' property of the element.
displayName - The 'DisplayName' property of the element.
predefinedValues - The 'PredefinedValues' property of the element.
defaultValue - The 'DefaultValue' property of the element.
mandatory - The 'Mandatory' property of the element.

DatabaseElement

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

Parameters:
node - The Xml Node representing this element.
Throws:
PhaseDefinitionException - If the given node couldn't be parsed.

DatabaseElement

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

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 file element by supplying its XmlNode represenation.

Parameters:
node - The Xml Node representing this element.
Throws:
PhaseDefinitionException - If the node name is not 'Folder' or attributes are missing.

getPredefinedValues

public java.lang.String[] getPredefinedValues()
Gets a list of predefined values of this element.

Returns:
A String[] that holds the predefined values

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()
Converts this instance to a valid XML string.

Returns:
A valid XML string representing this instance.