Class IdAbuseChecker
- java.lang.Object
-
- com.sun.msv.reader.relax.core.checker.IdAbuseChecker
-
- All Implemented Interfaces:
ExpressionVisitorVoid,RELAXExpressionVisitorVoid
public class IdAbuseChecker extends java.lang.Object implements RELAXExpressionVisitorVoid
makes sure that ID/IDREF are not abused. RELAX has the following constraint over the use of ID/IDREF.First, ID and IDREF can be only used as attribute values. They cannot be used from type attribute of elementRules.
Second, if <tag> clause declares directly or indirectly (by referencing attPool) one of its attribute as ID/IDREF type, it must satisfies either (or both) of the following statement.
- no other tag clause shares the same tag name.
- no other attribute of non-ID/IDREF types shares the same attribute name.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcurrentTagNameprivate java.util.SetidAttributesset of AttributeExps: that have ID/IDREF valuesprivate RELAXModulemoduleprivate java.util.SetnonIdAttrNamesset of Strings: names of non-ID/IDREF attributesprivate java.util.SetoverloadedNamesset of Strings: tag names that are used more than once in this moduleprivate RELAXCoreReaderreaderprivate java.util.SettagNamesset of Strings: tag names that are used in this module
-
Constructor Summary
Constructors Modifier Constructor Description privateIdAbuseChecker(RELAXCoreReader r, RELAXModule m)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheck(RELAXCoreReader reader, RELAXModule module)voidonAnyString()voidonAttPool(AttPoolClause exp)voidonAttribute(AttributeExp exp)voidonChoice(ChoiceExp exp)voidonConcur(ConcurExp exp)voidonData(DataExp exp)voidonElement(ElementExp exp)voidonElementRules(ElementRules exp)voidonEpsilon()voidonHedgeRules(HedgeRules exp)voidonInterleave(InterleaveExp exp)voidonList(ListExp exp)voidonMixed(MixedExp exp)voidonNullSet()voidonOneOrMore(OneOrMoreExp exp)voidonOther(OtherExp exp)voidonRef(ReferenceExp exp)voidonSequence(SequenceExp exp)voidonTag(TagClause exp)voidonValue(ValueExp exp)private voidrun()
-
-
-
Field Detail
-
tagNames
private final java.util.Set tagNames
set of Strings: tag names that are used in this module
-
overloadedNames
private final java.util.Set overloadedNames
set of Strings: tag names that are used more than once in this module
-
nonIdAttrNames
private final java.util.Set nonIdAttrNames
set of Strings: names of non-ID/IDREF attributes
-
idAttributes
private final java.util.Set idAttributes
set of AttributeExps: that have ID/IDREF values
-
module
private final RELAXModule module
-
reader
private final RELAXCoreReader reader
-
currentTagName
private java.lang.String currentTagName
-
-
Constructor Detail
-
IdAbuseChecker
private IdAbuseChecker(RELAXCoreReader r, RELAXModule m)
-
-
Method Detail
-
check
public static void check(RELAXCoreReader reader, RELAXModule module)
-
run
private void run()
-
onAttribute
public void onAttribute(AttributeExp exp)
- Specified by:
onAttributein interfaceExpressionVisitorVoid
-
onChoice
public void onChoice(ChoiceExp exp)
- Specified by:
onChoicein interfaceExpressionVisitorVoid
-
onElement
public void onElement(ElementExp exp)
- Specified by:
onElementin interfaceExpressionVisitorVoid
-
onOneOrMore
public void onOneOrMore(OneOrMoreExp exp)
- Specified by:
onOneOrMorein interfaceExpressionVisitorVoid
-
onMixed
public void onMixed(MixedExp exp)
- Specified by:
onMixedin interfaceExpressionVisitorVoid
-
onRef
public void onRef(ReferenceExp exp)
- Specified by:
onRefin interfaceExpressionVisitorVoid
-
onOther
public void onOther(OtherExp exp)
- Specified by:
onOtherin interfaceExpressionVisitorVoid
-
onEpsilon
public void onEpsilon()
- Specified by:
onEpsilonin interfaceExpressionVisitorVoid
-
onNullSet
public void onNullSet()
- Specified by:
onNullSetin interfaceExpressionVisitorVoid
-
onAnyString
public void onAnyString()
- Specified by:
onAnyStringin interfaceExpressionVisitorVoid
-
onSequence
public void onSequence(SequenceExp exp)
- Specified by:
onSequencein interfaceExpressionVisitorVoid
-
onData
public void onData(DataExp exp)
- Specified by:
onDatain interfaceExpressionVisitorVoid
-
onValue
public void onValue(ValueExp exp)
- Specified by:
onValuein interfaceExpressionVisitorVoid
-
onAttPool
public void onAttPool(AttPoolClause exp)
- Specified by:
onAttPoolin interfaceRELAXExpressionVisitorVoid
-
onTag
public void onTag(TagClause exp)
- Specified by:
onTagin interfaceRELAXExpressionVisitorVoid
-
onElementRules
public void onElementRules(ElementRules exp)
- Specified by:
onElementRulesin interfaceRELAXExpressionVisitorVoid
-
onHedgeRules
public void onHedgeRules(HedgeRules exp)
- Specified by:
onHedgeRulesin interfaceRELAXExpressionVisitorVoid
-
onInterleave
public void onInterleave(InterleaveExp exp)
- Specified by:
onInterleavein interfaceExpressionVisitorVoid
-
onConcur
public void onConcur(ConcurExp exp)
- Specified by:
onConcurin interfaceExpressionVisitorVoid
-
onList
public void onList(ListExp exp)
- Specified by:
onListin interfaceExpressionVisitorVoid
-
-