Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.ui.data.bean
Class BeanAdapterUtils

java.lang.Object
  |
  +--oracle.cabo.ui.data.bean.BeanAdapterUtils

public class BeanAdapterUtils
extends java.lang.Object

Utilities for working with bean DataObject adapters. Provides a location to register adapter classes, which allow for a higher-performance implementation than ordinary introspection. However, developers should generally delay creating and registering an adapter class until performance metrics justify the addition.

By default, the Bean adapter classes will use the actual class of an object instance - that is, object.getClass() - to find an adapter, or use introspection to create an adapter. However, this is not always desirable for two reasons:

  1. For efficiency reasons, it's faster to reuse the same adapter class for all implementations of a single interface.
  2. Introspection cannot succeed on package-private classes. However, it works fine if that package-private class has a public superclass or implements a public interface - and that public class or interface supports those properties.

Adapters can be built using the BuildBeanDOAdapter tool, and all of this rigamarole can be entirely bypassed by handing to Cabo instances of these adapter classes instead of the bean classes themselves.

See Also:
BuildBeanDOAdapter

Constructor Summary
BeanAdapterUtils()
           
 
Method Summary
static DataObject getAdapter(java.lang.Object instance)
          Creates a DataObject adapter class around an object instance.
static DataObject getAdapter(java.lang.Object instance, java.lang.Class objClass)
          Creates a DataObject adapter class around an object instance.
static DataObject getAdapter(RenderingContext context, java.lang.Object instance)
          Creates a DataObject adapter class around an object instance.
static DataObjectList getAdapterList(RenderingContext context, java.lang.Object listInstance)
          Creates a DataObjectList adapter class around an object.
static void registerAdapterClass(java.lang.Class beanClass, java.lang.Class adapterClass)
          Registers an adapter class to be used in place of introspection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanAdapterUtils

public BeanAdapterUtils()
Method Detail

getAdapter

public static DataObject getAdapter(java.lang.Object instance,
                                    java.lang.Class objClass)
                             throws java.lang.IllegalAccessException,
                                    java.lang.InstantiationException
Creates a DataObject adapter class around an object instance. Instead of using the actual class of the instance, use a superclass. See above for reasons why this may be useful.

getAdapter

public static DataObject getAdapter(java.lang.Object instance)
                             throws java.lang.IllegalAccessException,
                                    java.lang.InstantiationException
Creates a DataObject adapter class around an object instance.

getAdapter

public static DataObject getAdapter(RenderingContext context,
                                    java.lang.Object instance)
Creates a DataObject adapter class around an object instance. Instead of throwing exceptions, log exceptions with the RenderingContext's error log.

getAdapterList

public static DataObjectList getAdapterList(RenderingContext context,
                                            java.lang.Object listInstance)
Creates a DataObjectList adapter class around an object.

registerAdapterClass

public static void registerAdapterClass(java.lang.Class beanClass,
                                        java.lang.Class adapterClass)
Registers an adapter class to be used in place of introspection.

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.