Style Intelligence v12.0

inetsoft.uql
Class VariableTable

java.lang.Object
  extended by inetsoft.uql.VariableTable
All Implemented Interfaces:
inetsoft.util.ContentObject, Serializable, Cloneable

public class VariableTable
extends Object
implements inetsoft.util.ContentObject, Serializable, Cloneable

The VariableTable holds the variable values. It is passed to the query engine during query execution. The variable table should be populated for every variable in the query that require user supplied values. The inetsoft.uql.builder.VariableEntry class can be used to interactively prompt users for the values.

See Also:
Serialized Form

Field Summary
static String HTTP_REQUEST
          Deprecated. use SERVICE_REQUEST.
static String HTTP_RESPONSE
          Deprecated. use SERVICE_RESPONSE.
static String SERVICE_REQUEST
          The name for the ServiceRequest parameter.
static String SERVICE_RESPONSE
          The name for the ServiceResponse parameter.
 
Constructor Summary
VariableTable()
          Constructor.
 
Method Summary
 void addAll(VariableTable vars)
          Add all variables.
 void addBaseTable(VariableTable table)
          Add a table to the chain as the lowest priority table.
 void clear()
          Remove all entries.
 Object clone()
          Clone.
 boolean contains(String name)
          Check if the variable is inside this table.
 void copyParameters(XPrincipal user)
          Copy the parameters set in user principal.
 boolean equals(Object obj)
          Check if equals another object.
 boolean equalsContent(Object obj)
          Check if equals another object in content.
 Object get(String name)
          Get the value of a variable.
 Object get(UserVariable var)
          Get the value of a variable.
 VariableTable getBaseTable()
          Get the base variable table.
 Object getSession()
          Get the session associated with this table.
 VariableTable getSubset(String prefix)
          Get a variable table containing only the variables with the specified prefix.
 int hashCode()
          Get the hash code value.
static boolean isBuiltinVariable(String name)
          Check if a variable is builtin.
static boolean isContextVariable(String name)
          Check if a variable is context variable, which does not require prompt, for its value will be fetch from context.
 boolean isInternalParameter(String name)
          Check if is internal parameter.
 Enumeration keys()
          Get all variable names in the table.
 boolean printKey(PrintWriter writer)
          Create a unique key to identify this variable table.
 void put(String name, Object value)
          Set a variable value.
 void remove(String name)
          Remove a variable from the table.
 void removeBaseTable(Class type)
          Remove tables matching the type from the base table chain.
 void removeBaseTable(VariableTable table)
          Remove a table from the base table chain.
 void setBaseTable(VariableTable table)
          Set the base table for this variable table.
 void setSession(Object session)
          This method is called by the server to associate a table with an user session.
 int size()
          Return the number of variables in the table.
 String toString()
          To string.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HTTP_REQUEST

public static final String HTTP_REQUEST
Deprecated. use SERVICE_REQUEST.
The name for the HttpServletRequest parameter. This parameter is only available if the replet is running through the ServletRepository.

See Also:
Constant Field Values

HTTP_RESPONSE

public static final String HTTP_RESPONSE
Deprecated. use SERVICE_RESPONSE.
The name for the HttpServletResponse parameter. This parameter is only available if the replet is running through the ServletRepository.

See Also:
Constant Field Values

SERVICE_REQUEST

public static final String SERVICE_REQUEST
The name for the ServiceRequest parameter. This parameter is only available if the replet is running through one of the web clients.

See Also:
ServiceRequest, Constant Field Values

SERVICE_RESPONSE

public static final String SERVICE_RESPONSE
The name for the ServiceResponse parameter. This parameter is only available if the replet is running through one of the web clients.

See Also:
ServiceResponse, Constant Field Values
Constructor Detail

VariableTable

public VariableTable()
Constructor.

Method Detail

isContextVariable

public static boolean isContextVariable(String name)
Check if a variable is context variable, which does not require prompt, for its value will be fetch from context.


setSession

public void setSession(Object session)
This method is called by the server to associate a table with an user session. The session is used by execute any query variables used by a query. Applications normally don't need to set the session explicitly.


getSession

public Object getSession()
Get the session associated with this table.


copyParameters

public void copyParameters(XPrincipal user)
Copy the parameters set in user principal.


setBaseTable

public void setBaseTable(VariableTable table)
Set the base table for this variable table. The base table is searched if a variable is not found in the current table.

Parameters:
table - base variable table.

getBaseTable

public VariableTable getBaseTable()
Get the base variable table.


addBaseTable

public void addBaseTable(VariableTable table)
Add a table to the chain as the lowest priority table.


removeBaseTable

public void removeBaseTable(VariableTable table)
Remove a table from the base table chain.


removeBaseTable

public void removeBaseTable(Class type)
Remove tables matching the type from the base table chain.


size

public int size()
Return the number of variables in the table.


addAll

public void addAll(VariableTable vars)
            throws Exception
Add all variables.

Throws:
Exception

put

public void put(String name,
                Object value)
Set a variable value. The type of the value must match the type declared in the corresponding UserVariable object.

Parameters:
name - variable name.
value - variable value.

clear

public void clear()
Remove all entries. The base table is not changed.


contains

public boolean contains(String name)
Check if the variable is inside this table.


get

public Object get(UserVariable var)
           throws Exception
Get the value of a variable.

Parameters:
var - UserVariable object.
Returns:
variable value. Returns null if the variable is not defined.
Throws:
Exception

get

public Object get(String name)
           throws Exception
Get the value of a variable.

Parameters:
name - variable name.
Returns:
variable value. Returns null if the variable is not defined.
Throws:
Exception

remove

public void remove(String name)
Remove a variable from the table.

Parameters:
name - variable name.

keys

public Enumeration keys()
Get all variable names in the table.


getSubset

public VariableTable getSubset(String prefix)
Get a variable table containing only the variables with the specified prefix. The prefix is removed from the variable name in the returned table. The prefix checking is ignored if the variable name does not contain a dot '.'.


isBuiltinVariable

public static boolean isBuiltinVariable(String name)
Check if a variable is builtin.


clone

public Object clone()
Clone.

Overrides:
clone in class Object

toString

public String toString()
To string.

Overrides:
toString in class Object

printKey

public boolean printKey(PrintWriter writer)
                 throws Exception
Create a unique key to identify this variable table.

Specified by:
printKey in interface inetsoft.util.ContentObject
Throws:
Exception

equalsContent

public boolean equalsContent(Object obj)
Check if equals another object in content.

Specified by:
equalsContent in interface inetsoft.util.ContentObject

equals

public boolean equals(Object obj)
Check if equals another object.

Overrides:
equals in class Object
Parameters:
obj - the specified object.
Returns:
true if equals the object, false otherwise.

hashCode

public int hashCode()
Get the hash code value.

Overrides:
hashCode in class Object
Returns:
the hash code value.

isInternalParameter

public boolean isInternalParameter(String name)
Check if is internal parameter. An internal parameter should be ignored when building a hyperlink or drill.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.