org.codehaus.plexus.util.introspection

Class ReflectionValueExtractor

public class ReflectionValueExtractor extends 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
static MapclassMaps
Use a WeakHashMap here, so the keys (Class objects) can be garbage collected.
static Class[]CLASS_ARGS
static Object[]OBJECT_ARGS
Constructor Summary
ReflectionValueExtractor()
Method Summary
static Objectevaluate(String expression, Object root)
static Objectevaluate(String expression, Object root, boolean trimRootToken)
static ClassMapgetClassMap(Class clazz)

Field Detail

classMaps

private static final 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.

CLASS_ARGS

private static final Class[] CLASS_ARGS

OBJECT_ARGS

private static final Object[] OBJECT_ARGS

Constructor Detail

ReflectionValueExtractor

private ReflectionValueExtractor()

Method Detail

evaluate

public static Object evaluate(String expression, Object root)

evaluate

public static Object evaluate(String expression, Object root, boolean trimRootToken)

getClassMap

private static ClassMap getClassMap(Class clazz)