|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.syphr.prom.DefaultEvaluator
public class DefaultEvaluator
This Evaluator
implementation seeks to work the same way property evaluation
works in Ant. In other words, a reference is defined as a '$' followed by a property
name wrapped in braces.
For example, a reference to the property "some.property
" would like this:
${some.property}
.
Constructor Summary | |
---|---|
DefaultEvaluator()
|
Method Summary | |
---|---|
String |
evaluate(String rawValue,
Retriever retriever)
Transform the given raw value into a fully evaluated value (including recursively nested references). |
List<Reference> |
getReferences(String rawValue,
Retriever retriever)
Get a list of references contained within the given raw value. |
boolean |
isReferencing(String rawValue,
String name,
Retriever retriever)
Determine whether or not the given raw value references another value by name. |
Reference |
referenceAt(String rawValue,
int position,
Retriever retriever)
Retrieve the reference at the specified location, if one exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultEvaluator()
Method Detail |
---|
public String evaluate(String rawValue, Retriever retriever)
Evaluator
evaluate
in interface Evaluator
rawValue
- the raw value, which may contain references to other valuesretriever
- the retriever used to obtain the values of referenced properties
public Reference referenceAt(String rawValue, int position, Retriever retriever)
Evaluator
referenceAt
in interface Evaluator
rawValue
- the raw value that may or may not contain a referenceposition
- the position at which to look for a reference - this does not need to be
the beginning of the reference or any other particular position relative
to the reference, if a reference exists that contains this location in
the raw value, it will be returnedretriever
- the Retriever
used to get the value of the reference, if one is
found
null
otherwisepublic boolean isReferencing(String rawValue, String name, Retriever retriever)
Evaluator
isReferencing
in interface Evaluator
rawValue
- the raw value to searchname
- the name of the reference to findretriever
- the Retriever
instance used to convert references to values for
recursive searching
true
if a reference with the given name is found;
false
otherwisepublic List<Reference> getReferences(String rawValue, Retriever retriever)
Evaluator
Reference
contains a list of sub-references found
within its value, so a recursive listing is obtainable.
getReferences
in interface Evaluator
rawValue
- the raw value to search for referencesretriever
- the Retriever
instance used to convert references to values
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |