com.sun.msv.grammar.util

Class RefExpRemover

Implemented Interfaces:
ExpressionVisitorExpression

public class RefExpRemover
extends ExpressionCloner

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

Constructor Summary

RefExpRemover(ExpressionPool pool, boolean _recursive)

Method Summary

Expression
onAttribute(AttributeExp exp)
Expression
onElement(ElementExp exp)
Expression
onOther(OtherExp exp)
Expression
onRef(ReferenceExp exp)

Methods inherited from class com.sun.msv.grammar.ExpressionCloner

onAnyString, onChoice, onConcur, onData, onEpsilon, onInterleave, onList, onMixed, onNullSet, onOneOrMore, onSequence, onValue

Constructor Details

RefExpRemover

public RefExpRemover(ExpressionPool pool,
                     boolean _recursive)
Parameters:
_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.

Method Details

onAttribute

public Expression onAttribute(AttributeExp exp)
Specified by:
onAttribute in interface ExpressionVisitorExpression

onElement

public Expression onElement(ElementExp exp)
Specified by:
onElement in interface ExpressionVisitorExpression

onOther

public Expression onOther(OtherExp exp)
Specified by:
onOther in interface ExpressionVisitorExpression

onRef

public Expression onRef(ReferenceExp exp)
Specified by:
onRef in interface ExpressionVisitorExpression