org.drools.core.util.asm
Class ClassFieldInspector

java.lang.Object
  extended by org.drools.core.util.asm.ClassFieldInspector

public class ClassFieldInspector
extends Object

Visit a POJO user class, and extract the property getter methods that are public, in the order in which they are declared actually in the class itself (not using introspection). This may be enhanced in the future to allow annotations or perhaps external meta data configure the order of the indexes, as this may provide fine tuning options in special cases.


Constructor Summary
ClassFieldInspector(Class<?> classUnderInspection)
           
ClassFieldInspector(Class<?> classUnderInspection, boolean includeFinalMethods)
           
 
Method Summary
 Map<String,Integer> getFieldNames()
          Return a mapping of the field "names" (ie bean property name convention) to the numerical index by which they can be accessed.
 Map<String,Class<?>> getFieldTypes()
           
 Map<String,Field> getFieldTypesField()
           
 Map<String,Method> getGetterMethods()
           
 Map<String,Method> getSetterMethods()
           
 boolean isNonGetter(String name)
          sotty: Checks whether a returned field is actually a getter or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassFieldInspector

public ClassFieldInspector(Class<?> classUnderInspection)
                    throws IOException
Parameters:
classUnderInspection - The class that the fields to be shadowed are extracted for.
Throws:
IOException

ClassFieldInspector

public ClassFieldInspector(Class<?> classUnderInspection,
                           boolean includeFinalMethods)
                    throws IOException
Throws:
IOException
Method Detail

getFieldNames

public Map<String,Integer> getFieldNames()
Return a mapping of the field "names" (ie bean property name convention) to the numerical index by which they can be accessed.


isNonGetter

public boolean isNonGetter(String name)
sotty: Checks whether a returned field is actually a getter or not

Parameters:
name - the field to test
Returns:
true id the name does not correspond to a getter field

getFieldTypesField

public Map<String,Field> getFieldTypesField()
Returns:
A mapping of field types (unboxed).

getFieldTypes

public Map<String,Class<?>> getFieldTypes()
Returns:
A mapping of field types (unboxed).

getGetterMethods

public Map<String,Method> getGetterMethods()
Returns:
A mapping of methods for the getters.

getSetterMethods

public Map<String,Method> getSetterMethods()
Returns:
A mapping of methods for the getters.


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.