|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.clazz.reflect.common.ReflectedPropertyIntrospectorSupport org.apache.commons.clazz.reflect.extended.ReflectedMappedPropertyIntrospector
public class ReflectedMappedPropertyIntrospector
A ReflectedPropertyIntrospector that discovers mapped properties.
Nested Class Summary | |
---|---|
static class |
ReflectedMappedPropertyIntrospector.GetAccessorMethodParser
Parser for the getFoo(key) method:
Return type not void
Name starts with "get" followed by capitalized singular
form of the property name
One parameter
|
static class |
ReflectedMappedPropertyIntrospector.KeySetAccessorMethodParser
Parser for the getFooKeys() method:
Returns integer
Name starts with "get" followed by capitalized singular
form of the property name, followed by "Keys" or "KeySet"
No parameters
|
static class |
ReflectedMappedPropertyIntrospector.PutAccessorMethodParser
Parser for the setFoo(key, value) method:
Return type void
Name starts with "set" followed by capitalized singular
form of the property name
Two parameters
|
static class |
ReflectedMappedPropertyIntrospector.ReadAccessorMethodParser
Parser for the getFooMap() method:
Return type not void
Name starts with "get" followed by capitalized property name
No parameters
We don't check if the parameter is a Map here. |
static class |
ReflectedMappedPropertyIntrospector.RemoveAccessorMethodParser
Parser for the removeFoo(key) method:
Name starts with "remove" followed by capitalized singular
form of the property name
One parameter
|
static class |
ReflectedMappedPropertyIntrospector.WriteAccessorMethodParser
Parser for the setFooMap(Map) method:
Return type void
Name starts with "set" followed by capitalized property name
One parameter
We don't check if the parameter is a Map here. |
Field Summary | |
---|---|
protected static AccessorMethodParser |
GET_METHOD_PARSER
|
protected static AccessorMethodParser |
KEY_SET_METHOD_PARSER
|
protected static AccessorMethodParser |
PUT_METHOD_PARSER
|
protected static AccessorMethodParser |
READ_METHOD_PARSER
|
protected static AccessorMethodParser |
REMOVE_METHOD_PARSER
|
protected static AccessorMethodParser |
WRITE_METHOD_PARSER
|
Constructor Summary | |
---|---|
ReflectedMappedPropertyIntrospector()
|
Method Summary | |
---|---|
protected ReflectedAccessorPairProperty |
createProperty(ReflectedClazz clazz,
ReflectedPropertyParseResults parseResults)
Creates a new ReflectedMappedProperty based on parse results. |
protected ReflectedMappedPropertyParseResults |
findBySingularName(Map parseResultMapPlural,
String singularName)
Given a singular form of a property name, locates parse results for a property with the corresponding plural name. |
protected AccessorMethodParser |
getGetAccessorMethodParser()
|
protected AccessorMethodParser |
getKeySetAccessorMethodParser()
|
protected ReflectedMappedPropertyParseResults |
getParseResults(ReflectedClazz clazz,
Map parseResultMap,
String propertyName)
Finds a ReflectedMappedPropertyParseResults for the given propertyName or creates a new one and puts it in the map. |
protected AccessorMethodParser |
getPutAccessorMethodParser()
|
protected AccessorMethodParser |
getReadAccessorMethodParser()
|
protected AccessorMethodParser |
getRemoveAccessorMethodParser()
|
protected AccessorMethodParser |
getWriteAccessorMethodParser()
|
void |
introspectProperties(ReflectedClazz clazz,
Class javaClass,
Map parseResultMap)
Goes over methods of the supplied class and creates ReflectedAccessorPairProperty objects for discovered properties. |
protected boolean |
isCorrectPluralSuffix(String singular,
String suffix)
Returns true if the suffix is "s" or "Map". |
protected void |
mergeSingularMethods(Map parseResultMapPlural,
Map parseResultMapSingular)
Combines data collected from singular methods like getFoo(key) with parse results for plural methods
like getFooMap() . |
Methods inherited from class org.apache.commons.clazz.reflect.common.ReflectedPropertyIntrospectorSupport |
---|
introspectDeclaredProperties, introspectProperties, isCorrectPluralForm |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final AccessorMethodParser READ_METHOD_PARSER
protected static final AccessorMethodParser WRITE_METHOD_PARSER
protected static final AccessorMethodParser GET_METHOD_PARSER
protected static final AccessorMethodParser PUT_METHOD_PARSER
protected static final AccessorMethodParser REMOVE_METHOD_PARSER
protected static final AccessorMethodParser KEY_SET_METHOD_PARSER
Constructor Detail |
---|
public ReflectedMappedPropertyIntrospector()
Method Detail |
---|
public void introspectProperties(ReflectedClazz clazz, Class javaClass, Map parseResultMap)
introspectProperties
in class ReflectedPropertyIntrospectorSupport
protected AccessorMethodParser getReadAccessorMethodParser()
protected AccessorMethodParser getWriteAccessorMethodParser()
protected AccessorMethodParser getGetAccessorMethodParser()
protected AccessorMethodParser getPutAccessorMethodParser()
protected AccessorMethodParser getRemoveAccessorMethodParser()
protected AccessorMethodParser getKeySetAccessorMethodParser()
protected void mergeSingularMethods(Map parseResultMapPlural, Map parseResultMapSingular)
getFoo(key)
with parse results for plural methods
like getFooMap()
.
protected ReflectedMappedPropertyParseResults findBySingularName(Map parseResultMapPlural, String singularName)
protected boolean isCorrectPluralSuffix(String singular, String suffix)
true
if the suffix is "s" or "Map".
isCorrectPluralSuffix
in class ReflectedPropertyIntrospectorSupport
ReflectedPropertyIntrospectorSupport.isCorrectPluralSuffix(String,String)
protected ReflectedMappedPropertyParseResults getParseResults(ReflectedClazz clazz, Map parseResultMap, String propertyName)
protected ReflectedAccessorPairProperty createProperty(ReflectedClazz clazz, ReflectedPropertyParseResults parseResults)
createProperty
in class ReflectedPropertyIntrospectorSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |