Skip navigation links

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

E52944-01


javax.ide.util
Class MetaClass<T>

java.lang.Object
  extended by javax.ide.util.MetaClass<T>


public final class MetaClass<T>
extends java.lang.Object

A MetaClass describes a real Class with the purpose of providing to an IDE class level information, and delaying the loading of that class to the last possible moment: when an instance of the class is required.

A MetaClass binds the Class object from its class name using the appropriate class loader. Once the class is bound, new instances can be created using the newInstance() method.


Constructor Summary
MetaClass(java.lang.ClassLoader classLoader, java.lang.String className)
          Construct a meta class for the specified class name.

 

Method Summary
 boolean equals(java.lang.Object object)
           
 java.lang.ClassLoader getClassLoader()
          Get the classloader for this meta class.
 java.lang.String getClassName()
          Get the fully qualified class name.
 int hashCode()
           
 T newInstance()
          Creates a new instance of the class represented by this MetaClass object.
 java.lang.Class toClass()
          Build the Class object from the class name.
 java.lang.String toString()
           

 

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

 

Constructor Detail

MetaClass

public MetaClass(java.lang.ClassLoader classLoader,
                 java.lang.String className)
Construct a meta class for the specified class name.
Parameters:
classLoader - the class loader to load the class from. Must not be null.
className - the fully qualified name of the class. Must not be null.

Method Detail

getClassName

public java.lang.String getClassName()
Get the fully qualified class name. This name is used to create the real Class instance.
Returns:
The fully qualified class name.

getClassLoader

public java.lang.ClassLoader getClassLoader()
Get the classloader for this meta class.
Returns:
the class loader in which this meta class must be loaded.

toClass

public java.lang.Class toClass()
                        throws java.lang.ClassNotFoundException
Build the Class object from the class name. Uses the right class loader in doing so.
Returns:
The real Class object.
Throws:
java.lang.ClassNotFoundException - if the class was not found.

newInstance

public T newInstance()
              throws java.lang.InstantiationException,
                     java.lang.IllegalAccessException,
                     java.lang.ClassNotFoundException
Creates a new instance of the class represented by this MetaClass object.
Returns:
A newly created instance.
Throws:
java.lang.IllegalAccessException - if the Class or its initializer is not accessible.
java.lang.InstantiationException - if the Class is an abstract class, an interface, an array class, a primitive type, or void; or if the instantiation fails for some other reason.
java.lang.ClassNotFoundException - if the Class is not found using the MetaClass name.
java.lang.ClassCastException - if the Class is of the wrong type.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

Skip navigation links

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

E52944-01


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