Class IdAbuseChecker
java.lang.Object
com.sun.msv.reader.relax.core.checker.IdAbuseChecker
- All Implemented Interfaces:
ExpressionVisitorVoid
,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
FieldsModifier and TypeFieldDescriptionprivate String
private final Set
set of AttributeExps: that have ID/IDREF valuesprivate final RELAXModule
private final Set
set of Strings: names of non-ID/IDREF attributesprivate final Set
set of Strings: tag names that are used more than once in this moduleprivate final RELAXCoreReader
private final Set
set of Strings: tag names that are used in this module -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
check
(RELAXCoreReader reader, RELAXModule module) void
void
onAttPool
(AttPoolClause exp) void
onAttribute
(AttributeExp exp) void
void
void
void
onElement
(ElementExp exp) void
void
void
onHedgeRules
(HedgeRules exp) void
void
void
void
void
onOneOrMore
(OneOrMoreExp exp) void
void
onRef
(ReferenceExp exp) void
onSequence
(SequenceExp exp) void
void
private void
run()
-
Field Details
-
tagNames
set of Strings: tag names that are used in this module -
overloadedNames
set of Strings: tag names that are used more than once in this module -
nonIdAttrNames
set of Strings: names of non-ID/IDREF attributes -
idAttributes
set of AttributeExps: that have ID/IDREF values -
module
-
reader
-
currentTagName
-
-
Constructor Details
-
IdAbuseChecker
-
-
Method Details
-
check
-
run
private void run() -
onAttribute
- Specified by:
onAttribute
in interfaceExpressionVisitorVoid
-
onChoice
- Specified by:
onChoice
in interfaceExpressionVisitorVoid
-
onElement
- Specified by:
onElement
in interfaceExpressionVisitorVoid
-
onOneOrMore
- Specified by:
onOneOrMore
in interfaceExpressionVisitorVoid
-
onMixed
- Specified by:
onMixed
in interfaceExpressionVisitorVoid
-
onRef
- Specified by:
onRef
in interfaceExpressionVisitorVoid
-
onOther
- Specified by:
onOther
in interfaceExpressionVisitorVoid
-
onEpsilon
public void onEpsilon()- Specified by:
onEpsilon
in interfaceExpressionVisitorVoid
-
onNullSet
public void onNullSet()- Specified by:
onNullSet
in interfaceExpressionVisitorVoid
-
onAnyString
public void onAnyString()- Specified by:
onAnyString
in interfaceExpressionVisitorVoid
-
onSequence
- Specified by:
onSequence
in interfaceExpressionVisitorVoid
-
onData
- Specified by:
onData
in interfaceExpressionVisitorVoid
-
onValue
- Specified by:
onValue
in interfaceExpressionVisitorVoid
-
onAttPool
- Specified by:
onAttPool
in interfaceRELAXExpressionVisitorVoid
-
onTag
- Specified by:
onTag
in interfaceRELAXExpressionVisitorVoid
-
onElementRules
- Specified by:
onElementRules
in interfaceRELAXExpressionVisitorVoid
-
onHedgeRules
- Specified by:
onHedgeRules
in interfaceRELAXExpressionVisitorVoid
-
onInterleave
- Specified by:
onInterleave
in interfaceExpressionVisitorVoid
-
onConcur
- Specified by:
onConcur
in interfaceExpressionVisitorVoid
-
onList
- Specified by:
onList
in interfaceExpressionVisitorVoid
-