Package org.drools.mvel.asm
Class ClassFieldInspectorImpl
- java.lang.Object
-
- org.drools.mvel.asm.ClassFieldInspectorImpl
-
- All Implemented Interfaces:
org.drools.core.base.ClassFieldInspector
public class ClassFieldInspectorImpl extends Object implements org.drools.core.base.ClassFieldInspector
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClassFieldInspectorImpl.GetterOverloadWarningstatic classClassFieldInspectorImpl.IncompatibleGetterOverloadError
-
Constructor Summary
Constructors Constructor Description ClassFieldInspectorImpl(Class<?> classUnderInspection)ClassFieldInspectorImpl(Class<?> classUnderInspection, boolean includeFinalMethods)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.Class<?>getFieldType(String name)Map<String,Class<?>>getFieldTypes()Map<String,Field>getFieldTypesField()Map<String,Method>getGetterMethods()Collection<org.kie.internal.builder.KnowledgeBuilderResult>getInspectionResults(String fieldName)protected Map<String,Collection<org.kie.internal.builder.KnowledgeBuilderResult>>getResults()Map<String,Method>getSetterMethods()booleanisNonGetter(String name)sotty: Checks whether a returned field is actually a getter or not
-
-
-
Constructor Detail
-
ClassFieldInspectorImpl
public ClassFieldInspectorImpl(Class<?> classUnderInspection) throws IOException
- Parameters:
classUnderInspection- The class that the fields to be shadowed are extracted for.- Throws:
IOException
-
ClassFieldInspectorImpl
public ClassFieldInspectorImpl(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.- Specified by:
getFieldNamesin interfaceorg.drools.core.base.ClassFieldInspector
-
isNonGetter
public boolean isNonGetter(String name)
sotty: Checks whether a returned field is actually a getter or not- Specified by:
isNonGetterin interfaceorg.drools.core.base.ClassFieldInspector- Parameters:
name- the field to test- Returns:
- true id the name does not correspond to a getter field
-
getFieldTypesField
public Map<String,Field> getFieldTypesField()
- Specified by:
getFieldTypesFieldin interfaceorg.drools.core.base.ClassFieldInspector- Returns:
- A mapping of field types (unboxed).
-
getFieldTypes
public Map<String,Class<?>> getFieldTypes()
- Specified by:
getFieldTypesin interfaceorg.drools.core.base.ClassFieldInspector- Returns:
- A mapping of field types (unboxed).
-
getFieldType
public Class<?> getFieldType(String name)
- Specified by:
getFieldTypein interfaceorg.drools.core.base.ClassFieldInspector
-
getGetterMethods
public Map<String,Method> getGetterMethods()
- Specified by:
getGetterMethodsin interfaceorg.drools.core.base.ClassFieldInspector- Returns:
- A mapping of methods for the getters.
-
getSetterMethods
public Map<String,Method> getSetterMethods()
- Specified by:
getSetterMethodsin interfaceorg.drools.core.base.ClassFieldInspector- Returns:
- A mapping of methods for the getters.
-
getInspectionResults
public Collection<org.kie.internal.builder.KnowledgeBuilderResult> getInspectionResults(String fieldName)
- Specified by:
getInspectionResultsin interfaceorg.drools.core.base.ClassFieldInspector
-
getResults
protected Map<String,Collection<org.kie.internal.builder.KnowledgeBuilderResult>> getResults()
-
-