Style Intelligence v12.0

inetsoft.uql.schema
Class UserVariable

java.lang.Object
  extended by inetsoft.uql.schema.XVariable
      extended by inetsoft.uql.schema.UserVariable
All Implemented Interfaces:
inetsoft.util.XMLSerializable, Serializable, Cloneable
Direct Known Subclasses:
AssetVariable

public class UserVariable
extends XVariable

An user variable is a variable with a scalar value. The value can either by specified or enter by users at runtime.

See Also:
Serialized Form

Field Summary
static int CHECKBOXES
          Diplay as checkboxes.
static int COMBOBOX
          Display as a combobox.
static int DATE_COMBOBOX
          Display as date combobox.
static int LIST
          Display as a list.
static int NONE
          Display as a text field.
static int RADIO_BUTTONS
          Display as radio buttons.
 
Constructor Summary
UserVariable()
          Create an user variable.
UserVariable(String name)
          Create an user variable.
 
Method Summary
 Object clone()
          Returns a clone of this object.
 boolean equals(Object obj)
          Check if equals another object.
 Object evaluate(VariableTable vars)
          Evaulate the XVariable.
 String getAlias()
          Get the variable label.
 String getChoiceQuery()
          Get the name of the query that will be executed to generate a list of values for choices.
 Object[] getChoices()
          Get the list of choices.
 int getDisplayStyle()
          Get the display style.
 String getToolTip()
          Get the variable toolTip.
 Object[] getTypedValues()
          Get the list of values.
 XTypeNode getTypeNode()
          Get the variable value type.
 XValueNode getValueNode()
          Get the value of this variable.
 Object[] getValues()
          Get the list of values.
 int hashCode()
          Get the hash code value.
 boolean isCustomization()
          Check whether this parameter is used as customization parameter of a report.
 boolean isEmbedded()
          Check if it is an embeded variable from bean or subreport.
 boolean isHidden()
          Check if the value should be hidden during data entry.
 boolean isLocalQuery()
          Get local query option.
 boolean isLocalWorksheet()
          Check if localWorksheet.
 boolean isMultipleSelection()
          Check if multiple selection is allowed.
 boolean isPrompt()
          Check is the value of the variable needs to be enter by users.
 boolean isSortValue()
          Get the value of sortValue.
 boolean isUsedInOneOf()
          Check is used in one of condition.
protected  void parseAttributes(Element elem)
          Parse attributes.
protected  void parseContents(Element elem)
          Parse contents.
 void parseXML(Element elem)
          Parse the XML element that contains information on this variable.
 void setAlias(String label)
          Set the label for the user field when prompting users.
 void setChoiceQuery(String query)
          Set the name of the query that will be executed to generate a list of values for choices.
 void setChoices(Object[] choices)
          Set a list of items to choose the value from.
 void setCustomization(boolean customize)
          Set whether this parameter is used as customization parameter of a report.
 void setEmbedded(boolean embedded)
          Set whether to prompt users for the value.
 void setHidden(boolean hidden)
          Set if the contents of the variable should be hidden.
 void setLocalQuery(boolean local)
          Set local query option.
 void setLocalWorksheet(Boolean localw)
          Set if current query is localWorksheet.
 void setMultipleSelection(boolean multi)
          Set whether to allow multiple selection.
 void setPrompt(boolean prompt)
          Set whether to prompt users for the value.
 void setSortValue(boolean sortValue)
          Set the value of sortValue.
 void setToolTip(String toolTip)
          Set the toolTip for the user field when prompting users.
 void setTypeNode(XTypeNode xtype)
          Set the type of this variable.
 void setUsedInOneOf(boolean used)
          Set if current used in one of condition.
 void setValueNode(XValueNode value)
          Set the value of this variable.
 void setValues(Object[] values)
          Set a list of values to choose the value from.
 String toString()
          Get the "$(name)" as the variable representation.
protected  void writeAttributes(PrintWriter writer)
          Write attributes.
protected  void writeContents(PrintWriter writer)
          Write contents.
 void writeXML(PrintWriter writer)
          Write the variable XML representation.
 
Methods inherited from class inetsoft.uql.schema.XVariable
getName, getSource, parse, setName, setSource
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Display as a text field.

See Also:
Constant Field Values

COMBOBOX

public static final int COMBOBOX
Display as a combobox.

See Also:
Constant Field Values

LIST

public static final int LIST
Display as a list.

See Also:
Constant Field Values

RADIO_BUTTONS

public static final int RADIO_BUTTONS
Display as radio buttons.

See Also:
Constant Field Values

CHECKBOXES

public static final int CHECKBOXES
Diplay as checkboxes.

See Also:
Constant Field Values

DATE_COMBOBOX

public static final int DATE_COMBOBOX
Display as date combobox.

See Also:
Constant Field Values
Constructor Detail

UserVariable

public UserVariable()
Create an user variable.


UserVariable

public UserVariable(String name)
Create an user variable.

Method Detail

setPrompt

