Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.0.0)

E17483-01

oracle.adfinternal.model.adapter.bean
Class BeanDCUtils

java.lang.Object
  extended by oracle.adfinternal.model.adapter.bean.BeanDCUtils

public class BeanDCUtils
extends java.lang.Object

Since:
11.1.2

Field Summary
static java.lang.String MAIN_S
           
static java.lang.String READ_ONLY_COLLECTION
           
static java.lang.String READ_ONLY_SINGLE_VALUE
           
static java.lang.String UPDATEABLE_COLLECTION
           
static java.lang.String UPDATEABLE_SINGLE_VALUE
           
static java.lang.String VOID_S
           
 
Constructor Summary
BeanDCUtils()
           
 
Method Summary
static void addTransactionalOperations(StructureDef operationsDef)
          Adds default ADF Transactional operations to data control's StructureDefinition.
static boolean areEqual(java.lang.Object o1, java.lang.Object o2)
          This is a utility method that compares two objects when one or both of the objects might be null The result of this method is determined as follows: If o1 and o2 are the same object according to the == operator, return true.
static boolean areEquivalentCollections(java.util.Collection coll1, java.util.Collection coll2)
           
static boolean areEquivalentParameters(java.util.Collection<java.util.List<java.lang.String>> params1, java.util.Collection<java.util.List<java.lang.String>> params2)
           
static StructureDef buildReadOnlyCollectionOperations()
           
static StructureDef buildSingleValueReadOnlyOperations()
           
static StructureDef buildSingleValueUpdateableOperations()
           
static StructureDef buildUpdateableCollectionOperations()
           
static java.lang.String capitalize(java.lang.String propertyName)
          Capitalize the first character of the given string.
static BeanMethodInfo findMethod(java.lang.Class clz, java.lang.String methodName, java.util.List params)
           
static java.lang.String getClassFromPrimitive(java.lang.String type)
          Get the name of the Class associated with a given primitive type name.
static java.util.List<BeanMethodInfo> getConstructorMethods(java.lang.Class clz, int modifier)
           
static CriteriaHandler getCriteriaHandler(java.lang.String dcHandler)
          Criteria Handler - DataControlHandler
static java.lang.String getGenericCollectionType(java.lang.String type)
           
static java.util.List<BeanMethodInfo> getMethods(java.lang.Class clz, int modifier)
           
static java.lang.String getPackage(java.lang.String qualifiedClassName)
          Extracts the package name from a qualified name.
static java.lang.String getPrimitiveFromClass(java.lang.String type)
          Get the name of the primitive associated with a given Class name.
static java.lang.String getQualifiedTypeName(java.lang.reflect.Type type)
           
static java.lang.String getReturnType(java.lang.reflect.Method m)
           
static java.lang.String getShortName(java.lang.String qualifiedClassName)
          Extracts a class name from a qualified name.
static java.lang.String getType(java.lang.String type)
           
static boolean hasLength(java.lang.CharSequence cs)
          Returns true if the specified String is not null and has a length greater than zero.
static boolean hasLength(java.lang.String s)
           
static java.lang.Object invokeMethod(java.lang.Object instance, java.lang.String methodName, java.lang.Class[] paramTypes, java.lang.Object[] params)
          Invoke method by name, parameters, values
static boolean isArray(java.lang.String type)
           
static boolean isBooleanType(java.lang.String name, java.lang.String type)
           
static boolean isCollection(java.lang.String type)
           
static boolean isComplex(java.lang.String type)
           
static boolean isInterface(java.lang.Class clz, java.lang.String iface)
          Is class implements interface
static boolean isPrimitiveType(java.lang.String type)
           
static java.lang.String makeReaderName(java.lang.String propertyName)
          Generate the name of a JavaBeans compliant read accessor given a property name.
static java.lang.String makeReaderName(java.lang.String propertyName, java.lang.String type)
          Generate the name of a JavaBeans compliant read accessor given a property name.
