Package com.sun.msv.reader.trex.ng
Class RestrictionChecker
java.lang.Object
com.sun.msv.reader.trex.ng.RestrictionChecker
Checks RELAX NG contextual restrictions defined in the section 7.
ExpressionWalker is used to walk the content model thoroughly. Depending on the current context, different walkers are used so that we can detect contextual restrictions properly.
For each ElementExp and AttributeExp, its name class is checked to detect the constraint set out in the section 7.1.6. Also, a set is used to avoid redundant checks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
The base class of all other context-specific checker.private class
private class
protected class
private class
(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescriptionObject that checks duplicate attributes in a content model.Object that checks conflicting elements in interleave.private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private Expression
The source location of this expression should be also reported in case of error.private final NameClassVisitor
Used to visit children of AnyNameClassprivate final ExpressionWalker
Used to visit children of attributes.private final ExpressionWalker
Used to visit children of elements.private final ExpressionWalker
Used to visit children of the 'except' clause of data.private final ExpressionWalker
Used to visit children of group/interleave in oneOrMore in elements.private final ExpressionWalker
Used to visit children of interleaves in lists.private final ExpressionWalker
Used to visit children of lists.private final RestrictionChecker.NameClassWalker
Used to visit name classes.private final NameClassVisitor
Used to visit children of NamespaceNameClassprivate final ExpressionWalker
Used to visit children of oneOrMore in elements.private final ExpressionWalker
Used to visit the start pattern.private final RELAXNGReader
Reader object to which errors are reported.private final Set
Visited ElementExp/AttributeExps. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
check()
Traverses the grammar and performs the contextual check.void
Checks the contextual restriction on a name class.private void
reportError
(Expression exp, String errorMsg) private void
reportError
(Expression exp, String errorMsg, Object[] args)
-
Field Details
-
reader
Reader object to which errors are reported. -
errorContext
The source location of this expression should be also reported in case of error. -
visitedExps
Visited ElementExp/AttributeExps. -
attDupChecker
Object that checks duplicate attributes in a content model. -
elemDupChecker
Object that checks conflicting elements in interleave. -
inExcept
Used to visit children of the 'except' clause of data. -
inGroupInOneOrMoreInElement
Used to visit children of group/interleave in oneOrMore in elements. -
inOneOrMoreInElement
Used to visit children of oneOrMore in elements. -
inElement
Used to visit children of elements. -
inAttribute
Used to visit children of attributes. -
inInterleaveInList
Used to visit children of interleaves in lists. -
inList
Used to visit children of lists. -
inStart
Used to visit the start pattern. -
inNameClass
Used to visit name classes. -
inAnyNameClass
Used to visit children of AnyNameClass -
inNsNameClass
Used to visit children of NamespaceNameClass -
ERR_ATTRIBUTE_IN_EXCEPT
- See Also:
-
ERR_ELEMENT_IN_EXCEPT
- See Also:
-
ERR_LIST_IN_EXCEPT
- See Also:
-
ERR_TEXT_IN_EXCEPT
- See Also:
-
ERR_EMPTY_IN_EXCEPT
- See Also:
-
ERR_SEQUENCE_IN_EXCEPT
- See Also:
-
ERR_INTERLEAVE_IN_EXCEPT
- See Also:
-
ERR_ONEORMORE_IN_EXCEPT
- See Also:
-
ERR_REPEATED_GROUPED_ATTRIBUTE
- See Also:
-
ERR_ELEMENT_IN_ATTRIBUTE
- See Also:
-
ERR_ATTRIBUTE_IN_ATTRIBUTE
- See Also:
-
ERR_ATTRIBUTE_IN_LIST
- See Also:
-
ERR_ELEMENT_IN_LIST
- See Also:
-
ERR_LIST_IN_LIST
- See Also:
-
ERR_TEXT_IN_LIST
- See Also:
-
ERR_ATTRIBUTE_IN_START
- See Also:
-
ERR_LIST_IN_START
- See Also:
-
ERR_TEXT_IN_START
- See Also:
-
ERR_EMPTY_IN_START
- See Also:
-
ERR_SEQUENCE_IN_START
- See Also:
-
ERR_INTERLEAVE_IN_START
- See Also:
-
ERR_DATA_IN_START
- See Also:
-
ERR_ONEORMORE_IN_START
- See Also:
-
ERR_DATA_IN_INTERLEAVE_IN_LIST
- See Also:
-
ERR_VALUE_IN_INTERLEAVE_IN_LIST
- See Also:
-
ERR_ANYNAME_IN_ANYNAME
- See Also:
-
ERR_ANYNAME_IN_NSNAME
- See Also:
-
ERR_NSNAME_IN_NSNAME
- See Also:
-
ERR_DUPLICATE_ATTRIBUTES
- See Also:
-
ERR_DUPLICATE_ELEMENTS
- See Also:
-
-
Constructor Details
-
RestrictionChecker
-
-
Method Details
-
check
public void check()Traverses the grammar and performs the contextual check. -
reportError
-
reportError
-
checkNameClass
Checks the contextual restriction on a name class.If an error is found, it is reported through GrammarReader.
-