com.infoengine.object.factory
Class Webject

java.lang.Object
  extended bycom.infoengine.object.factory.Webject
All Implemented Interfaces:
Cloneable, Serializable
Direct Known Subclasses:
Webject

public class Webject
extends Object
implements Cloneable, Serializable

See Also:
Serialized Form

Field Summary
static String CLASS
           
private static int counter
           
static String DISPLAY
           
static String EXTERNAL
           
static String GROUP
           
static String GROUP_IN
           
static String GROUP_OUT
           
static String MESSAGE
           
private  IeNode myNode
           
static String OBJECT
           
static String OUTPUT
           
static String TASK
           
static byte[] text
           
static String TYPE
           
static String UNKNOWN
           
 
Constructor Summary
Webject()
          Constructs an unnamed webject.
Webject(IeNode node)
          Constructs a webject wrapper around an existing set of parameters.
Webject(String name)
          Constructs a named webject.
 
Method Summary
 Param addKey(String key, String value)
          Adds a KEY parameter to this webject.
 void addMessage(String message)
          Adds a warning or error message to this webject.
 void addMeta(IeMeta meta)
          Adds a specific meta item to this webject.
 void addMetaValue(String name, String value)
          Adds a meta item to this webject with a specific name and value.
 void addOutput(String message)
          Adds an output message to this webject.
 void addParam(Param param)
          Adds a new parameter to this webject.
 Param addUniqueKey(String key, String value)
          Adds a KEY parameter to this webject only if the webject does not contain it already.
 Param addUniqueValue(String key, String value)
          Adds a VALUE parameter to this webject only if the webject does not contain it already.
 Param addValue(String keyval)
          Adds a VALUE parameter to this webject.
 Param addValue(String key, String value)
          Adds a VALUE parameter to this webject.
 void addWebject(Webject webject)
          Adds a new webject as a child of this webject.
 void clearParams()
          Removes all parameters of this webject.
 Object clone()
          Returns a shallow copy of this webject.
 Webject deepClone()
          Returns a deep copy of this webject.
 String getClassName()
          Returns the class name currently assigned to this webject.
 String getGroupInName()
          Returns the name of the default input group of this webject.
 Enumeration getGroupInNames()
          Returns the names of all input groups currently associated with this webject.
 String getGroupOutName()
          Returns the name of the default output group of this webject.
 Enumeration getGroupOutNames()
          Returns the names of all output groups currently associated with this webject.
 Param getKey(String name)
          Returns the KEY parameter with the specified name.
 Enumeration getKeys()
          Returns all of the KEY parameters contained in this webject.
 Enumeration getMessages()
          Returns any warning or error messages generated by this webject.
 String getMetaValue(String name)
          Returns a meta value from this webject by name.
 String getName()
          Returns the name currently assigned to this webject.
 IeNode getNode()
          Returns the internal IeNode object of this webject.
 Enumeration getOutput()
          Returns any output messages generated by this webject.
 Param getParam(String name)
          Returns a webject parameter by name.
protected  Param getParam(String name, int type)
          Returns a webject parameter of a specific type by name.
 Enumeration getParamNames()
          Returns the names of all parameters associated with this webject.
 Enumeration getParams(String name)
          Returns all of the webject parameters with a specified name.
protected  Enumeration getParams(String name, int type)
          Returns all of the webject parameters with a specified name and type.
 String getPassword()
          Returns the password currently associated with this webject.
 String getType()
          Returns the type currently assigned to this webject.
 String getUserName()
          Returns the username currently associated with this webject.
 Param getValue(String name)
          Returns the VALUE parameter with the specified name.
 Enumeration getValues()
          Returns all of the VALUE parameters contained in this webject.
 Enumeration getWebjects()
          Returns any webjects that are children of this webject.
protected static IeNode newStructure()
          Returns a new webject structure.
private static int nextSeqNo()
           
 String paramValue(String name)
          Returns the value of a webject parameter by name.
 String paramValue(String name, String defaultValue)
          Returns the value of a webject parameter by name.
 Enumeration paramValues(String name)
          Returns all values of a named parameter of this webject.
 void printTree()
          Prints the internal structure of this webject to System.out.
 void removeAllWebjects()
          Removes all child webjects from this webject.
 void removeParam(Param param)
          Removes a specific parameter from this webject.
 void removeParams(String name)
          Removes all parameters with a specified name from this webject.
 void removeWebject(Webject webject)
          Removes a specific child webject from this webject.
 void setClassName(String name)
          Sets the class name assigned to this webject.
 void setName(String name)
          Sets the name of this webject.
protected  void setNode(IeNode node)
          Sets the internal IeNode object of this webject.
 void setParam(Param param)
          Sets a new parameter for this webject.
 void setPassword(String pwd)
          Sets the password associated with this webject.
 void setType(String type)
          Sets the type assigned to this webject.
 void setUserName(String name)
          Sets the username associated with this webject.
 Param setValue(String key, String value)
          Sets a VALUE parameter in this webject.
 String toString()
          Produces a String representation of this webject.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

counter

private static int counter

MESSAGE

public static final String MESSAGE
See Also:
Constant Field Values

OUTPUT

public static final String OUTPUT
See Also:
Constant Field Values

GROUP_IN

public static final String GROUP_IN
See Also:
Constant Field Values

GROUP_OUT

public static final String GROUP_OUT
See Also:
Constant Field Values

CLASS

public static final String CLASS
See Also:
Constant Field Values

TYPE

public static final String TYPE
See Also:
Constant Field Values

UNKNOWN

public static final String UNKNOWN
See Also:
Constant Field Values

OBJECT

public static final String OBJECT
See Also:
Constant Field Values

EXTERNAL

public static final String EXTERNAL
See Also:
Constant Field Values

DISPLAY

public static final String DISPLAY
See Also:
Constant Field Values

GROUP

public static final String GROUP
See Also:
Constant Field Values

TASK

public static final String TASK
See Also:
Constant Field Values

text

public static final byte[] text

myNode

private IeNode myNode
Constructor Detail

Webject

public Webject()
Constructs an unnamed webject.


Webject

public Webject(String name)
Constructs a named webject.

Parameters:
name - The name of the webject.

Webject

public Webject(IeNode node)
Constructs a webject wrapper around an existing set of parameters.

Method Detail

getName

public String getName()
Returns the name currently assigned to this webject.

Returns:
The webject's current name.

setName

public void setName(String name)
Sets the name of this webject.

Parameters:
name - The webject's new name.

setPassword

public void setPassword(String pwd)
Sets the password associated with this webject.

Parameters:
pwd - The webject's new password.

getPassword

public String getPassword()
Returns the password currently associated with this webject.

Returns:
The webject's current password.

setUserName

public void setUserName(String name)
Sets the username associated with this webject.

Parameters:
name - The webject's new username.

getUserName

public String getUserName()
Returns the username currently associated with this webject.

Returns:
The webject's current username.

getType

public String getType()
Returns the type currently assigned to this webject.

Returns:
The webject's current type.

setType

public void setType(String type)
Sets the type assigned to this webject.

Parameters:
type - The webject's new type.

getClassName

public String getClassName()
Returns the class name currently assigned to this webject.

Returns:
The webject's current class name.

setClassName

public void setClassName(String name)
Sets the class name assigned to this webject.

Parameters:
name - The webject's new class name.

getGroupInName

public String getGroupInName()
Returns the name of the default input group of this webject.

Returns:
The default input group name.

getGroupInNames

public Enumeration getGroupInNames()
Returns the names of all input groups currently associated with this webject.

Returns:
The input group names.

getGroupOutName

public String getGroupOutName()
Returns the name of the default output group of this webject.

Returns:
The default output group name.

getGroupOutNames

public Enumeration getGroupOutNames()
Returns the names of all output groups currently associated with this webject.

Returns:
The output group names.

clearParams

public void clearParams()
Removes all parameters of this webject.


addParam

public void addParam(Param param)
Adds a new parameter to this webject.

Parameters:
param - The new parameter to be added.

setParam

public void setParam(Param param)
Sets a new parameter for this webject. If any parameters with the same name were added previously, they are removed.

Parameters:
param - The new parameter to be set.

removeParam

public void removeParam(Param param)
Removes a specific parameter from this webject.

Parameters:
param - The parameter to be removed.

removeParams

public void removeParams(String name)
Removes all parameters with a specified name from this webject.

Parameters:
name - The name of the parameter(s) to be removed.

paramValue

public String paramValue(String name)
Returns the value of a webject parameter by name.

Parameters:
name - The name of the desired parameter.
Returns:
The named parameter's value, or an empty string if the parameter is not found in the webject.

paramValue

public String paramValue(String name,
                         String defaultValue)
Returns the value of a webject parameter by name. If the parameter is not found in the webject, returns a default value.

Parameters:
name - The name of the desired parameter.
defaultValue - The default value to return if the parameter is not found.
Returns:
The named parameter's value, or the default value if the parameter is not found in the webject.

paramValues

public Enumeration paramValues(String name)
Returns all values of a named parameter of this webject.

Parameters:
name - The name of the desired parameter.
Returns:
The named parameter's values.

getParam

public Param getParam(String name)
Returns a webject parameter by name.

Parameters:
name - The name of the desired parameter.
Returns:
The named parameter's value, or null if the parameter is not found in the webject.

getParam

protected Param getParam(String name,
                         int type)
Returns a webject parameter of a specific type by name.

Parameters:
name - The name of the desired parameter.
type - The type of the desired parameter.
Returns:
The named parameter's value, or null if the parameter is not found in the webject.

getParams

public Enumeration getParams(String name)
Returns all of the webject parameters with a specified name.

Parameters:
name - The name of the desired parameters. A null name causes all parameters, regardless of name, to be returned.
Returns:
The parameters.

