public class HasNode extends Object
Modifier and Type | Method and Description |
---|---|
String |
evaluate(Features features,
Set<String> discovered) |
String |
evaluate(Features features,
Set<String> discovered,
boolean coerceUndefinedToFalse)
Evaluate the has plugin for the given set of features.
|
ModuleDeps |
evaluateAll(String pluginName,
Features features,
Set<String> discovered,
BooleanTerm term,
String comment) |
ModuleDeps |
evaluateAll(String pluginName,
Features features,
Set<String> discovered,
ModuleDepInfo terms,
String comment) |
void |
gatherEndpoints(Collection<HasNode> result)
Adds to
result the end point nodes (nodes that specify a module name) for this
node and all of the child nodes. |
String |
getFeature() |
String |
getNodeName() |
HasNode |
normalize(String ref)
Normalizes the current node relative to the path specified in
ref and recursively normalizes child nodes. |
void |
replaceWith(HasNode node)
Replaces the properties of the current node with the properties of the specified node.
|
void |
replaceWith(String nodeName)
Replaces the properties of the current node with the specified node name, making this node
into an end point node.
|
HasNode |
resolve(Features features,
Set<String> discovered,
boolean coerceUndefinedToFalse)
Recursively resolves the current node with the specified features.
|
String |
toString()
Returns the string representation of this node.
|
public HasNode(String str)
public String evaluate(Features features, Set<String> discovered, boolean coerceUndefinedToFalse)
features
- The features passed to the aggregator.discovered
- A map in which all features encountered in the evaluation will
be placed. This will not necessarily contain all features in
the dependency expression. Only the ones in the evaluation
chain will be included.coerceUndefinedToFalse
- If true, then a feature not being defined will be treated the
same as if the feature were defined with a value of false.public ModuleDeps evaluateAll(String pluginName, Features features, Set<String> discovered, BooleanTerm term, String comment)
public ModuleDeps evaluateAll(String pluginName, Features features, Set<String> discovered, ModuleDepInfo terms, String comment)
public HasNode resolve(Features features, Set<String> discovered, boolean coerceUndefinedToFalse)
features
will be replaced with the result of the
evaluation.features
- The features passed to the aggregator.discovered
- A map in which all features encountered in the evaluation will be placed. This
will not necessarily contain all features in the dependency expression. Only the
ones in the evaluation chain will be included.coerceUndefinedToFalse
- If true, then a feature not being defined will be treated the same as if the
feature were defined with a value of false.public void gatherEndpoints(Collection<HasNode> result)
result
the end point nodes (nodes that specify a module name) for this
node and all of the child nodes.result
- The collection that the end point nodes will be added topublic void replaceWith(HasNode node)
node
- The node to replace this node withpublic void replaceWith(String nodeName)
nodeName
- The name of the end point.public HasNode normalize(String ref)
ref
and recursively normalizes child nodes.ref
- The reference path to which relative paths are normalizednormalized = new HasNode(name).normalize(ref).toString();
public String toString()
public String getFeature()
public String getNodeName()
Copyright © 2011-2015 IBM. All Rights Reserved.