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 Setset of checked Expressions.private final Mapset of checked ReferenceExps.private static final intprivate static final intprivate static final intprivate static final Integer[]integer pool implementation.private final TREXBaseReaderprivate final booleanIf 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 booleanIt is an error if a pattern with data is combined to other patterns.private static ObjectonAttribute(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:
onRefin interfaceExpressionVisitor
-
onOther
- Specified by:
onOtherin interfaceExpressionVisitor
-
onInterleave
- Specified by:
onInterleavein interfaceExpressionVisitor
-
onSequence
- Specified by:
onSequencein interfaceExpressionVisitor
-
onEpsilon
- Specified by:
onEpsilonin interfaceExpressionVisitor
-
onNullSet
- Specified by:
onNullSetin interfaceExpressionVisitor
-
onData
- Specified by:
onDatain interfaceExpressionVisitor
-
onValue
- Specified by:
onValuein interfaceExpressionVisitor
-
onList
- Specified by:
onListin interfaceExpressionVisitor
-
onAnyString
- Specified by:
onAnyStringin interfaceExpressionVisitor
-
onAttribute
- Specified by:
onAttributein interfaceExpressionVisitor
-
onElement
- Specified by:
onElementin interfaceExpressionVisitor
-
toInt
-
merge
-
isError
-
onChoice
- Specified by:
onChoicein interfaceExpressionVisitor
-
onConcur
- Specified by:
onConcurin interfaceExpressionVisitor
-
onOneOrMore
- Specified by:
onOneOrMorein interfaceExpressionVisitor
-
onMixed
- Specified by:
onMixedin interfaceExpressionVisitor
-