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

E13403-03

oracle.ide.extension
Class LazyClassAdapter

java.lang.Object
  extended by oracle.javatools.data.HashStructureAdapter
      extended by oracle.ide.extension.LazyClassAdapter

public final class LazyClassAdapter
extends HashStructureAdapter

LazyClassAdapter is a hash structure adapter that can retrieve instances of a class declared in an extension manifest. It is intended to be used in conjunction with HashStructureHook.

Use the createInstance( Class, String ) method to create a new instance of some class specified in the structure. The keyName should be the location of the fully qualified class name within the hash structure.

The class will be loaded in the context of the classloader for the extension that declared the fully qualified class name in its extension manifest.

Since:
11.0

Field Summary
 
Fields inherited from class oracle.javatools.data.HashStructureAdapter
_hash
 
Method Summary
<T> T
createInstance(java.lang.Class<T> clazz, java.lang.String keyName)
          Creates a new instance of a class specified in this hash structure.
static LazyClassAdapter getInstance(HashStructure hash)
          Creates an instance of this adapter for the specified hash structure.
<T> MetaClass<T>
getMetaClass(java.lang.String keyName)
          Gets the meta class for the specified key.
 
Methods inherited from class oracle.javatools.data.HashStructureAdapter
addStructureChangeListener, containsKey, copyTo, copyToImpl, equals, equalsImpl, findOrCreate, forcedCopyTo, getHashStructure, removeStructureChangeListener, useObjectEquals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LazyClassAdapter getInstance(HashStructure hash)
Creates an instance of this adapter for the specified hash structure.

Parameters:
hash - hash structure to adapt.
Returns:
an instance of LazyClassAdapter.

createInstance

public <T> T createInstance(java.lang.Class<T> clazz,
                            java.lang.String keyName)
Creates a new instance of a class specified in this hash structure.

Parameters:
clazz - the expected type / superclass of the class.
keyName - the name of the key to look up for the fully qualified class name. Must not be null.
Returns:
a new instance of the class specified by the key. May return null if there is no such key.

getMetaClass

public <T> MetaClass<T> getMetaClass(java.lang.String keyName)
Gets the meta class for the specified key. The meta class is an object you can use to lazily load the class. It encapsulates the loader and fully qualified class name for a class.

Parameters:
keyName - the key to look up for the meta class. Must not be null.
Returns:
a meta class. May be null if the key does not exist.

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

E13403-03

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