com.ibm.commons.iloader.node
Interface ILoader

All Known Implementing Classes:
AbstractLoader, JavaBeanLoader

public interface ILoader

An adapter to a real world object. This interface is used to describe the behavior of a model. Implementors should extend com.ibm.commons.iloader.node.loaders.AbstractLoader.


Method Summary
 IClassDef getClassOf(java.lang.Object object)
          Get the class for a particular object.
 java.util.Iterator<IClassDef> getInheritingClassesOf(IClassDef classDef)
          Returns a iterator of all of the classes that inherit from the provided IClassDef.
 java.lang.String[] getNamespaces()
          Get the list of namespaces handled by this loader.
 java.lang.Object getObject(java.lang.Object instance, IAttribute attribute)
          Get an object value for the given attribute.
 IObjectCollection getObjectCollection(java.lang.Object instance, ICollection collection)
          Get an object collection based on the provided property (ICollection).
 java.lang.String getValue(java.lang.Object instance, IAttribute attribute)
          Returns a string value for the given attribute.
 IValueCollection getValueCollection(java.lang.Object instance, ICollection collection)
          Get a value collection based on the provided property (ICollection).
 boolean handleNamespace(java.lang.String namespace)
          Check if the loader is using a particular namespace
 boolean isNativeClass(java.lang.Object o)
          Check is an object is a native class.
 boolean isNativeObject(java.lang.Object o)
          Determines if the provided object is supported by the current ILoader instance.
 IClassDef loadClass(java.lang.String namespace, java.lang.String className)
          Load a class giving a name.
 void setObject(java.lang.Object instance, IAttribute attribute, java.lang.Object value, DataChangeNotifier notifier)
          Sets an object value for the given attribute.
 void setValue(java.lang.Object instance, IAttribute attribute, java.lang.String value, DataChangeNotifier notifier)
          Sets the given attribute's value.
 

Method Detail

getNamespaces

java.lang.String[] getNamespaces()
Get the list of namespaces handled by this loader.

Returns:
returns the qualified names of all supported namespaces

handleNamespace

boolean handleNamespace(java.lang.String namespace)
Check if the loader is using a particular namespace

Returns:
returns true if the provided namespace is supported by the current loader

isNativeClass

boolean isNativeClass(java.lang.Object o)
Check is an object is a native class.

Returns:
returns true if the object provided is assignable from the current loader.

loadClass

IClassDef loadClass(java.lang.String namespace,
                    java.lang.String className)
                    throws com.ibm.commons.iloader.node.NodeException
Load a class giving a name.

Parameters:
namespace - the namespace that the IClassDef is to correspond to
className - the desired class
Returns:
a IClassDef object for the given classname and namespace
Throws:
com.ibm.commons.iloader.node.NodeException

getClassOf

IClassDef getClassOf(java.lang.Object object)
                     throws com.ibm.commons.iloader.node.NodeException
Get the class for a particular object.

Parameters:
object - an object whose IClassDef is required
Returns:
returns the IClassDef for the given object
Throws:
NodeException - throws a NodeException if the provided object is supported by the ILoader.

getInheritingClassesOf

java.util.Iterator<IClassDef> getInheritingClassesOf(IClassDef classDef)
Returns a iterator of all of the classes that inherit from the provided IClassDef.

Parameters:
classDef -
Returns:
an Iterator of IClassDef containing concrete classes that implements and IClassDef

isNativeObject

boolean isNativeObject(java.lang.Object o)
Determines if the provided object is supported by the current ILoader instance.

Returns:
returns true if the provided object is supported by the ILoader

getValue

java.lang.String getValue(java.lang.Object instance,
                          IAttribute attribute)
                          throws com.ibm.commons.iloader.node.NodeException
Returns a string value for the given attribute. The ILoader determines the value of the attribute in the model supported by the ILoader.

Parameters:
instance - an instance of the model that contains the given attribute
attribute - the attribute whose value is sought
Returns:
returns a string for the given attribute
Throws:
com.ibm.commons.iloader.node.NodeException
See Also:
IAttribute

setValue

void setValue(java.lang.Object instance,
              IAttribute attribute,
              java.lang.String value,
              DataChangeNotifier notifier)
              throws com.ibm.commons.iloader.node.NodeException
Sets the given attribute's value.

Parameters:
instance - an instance of the model that contains the given attribute
attribute - the attribute whose value is to be set
value - the value to set the attribute to
DataChangeNodifier - a notifier that is to be notified when the value change occurs in the attribute
Throws:
NodeException - throws a NodeException if the given attribute is not supported by the ILoader
See Also:
IAttribute

getObject

java.lang.Object getObject(java.lang.Object instance,
                           IAttribute attribute)
                           throws com.ibm.commons.iloader.node.NodeException
Get an object value for the given attribute.

Parameters:
instance - an instance of the model that contains the given attribute
attribute - the attribute whose value is to be set
Returns:
returns a object for the given attribute
Throws:
NodeException - throws a NodeException if the particular object/attribute is not supported by the current ILoader
See Also:
IAttribute

setObject

void setObject(java.lang.Object instance,
               IAttribute attribute,
               java.lang.Object value,
               DataChangeNotifier notifier)
               throws com.ibm.commons.iloader.node.NodeException
Sets an object value for the given attribute.

Parameters:
instance - an instance of the model that contains the given attribute
attribute - the attribute whose value is to be set
value - the value that is to be set on the IAttribute
notifier - a notifier that should be notified when the value changes
Throws:
NodeException - throws a NodeException if the particular object/attribute is not supported by the current ILoader
See Also:
IAttribute

getValueCollection

IValueCollection getValueCollection(java.lang.Object instance,
                                    ICollection collection)
                                    throws com.ibm.commons.iloader.node.NodeException
Get a value collection based on the provided property (ICollection).

Parameters:
instance - an instance of the model that contains the given collection
collection - the ICollection whose value is sought
Returns:
returns an IValueCollection
Throws:
NodeException - throws a NodeException if the particular object/attribute is not supported by the current ILoader
See Also:
ICollection

getObjectCollection

IObjectCollection getObjectCollection(java.lang.Object instance,
                                      ICollection collection)
                                      throws com.ibm.commons.iloader.node.NodeException
Get an object collection based on the provided property (ICollection).

Parameters:
instance - an instance of the model that contains the given collection
collection - the ICollection whose value is sought
Returns:
returns an IObjectCollection
Throws:
NodeException - throws a NodeException if the particular object/attribute is not supported by the current ILoader
See Also:
ICollection