Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.db.property
Class PropertyHelper

java.lang.Object
  extended by oracle.javatools.db.property.PropertyHelper


public class PropertyHelper
extends java.lang.Object

Helper class that allows you to get the value for a given property (path) on an object. Doesn't use the core Property API but instead just looks for get methods, making it more flexible for property frameworks such as SXML and DDL generation.

Since:
11

Constructor Summary
PropertyHelper()
           

 

Method Summary
static PropertyInfo findPropertyInfo(java.lang.Class clz, java.lang.String propPath, java.lang.Class<? extends DBObjectProvider> proClz)
          If the given property path is supported for the given object class this method returns the PropertyInfo associated with that property.
static PropertyInfo findPropertyInfo(java.lang.String type, java.lang.String propPath, java.lang.Class<? extends DBObjectProvider> proClz)
          If the given property path is supported for the given object class this method returns the PropertyInfo associated with that property.
 Difference getChildDifference(Difference diff, java.lang.String propPath)
          Traverses the given difference looking for a Difference heirachy that matches the given property path, and returns the Difference at the end of that path if one is found.
 java.lang.Object getPropertyValue(java.lang.Object obj, java.lang.String propPath)
          Gets the value for the given property path on the given object.
 java.lang.Object getPropertyValueOrFail(java.lang.Object obj, java.lang.String propPath)
          Gets the value for the given property path on the given object.
 boolean isValidProperty(java.lang.Object obj, java.lang.String propName, java.lang.Object context)
          Returns true if the given propName is a valid property for the given object.
 void setPropertyValue(java.lang.Object bean, java.lang.String propPath, java.lang.Object value)
          Sets property value on a given object.
 void setPropertyValueOrFail(java.lang.Object bean, java.lang.String propPath, java.lang.Object value)
          Sets property value on a given object.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

PropertyHelper

public PropertyHelper()

Method Detail

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object obj,
                                         java.lang.String propPath)
Gets the value for the given property path on the given object.

getPropertyValueOrFail

public java.lang.Object getPropertyValueOrFail(java.lang.Object obj,
                                               java.lang.String propPath)
                                        throws MissingPropertyException
Gets the value for the given property path on the given object. If the property is not found, a MissingPropertyException is thrown.
Throws:
MissingPropertyException

isValidProperty

public boolean isValidProperty(java.lang.Object obj,
                               java.lang.String propName,
                               java.lang.Object context)
Returns true if the given propName is a valid property for the given object. Note this shouldn't be called with prperty paths, just property names.
Parameters:
obj - the object the property is for
propName - the property name
context - the context (parent) object
Returns:
true if we determine the property is valid, or cannot determine the properties validity.

setPropertyValue

public void setPropertyValue(java.lang.Object bean,
                             java.lang.String propPath,
                             java.lang.Object value)
Sets property value on a given object. Property can be a set method of the bean or part of a key in it's property map. In the latter case if value is null then the property mapping is removed.

setPropertyValueOrFail

public void setPropertyValueOrFail(java.lang.Object bean,
                                   java.lang.String propPath,
                                   java.lang.Object value)
                            throws MissingPropertyException
Sets property value on a given object. Property can be a set method of the bean or part of a key in it's property map. In the latter case if value is null then the property mapping is removed.
Throws:
MissingPropertyException

getChildDifference

public Difference getChildDifference(Difference diff,
                                     java.lang.String propPath)
                              throws MissingPropertyException
Traverses the given difference looking for a Difference heirachy that matches the given property path, and returns the Difference at the end of that path if one is found.
Parameters:
diff - the parent Difference
propPath - the property path to resolve from the object in the parent Difference.
Throws:
MissingPropertyException - if the path is invalid

findPropertyInfo

public static PropertyInfo findPropertyInfo(java.lang.String type,
                                            java.lang.String propPath,
                                            java.lang.Class<? extends DBObjectProvider> proClz)
If the given property path is supported for the given object class this method returns the PropertyInfo associated with that property.
Parameters:
type - the object type
propPath - the property path
proClz - the provider class to filter the supported properties by
Returns:
a PropertyInfo for the property path if supported, else null

findPropertyInfo

public static PropertyInfo findPropertyInfo(java.lang.Class clz,
                                            java.lang.String propPath,
                                            java.lang.Class<? extends DBObjectProvider> proClz)
If the given property path is supported for the given object class this method returns the PropertyInfo associated with that property.
Parameters:
clz - the object class
propPath - the property path
proClz - the provider class to filter the supported properties by
Returns:
a PropertyInfo for the property path if supported, else null

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


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