public class RefExpRemover extends ExpressionCloner
Modifier and Type | Field and Description |
---|---|
private boolean |
recursive |
private java.util.Set |
visitedElements
set of visited ElementExps
|
pool
Constructor and Description |
---|
RefExpRemover(ExpressionPool pool,
boolean _recursive) |
Modifier and Type | Method and Description |
---|---|
Expression |
onAttribute(AttributeExp exp) |
Expression |
onElement(ElementExp exp) |
Expression |
onOther(OtherExp exp) |
Expression |
onRef(ReferenceExp exp) |
onAnyString, onChoice, onConcur, onData, onEpsilon, onInterleave, onList, onMixed, onNullSet, onOneOrMore, onSequence, onValue
private final java.util.Set visitedElements
private final boolean recursive
public RefExpRemover(ExpressionPool pool, boolean _recursive)
_recursive
- If true, this object behaves destructively. It recursively visits all the reachable expressions and removes ReferenceExps. In this process, this object changes the content model of ElementExps.
If false, this object doesn't visit the content models of child elements, therefore, it behaves non-destructively. Nothing in the original expression will be touched.
public Expression onElement(ElementExp exp)
public Expression onAttribute(AttributeExp exp)
public Expression onRef(ReferenceExp exp)
public Expression onOther(OtherExp exp)