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 TypeMethodDescriptionbooleanallowGet()Returns whether the property value can be retrieved.booleanallowSet()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 StringgetPropertyConstantName(int propertyTypeId) Returns the property name for a given property type ID.static intgetPropertyConstantValue(String pname) Returns the property number (propertyTypeId) for a named property.Returns the description of the property.static StringgetPropertyDescription(int propertyTypeId) Returns the description of the property.intReturns theD2FP_x Forms ID integer of this property.static intgetPropertyId(String propertyName) Returns the property ID for a property given the Jdapi name.Returns the Jdapi name for a given property.static StringgetPropertyName(int propertyTypeId) Returns the Jdapi name for a given property.Returns the datatype (class) of the property.static ClassgetPropertyType(int propertyTypeId) Returns the datatype (class) of the property.static StringgetPropertyValueName(int propertyTypeId, int val) Returns the string representation of a given property's value.static intgetPropertyValueValue(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:
trueif the property can be retrieved;falseotherwise.
-
allowSet
public boolean allowSet()Returns whether the property value can be set.- Returns:
trueif the property value can be set;falseotherwise.
-
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 beNameandDataSourceBlockwhich are associated with the FormsItemobject. 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 beNameandDataSourceBlockwhich are associated with the FormsItemobject. 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 theNameandDataSourceBlockJdapi names (which are associated with the FormsItemobject) 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 applygetAllowedValuesto 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 usinggetPropertyConstantNameor 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 asgetPropertyNamebut in a different style. It is recommended that you usegetPropertyNameinstead.- Parameters:
propertyTypeId- the property ID number.- Returns:
- the property name in the style of the C API
#define, but without theD2FP_prefix.
-