Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.jbo.common
Class VariableImpl

java.lang.Object
  extended by oracle.jbo.server.NamedObjectImpl
      extended by oracle.jbo.common.VariableImpl
All Implemented Interfaces:
Formattable, AttributeDef, AttributeHints, JIReservedVarNames, JboReservedVarNames, Properties, Variable

public class VariableImpl
extends NamedObjectImpl
implements Variable, AttributeHints, JboReservedVarNames


Field Summary
static java.lang.Class CLASS_INSTANCE
           
 
Fields inherited from class oracle.jbo.server.NamedObjectImpl
mObjName, mParent, mProperties, mUserData, RES_ID_SUFFIX
 
Fields inherited from interface oracle.jbo.Variable
VAR_KIND_VIEW_CRITERIA_PARAM, VAR_KIND_WHERE_CLAUSE_PARAM, VAR_KIND_WHERE_OR_CRIT_PARAM
 
Fields inherited from interface oracle.jbo.AttributeDef
ATTR_ASSOCIATED_ROW, ATTR_ASSOCIATED_ROWITERATOR, ATTR_DYNAMIC, ATTR_ENTITY_DERIVED, ATTR_HIDDEN, ATTR_PERSISTENT, ATTR_ROWSET, ATTR_SQL_DERIVED, ATTR_TRANSIENT, ATTR_VARIABLE, READONLY, UPDATEABLE, UPDATEABLE_WHILE_NEW
 
Fields inherited from interface oracle.jbo.AttributeHints
ATTRIBUTE_BINDEDITOR_LABEL, ATTRIBUTE_CTL_CATEGORY, ATTRIBUTE_CTL_DISPLAYHEIGHT, ATTRIBUTE_CTL_DISPLAYWIDTH, ATTRIBUTE_CTL_FIELD_ORDER, ATTRIBUTE_CTL_FORMTYPE, ATTRIBUTE_CTL_TYPE, ATTRIBUTE_DISPLAY_HINT, ATTRIBUTE_DISPLAY_HINT_DISPLAY, ATTRIBUTE_DISPLAY_HINT_HIDE, ATTRIBUTE_FORM_TYPE_DETAIL, ATTRIBUTE_FORM_TYPE_SHORT, ATTRIBUTE_LABEL, ATTRIBUTE_TOOLTIP, CTL_CHECK_BOX, CTL_CHOICE_LIST, CTL_COMBO_BOX, CTL_COMBO_BOX_LOV, CTL_DATE, CTL_DEFAULT, CTL_EDIT, CTL_IMAGE, CTL_INPUT_TEXT_LOV, CTL_LIST_BOX, CTL_NUMBER_EDIT, CTL_RADIO_GROUP, CTLTYPE_CHECKBOX, CTLTYPE_COMBO, CTLTYPE_COMBOLOV, CTLTYPE_DATE, CTLTYPE_DEFAULT, CTLTYPE_EDIT, CTLTYPE_IMAGE, CTLTYPE_LIST, CTLTYPE_LISTBOX, CTLTYPE_LOV, CTLTYPE_NUMEDIT, CTLTYPE_RADIOGRP, CTLTYPE_TOGGLE, FMT_FORMAT, FMT_FORMATTER, HINT_NAME_CATEGORY, HINT_NAME_DISPLAY_HEIGHT, HINT_NAME_DISPLAY_HINT, HINT_NAME_DISPLAY_WIDTH, HINT_NAME_FIELD_ORDER, HINT_NAME_FORMAT, HINT_NAME_LABEL, HINT_NAME_MANDATORY, HINT_NAME_TOOLTIP, HINT_NAME_UPDATEABLE, PNAME_Button, PNAME_ButtonGroup, PNAME_ComboBox, PNAME_EnumList, PNAME_LovButton, PNAME_TextField
 
