com.adventnet.utilities.xml.sax
Class ValueObject

java.lang.Object
  extended by com.adventnet.utilities.xml.sax.ValueObject

public class ValueObject
extends java.lang.Object


Constructor Summary
ValueObject()
           
ValueObject(java.util.Hashtable hash)
          Add all the entries of this hash to the valueobject.
ValueObject(int increment)
          increment and initial size
 
Method Summary
 void add(java.lang.String s, boolean someBooleanValue)
           
 void add(java.lang.String s, int i)
           
 void add(java.lang.String s, long anyLongValue)
           
 void add(java.lang.String s, java.lang.Object ob)
          allows duplicate entries
 boolean getBooleanValue(java.lang.String s)
          Returns boolean value corresponding to the key.
 java.util.Hashtable getDataAsHashtable()
           
 java.util.Hashtable getDataAsHashtable(java.util.Hashtable retHash)
           
 int getIntValue(java.lang.String s)
          Returns int value corresponding to the key.
 long getLongValue(java.lang.String s)
          Returns long value corresponding to the key.
 java.lang.String getValue(java.lang.String s)
          Note : Ignores case by default : throws EXMLPropertyNotFoundException if the key is not found
 java.lang.String getValue(java.lang.String s, boolean ignoreCase)
           
static java.lang.String getValue(java.util.Vector vofVO, java.lang.String searchKey, java.lang.String searchValue, java.lang.String returnKey)
          This will take the string and search for the key searchKey whose value is searchValue and return the value of the returnKey corresponding to the valueObject.
 java.util.LinkedList getValues(java.lang.String s)
          Sample usage LinkedList ll = vo.getValues(MLET_URL); Object obj[] = ll.toArray(); for(int i=0;i
 java.util.Enumeration keys()
           
static void main(java.lang.String[] args)
           
 void overwrite(java.lang.String s, java.lang.Object ob)
          More costly operation as it loops to remove a particular item and then adds
 void remove(java.lang.String s)
          removes the first occurence of a particular item
 int size()
           
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String separator)
           
static void updateFromFrameworkHashIntoDataHash(java.util.Hashtable frameworkHash, java.lang.String hashKey, java.util.Hashtable dataHashToBeFilled)
           
static void updateTargetHashWithInputHash(java.util.Hashtable targetHash, java.lang.String targetHashKey, java.util.Hashtable datahash)
          the contents of datahash key and value are taken and a vector of ValueObjects are created and added to the targetHash with targetHashKey as the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueObject

public ValueObject()

ValueObject

public ValueObject(int increment)
increment and initial size


ValueObject

public ValueObject(java.util.Hashtable hash)
            throws java.lang.NullPointerException
Add all the entries of this hash to the valueobject. The key of the hash must be a String throws NullPointerException if hash is null

Throws:
java.lang.NullPointerException
Method Detail

overwrite

public void overwrite(java.lang.String s,
                      java.lang.Object ob)
More costly operation as it loops to remove a particular item and then adds


add

public void add(java.lang.String s,
                java.lang.Object ob)
allows duplicate entries


add

public void add(java.lang.String s,
                boolean someBooleanValue)

add

public void add(java.lang.String s,
                int i)

add

public void add(java.lang.String s,
                long anyLongValue)

remove

public void remove(java.lang.String s)
removes the first occurence of a particular item


keys

public java.util.Enumeration keys()

getValues

public java.util.LinkedList getValues(java.lang.String s)
Sample usage LinkedList ll = vo.getValues(MLET_URL); Object obj[] = ll.toArray(); for(int i=0;i

getValue

public java.lang.String getValue(java.lang.String s)
                          throws EXMLPropertyNotFoundException
Note : Ignores case by default : throws EXMLPropertyNotFoundException if the key is not found

Throws:
EXMLPropertyNotFoundException

getValue

public java.lang.String getValue(java.lang.String s,
                                 boolean ignoreCase)
                          throws EXMLPropertyNotFoundException
Throws:
EXMLPropertyNotFoundException

getIntValue

public int getIntValue(java.lang.String s)
                throws EXMLPropertyNotFoundException,
                       java.lang.NumberFormatException,
                       java.lang.IllegalArgumentException
Returns int value corresponding to the key.

Throws:
EXMLPropertyNotFoundException
java.lang.NumberFormatException
java.lang.IllegalArgumentException

getLongValue

public long getLongValue(java.lang.String s)
                  throws EXMLPropertyNotFoundException,
                         java.lang.NumberFormatException,
                         java.lang.IllegalArgumentException
Returns long value corresponding to the key.

Throws:
EXMLPropertyNotFoundException
java.lang.NumberFormatException
java.lang.IllegalArgumentException

getBooleanValue

public boolean getBooleanValue(java.lang.String s)
                        throws EXMLPropertyNotFoundException,
                               java.lang.IllegalArgumentException
Returns boolean value corresponding to the key.

Throws:
EXMLPropertyNotFoundException
java.lang.IllegalArgumentException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String separator)

size

public int size()

getValue

public static java.lang.String getValue(java.util.Vector vofVO,
                                        java.lang.String searchKey,
                                        java.lang.String searchValue,
                                        java.lang.String returnKey)
                                 throws EXMLPropertyNotFoundException
This will take the string and search for the key searchKey whose value is searchValue and return the value of the returnKey corresponding to the valueObject.

Parameters:
vofVO - vector of valueObjects
Throws:
EXMLPropertyNotFoundException

getDataAsHashtable

public java.util.Hashtable getDataAsHashtable()

getDataAsHashtable

public java.util.Hashtable getDataAsHashtable(java.util.Hashtable retHash)

main

public static void main(java.lang.String[] args)

updateTargetHashWithInputHash

public static void updateTargetHashWithInputHash(java.util.Hashtable targetHash,
                                                 java.lang.String targetHashKey,
                                                 java.util.Hashtable datahash)
                                          throws java.lang.IllegalArgumentException
the contents of datahash key and value are taken and a vector of ValueObjects are created and added to the targetHash with targetHashKey as the key. The xml tag of the key in the hashtable will be key and that of its value will be the string value. key & value tags are hardcoded Hashtable -- key1 value1 key2 value2 project file xml fie : key1 value1 key2 value2

Throws:
java.lang.IllegalArgumentException
See Also:
updateFromFrameworkHashIntoDataHash()

updateFromFrameworkHashIntoDataHash

public static void updateFromFrameworkHashIntoDataHash(java.util.Hashtable frameworkHash,
                                                       java.lang.String hashKey,
                                                       java.util.Hashtable dataHashToBeFilled)
                                                throws EXMLPropertyNotFoundException,
                                                       java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException
EXMLPropertyNotFoundException
See Also:
updateTargetHashWithInputHash