getParams

protected Enumeration getParams(String name,
                                int type)
Returns all of the webject parameters with a specified name and type.

Parameters:
name - The name of the desired parameters. A null name causes all parameters, regardless of name, to be returned if they have the specified type.
type - The type of the desired parameters. Param.UNKNOWN causes all parameters, regardless of type, to be returned if they have the specified name.
Returns:
The matching parameters. If name is null and type is Param.UNKNOWN, all parameters of the webject are returned.

getParamNames

public Enumeration getParamNames()
Returns the names of all parameters associated with this webject.

Returns:
The parameter names.

getMetaValue

public String getMetaValue(String name)
Returns a meta value from this webject by name.

Parameters:
name - The name of the desired meta value.
Returns:
The value of the named meta, or null if the meta is not found in the webject.

addMetaValue

public void addMetaValue(String name,
                         String value)
Adds a meta item to this webject with a specific name and value.

Parameters:
name - The name of the new meta item.
value - The value of the meta item.

addMeta

public void addMeta(IeMeta meta)
Adds a specific meta item to this webject.

Parameters:
meta - The IeMeta object to be added.

getKey

public Param getKey(String name)
Returns the KEY parameter with the specified name.

Parameters:
name - The name associated with the KEY parameter.
Returns:
The named KEY parameter, or null if the parameter is not found in the webject.

getKeys

public Enumeration getKeys()
Returns all of the KEY parameters contained in this webject.

Returns:
The KEY parameters.

addKey

public Param addKey(String key,
                    String value)
Adds a KEY parameter to this webject.

Parameters:
key - The name of the new parameter.
value - The value of the new parameter.
Returns:
The new KEY parameter.

addUniqueKey

public Param addUniqueKey(String key,
                          String value)
Adds a KEY parameter to this webject only if the webject does not contain it already.

Parameters:
key - The name of the new parameter.
value - The value of the new parameter.
Returns:
The new parameter, or the pre-existing parameter with this value

getValue

public Param getValue(String name)
Returns the VALUE parameter with the specified name.

Parameters:
name - The name of the desired VALUE parameter.
Returns:
The named VALUE parameter, or null if the parameter is not found in the webject.

getValues

public Enumeration getValues()
Returns all of the VALUE parameters contained in this webject.

Returns:
The VALUE parameters.

addValue

public Param addValue(String key,
                      String value)
Adds a VALUE parameter to this webject.

Parameters:
key - The name of the new parameter.
value - The value of the new parameter.
Returns:
The new parameter.

addUniqueValue

public Param addUniqueValue(String key,
                            String value)
Adds a VALUE parameter to this webject only if the webject does not contain it already.

Parameters:
key - The name of the new parameter.
value - The value of the new parameter.
Returns:
The new parameter, or the pre-existing parameter with this value

setValue

public Param setValue(String key,
                      String value)
Sets a VALUE parameter in this webject.

Parameters:
key - The name of the new parameter.
value - The value of the new parameter.
Returns:
The new parameter.

addValue

public Param addValue(String keyval)
Adds a VALUE parameter to this webject.

Parameters:
keyval - A key=value string representing a parameter.
Returns:
The new parameter.

getMessages

public Enumeration getMessages()
Returns any warning or error messages generated by this webject.

Returns:
The warning or error messages.

addMessage

public void addMessage(String message)
Adds a warning or error message to this webject.

Parameters:
message - The warning or error message to be added.

getOutput

public Enumeration getOutput()
Returns any output messages generated by this webject.

Returns:
The output messages.

addOutput

public void addOutput(String message)
Adds an output message to this webject.

Parameters:
message - The output message to be added.

clone

public Object clone()
Returns a shallow copy of this webject.

Returns:
The shallow copy.

deepClone

public Webject deepClone()
Returns a deep copy of this webject.

Returns:
The deep copy.

nextSeqNo

private static int nextSeqNo()

newStructure

protected static IeNode newStructure()
Returns a new webject structure.

Returns:
The new webject.

getNode

public IeNode getNode()
Returns the internal IeNode object of this webject.

Returns:
This webject's set of parameters and meta.

setNode

protected void setNode(IeNode node)
Sets the internal IeNode object of this webject.

Parameters:
node - The new set of parameters and meta that define this webject.

getWebjects

public Enumeration getWebjects()
Returns any webjects that are children of this webject.

Returns:
This webject's set of child webjects.

addWebject

public void addWebject(Webject webject)
Adds a new webject as a child of this webject.

Parameters:
webject - The new child webject.

removeWebject

public void removeWebject(Webject webject)
Removes a specific child webject from this webject.

Parameters:
webject - The child webject to be removed.

removeAllWebjects

public void removeAllWebjects()
Removes all child webjects from this webject.


printTree

public void printTree()
Prints the internal structure of this webject to System.out.


toString

public String toString()
Produces a String representation of this webject.

Returns:
The string representation of this webject.