public class ReflectionPropertyHandlerFactory extends Object implements PropertyHandlerFactory
Create PropertyGetter
and PropertySetter
based on Java reflection
Constructor and Description |
---|
ReflectionPropertyHandlerFactory() |
Modifier and Type | Method and Description |
---|---|
ListPropertyGetter |
createListPropertyGetter(Class itemType) |
ListPropertySetter |
createListPropertySetter(Class itemType) |
MapPropertyGetter |
createMapPropertyGetter(Class keyType,
Class valType) |
MapPropertySetter |
createMapPropertySetter(Class keyType,
Class valType) |
PropertyGetter |
createPropertyGetter(Class c,
String propName,
boolean requireField)
Create a
PropertyGetter |
PropertySetter |
createPropertySetter(Class c,
String propName)
Create a
PropertySetter |
protected PropertyGetter |
newGetter(Class c,
Method m,
Field f) |
protected PropertySetter |
newSetter(Class c,
Method m,
Field f) |
public PropertySetter createPropertySetter(Class c, String propName)
PropertyHandlerFactory
Create a PropertySetter
createPropertySetter
in interface PropertyHandlerFactory
c
- the class of the entitypropName
- the name of the propertypublic PropertyGetter createPropertyGetter(Class c, String propName, boolean requireField)
PropertyHandlerFactory
Create a PropertyGetter
createPropertyGetter
in interface PropertyHandlerFactory
c
- the class of the entitypropName
- the name of the propertyrequireField
- force to get the field directly instead of using getter methodpublic MapPropertyGetter createMapPropertyGetter(Class keyType, Class valType)
createMapPropertyGetter
in interface PropertyHandlerFactory
public MapPropertySetter createMapPropertySetter(Class keyType, Class valType)
createMapPropertySetter
in interface PropertyHandlerFactory
public ListPropertyGetter createListPropertyGetter(Class itemType)
createListPropertyGetter
in interface PropertyHandlerFactory
public ListPropertySetter createListPropertySetter(Class itemType)
createListPropertySetter
in interface PropertyHandlerFactory
protected PropertyGetter newGetter(Class c, Method m, Field f)
protected PropertySetter newSetter(Class c, Method m, Field f)
Copyright © 2014–2018 OSGL (Open Source General Library). All rights reserved.