jodd.introspector
Class WeakIntrospector

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

public class WeakIntrospector
extends Object
implements Introspector

Smarter Introspector caches class data together with class loader information. Therefore, if classes are reloaded dynamically, this introspector will maintains its cache.


Field Summary
protected  Map<ClassLoader,Map<String,ClassDescriptor>> cache
           
 
Constructor Summary
WeakIntrospector()
           
 
Method Summary
protected  ClassDescriptor describeClass(Class type)
          Describes a class by creating a new instance of ClassDescriptor.
protected  Map<String,ClassDescriptor> getClassDescriptorMap(Class type)
          Returns class descriptor map.
 ClassDescriptor lookup(Class type)
          Returns the ClassDescriptor object for specified class.
 ClassDescriptor register(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 Map<ClassLoader,Map<String,ClassDescriptor>> cache
Constructor Detail

WeakIntrospector

public WeakIntrospector()
Method Detail

getClassDescriptorMap

protected Map<String,ClassDescriptor> getClassDescriptorMap(Class type)
Returns class descriptor map.


lookup

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

Specified by:
lookup in interface Introspector

register

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

Specified by:
register in interface Introspector

describeClass

protected ClassDescriptor describeClass(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