jodd.introspector
Class SimpleIntrospector

java.lang.Object
  extended by jodd.introspector.SimpleIntrospector
All Implemented Interfaces:
Introspector

public class SimpleIntrospector
extends java.lang.Object
implements Introspector

Simple Introspector caches all class descriptors. It does not provide any more subtle logic behind, therefore, it should not be used in environments with dynamic class re-loading. todo: add optional max value for total number of class descriptors stored in cache


Field Summary
protected  java.util.Map<java.lang.Class,ClassDescriptor> cache
           
 
Constructor Summary
SimpleIntrospector()
           
 
Method Summary
protected  ClassDescriptor describeClass(java.lang.Class type)
          Describes a class by creating a new instance of ClassDescriptor.
 java.lang.String getStatistics()
          Returns simple statistics information about all cached descriptors and their usage.
 ClassDescriptor lookup(java.lang.Class type)
          Returns the ClassDescriptor object for specified class.
 ClassDescriptor register(java.lang.Class type)
          Registers new class type.
 void reset()
          Resets current cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected java.util.Map<java.lang.Class,ClassDescriptor> cache
Constructor Detail

SimpleIntrospector

public SimpleIntrospector()
Method Detail

lookup

public ClassDescriptor lookup(java.lang.Class type)
Returns the ClassDescriptor object for specified class.

Specified by:
lookup in interface Introspector

register

public ClassDescriptor register(java.lang.Class type)
Registers new class type. If type already registered, it will be reseted and registered again with new class descriptor.

Specified by:
register in interface Introspector

describeClass

protected ClassDescriptor describeClass(java.lang.Class type)
Describes a class by creating a new instance of ClassDescriptor.


reset

public void reset()
Resets current cache.

Specified by:
reset in interface Introspector

getStatistics

public java.lang.String getStatistics()
Returns simple statistics information about all cached descriptors and their usage.

Specified by:
getStatistics in interface Introspector


Copyright ©2008 Jodd Team