org.reflext.api.introspection
Class MethodIntrospector

java.lang.Object
  extended by org.reflext.api.introspection.MethodIntrospector

public class MethodIntrospector
extends java.lang.Object

An introspector for methods of various types. The introspector execution is parameterized by the hierarchy scope that is used to navigate the class and its super classes and implemented interfaces. The introspector execution is parameterized by the remove overrides boolean that tells to keep or not the overriden methods that are redefined in a class.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
MethodIntrospector(HierarchyScope hierarchyScope)
          Builds a new introspector with the specified hierarchy scope and a removeOverrides parameter set to false.
MethodIntrospector(HierarchyScope hierarchyScope, boolean removeOverrides)
          Creates an introspector with the specified hierarchy scope and the specified removeOverrides parameter.
MethodIntrospector(HierarchyVisitorStrategy strategy)
          Builds a new introspector with the specified hierarchy visitor strategy and a removeOverrides parameter set to false.
MethodIntrospector(HierarchyVisitorStrategy strategy, boolean removeOverrides)
          Creates an introspector with the specified hierarchy visitor strategy and the specified removeOverrides parameter.
 
Method Summary
 java.util.Map<java.lang.String,MethodInfo> getGetterMap(ClassTypeInfo classTypeInfo)
          Returns a map of all method info getters on the specified class type info.
 java.lang.Iterable<MethodInfo> getGetters(ClassTypeInfo classTypeInfo)
          Find all method info getters on the specified class type info.
 java.util.Set<MethodInfo> getMethods(TypeInfo typeInfo)
          Returns all method on the specified type info.
 java.util.Map<java.lang.String,java.util.Set<MethodInfo>> getSetterMap(ClassTypeInfo classTypeInfo)
          Returns a map of all method info setters on the specified class type info.
 java.lang.Iterable<MethodInfo> getSetters(ClassTypeInfo classTypeInfo)
          Find all method info setters on the specified class type info.
<A> java.util.Collection<AnnotationTarget<MethodInfo,A>>
resolveMethods(ClassTypeInfo cti, AnnotationType<A,?> annotationClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodIntrospector

public MethodIntrospector(HierarchyVisitorStrategy strategy,
                          boolean removeOverrides)
                   throws java.lang.NullPointerException
Creates an introspector with the specified hierarchy visitor strategy and the specified removeOverrides parameter.

Parameters:
strategy - the hierarchy visitor strategy
removeOverrides - the remove overrides
Throws:
java.lang.NullPointerException - if the hierarchy scope is null

MethodIntrospector

public MethodIntrospector(HierarchyScope hierarchyScope,
                          boolean removeOverrides)
                   throws java.lang.NullPointerException
Creates an introspector with the specified hierarchy scope and the specified removeOverrides parameter.

Parameters:
hierarchyScope - the hierarchy scope
removeOverrides - the remove overrides
Throws:
java.lang.NullPointerException - if the hierarchy scope is null

MethodIntrospector

public MethodIntrospector(HierarchyScope hierarchyScope)
                   throws java.lang.NullPointerException
Builds a new introspector with the specified hierarchy scope and a removeOverrides parameter set to false.

Parameters:
hierarchyScope - the hierarchy scope
Throws:
java.lang.NullPointerException - if the hierarchy scope is null

MethodIntrospector

public MethodIntrospector(HierarchyVisitorStrategy strategy)
                   throws java.lang.NullPointerException
Builds a new introspector with the specified hierarchy visitor strategy and a removeOverrides parameter set to false.

Parameters:
strategy - the hierarchy visitor strategy
Throws:
java.lang.NullPointerException - if the hierarchy scope is null
Method Detail

resolveMethods

public <A> java.util.Collection<AnnotationTarget<MethodInfo,A>> resolveMethods(ClassTypeInfo cti,
                                                                               AnnotationType<A,?> annotationClass)

getGetterMap

public java.util.Map<java.lang.String,MethodInfo> getGetterMap(ClassTypeInfo classTypeInfo)
                                                        throws java.lang.NullPointerException
Returns a map of all method info getters on the specified class type info.

Parameters:
classTypeInfo - the class type info
Returns:
an iterable of the method info getters
Throws:
java.lang.NullPointerException - if the specified class type info is null

getGetters

public java.lang.Iterable<MethodInfo> getGetters(ClassTypeInfo classTypeInfo)
                                          throws java.lang.NullPointerException
Find all method info getters on the specified class type info.

Parameters:
classTypeInfo - the class type info
Returns:
an iterable of the method info getters
Throws:
java.lang.NullPointerException - if the specified class type info is null

getSetterMap

public java.util.Map<java.lang.String,java.util.Set<MethodInfo>> getSetterMap(ClassTypeInfo classTypeInfo)
                                                                       throws java.lang.NullPointerException
Returns a map of all method info setters on the specified class type info.

Parameters:
classTypeInfo - the class type info
Returns:
an iterable of the method info setters
Throws:
java.lang.NullPointerException - if the specified class type info is null

getSetters

public java.lang.Iterable<MethodInfo> getSetters(ClassTypeInfo classTypeInfo)
Find all method info setters on the specified class type info.

Parameters:
classTypeInfo - the class type info
Returns:
an iterable of the method info setters
Throws:
java.lang.NullPointerException - if the specified class type info is null

getMethods

public java.util.Set<MethodInfo> getMethods(TypeInfo typeInfo)
                                     throws java.lang.NullPointerException
Returns all method on the specified type info.

Parameters:
typeInfo - the type info
Returns:
all the methods
Throws:
java.lang.NullPointerException - if the specified type info is null


Copyright © 2010 eXo Platform SAS. All Rights Reserved.