Package com.sun.msv.reader.trex
Class TREXSequencedStringChecker
java.lang.Object
com.sun.msv.reader.trex.TREXSequencedStringChecker
- All Implemented Interfaces:
ExpressionVisitor
makes sure that there is no sequenced string.
"sequenced string" is something like this.
abc
Also, TREX prohibits sequence of typed strings and elements.
In this checker, we introduce a function "f" that takes a string and computes the string-sensitivity of the pattern.
"f" returns 3 bits of information. One is whether it contains elements. Another is whehter it contains text. And the last is whether it contains DataExp/ValueExp.
"f" is computed recursively through the pattern.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set
set of checked Expressions.private final Map
set of checked ReferenceExps.private static final int
private static final int
private static final int
private static final Integer[]
integer pool implementation.private final TREXBaseReader
private final boolean
If this flag is set to true, this class raises an error for anyStrings in two branches of interleave. -
Constructor Summary
ConstructorsConstructorDescriptionTREXSequencedStringChecker
(TREXBaseReader reader, boolean _rejectTextInInterleave) -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
It is an error if a pattern with data is combined to other patterns.private static Object
onAttribute
(AttributeExp exp) onElement
(ElementExp exp) onOneOrMore
(OneOrMoreExp exp) onRef
(ReferenceExp exp) onSequence
(SequenceExp exp) private static final int
-
Field Details
-
rejectTextInInterleave
private final boolean rejectTextInInterleaveIf this flag is set to true, this class raises an error for anyStrings in two branches of interleave. -
intPool
integer pool implementation. -
HAS_ELEMENT
private static final int HAS_ELEMENT- See Also:
-
HAS_ANYSTRING
private static final int HAS_ANYSTRING- See Also:
-
HAS_DATA
private static final int HAS_DATA- See Also:
-
reader
-
checkedExps
set of checked Expressions. once an ElementExp/AttributeExp is checked, it will be added to this set. this set is used to prevent infinite recursion. -
checkedRefExps
set of checked ReferenceExps. Once a ReferenceExp is checked, it will be added (with its result) to this map. This is useful to speed up the check.
-
-
Constructor Details
-
TREXSequencedStringChecker
-
-
Method Details
-
onRef
- Specified by:
onRef
in interfaceExpressionVisitor
-
onOther
- Specified by:
onOther
in interfaceExpressionVisitor
-
onInterleave
- Specified by:
onInterleave
in interfaceExpressionVisitor
-
onSequence
- Specified by:
onSequence
in interfaceExpressionVisitor
-
onEpsilon
- Specified by:
onEpsilon
in interfaceExpressionVisitor
-
onNullSet
- Specified by:
onNullSet
in interfaceExpressionVisitor
-
onData
- Specified by:
onData
in interfaceExpressionVisitor
-
onValue
- Specified by:
onValue
in interfaceExpressionVisitor
-
onList
- Specified by:
onList
in interfaceExpressionVisitor
-
onAnyString
- Specified by:
onAnyString
in interfaceExpressionVisitor
-
onAttribute
- Specified by:
onAttribute
in interfaceExpressionVisitor
-
onElement
- Specified by:
onElement
in interfaceExpressionVisitor
-
toInt
-
merge
-
isError
It is an error if a pattern with data is combined to other patterns. -
onChoice
- Specified by:
onChoice
in interfaceExpressionVisitor
-
onConcur
- Specified by:
onConcur
in interfaceExpressionVisitor
-
onOneOrMore
- Specified by:
onOneOrMore
in interfaceExpressionVisitor
-
onMixed
- Specified by:
onMixed
in interfaceExpressionVisitor
-