org.codehaus.plexus.util.introspection
Class ReflectionValueExtractor

java.lang.Object
  extended by org.codehaus.plexus.util.introspection.ReflectionValueExtractor

public class ReflectionValueExtractor
extends java.lang.Object

Using simple dotted expressions extract the values from a MavenProject instance, For example we might want to extract a value like: project.build.sourceDirectory

Version:
$Id: ReflectionValueExtractor.java 6553 2007-06-16 07:59:46Z kenney $
Author:
Jason van Zyl

Field Summary
private static java.lang.Class[] CLASS_ARGS
           
private static java.util.Map classMaps
          Use a WeakHashMap here, so the keys (Class objects) can be garbage collected.
private static java.lang.Object[] OBJECT_ARGS
           
 
Constructor Summary
private ReflectionValueExtractor()
           
 
Method Summary
static java.lang.Object evaluate(java.lang.String expression, java.lang.Object root)
           
static java.lang.Object evaluate(java.lang.String expression, java.lang.Object root, boolean trimRootToken)
           
private static ClassMap getClassMap(java.lang.Class clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_ARGS

private static final java.lang.Class[] CLASS_ARGS

OBJECT_ARGS

private static final java.lang.Object[] OBJECT_ARGS

classMaps

private static final java.util.Map classMaps
Use a WeakHashMap here, so the keys (Class objects) can be garbage collected. This approach prevents permgen space overflows due to retention of discarded classloaders.

Constructor Detail

ReflectionValueExtractor

private ReflectionValueExtractor()
Method Detail

evaluate

public static java.lang.Object evaluate(java.lang.String expression,
                                        java.lang.Object root)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

evaluate

public static java.lang.Object evaluate(java.lang.String expression,
                                        java.lang.Object root,
                                        boolean trimRootToken)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getClassMap

private static ClassMap getClassMap(java.lang.Class clazz)