static java.lang.String makeWriterName(java.lang.String propertyName)
          Generate the name of a JavaBeans compliant write accessor given a property name.
static boolean shouldHaveMetaData(java.lang.String sType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ_ONLY_COLLECTION

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

UPDATEABLE_COLLECTION

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

UPDATEABLE_SINGLE_VALUE

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

READ_ONLY_SINGLE_VALUE

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

MAIN_S

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

VOID_S

public static final java.lang.String VOID_S
See Also:
Constant Field Values
Constructor Detail

BeanDCUtils

public BeanDCUtils()
Method Detail

getShortName

public static java.lang.String getShortName(java.lang.String qualifiedClassName)
Extracts a class name from a qualified name.

Parameters:
qualifiedClassName - a Java name; a sequence of identifiers with interspersed '.' tokens.
Returns:
the identifier that follows the last '.' token, or all of qualifiedClassName if it contains no '.' tokens.

getPackage

public static final java.lang.String getPackage(java.lang.String qualifiedClassName)
Extracts the package name from a qualified name.

Parameters:
qualifiedClassName - a Java name; a sequence of identifiers with interspersed '.' tokens.
Returns:
the portion of qualifiedClassName that precedes the last '.' token, or the empty string if qualifiedClassName contains no '.' tokens.

isComplex

public static boolean isComplex(java.lang.String type)

isCollection

public static boolean isCollection(java.lang.String type)

isArray

public static boolean isArray(java.lang.String type)

isBooleanType

public static boolean isBooleanType(java.lang.String name,
                                    java.lang.String type)

areEquivalentCollections

public static boolean areEquivalentCollections(java.util.Collection coll1,
                                               java.util.Collection coll2)

areEquivalentParameters

public static boolean areEquivalentParameters(java.util.Collection<java.util.List<java.lang.String>> params1,
                                              java.util.Collection<java.util.List<java.lang.String>> params2)
Parameters:
params1 - Collection of List, where each List is a param type/name pair
params2 - Collection of List, where each List is a param type/name pair
Returns:
true if both Collections are null/empty, or if the type components of each Collection's List are equivalent

getType

public static java.lang.String getType(java.lang.String type)
Returns:
the type part of this type

getReturnType

public static java.lang.String getReturnType(java.lang.reflect.Method m)
Returns:
a fully qualifed type part of this method

getQualifiedTypeName

public static java.lang.String getQualifiedTypeName(java.lang.reflect.Type type)
Returns:
a fully qualified type name

getGenericCollectionType

public static java.lang.String getGenericCollectionType(java.lang.String type)
Returns:
the element type of a JDK 1.5 generic collection type, or null if it is not a generic collection type.

getPrimitiveFromClass

public static java.lang.String getPrimitiveFromClass(java.lang.String type)
Get the name of the primitive associated with a given Class name.

Parameters:
type - The Class name of a primitive Class.
Returns:
The name of the primitive for which the Class is a wrapper else null.

getClassFromPrimitive

public static java.lang.String getClassFromPrimitive(java.lang.String type)
Get the name of the Class associated with a given primitive type name.

Parameters:
type - The primitive type name.
Returns:
The name of the Class which is a wrapper for the primitive, else null.

isPrimitiveType

public static boolean isPrimitiveType(java.lang.String type)

capitalize

public static java.lang.String capitalize(java.lang.String propertyName)
Capitalize the first character of the given string.

Parameters:
propertyName - The string to capitalize.
Returns:
The specified string with its first character capitalized.

makeReaderName

public static java.lang.String makeReaderName(java.lang.String propertyName,
                                              java.lang.String type)
Generate the name of a JavaBeans compliant read accessor given a property name. Will be either get(PropertyName) or is(PropertyName) dependant on the property type.

Parameters:
propertyName - Name of the property to which the reader applies.
type - Class name of the property type.
Returns:
The name of a JavaBeans compliant read accessor.

makeReaderName

public static java.lang.String makeReaderName(java.lang.String propertyName)
Generate the name of a JavaBeans compliant read accessor given a property name. Will be of the form get(PropertyName).

Parameters:
propertyName - Name of the property to which the reader applies.
Returns:
The name of a JavaBeans compliant read accessor.

makeWriterName

public static java.lang.String makeWriterName(java.lang.String propertyName)
Generate the name of a JavaBeans compliant write accessor given a property name. Will be of the form set(PropertyName).

Parameters:
propertyName - Name of the property to which the writer applies.
Returns:
The name of a JavaBeans compliant write accessor.

shouldHaveMetaData

public static boolean shouldHaveMetaData(java.lang.String sType)
Parameters:
sType -
Returns:
true if object is complex type

getMethods

public static java.util.List<BeanMethodInfo> getMethods(java.lang.Class clz,
                                                        int modifier)
Parameters:
clz -
modifier -
Returns:
list of bean methods

getConstructorMethods

public static java.util.List<BeanMethodInfo> getConstructorMethods(java.lang.Class clz,
                                                                   int modifier)
Parameters:
clz -
modifier -
Returns:
list of constructor operations

findMethod

public static BeanMethodInfo findMethod(java.lang.Class clz,
                                        java.lang.String methodName,
                                        java.util.List params)
Parameters:
clz -
methodName -
params -
Returns:
not null if method exist

addTransactionalOperations

public static void addTransactionalOperations(StructureDef operationsDef)
Adds default ADF Transactional operations to data control's StructureDefinition.


buildSingleValueUpdateableOperations

public static StructureDef buildSingleValueUpdateableOperations()
Returns:
the structure for update single value

buildSingleValueReadOnlyOperations

public static StructureDef buildSingleValueReadOnlyOperations()
Returns:
the structure for read only single value

buildUpdateableCollectionOperations

public static StructureDef buildUpdateableCollectionOperations()
Returns:
the structure for updatable collection

buildReadOnlyCollectionOperations

public static StructureDef buildReadOnlyCollectionOperations()
Returns:
the structure for read only collection

hasLength

public static final boolean hasLength(java.lang.String s)
See Also:
hasLength(CharSequence)

hasLength

public static final boolean hasLength(java.lang.CharSequence cs)
Returns true if the specified String is not null and has a length greater than zero. This is a very frequently occurring check.


areEqual

public static final boolean areEqual(java.lang.Object o1,
                                     java.lang.Object o2)
This is a utility method that compares two objects when one or both of the objects might be null The result of this method is determined as follows:
  1. If o1 and o2 are the same object according to the == operator, return true.
  2. Otherwise, if either o1 or o2 is null, return false.
  3. Otherwise, return o1.equals(o2).
For array types, one of the equals methods in Arrays should be used instead of this method. Note that arrays with more than one dimension will require some custom code in order to implement equals properly.


isInterface

public static boolean isInterface(java.lang.Class clz,
                                  java.lang.String iface)
Is class implements interface

Parameters:
clz - Class for implements class
iface - String for interface
Returns:
true boolean for iface

getCriteriaHandler

public static CriteriaHandler getCriteriaHandler(java.lang.String dcHandler)
                                          throws java.lang.Exception
Criteria Handler - DataControlHandler

Parameters:
dcHandler - String handler className
Returns:
instance of criteria handler
Throws:
java.lang.Exception

invokeMethod

public static java.lang.Object invokeMethod(java.lang.Object instance,
                                            java.lang.String methodName,
                                            java.lang.Class[] paramTypes,
                                            java.lang.Object[] params)
                                     throws java.lang.Exception
Invoke method by name, parameters, values

Parameters:
instance - Object
methodName - String
paramTypes - Class[]
params - Object[]
Returns:
result
Throws:
java.lang.Exception

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.0.0)

E17483-01

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