org.bibalex.daf.managers.resourcemanager
Class ResourceElement

java.lang.Object
  extended by org.bibalex.daf.managers.resourcemanager.ResourceElement
Direct Known Subclasses:
DefaultResourceElement

public class ResourceElement
extends java.lang.Object

Represents an element within a section in the resource file.

Author:
Shehab.Kamal

Field Summary
private  java.util.Hashtable<java.lang.String,java.lang.String> hashTable
          A hast table to store the key and the value of the element.
 
Constructor Summary
ResourceElement()
          Default constructor.
ResourceElement(org.w3c.dom.Node node)
          Creates a new instance of ResourceElement.
 
Method Summary
 java.lang.String getCaption()
          Gets the caption of this element.
 java.lang.String getName()
          Gets the name of this element.
 java.lang.String getValue(java.lang.String key)
          Gets the value of the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hashTable

private java.util.Hashtable<java.lang.String,java.lang.String> hashTable
A hast table to store the key and the value of the element.

Constructor Detail

ResourceElement

public ResourceElement()
Default constructor.


ResourceElement

public ResourceElement(org.w3c.dom.Node node)
                throws ResourceManagerException
Creates a new instance of ResourceElement.

Parameters:
node - An XmlNode representing the element.
Throws:
ResourceManagerException - The exception is thrown if the given node contains no attributes.
Method Detail

getName

public java.lang.String getName()
Gets the name of this element.

Returns:
The name of the element. If the element has no name, null is returned.

getCaption

public java.lang.String getCaption()
Gets the caption of this element.

Returns:
The caption of the element. If the element has no caption, null is returned.

getValue

public java.lang.String getValue(java.lang.String key)
Gets the value of the given key.

Parameters:
key - The key to search for its value.
Returns:
The value associated with the given key. If the key is not associated with any value, null is returned.