Top Description Fields Constructors Methods
com.sun.msv.grammar.util

public Class RefExpRemover

extends ExpressionCloner
Class Inheritance
Imports
java.util.Set, com.sun.msv.grammar.AttributeExp, .ElementExp, .Expression, .ExpressionCloner, .ExpressionPool, .OtherExp, .ReferenceExp

removes all ReferenceExp from AGM. when named expression is nullSet, it cannot be used. by replacing ReferenceExp by its definition, those unavailable expressions will be properly removed from AGM.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
private final boolean
private final Set<ElementExp>
visitedElements

set of visited ElementExps

Inherited from com.sun.msv.grammar.ExpressionCloner:
pool

Constructor Summary

AccessConstructor and Description
public
RefExpRemover(ExpressionPool pool, boolean

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.

_recursive
)

Method Summary

Modifier and TypeMethod and Description
public Expression
public Expression
public Expression
public Expression
Inherited from com.sun.msv.grammar.ExpressionCloner:
onAnyStringonChoiceonConcuronDataonEpsilononInterleaveonListonMixedonNullSetonOneOrMoreonSequenceonValue

Field Detail

recursiveback to summary
private final boolean recursive
visitedElementsback to summary
private final Set<ElementExp> visitedElements

set of visited ElementExps

Constructor Detail

RefExpRemoverback to summary
public RefExpRemover(ExpressionPool pool, boolean _recursive)
Parameters
_recursive:boolean

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.

Method Detail

onAttributeback to summary
public Expression onAttribute(AttributeExp exp)

Implements com.sun.msv.grammar.ExpressionVisitorExpression.onAttribute.

onElementback to summary
public Expression onElement(ElementExp exp)

Implements com.sun.msv.grammar.ExpressionVisitorExpression.onElement.

onOtherback to summary
public Expression onOther(OtherExp exp)

Implements com.sun.msv.grammar.ExpressionVisitorExpression.onOther.

onRefback to summary
public Expression onRef(ReferenceExp exp)

Implements com.sun.msv.grammar.ExpressionVisitorExpression.onRef.