cz.cuni.amis.introspection
Class AbstractObjectFolder<T>

Package class diagram package AbstractObjectFolder
java.lang.Object
  extended by cz.cuni.amis.introspection.Feature
      extended by cz.cuni.amis.introspection.Folder
          extended by cz.cuni.amis.introspection.AbstractObjectFolder<T>
Direct Known Subclasses:
DynamicMBeanToFolderAdapter, FolderUnion, PythonInstrospectableProxy, ReflectionObjectFolder, ScriptFolder

public abstract class AbstractObjectFolder<T>
extends Folder

This is wrapper class for introspectable objects. You have to give it object to be introspected in the constructor and implement methods computing array of properties and array of children objects (computeProperties() and computeChildren()). This abstract implementation caches computed results and returns them by getProperties() and getChildren() methods.

Author:
ik

Field Summary
 
Fields inherited from class cz.cuni.amis.introspection.Feature
name
 
Constructor Summary
AbstractObjectFolder(String name, T object)
          Creates a new instance of Folder and bind it with given object.
 
Method Summary
protected abstract  Folder[] computeFolders(T object)
          Computes list of introspectable children of object to be introspected.
protected abstract  Property[] computeProperties(T object)
          Computes list of properties of object to be introspected.
 Folder[] getFolders()
          Returns lazy initialized list of children.
 Property[] getProperties()
          Returns lazy initialized list of properties.
protected  T getProxiedObject()
          Return object proxied by this Folder.
 
Methods inherited from class cz.cuni.amis.introspection.Folder
createProperties, createProperties, getFolder, getProperty, loadFromProperties, loadFromProperties
 
Methods inherited from class cz.cuni.amis.introspection.Feature
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractObjectFolder

public AbstractObjectFolder(String name,
                            T object)
Creates a new instance of Folder and bind it with given object. Then name is set to object.getClass().getSimpleName();

Parameters:
object - Object to be introspected.
Method Detail

getFolders

public Folder[] getFolders()
                    throws IntrospectionException
Returns lazy initialized list of children.

Specified by:
getFolders in class Folder
Returns:
list of children
Throws:
IntrospectionException

getProperties

public Property[] getProperties()
                         throws IntrospectionException
Returns lazy initialized list of properties.

Specified by:
getProperties in class Folder
Returns:
list of properties
Throws:
IntrospectionException

computeProperties

protected abstract Property[] computeProperties(T object)
                                         throws IntrospectionException
Computes list of properties of object to be introspected.

Parameters:
object - Object to be introspected.
Returns:
Array of properties.
Throws:
IntrospectionException

computeFolders

protected abstract Folder[] computeFolders(T object)
                                    throws IntrospectionException
Computes list of introspectable children of object to be introspected.

Parameters:
object - Object to be introspected.
Returns:
Array of introspectable children.
Throws:
IntrospectionException

getProxiedObject

protected T getProxiedObject()
Return object proxied by this Folder.

Returns:
An object proxied by this Folder.


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.