Fields inherited from interface oracle.jbo.JboReservedVarNames
RESERVED_VAR_AGG_AVG, RESERVED_VAR_AGG_COUNT, RESERVED_VAR_AGG_MAX, RESERVED_VAR_AGG_MIN, RESERVED_VAR_AGG_SUM, RESERVED_VAR_AGGVAL_PREFIX, RESERVED_VAR_STRUCTURE_DEF
 
Fields inherited from interface oracle.jbo.expr.JIReservedVarNames
RESERVED_VAR_VALUE
 
Constructor Summary
VariableImpl()
           
VariableImpl(java.lang.String name)
           
VariableImpl(java.lang.String name, java.lang.Object defaultValue, byte updateable, boolean notNull, java.lang.Class javaType)
           
 
Method Summary
 java.lang.Object convertToJava(java.lang.Object data)
           
 boolean displayInShortForm(LocaleContext locale)
          Returns true if the attribute is to displayed in the short(summary) form.
 java.lang.Object evaluateTransientExpression(VariableManagerOwnerBase owner)
           
 ViewObject getAccessorVO(ViewObject originVO)
          For an accessor attribute, this method creates a View Object that works for the View Link definition.
 byte getAttributeKind()
          Gets the attribute value.
 java.lang.String getColumnName()
          Overridden to return null in Variable implementations.
 java.lang.String getColumnNameForQuery()
          Overridden to return null in Variable implementations.
 java.lang.String[][] getCompOpers(LocaleContext locale)
          Returns a Map of operators for this attribute.
 int getControlType(LocaleContext locale)
          * Returns the preferred control type for this attribute
 java.lang.Object getDefaultValue()
           
 int getDisplayHeight(LocaleContext locale)
          * Returns the display width for this attribute
 java.lang.String getDisplayHint(LocaleContext locale)
          * Retrieves the displya hint that dictates whether this * attributr should be visible or not.
 int getDisplayWidth(LocaleContext locale)
          * Returns the display width for this attribute
 int getElemSQLType()
          Overridden to return -1;
 java.lang.Class getElemType()
          Returns the element type of the attribute.
 ExprEval getExprEval()
           
 java.lang.Object getExtendedData()
           
 java.lang.String getFormat(LocaleContext locale)
          returns the format string stored in the ui hints
 java.lang.String getFormattedAttribute(AttributeList attrList, LocaleContext locale)
          Returns the formatted value for the attribute.
 Formatter getFormatter(LocaleContext locale)
          returns the formatter object stored in the ui hints
 java.lang.String getFormatterClassName(LocaleContext locale)
          * returns the formatter object stored in the ui hints
 java.lang.String getHint(LocaleContext locale, java.lang.String sHintName)
          * Return defaulted hint value
 java.lang.String getHintValue(LocaleContext locale, java.lang.String sHintName)
          * Return non-defaulted hint value
 int getIndex()
          Gets the index of the attribute in the context of a StoreInfo instance.
 java.lang.Class getJavaType()
          Gets the Java class of the object stored for this attribute definition.
 java.lang.String getJavaTypeName()
           
 java.lang.String getLabel(LocaleContext locale)
          Retrieves the label to be used in any attribute prompts
 ListBindingDef getListBindingDef()
           
 java.lang.String getLocaleName(LocaleContext locale, java.lang.String sName)
          function for retrieving the locale name of a hint
 java.lang.String getLOVName()
          Gets the name of the LOV (list of values) associated with this attribute definition.
 int getPrecision()
          Gets the precision of a numeric or string attribute.
 int getScale()
          Get the scale value of a numeric attribute.
 int getSQLType()
          Overridden to return -1;
 StructureDef getStructureDef(VariableManagerOwnerBase owner)
           
 java.lang.String getTooltip(LocaleContext locale)
          Retrives the tooltip text to be used for this attribute
 java.lang.String getTransientExpression()
           
 AttributeHints getUIHelper()
          Returns the user interface hints interface for retrieving hint * information such as labels, prompts,...
 byte getUpdateableFlag()
          Tests if an attribute can be modified.
 java.lang.String getVariableKind()
           
 VariableManager getVariableManager()
           
 boolean hasFormatInformation(LocaleContext locale)
          Return true if any format hints have been defined for this attribute.
 boolean isDefinedDefaultValue()
          Passivation uses this to tell if the current value is the meta-data default.
 boolean isDefValExpression()
          Is the default value an expression?
 boolean isDirty()
           
 boolean isDiscrColumn()
          Tests if an attribute is a discriminator.
 boolean isMandatory()
          Tests if an attribute does not allow null values.
 boolean isPassivationNeeded()
          Tells the framework whether or not to include this definition in the passivation snapshot that is about to occur.
 boolean isPrimaryKey()
          Overridden to return false;
 boolean isQueriable()
          Tests if an attribute is queriable.
 boolean isSelected()
          Tests if an attribute is transient.
static VariableImpl loadFromXml(org.kxml2.io.KXmlParser parser)
          Load a Variable definition from a chunk of XML
 java.lang.Object parseFormattedAttribute(java.lang.String sValue, LocaleContext locale)
          Strips off the formatting from a string and constructs an instance of the attribute's domain using the 'clean' string as a parameter of the contructor.
 void setDefaultValue(java.lang.Object val)
           
 void setDirty(boolean b)
           
 void setExtendedData(java.lang.Object data)
           
 void setJavaType(java.lang.Class cls)
           
 void setMandatory(boolean b)
           
 void setName(java.lang.String name)
          Name this object.
 void setPrecisionScale(int prec, int sc)
           
 void setTransientExpression(java.lang.String expr)
           
 void setUpdateableFlag(byte updateable)
           
 void setVariableKind(java.lang.String k)
           
 void setVariableManager(VariableManager manager)
           
 
Methods inherited from class oracle.jbo.server.NamedObjectImpl
formatChildCollectionForOutput, formatChildCollectionForOutput, formatChildCollectionForOutput, formatForOutput, formatForOutput, getAllProperties, getFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getResourcesFromBundle, getUserData, parseAttrArrayElements, refreshProperty, requiresNamePrefixedResId, resolvePropertyRaw, setFullName, setParent, setPropertiesMap, setProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.AttributeDef
getName
 
Methods inherited from interface oracle.jbo.Properties
getProperties, getProperty, getProperty, refreshProperty
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE
Constructor Detail

VariableImpl

public VariableImpl()

VariableImpl

public VariableImpl(java.lang.String name)

VariableImpl

public VariableImpl(java.lang.String name,
                    java.lang.Object defaultValue,
                    byte updateable,
                    boolean notNull,
                    java.lang.Class javaType)
Method Detail

convertToJava

public java.lang.Object convertToJava(java.lang.Object data)
Specified by:
convertToJava in interface Variable

getAttributeKind

public byte getAttributeKind()
Description copied from interface: AttributeDef
Gets the attribute value.

Specified by:
getAttributeKind in interface AttributeDef
Specified by:
getAttributeKind in interface Variable
Returns:
ATTR_VARIABLE

getColumnName

public java.lang.String getColumnName()
Description copied from interface: Variable
Overridden to return null in Variable implementations.

Specified by:
getColumnName in interface AttributeDef
Specified by:
getColumnName in interface Variable
Returns:
the name of the column.

getColumnNameForQuery

public java.lang.String getColumnNameForQuery()
Description copied from interface: Variable
Overridden to return null in Variable implementations.

Specified by:
getColumnNameForQuery in interface AttributeDef
Specified by:
getColumnNameForQuery in interface Variable
Returns:
the column name to be used in query.

getDefaultValue

public java.lang.Object getDefaultValue()
Specified by:
getDefaultValue in interface Variable

getElemSQLType

public int getElemSQLType()
Description copied from interface: Variable
Overridden to return -1;

