|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.plexus.interpolation.object.FieldBasedObjectInterpolator
public class FieldBasedObjectInterpolator
Reflectively traverses an object graph and uses an Interpolator
instance to resolve any String fields in the
graph.
NOTE: This code is based on a reimplementation of ModelInterpolator in
maven-project 2.1.0-M1, which became a performance bottleneck when the
interpolation process became a hotspot.
Field Summary | |
---|---|
static java.util.Set |
DEFAULT_BLACKLISTED_FIELD_NAMES
|
static java.util.Set |
DEFAULT_BLACKLISTED_PACKAGE_PREFIXES
|
Constructor Summary | |
---|---|
FieldBasedObjectInterpolator()
Use the default settings for blacklisted fields and packages, where fields named 'parent' and classes in packages starting with 'java' will not be interpolated. |
|
FieldBasedObjectInterpolator(java.util.Set blacklistedFieldNames,
java.util.Set blacklistedPackagePrefixes)
Use the given black-lists to limit the interpolation of fields and classes (by package). |
Method Summary | |
---|---|
static void |
clearCaches()
Clear out the Reflection caches kept for the most expensive operations encountered: field lookup and primitive queries for fields. |
java.util.List |
getWarnings()
Retrieve the List of warnings (ObjectInterpolationWarning
instances) generated during the last interpolation execution. |
boolean |
hasWarnings()
Returns true if the last interpolation execution generated warnings. |
void |
interpolate(java.lang.Object target,
Interpolator interpolator)
Using reflective field access and mutation, traverse the object graph from the given starting point and interpolate any Strings found in that graph using the given Interpolator . |
void |
interpolate(java.lang.Object target,
Interpolator interpolator,
RecursionInterceptor recursionInterceptor)
Using reflective field access and mutation, traverse the object graph from the given starting point and interpolate any Strings found in that graph using the given Interpolator . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.Set DEFAULT_BLACKLISTED_FIELD_NAMES
public static final java.util.Set DEFAULT_BLACKLISTED_PACKAGE_PREFIXES
Constructor Detail |
---|
public FieldBasedObjectInterpolator()
public FieldBasedObjectInterpolator(java.util.Set blacklistedFieldNames, java.util.Set blacklistedPackagePrefixes)
blacklistedFieldNames
- The list of field names to ignoreblacklistedPackagePrefixes
- The list of package prefixes whose classes should be ignoredMethod Detail |
---|
public static void clearCaches()
public boolean hasWarnings()
hasWarnings
in interface ObjectInterpolator
public java.util.List getWarnings()
List
of warnings (ObjectInterpolationWarning
instances) generated during the last interpolation execution.
getWarnings
in interface ObjectInterpolator
public void interpolate(java.lang.Object target, Interpolator interpolator) throws InterpolationException
Interpolator
. Limits to this process can be
managed using the black lists configured in the constructor.
interpolate
in interface ObjectInterpolator
target
- The starting point of the object graph to traverseinterpolator
- The Interpolator
used to resolve any Strings encountered during traversal.
NOTE: Uses SimpleRecursionInterceptor
.
InterpolationException
public void interpolate(java.lang.Object target, Interpolator interpolator, RecursionInterceptor recursionInterceptor) throws InterpolationException
Interpolator
. Limits to this process can be
managed using the black lists configured in the constructor.
interpolate
in interface ObjectInterpolator
target
- The starting point of the object graph to traverseinterpolator
- The Interpolator
used to resolve any Strings encountered during traversal.recursionInterceptor
- The RecursionInterceptor
used to detect cyclical expressions in the graph
InterpolationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |