org.apache.commons.clazz.reflect.common
Class ReflectedListPropertyIntrospectorSupport

java.lang.Object
  extended by org.apache.commons.clazz.reflect.common.ReflectedPropertyIntrospectorSupport
      extended by org.apache.commons.clazz.reflect.common.ReflectedListPropertyIntrospectorSupport
All Implemented Interfaces:
ReflectedPropertyIntrospector
Direct Known Subclasses:
ExtendedReflectedListPropertyIntrospector, StandardReflectedListPropertyIntrospector

public abstract class ReflectedListPropertyIntrospectorSupport
extends ReflectedPropertyIntrospectorSupport

A ReflectedPropertyIntrospector that discovers list (aka indexed) properties.

Version:
$Id: ReflectedListPropertyIntrospectorSupport.java 155436 2005-02-26 13:17:48Z dirkv $
Author:
Dmitri Plotnikov

Nested Class Summary
static class ReflectedListPropertyIntrospectorSupport.GetAccessorMethodParser
          Parser for the getFoo(int) method: Return type not void Name starts with "get" followed by capitalized singular form of the property name One integer parameter
static class ReflectedListPropertyIntrospectorSupport.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 List here.
static class ReflectedListPropertyIntrospectorSupport.SetAccessorMethodParser
          Parser for the setFoo(index, value) method: Return type void Name starts with "set" followed by capitalized singular form of the property name Two parameters, first integer
static class ReflectedListPropertyIntrospectorSupport.WriteAccessorMethodParser
          Parser for the setFooList(List) method: Return type void Name starts with "set" followed by capitalized property name One parameter We don't check if the parameter is a List here.
 
Field Summary
protected static AccessorMethodParser GET_METHOD_PARSER
           
protected static AccessorMethodParser READ_METHOD_PARSER
           
protected static AccessorMethodParser SET_METHOD_PARSER
           
protected static AccessorMethodParser WRITE_METHOD_PARSER
           
 
Constructor Summary
ReflectedListPropertyIntrospectorSupport()
           
 
Method Summary
protected  ReflectedAccessorPairProperty createProperty(ReflectedClazz clazz, ReflectedPropertyParseResults parseResults)
          Creates a new ReflectedListProperty based on parse results.
protected  ReflectedListPropertyParseResults 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 getGetAccessMethodParser()
           
protected  ReflectedListPropertyParseResults getParseResults(ReflectedClazz clazz, Map parseResultMap, String propertyName)
          Finds a ReflectedListPropertyParseResults for the given propertyName or creates a new one and puts it in the map.
protected  AccessorMethodParser getReadAccessMethodParser()
           
protected  AccessorMethodParser getSetAccessMethodParser()
           
protected  AccessorMethodParser getWriteAccessMethodParser()
           
protected  void mergeSingularMethods(Map parseResultMapPlural, Map parseResultMapSingular)
          Combines data collected from singular methods like getFoo(index) with Properties, which already contain data about plural methods like getFooList().
 
Methods inherited from class org.apache.commons.clazz.reflect.common.ReflectedPropertyIntrospectorSupport
introspectDeclaredProperties, introspectProperties, introspectProperties, isCorrectPluralForm, isCorrectPluralSuffix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ_METHOD_PARSER

protected static final AccessorMethodParser READ_METHOD_PARSER

WRITE_METHOD_PARSER

protected static final AccessorMethodParser WRITE_METHOD_PARSER

GET_METHOD_PARSER

protected static final AccessorMethodParser GET_METHOD_PARSER

SET_METHOD_PARSER

protected static final AccessorMethodParser SET_METHOD_PARSER
Constructor Detail

ReflectedListPropertyIntrospectorSupport

public ReflectedListPropertyIntrospectorSupport()
Method Detail

getReadAccessMethodParser

protected AccessorMethodParser getReadAccessMethodParser()

getWriteAccessMethodParser

protected AccessorMethodParser getWriteAccessMethodParser()

getGetAccessMethodParser

protected AccessorMethodParser getGetAccessMethodParser()

getSetAccessMethodParser

protected AccessorMethodParser getSetAccessMethodParser()

getParseResults

protected ReflectedListPropertyParseResults getParseResults(ReflectedClazz clazz,
                                                            Map parseResultMap,
                                                            String propertyName)
Finds a ReflectedListPropertyParseResults for the given propertyName or creates a new one and puts it in the map.


mergeSingularMethods

protected void mergeSingularMethods(Map parseResultMapPlural,
                                    Map parseResultMapSingular)
Combines data collected from singular methods like getFoo(index) with Properties, which already contain data about plural methods like getFooList().


findBySingularName

protected ReflectedListPropertyParseResults findBySingularName(Map parseResultMapPlural,
                                                               String singularName)
Given a singular form of a property name, locates parse results for a property with the corresponding plural name.


createProperty

protected ReflectedAccessorPairProperty createProperty(ReflectedClazz clazz,
                                                       ReflectedPropertyParseResults parseResults)
Creates a new ReflectedListProperty based on parse results.

Specified by:
createProperty in class ReflectedPropertyIntrospectorSupport


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.