Specified by:
getElemSQLType in interface AttributeDef
Specified by:
getElemSQLType in interface Variable
Returns:
the jdbc type (java.sql.Types.*) of this attribute's elements, or java.sql.Types.NULL if this attribute is not an array attribute.

getExtendedData

public java.lang.Object getExtendedData()
Specified by:
getExtendedData in interface Variable

getJavaTypeName

public java.lang.String getJavaTypeName()
Specified by:
getJavaTypeName in interface Variable

getSQLType

public int getSQLType()
Description copied from interface: Variable
Overridden to return -1;

Specified by:
getSQLType in interface AttributeDef
Specified by:
getSQLType in interface Variable
Returns:
the JDBC type.
See Also:
java.sql.Types

getVariableKind

public java.lang.String getVariableKind()
Specified by:
getVariableKind in interface Variable

getVariableManager

public VariableManager getVariableManager()
Specified by:
getVariableManager in interface Variable

isDefinedDefaultValue

public boolean isDefinedDefaultValue()
Description copied from interface: Variable
Passivation uses this to tell if the current value is the meta-data default.

Specified by:
isDefinedDefaultValue in interface Variable

isPassivationNeeded

public boolean isPassivationNeeded()
Description copied from interface: Variable
Tells the framework whether or not to include this definition in the passivation snapshot that is about to occur. Each snapshot only includes objects that couldn't be recreated from their meta-data. Each variable has the concept of whether or not it is currently "dirty". i.e. The definition of the variable has somehow changed since it was last loaded from it's meta-data definition, or it was created dynamically.

Specified by:
isPassivationNeeded in interface Variable

isPrimaryKey

public boolean isPrimaryKey()
Description copied from interface: Variable
Overridden to return false;

Specified by:
isPrimaryKey in interface AttributeDef
Specified by:
isPrimaryKey in interface Variable
Returns:
true if this is either a Primary Key attribute or part of the attributes that constitute the Primary Key for a given row.

setDefaultValue

public void setDefaultValue(java.lang.Object val)
Specified by:
setDefaultValue in interface Variable

setExtendedData

public void setExtendedData(java.lang.Object data)
Specified by:
setExtendedData in interface Variable

setJavaType

public void setJavaType(java.lang.Class cls)
Specified by:
setJavaType in interface Variable

setMandatory

public void setMandatory(boolean b)
Specified by:
setMandatory in interface Variable

setPrecisionScale

public void setPrecisionScale(int prec,
                              int sc)
Specified by:
setPrecisionScale in interface Variable

setUpdateableFlag

public void setUpdateableFlag(byte updateable)
Specified by:
setUpdateableFlag in interface Variable

setVariableKind

public void setVariableKind(java.lang.String k)
Specified by:
setVariableKind in interface Variable

setVariableManager

public void setVariableManager(VariableManager manager)
Specified by:
setVariableManager in interface Variable

getElemType

public java.lang.Class getElemType()
Description copied from interface: AttributeDef
Returns the element type of the attribute.

For VARRAYs, this method returns the class name of the elements that are in the VARRAY.

Element type is relevant only if the attribute is an array attribute.

Specified by:
getElemType in interface AttributeDef
Returns:
the attribute's element class, or null if the attribute is not an array attribute.

getIndex

public int getIndex()
Description copied from interface: AttributeDef
Gets the index of the attribute in the context of a StoreInfo instance.

Specified by:
getIndex in interface AttributeDef
Returns:
the index of the attribute row's definition object.

getJavaType

public java.lang.Class getJavaType()
Description copied from interface: AttributeDef
Gets the Java class of the object stored for this attribute definition.

Specified by:
getJavaType in interface AttributeDef
Returns:
the class of the attribute.

getPrecision

public int getPrecision()
Description copied from interface: AttributeDef
Gets the precision of a numeric or string attribute.

'Precision' for a string is the maximum length.

Specified by:
getPrecision in interface AttributeDef
Returns:
the precision value for this attribute.

