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

E10653-04

oracle.adf.model.generic
Class AttributeDefImpl

java.lang.Object
  extended by oracle.jbo.common.NamedObjectImpl
      extended by oracle.jbo.mom.DefinitionObject
          extended by oracle.adf.model.generic.AttributeDefImpl
All Implemented Interfaces:
AttributeDef, AttributeHints, ResourceBundleOwner, Properties, ValidationManager

public class AttributeDefImpl
extends DefinitionObject
implements AttributeDef, AttributeHints, ValidationManager, ResourceBundleOwner

The AttributeDefHelper class implement the AttributeDef interface

See Also:
RowImpl

Nested Class Summary
 
Nested classes/interfaces inherited from interface oracle.jbo.AttributeHints
AttributeHints.ControlType
 
Field Summary
 
Fields inherited from class oracle.jbo.mom.DefinitionObject
DEF_MDS_CLIENT_KEY, DEF_SCOPE_PERS, DEF_SCOPE_SESSION, DEF_SCOPE_SHARED, mBaseDefObject, mExtendedDefObjects, mObjectResolved, PERSDEF_MDS_CLIENT_KEY
 
Fields inherited from class oracle.jbo.common.NamedObjectImpl
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX
 
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_AUTOSUBMIT, 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_AUTOSUBMIT, HINT_NAME_CATEGORY, HINT_NAME_CTL_TYPE, 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_ComboBoxLovEdit, PNAME_EnumList, PNAME_LovButton, PNAME_TextField
 
Constructor Summary
AttributeDefImpl(java.lang.String nm, java.lang.String type, java.lang.String accName, boolean editable, int index)
          Deprecated. since 10.1.2. Use a constructor variant that takes StructureDefImpl.
AttributeDefImpl(StructureDefImpl def, java.lang.String nm, java.lang.String cnm, int idx, java.lang.String typ, java.lang.String cnmType, byte upd, boolean pk, boolean reqd, java.lang.String elemClzName)
          Construct a new instance.
 
Method Summary
 void addValidator(JboValidatorInterface intf)
           
 boolean displayInShortForm(LocaleContext locale)
          Returns true if the attribute is to displayed in the short(summary) form.
 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()
          Gets the name of the database column the attribute represents.
 java.lang.String getColumnNameForQuery()
          Gets the column name to be used in query statement.
 java.lang.Class getColumnType()
           
 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
 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()
          Returns the jdbc type of the elements of this attribute.
 java.lang.Class getElemType()
          Returns the element type of the attribute.
 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.
 java.lang.String getName()
          Get the name of this object.
 java.util.Map getOperators(LocaleContext locale)
           
 int getPrecision()
          Gets the precision of a numeric or string attribute.
 ResourceBundleDef getResourceBundleDef()
           
 java.lang.String getResourcePrefix()
           
 int getScale()
          Get the scale value of a numeric attribute.
 int getSQLType()
          Gets the JDBC type of the attribute.
 java.lang.String getTooltip(LocaleContext locale)
          Retrives the tooltip text to be used for this attribute
 AttributeHints getUIHelper()
          return the AttributeHints interface implemented by this class
 byte getUpdateableFlag()
          Tests if an attribute can be modified.
 java.util.ArrayList getValidators()
           
 boolean hasFormatInformation(LocaleContext locale)
          Return true if any format hints have been defined for this attribute.
 boolean isAutoSubmit(LocaleContext locale)
          Returns the autoSubmit value for this attribute
 boolean isDiscrColumn()
          Tests if an attribute is a discriminator.
 boolean isMandatory()
          Return true if this attribute does not allow null values.
 boolean isPrimaryKey()
          Tests if an attribute is a Primary Key.
 boolean isQueriable()
          Tests if an attribute is queriable.
 boolean isSelected()
           
 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 setPrecisionScale(int prec, int scale)
          Use setPrecisionScale(int, int, boolean) to indicate if this def should imply applying precision validation as well.
 void setPrecisionScale(int prec, int scale, boolean applyValidation)
           
 void validate(AttributeList al, java.lang.Object newValue)
           
 
Methods inherited from class oracle.jbo.mom.DefinitionObject
addExtendedDefObject, addPropertySetName, finishedLoading, getBaseDefObject, getContainerDef, getContainerName, getDefScope, getExtendedDefObjects, getMdsKey, getMdsReference, getPropertySetName, getPropertySetNames, hasExtendedDefObjects, isBaseDefFor, isDynamicDefinitionObject, isObjectResolved, loadCustomProperties, loadProperties, loadPropertiesInMap, loadPropertySetNames, loadSchemaProperties, objectRemoved, removeExtendedDefObject, resolveReferences, setBaseDefObject, setBaseDefObject, setDefScope, setMdsKey, setMdsReference, setName, setObjectResolved, setParent, setPropertySetName
 
Methods inherited from class oracle.jbo.common.NamedObjectImpl
allocatePropertyMap, getAllProperties, getFullName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyMap, getResourcesFromBundle, refreshProperty, removeProperty, removeProperty, requiresNamePrefixedResId, resolvePropertyRaw, setFullName, setPropertiesMap, setPropertiesMap2, setProperty, setProperty, setPropertyMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.Properties
getProperties, getProperty, getProperty, refreshProperty
 
Methods inherited from interface oracle.jbo.rules.ValidationManager
getFullName
 

Constructor Detail

AttributeDefImpl

public AttributeDefImpl(java.lang.String nm,
                        java.lang.String type,
                        java.lang.String accName,
                        boolean editable,
                        int index)
Deprecated. since 10.1.2. Use a constructor variant that takes StructureDefImpl.

Construct a new instance.

