Extension SDK

oracle.ide.inspector
Class InspectorFactory

java.lang.Object
  extended byoracle.ide.inspector.InspectorFactory

public class InspectorFactory
extends java.lang.Object

The InspectorFactory class is a singleton class that provides a registry for registering Inspectable implemenations on a class by class basis.


Method Summary
static java.beans.BeanInfo getBeanInfo(java.lang.Class beanClass)
          Utility method to retrieve a BeanInfo for a given class.
 Inspectable getInspectable(Context context, Element element)
          Get the registered Inspectable implementation for the data referred to by the given Element within the given Context.
static InspectorFactory getInstance()
          Get the singleton InspectorFactory instance.
 MultiInspectable getMultiInspectable(Context context)
          Get a MultiInspectable instance for the given Context.
 java.lang.Class getPropertyModelType(java.lang.Class cls)
          Get the registered IdePropertyModel type for the SupportsInspection type provided, else the default type IdeMultiObjectModel.class.
 void registerInspectable(java.lang.Class targetClass, java.lang.Class inspectableClass)
          Register an Inspectable type to be used when requesting the Inspectable for a given SupportsInspection type.
 void registerPropertyModel(java.lang.Class targetClass, java.lang.Class modelClass)
          Register an IdePropertyModel type to be used when requesting the model type for a given SupportsInspection type.
 void setDefaultInspectable(java.lang.Class cls)
          Set the default Inspectable implementation to use when no other match can be found for any give Class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static InspectorFactory getInstance()
Get the singleton InspectorFactory instance.

Returns:
the singleton InspectorFactory instance.

getMultiInspectable

public MultiInspectable getMultiInspectable(Context context)
Get a MultiInspectable instance for the given Context.

Parameters:
context - the Context for which a MultiInspectable is desired.
Returns:
a MultiInspectable.

getInspectable

public Inspectable getInspectable(Context context,
                                  Element element)
Get the registered Inspectable implementation for the data referred to by the given Element within the given Context.

Parameters:
context - the Context in which to interpret the Element.
element - the Element holding the data to inspect.
Returns:
an Inspectable.

registerInspectable

public void registerInspectable(java.lang.Class targetClass,
                                java.lang.Class inspectableClass)
                         throws java.lang.ClassCastException
Register an Inspectable type to be used when requesting the Inspectable for a given SupportsInspection type. Registering a null value for a given SupportsInspection type will remove any previous Inspectable type registered for that SupportsInspection type.

Parameters:
targetClass - the SupportsInspection implementation for which an Inspectable implementation is being registered.
inspectableClass - the Inspectable implementation being registered.
Throws:
java.lang.ClassCastException
See Also:
getInspectable(oracle.ide.addin.Context, oracle.ide.model.Element)

setDefaultInspectable

public void setDefaultInspectable(java.lang.Class cls)
Set the default Inspectable implementation to use when no other match can be found for any give Class.

Parameters:
cls - the Inspectable implementation to use as default.
See Also:
getInspectable(oracle.ide.addin.Context, oracle.ide.model.Element)

getPropertyModelType

public java.lang.Class getPropertyModelType(java.lang.Class cls)
Get the registered IdePropertyModel type for the SupportsInspection type provided, else the default type IdeMultiObjectModel.class.

Returns:
a IdePropertyModel.

registerPropertyModel

public void registerPropertyModel(java.lang.Class targetClass,
                                  java.lang.Class modelClass)
                           throws java.lang.ClassCastException
Register an IdePropertyModel type to be used when requesting the model type for a given SupportsInspection type. Registering a null value for a given SupportsInspection type will remove any previous model type registered for that SupportsInspection type.

Parameters:
targetClass - the SupportsInspection implementation for which an IdePropertyModel implementation is being registered.
modelClass - the IdePropertyModel implementation being registered.
Throws:
java.lang.ClassCastException
See Also:
getPropertyModelType(java.lang.Class)

getBeanInfo

public static final java.beans.BeanInfo getBeanInfo(java.lang.Class beanClass)
                                             throws java.beans.IntrospectionException
Utility method to retrieve a BeanInfo for a given class.

Parameters:
beanClass - the Class for which a BeanInfo is desired.
Throws:
java.beans.IntrospectionException

Extension SDK

 

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