Skip navigation links

Oracle® Fusion Middleware Content Integration Suite (CIS) Java API Reference
11g Release 1 (11.1)

E17350-01


com.stellent.cis.common.bean
Class BeanUtil

java.lang.Object
  extended by com.stellent.cis.common.bean.BeanUtil


public class BeanUtil
extends java.lang.Object

Generic utility methods for working with bean objects


Field Summary
static java.lang.String BOOLEAN_FALSE
           
static java.lang.String BOOLEAN_NO
           
static java.lang.String BOOLEAN_OFF
           
static java.lang.String BOOLEAN_ON
           
static java.lang.String BOOLEAN_TRUE
           
static java.lang.String BOOLEAN_YES
           
protected static java.lang.String CREATE_OBJECT
           
static java.lang.String DOT_SIGN
          Package/Class Name separator
protected static java.lang.String GET_CLASS
           
protected static java.lang.String NEW_INSTANCE
           

 

Constructor Summary
BeanUtil()
           

 

Method Summary
static boolean equal(java.lang.Object obj1, java.lang.Object obj2)
          Simply compares two objects using equals() method and takes care about nulls null == null = false
static java.lang.Object getPrivilegedProperty(java.lang.Object instance, java.lang.String propertyName)
          Retrieves a privilged property
static java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Object anInstance, java.lang.String aPropertyName)
          Returns property descriptor of the selected property for the selected object instance.
static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class instanceClass)
          Returns property descriptor list for a given object class selected object instance.
static java.lang.Class loadClass(java.lang.String className)
           
static java.lang.Class loadClass(java.lang.String className, java.lang.ClassLoader classLoader)
           
static byte[] save(java.lang.Object object)
          Serialize an object to an array of bytes.
static void setProperties(java.lang.Object anInstance, java.util.Map propertyValues)
           
static void setProperty(java.lang.Object anInstance, java.lang.String aPropertyName, java.lang.Object aValue)
          Set's a particular property of the instance Usage: SomeBean bean = new SomeBean(); Integer propertyValue = new Integer(10); ClassTools.setProperty(bean, "propertyName", propertyValue); is in fact equal to bean.setPropertyValue(propertyValue); Simple types are also supported int propertyValue = 10; ClassTools.setProperty(bean, "intPropertyName", new Integer(propertyValue));
static boolean setPropertyByString(java.lang.Object anInstance, java.lang.String aPropertyName, java.lang.String aStringValue)
          Set's a particular property of the instance by string value Usage: SomeBean bean = new SomeBean(); ObjectUtil.setPropertyByString(bean, "someProperty", "10");
static boolean setSpecialProperty(java.lang.Object instance, java.lang.String propName, java.lang.Object value)
          Sets a "special" property, i.e.
static java.lang.Object StringToValue(java.lang.String s, java.lang.Class t)
          Converts String value to the type specified by class

 

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

 

Field Detail

DOT_SIGN

public static final java.lang.String DOT_SIGN
Package/Class Name separator
See Also:
Constant Field Values

BOOLEAN_TRUE

public static final java.lang.String BOOLEAN_TRUE
See Also:
Constant Field Values

BOOLEAN_FALSE

public static final java.lang.String BOOLEAN_FALSE
See Also:
Constant Field Values

BOOLEAN_YES

public static final java.lang.String BOOLEAN_YES
See Also:
Constant Field Values

BOOLEAN_NO

public static final java.lang.String BOOLEAN_NO
See Also:
Constant Field Values

BOOLEAN_ON

public static final java.lang.String BOOLEAN_ON
See Also:
Constant Field Values

BOOLEAN_OFF

public static final java.lang.String BOOLEAN_OFF
See Also:
Constant Field Values

CREATE_OBJECT

protected static final java.lang.String CREATE_OBJECT
See Also:
Constant Field Values

GET_CLASS

protected static final java.lang.String GET_CLASS
See Also:
Constant Field Values

NEW_INSTANCE

protected static final java.lang.String NEW_INSTANCE
See Also:
Constant Field Values

Constructor Detail

BeanUtil

public BeanUtil()

Method Detail

StringToValue

public static java.lang.Object StringToValue(java.lang.String s,
                                             java.lang.Class t)
Converts String value to the type specified by class

getPropertyDescriptor

public static java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Object anInstance,
                                                                  java.lang.String aPropertyName)
Returns property descriptor of the selected property for the selected object instance.
Parameters:
anInstance -

getPropertyDescriptors

public static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class instanceClass)
Returns property descriptor list for a given object class selected object instance.
Parameters:
instanceClass -
Returns:
PropertyDescriptor[] for passed in class

setProperty

public static void setProperty(java.lang.Object anInstance,
                               java.lang.String aPropertyName,
                               java.lang.Object aValue)
Set's a particular property of the instance Usage: SomeBean bean = new SomeBean(); Integer propertyValue = new Integer(10); ClassTools.setProperty(bean, "propertyName", propertyValue); is in fact equal to bean.setPropertyValue(propertyValue); Simple types are also supported int propertyValue = 10; ClassTools.setProperty(bean, "intPropertyName", new Integer(propertyValue));

setPropertyByString

public static boolean setPropertyByString(java.lang.Object anInstance,
                                          java.lang.String aPropertyName,
                                          java.lang.String aStringValue)
Set's a particular property of the instance by string value Usage: SomeBean bean = new SomeBean(); ObjectUtil.setPropertyByString(bean, "someProperty", "10");

setSpecialProperty

public static boolean setSpecialProperty(java.lang.Object instance,
                                         java.lang.String propName,
                                         java.lang.Object value)
Sets a "special" property, i.e. a property with special notation to indicate setting into an map or list. For example:
  setSpecialProperty (instance, "value(name)", "charles") -> calls instance.setValue ("name", "charles")
  setSpecialProperty (instance, "value[1]", "charles") -> calls instance.setValue ("charles", 1)
 
Parameters:
instance -
propName -
value -
Returns:

setProperties

public static void setProperties(java.lang.Object anInstance,
                                 java.util.Map propertyValues)

equal

public static boolean equal(java.lang.Object obj1,
                            java.lang.Object obj2)
Simply compares two objects using equals() method and takes care about nulls null == null = false

save

public static byte[] save(java.lang.Object object)
Serialize an object to an array of bytes.
Parameters:
object - the object to serialize. Must implement Serializable
Returns:
array of bytes that constitute the serialized object or null if an error occurred

getPrivilegedProperty

public static java.lang.Object getPrivilegedProperty(java.lang.Object instance,
                                                     java.lang.String propertyName)
                                              throws java.lang.IllegalAccessException
Retrieves a privilged property
Returns:
null if not found, the object otherwise
Throws:
java.lang.IllegalAccessException

loadClass

public static java.lang.Class loadClass(java.lang.String className)
                                 throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

loadClass

public static java.lang.Class loadClass(java.lang.String className,
                                        java.lang.ClassLoader classLoader)
                                 throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

Skip navigation links

Oracle® Fusion Middleware Content Integration Suite (CIS) Java API Reference
11g Release 1 (11.1)

E17350-01


Copyright © 1996, 2010, Oracle and/or its affiliates. All rights reserved.