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