Parameters:
nm - The AttributeDefImpl instance name. Must be unique for for the parent StructureDefImpl instance.
type - The type of the value that is returned by this AttributeDefImpl instance.
accName - The name that should be used to acquire the AttributeDefImpl value from the owning StructureDefImpl. If The owning StructureDefImpl instance is dynamic then this should be a map key. If the owning StructureDefImpl instance references a a JavaBean then this should be a JavaBean property name.
editable - a boolean indicating if the AttributeDefImpl value is editable.
index - The index of the AttributeDefImpl instance in its owning StructureDefImpl instance.

AttributeDefImpl

public AttributeDefImpl(StructureDefImpl def,
                        java.lang.String nm,
                        java.lang.String cnm,
                        int idx,
                        java.lang.String typ,
                        java.lang.String cnmType,
                        byte upd,
                        boolean pk,
                        boolean reqd,
                        java.lang.String elemClzName)
Construct a new instance. For internal use only.

Parameters:
def - instance to which this attribute definition belongs.
nm - The AttributeDefImpl instance name. Must be unique for for the parent StructureDefImpl instance.
cnm - Name of the source to which this attribute is mapped to in the source data objects for this definition
idx - Index of this attribute within the structure definition.
typ - The type of the value that is returned by this AttributeDefImpl instance.
cnmType - The type of the value that the source data objects provide for this attribute.
upd - One of the three udpateable flags in AttributeDef.
pk - Whether this attribute should be a primarykey participant
reqd - Whether this attribute requires a non-null value.
elemClzName - Name of the class to which the objects in this attribute belongs if this attribute represents a collection type attribute (e.g., Array domain)
Method Detail

setPrecisionScale

public void setPrecisionScale(int prec,
                              int scale)
Use setPrecisionScale(int, int, boolean) to indicate if this def should imply applying precision validation as well.


setPrecisionScale

public void setPrecisionScale(int prec,
                              int scale,
                              boolean applyValidation)

getUIHelper

public AttributeHints getUIHelper()
return the AttributeHints interface implemented by this class

Specified by:
getUIHelper in interface AttributeDef
See Also:
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

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

getLabel

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

Specified by:
getLabel in interface AttributeHints

getOperators

public java.util.Map getOperators(LocaleContext locale)

getTooltip

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

Specified by:
getTooltip in interface AttributeHints

getDisplayHint

public 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

getControlType

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

Specified by:
getControlType in interface AttributeHints

getDisplayWidth

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

Specified by:
getDisplayWidth in interface AttributeHints

getDisplayHeight

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

Specified by:
getDisplayHeight 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

getFormat

public 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 Formatter getFormatter(LocaleContext locale)
Description copied from interface: AttributeHints
returns the formatter object stored in the ui hints

Specified by:
getFormatter in interface AttributeHints

hasFormatInformation

public 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

getFormattedAttribute

public 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

parseFormattedAttribute

public 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

displayInShortForm

public 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

getFormatterClassName

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

Specified by:
getFormatterClassName in interface AttributeHints

isAutoSubmit

public boolean isAutoSubmit(LocaleContext locale)
Returns the autoSubmit value for this attribute

Specified by:
isAutoSubmit in interface AttributeHints

getName

public java.lang.String getName()
Description copied from class: NamedObjectImpl
Get the name of this object.

Specified by:
getName in interface AttributeDef
Specified by:
getName in interface ValidationManager
Overrides:
getName in class NamedObjectImpl
Returns:
the name given to this object.

getColumnName

public java.lang.String getColumnName()
Description copied from interface: AttributeDef
Gets the name of the database column the attribute represents.

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

getColumnType

public java.lang.Class getColumnType()

getColumnNameForQuery

public java.lang.String getColumnNameForQuery()
Description copied from interface: AttributeDef
Gets the column name to be used in query statement. If the VO involves multiple entity usages, the column name may have to be qualified with the table alias for the appropriate entity. If the query statement is a full query ("expert mode"), the where-clause in the outer select must use column alias used for the inner select. This method takes care of all this and returns the right column name to be used for a query statement.

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

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.

getJavaTypeName

public java.lang.String getJavaTypeName()

getSQLType

public int getSQLType()
Description copied from interface: AttributeDef
Gets the JDBC type of the attribute.

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

getAttributeKind

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

Specified by:
getAttributeKind in interface AttributeDef
Returns:
one of the ATTR constants defined for this class.

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.

isSelected

public boolean isSelected()
Specified by:
isSelected in interface AttributeDef

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.

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.

isPrimaryKey

public boolean isPrimaryKey()
Description copied from interface: AttributeDef
Tests if an attribute is a Primary Key.

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

isMandatory

public boolean isMandatory()
Return true if this attribute does not allow null values.

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

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.

getElemType

public java.lang.Class getElemType()
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.

getElemSQLType

public int getElemSQLType()
Returns the jdbc type of the elements of this attribute.

For VARRAYs, this method returns the jdbc type of the elements that are in the VARRAY.

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

Specified by:
getElemSQLType in interface AttributeDef
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.

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.

addValidator

public void addValidator(JboValidatorInterface intf)
Specified by:
addValidator in interface ValidationManager

getValidators

public java.util.ArrayList getValidators()
Specified by:
getValidators in interface ValidationManager

validate

public void validate(AttributeList al,
                     java.lang.Object newValue)

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

getResourceBundleDef

public ResourceBundleDef getResourceBundleDef()
Specified by:
getResourceBundleDef in interface ResourceBundleOwner
Specified by:
getResourceBundleDef in interface ValidationManager

getResourcePrefix

public java.lang.String getResourcePrefix()
Specified by:
getResourcePrefix in interface ResourceBundleOwner

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

E10653-04

Copyright © 1997, 2010, Oracle. All rights reserved.