public void setPrompt(boolean prompt)
Set whether to prompt users for the value.

Parameters:
prompt - true if the value should be entered by users at runtime.

isPrompt

public boolean isPrompt()
Check is the value of the variable needs to be enter by users.


setEmbedded

public void setEmbedded(boolean embedded)
Set whether to prompt users for the value.

Parameters:
embedded - true if it is an embeded variable from bean or subreport.

isEmbedded

public boolean isEmbedded()
Check if it is an embeded variable from bean or subreport.


getDisplayStyle

public int getDisplayStyle()
Get the display style.

Returns:
the display style.

setCustomization

public void setCustomization(boolean customize)
Set whether this parameter is used as customization parameter of a report.


isCustomization

public boolean isCustomization()
Check whether this parameter is used as customization parameter of a report.


setAlias

public void setAlias(String label)
Set the label for the user field when prompting users.


getAlias

public String getAlias()
Get the variable label.


getToolTip

public String getToolTip()
Get the variable toolTip.


setToolTip

public void setToolTip(String toolTip)
Set the toolTip for the user field when prompting users.


setChoices

public void setChoices(Object[] choices)
Set a list of items to choose the value from.


getChoices

public Object[] getChoices()
Get the list of choices.

Returns:
null if choice is not set.

setValues

public void setValues(Object[] values)
Set a list of values to choose the value from.


getValues

public Object[] getValues()
Get the list of values.

Returns:
null if value is not set.

setSortValue

public void setSortValue(boolean sortValue)
Set the value of sortValue.


isSortValue

public boolean isSortValue()
Get the value of sortValue.

Returns:
true or false.

getTypedValues

public Object[] getTypedValues()
Get the list of values. If the type is set and has a format, this method will try to parse any string in the value according to the format. This method is called at runtime to get property typed object. All values are stored as string in design time.

Returns:
null if value is not set.

setValueNode

public void setValueNode(XValueNode value)
Set the value of this variable.


getValueNode

public XValueNode getValueNode()
Get the value of this variable.


setTypeNode

public void setTypeNode(XTypeNode xtype)
Set the type of this variable.

Parameters:
xtype - value type, one of the value defined in XSchema.

getTypeNode

public XTypeNode getTypeNode()
Get the variable value type.


evaluate

public Object evaluate(VariableTable vars)
Evaulate the XVariable. Will return default value from ValueNode.

Specified by:
evaluate in class XVariable

setHidden

public void setHidden(boolean hidden)
Set if the contents of the variable should be hidden. This is only checked for string types. If it's true, the value is hidden as a password field.


isHidden

public boolean isHidden()
Check if the value should be hidden during data entry.


setMultipleSelection

public void setMultipleSelection(boolean multi)
Set whether to allow multiple selection.


isMultipleSelection

public boolean isMultipleSelection()
Check if multiple selection is allowed.


setChoiceQuery

public void setChoiceQuery(String query)
Set the name of the query that will be executed to generate a list of values for choices.

Parameters:
query - the query name or column/attribute name.

getChoiceQuery

public String getChoiceQuery()
Get the name of the query that will be executed to generate a list of values for choices.


setLocalQuery

public void setLocalQuery(boolean local)
Set local query option.


isLocalQuery

public boolean isLocalQuery()
Get local query option.


writeXML

public void writeXML(PrintWriter writer)
Write the variable XML representation.


writeAttributes

protected void writeAttributes(PrintWriter writer)
Write attributes.

Overrides:
writeAttributes in class XVariable
Parameters:
writer - the specified print writer.

writeContents

protected void writeContents(PrintWriter writer)
Write contents.

Parameters:
writer - the specified print writer.

parseXML

public void parseXML(Element elem)
              throws Exception
Parse the XML element that contains information on this variable.

Parameters:
elem - the specified xml element.
Throws:
Exception

parseAttributes

protected void parseAttributes(Element elem)
                        throws Exception
Parse attributes.

Overrides:
parseAttributes in class XVariable
Parameters:
elem - the specified xml element.
Throws:
Exception

parseContents

protected void parseContents(Element elem)
                      throws Exception
Parse contents.

Parameters:
elem - the specified xml element.
Throws:
Exception

clone

public Object clone()
Returns a clone of this object.

Overrides:
clone in class XVariable

equals

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

Overrides:
equals in class Object
Returns:
true if equals, false otherwise.

hashCode

public int hashCode()
Get the hash code value.

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

setLocalWorksheet

public void setLocalWorksheet(Boolean localw)
Set if current query is localWorksheet.


isLocalWorksheet

public boolean isLocalWorksheet()
Check if localWorksheet.

Returns:
true if localWorksheet, false otherwise.

setUsedInOneOf

public void setUsedInOneOf(boolean used)
Set if current used in one of condition.


isUsedInOneOf

public boolean isUsedInOneOf()
Check is used in one of condition.


toString

public String toString()
Get the "$(name)" as the variable representation.

Overrides:
toString in class Object

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