Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

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
 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 propPath 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 propPath 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

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

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