Package oracle.forms.jdapi
Class JdapiMetaProperty
java.lang.Object
oracle.forms.jdapi.JdapiMetaProperty
The class
JdapiMetaProperty
represents the metadata for a given property, obtained
from a given JdapiMetaObject
which is in turn obtained
from a given Forms object.
JdapiMetaProperty
also has some static utility methods for inspecting any property
(usually by constant value). These methods allow you to
obtain, for example, the name of the property, a phrase that describes the property,
its allowed values, and its type. It also has non-static methods that allow you to obtain the
property ID, and whether the property can be set or only read.
For example, the following code sample casts
a given string property to the more generic JdapiMetaProperty
. This allows the
methods allowGet
and getPropertyId
to be used:
... while (stringProps.hasNext()) { JdapiMetaProperty prop = (JdapiMetaProperty)stringProps.next(); if (prop.allowGet()) { // this line returns the equivalent value to the JdapiTypes.<prop>_PTID constant int propNum = prop.getPropertyID(); System.out.println( "Property No. " + propNum + " has value " + jo.getStringProperty(propNum)); } }
-
Method Summary
Modifier and TypeMethodDescriptionboolean
allowGet()
Returns whether the property value can be retrieved.boolean
allowSet()
Returns whether the property value can be set.int[]
Returns an array of valid values for numeric Forms properties that are really enumerated properties If this method is applied to a non-numeric enumerated property, it returns "null".static int[]
getAllowedValues
(int propertyId) Returns an array of valid values for numeric Forms properties that are really enumerated properties If this method is applied to a non-numeric enumerated property, it returns "null".static String
getPropertyConstantName
(int propertyTypeId) Returns the property name for a given property type ID.static int
getPropertyConstantValue
(String pname) Returns the property number (propertyTypeId
) for a named property.Returns the description of the property.static String
getPropertyDescription
(int propertyTypeId) Returns the description of the property.int
Returns theD2FP_
x Forms ID integer of this property.static int
getPropertyId
(String propertyName) Returns the property ID for a property given the Jdapi name.Returns the Jdapi name for a given property.static String
getPropertyName
(int propertyTypeId) Returns the Jdapi name for a given property.Returns the datatype (class) of the property.static Class
getPropertyType
(int propertyTypeId) Returns the datatype (class) of the property.static String
getPropertyValueName
(int propertyTypeId, int val) Returns the string representation of a given property's value.static int
getPropertyValueValue
(int propertyTypeId, String name) Returns the numeric value for a given property's string representation for that value.
-
Method Details
-
getPropertyId
public int getPropertyId()Returns theD2FP_
x Forms ID integer of this property.- Returns:
- the
D2FP_
x Forms ID of this property.
-
allowGet
public boolean allowGet()Returns whether the property value can be retrieved.- Returns:
true
if the property can be retrieved;false
otherwise.
-
allowSet
public boolean allowSet()Returns whether the property value can be set.- Returns:
true
if the property value can be set;false
otherwise.
-
getAllowedValues
public int[] getAllowedValues()Returns an array of valid values for numeric Forms properties that are really enumerated properties If this method is applied to a non-numeric enumerated property, it returns "null".- Returns:
- an array of valid values or "null" if the method is not applicable to the property.
-
getPropertyName
Returns the Jdapi name for a given property. Examples of Jdapi names would beName
andDataSourceBlock
which are associated with the FormsItem
object. For the static version of this method, seegetPropertyName(int propertyTypeId)
.- Returns:
- the Jdapi name of the property.
-
getPropertyType
Returns the datatype (class) of the property. The datatype can beBoolean
,Integer
,String
, orJdapiObjectChildIterator
. For the static version of this method seegetPropertyType(int propertyTypeId)
.- Returns:
- the datatype as a class:
Boolean
,Integer
,String
, orJdapiObjectChildIterator
.
-
getPropertyDescription
Returns the description of the property. Each property can have a short descriptive phrase associated with it. This method returns that phrase.- Returns:
- a string description of property.
-
getPropertyType
Returns the datatype (class) of the property. The datatype can beBoolean
,Integer
,String
, orJdapiObjectChildIterator
. For the non-static version of this method seegetPropertyType()
.- Parameters:
propertyTypeId
- the number that identifies the property.- Returns:
- the datatype as a class:
Boolean
,Integer
,String
, orJdapiObject
.
-
getPropertyDescription
Returns the description of the property. Each property can have a short descriptive phrase associated with it. This method returns that phrase. For the non-static version of this method, seegetPropertyDescription()
.- Parameters:
propertyTypeId
- the number that identifies the property.- Returns:
- a string description of property.
-
getPropertyName
Returns the Jdapi name for a given property. Examples of Jdapi names would beName
andDataSourceBlock
which are associated with the FormsItem
object. For the non-static version of this method, seegetPropertyName()
.- Parameters:
propertyTypeId
- the property type ID that identifies the property.- Returns:
- the Jdapi name of the property that corresponds to the property type ID.
-
getPropertyId
Returns the property ID for a property given the Jdapi name. For example, this method could be given the given theName
andDataSourceBlock
Jdapi names (which are associated with the FormsItem
object) to obtain the corresponding integer property ID.- Parameters:
propertyName
- the Jdapi name of a property.- Returns:
- propertyTypeId the integer corresponding to the property.
-
getAllowedValues
public static int[] getAllowedValues(int propertyId) Returns an array of valid values for numeric Forms properties that are really enumerated properties If this method is applied to a non-numeric enumerated property, it returns "null".- Parameters:
propertyId
- the property ID that identifies the property- Returns:
- an array of valid values or "null" if the method is not applicable to the property.
-
getPropertyValueName
Returns the string representation of a given property's value. For example, you could applygetAllowedValues
to an enumerated property to get the integer values which the property can have. Then pass the property's type ID and the integer values to this method to return the names associated with the values.- Parameters:
propertyTypeId
- the property number.val
- the integer value of property.- Returns:
- String representation of the property associated with
val
.
-
getPropertyValueValue
Returns the numeric value for a given property's string representation for that value. This is the opposite of method getPropertyValueName.- Parameters:
propertyTypeId
- the property number.name
- String representation of the property associated withval
.- Returns:
- val the integer value of property.
-
getPropertyConstantValue
Returns the property number (propertyTypeId
) for a named property. Property names (pname
) can be found usinggetPropertyConstantName
or by removing theD2FP_
prefix from the C Forms API#defines
.- Parameters:
pname
- the name of the property.- Returns:
- the property number.
-
getPropertyConstantName
Returns the property name for a given property type ID. This method returns the same name asgetPropertyName
but in a different style. It is recommended that you usegetPropertyName
instead.- Parameters:
propertyTypeId
- the property ID number.- Returns:
- the property name in the style of the C API
#define
, but without theD2FP_
prefix.
-