getScale

public int getScale()
Description copied from interface: AttributeDef
Get the scale value of a numeric attribute.

Specified by:
getScale in interface AttributeDef
Returns:
the scale value for this attribute, if applicable.

getUIHelper

public AttributeHints getUIHelper()
Description copied from interface: AttributeDef
Returns the user interface hints interface for retrieving hint * information such as labels, prompts,...

Specified by:
getUIHelper in interface AttributeDef
See Also:
AttributeHints

getUpdateableFlag

public byte getUpdateableFlag()
Description copied from interface: AttributeDef
Tests if an attribute can be modified.

Specified by:
getUpdateableFlag in interface AttributeDef
Returns:
READONLY, UPDATEABLE, or UPDATEABLE_WHILE_NEW.

isMandatory

public boolean isMandatory()
Description copied from interface: AttributeDef
Tests if an attribute does not allow null values.

Specified by:
isMandatory in interface AttributeDef
Returns:
true if this attribute cannot store a null value

isQueriable

public boolean isQueriable()
Description copied from interface: AttributeDef
Tests if an attribute is queriable.

Queriable attributes are those that may have a filter condition for the WHERE clause If this method returns false, the attribute will not be used in constructing the WHERE clause of SQL statements to fetch data.

Specified by:
isQueriable in interface AttributeDef
Returns:
true if this attribute is queriable.

isSelected

public boolean isSelected()
Description copied from interface: AttributeDef
Tests if an attribute is transient. Transient attributes are those whose values are derived when needed. There is no mapping onto a column in a table for these values.

Specified by:
isSelected in interface AttributeDef
Returns:
true if this attribute is transient.

setName

public void setName(java.lang.String name)
Description copied from class: NamedObjectImpl
Name this object.

Specified by:
setName in interface Variable
Overrides:
setName in class NamedObjectImpl
Parameters:
name - the name to be given to this object.

loadFromXml

public static final VariableImpl loadFromXml(org.kxml2.io.KXmlParser parser)
Load a Variable definition from a chunk of XML

Parameters:
parser - A KXmlParser object positioned at the start of a element
Returns:
A VariableImpl object

isDefValExpression

public boolean isDefValExpression()
Is the default value an expression?

Returns:

getAccessorVO

public ViewObject getAccessorVO(ViewObject originVO)
Description copied from interface: AttributeDef
For an accessor attribute, this method creates a View Object that works for the View Link definition.

Specified by:
getAccessorVO in interface AttributeDef
Parameters:
originVO - the View Object that owns the accessor
Returns:
a ViewObject instance.

isDiscrColumn

public boolean isDiscrColumn()
Description copied from interface: AttributeDef
Tests if an attribute is a discriminator. Discriminating attributes are those whose values determine the (sub)type representing the entity.

Specified by:
isDiscrColumn in interface AttributeDef
Returns:
true if this is a Discriminator Column; false otherwise.

setTransientExpression

public void setTransientExpression(java.lang.String expr)
Specified by:
setTransientExpression in interface Variable

getFormat

public final java.lang.String getFormat(LocaleContext locale)
Description copied from interface: AttributeHints
returns the format string stored in the ui hints

Specified by:
getFormat in interface AttributeHints

getFormatter

public final Formatter getFormatter(LocaleContext locale)
Description copied from interface: AttributeHints
returns the formatter object stored in the ui hints

Specified by:
getFormatter in interface AttributeHints

getFormatterClassName

public final java.lang.String getFormatterClassName(LocaleContext locale)
* returns the formatter object stored in the ui hints

Specified by:
getFormatterClassName in interface AttributeHints

hasFormatInformation

public final boolean hasFormatInformation(LocaleContext locale)
Description copied from interface: AttributeHints
Return true if any format hints have been defined for this attribute. This function should eb used to bracket any calls to the formatting api.

Specified by:
hasFormatInformation in interface AttributeHints

