cz.cuni.amis.introspection.java
Class ReflectionObjectFolder

Package class diagram package ReflectionObjectFolder
java.lang.Object
  extended by cz.cuni.amis.introspection.Feature
      extended by cz.cuni.amis.introspection.Folder
          extended by cz.cuni.amis.introspection.AbstractObjectFolder<Object>
              extended by cz.cuni.amis.introspection.java.ReflectionObjectFolder

public class ReflectionObjectFolder
extends AbstractObjectFolder<Object>

Implementation of automatic object introspection using Java Reflection API. Primitive public fields of object (see javadoc fo list of primitive types) marked by PogProp annotation are returned as Properties, unknown more complicated types implementing Introspectable interface are returned as Children for further introspection. TODO annotations arent working ... fix it

All returned properties are for now uneditable. Just for the sake of simplicity.

THIS EXAMPLE IMPLEMENTATION DOESN'T DEAL WITH INHERITANCE.

Author:
ik

Field Summary
 
Fields inherited from class cz.cuni.amis.introspection.Feature
name
 
Constructor Summary
ReflectionObjectFolder(String name, Object object)
          Creates a new instance of JavaReflectionProxy
 
Method Summary
protected  Folder[] computeFolders(Object object)
          All data fields of introspected object that implement Introspectable interface are added to the list of children.
protected  Property[] computeProperties(Object object)
          All data fields which are marked by @PogProp annotation and PropertyEditorManager can find editor for them are recognized as Properties of introspectable proxy and are returned by this method.
protected  Collection<Property> getDeclaredProperties(Class cls, Object object)
          Get all Properties from given class.
protected  Collection<Folder> getDeclaredProxies(Class cls, Object object)
          Get all IntrospectableProxies from given class.
 
Methods inherited from class cz.cuni.amis.introspection.AbstractObjectFolder
getFolders, getProperties, getProxiedObject
 
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

ReflectionObjectFolder

public ReflectionObjectFolder(String name,
                              Object object)
Creates a new instance of JavaReflectionProxy

Method Detail

getDeclaredProperties

protected Collection<Property> getDeclaredProperties(Class cls,
                                                     Object object)
Get all Properties from given class.


getDeclaredProxies

protected Collection<Folder> getDeclaredProxies(Class cls,
                                                Object object)
Get all IntrospectableProxies from given class.


computeProperties

protected Property[] computeProperties(Object object)
All data fields which are marked by @PogProp annotation and PropertyEditorManager can find editor for them are recognized as Properties of introspectable proxy and are returned by this method.

Specified by:
computeProperties in class AbstractObjectFolder<Object>
Parameters:
object - Object to be introspected.
Returns:
Array of properties.

computeFolders

protected Folder[] computeFolders(Object object)
All data fields of introspected object that implement Introspectable interface are added to the list of children.

Specified by:
computeFolders in class AbstractObjectFolder<Object>
Parameters:
object - Object to be introspected.
Returns:
Array of introspectable children.


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