parseFormattedAttribute

public final java.lang.Object parseFormattedAttribute(java.lang.String sValue,
                                                      LocaleContext locale)
Description copied from interface: AttributeHints
Strips off the formatting from a string and constructs an instance of the attribute's domain using the 'clean' string as a parameter of the contructor.

Specified by:
parseFormattedAttribute in interface AttributeHints

getExprEval

public ExprEval getExprEval()

displayInShortForm

public final boolean displayInShortForm(LocaleContext locale)
Description copied from interface: AttributeHints
Returns true if the attribute is to displayed in the short(summary) form.

Specified by:
displayInShortForm in interface AttributeHints

getCompOpers

public java.lang.String[][] getCompOpers(LocaleContext locale)
Description copied from interface: AttributeHints
Returns a Map of operators for this attribute.

Specified by:
getCompOpers in interface AttributeHints

getControlType

public final int getControlType(LocaleContext locale)
* Returns the preferred control type for this attribute

Specified by:
getControlType in interface AttributeHints

getDisplayHeight

public final int getDisplayHeight(LocaleContext locale)
* Returns the display width for this attribute

Specified by:
getDisplayHeight in interface AttributeHints

getDisplayHint

public final java.lang.String getDisplayHint(LocaleContext locale)
* Retrieves the displya hint that dictates whether this * attributr should be visible or not. The two possible values * are: * ATTRIBUTE_DISPLAY_HINT_DISPLAY = "Display"; * ATTRIBUTE_DISPLAY_HINT_HIDE = "Hide";

Specified by:
getDisplayHint in interface AttributeHints

getDisplayWidth

public final int getDisplayWidth(LocaleContext locale)
* Returns the display width for this attribute

Specified by:
getDisplayWidth in interface AttributeHints

getFormattedAttribute

public final java.lang.String getFormattedAttribute(AttributeList attrList,
                                                    LocaleContext locale)
Description copied from interface: AttributeHints
Returns the formatted value for the attribute. The AttributeList parameter will usually be an instance of the oracle.jbo.Row class.

Specified by:
getFormattedAttribute in interface AttributeHints

getHint

public java.lang.String getHint(LocaleContext locale,
                                java.lang.String sHintName)
* Return defaulted hint value

Specified by:
getHint in interface AttributeHints

getHintValue

public java.lang.String getHintValue(LocaleContext locale,
                                     java.lang.String sHintName)
* Return non-defaulted hint value

Specified by:
getHintValue in interface AttributeHints

getLabel

public final java.lang.String getLabel(LocaleContext locale)
Retrieves the label to be used in any attribute prompts

Specified by:
getLabel in interface AttributeHints

getLocaleName

public java.lang.String getLocaleName(LocaleContext locale,
                                      java.lang.String sName)
Description copied from interface: AttributeHints
function for retrieving the locale name of a hint

Specified by:
getLocaleName in interface AttributeHints

getTooltip

public final java.lang.String getTooltip(LocaleContext locale)
Retrives the tooltip text to be used for this attribute

Specified by:
getTooltip in interface AttributeHints

getLOVName

public java.lang.String getLOVName()
Description copied from interface: AttributeDef
Gets the name of the LOV (list of values) associated with this attribute definition.

Specified by:
getLOVName in interface AttributeDef
Returns:
the name of the LOV (may be null)

getListBindingDef

public ListBindingDef getListBindingDef()
Specified by:
getListBindingDef in interface AttributeDef

evaluateTransientExpression

public java.lang.Object evaluateTransientExpression(VariableManagerOwnerBase owner)
Specified by:
evaluateTransientExpression in interface Variable

getTransientExpression

public java.lang.String getTransientExpression()
Specified by:
getTransientExpression in interface Variable

getStructureDef

public StructureDef getStructureDef(VariableManagerOwnerBase owner)

isDirty

public boolean isDirty()

setDirty

public void setDirty(boolean b)

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.