Note about id context provider interface: while it'd be nice to separate that part out, it is unfortunately closely tied to the validation process. Hence it's directly implemented by this class.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ArrayList | |
| pack-priv final AttributeProxy | mAttributeProxy
This object provides limited access to attribute values of the currently validated element. |
| pack-priv final ValidationContext | |
| pack-priv Acceptor | |
| pack-priv String | |
| pack-priv String | |
| pack-priv final StringRef | |
| pack-priv ElementIdMap | mIdDefs
Map that contains information about element id (values of attributes or textual content with type ID) declarations and references |
| pack-priv final XMLValidationSchema | |
| pack-priv XMLValidationProblem | mProblem
Sometimes a problem object has to be temporarily stored, and only reported later on. |
| pack-priv final StartTagInfo | mStartTag
StartTagInfo instance need not be thread-safe, and it is not immutable so let's reuse one instance during a single validation. |
| protected String | mStartTagPrefix
Since `StartTagInfo` has no place for prefix, hold reference to one here |
| pack-priv final TextAccumulator | |
| pack-priv final DocumentDeclaration |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| private QName | |
| private QName | |
| pack-priv void | |
| public String | getAttributeType(int index)
Implements abstract org. Method for getting schema-specified type of an attribute, if information is available. |
| pack-priv PrefixedName | |
| public String | getBaseUri()
Implements org. Returns the base URI of the context. |
| pack-priv PrefixedName | |
| public int | getIdAttrIndex()
Implements abstract org. Method for finding out the index of the attribute that is of type ID; derived from DTD, W4C Schema, or some other validation source. |
| public int | getNotationAttrIndex()
Implements abstract org. Method for finding out the index of the attribute (collected using the attribute collector; having DTD/Schema-derived info in same order) that is of type NOTATION. |
| public XMLValidationSchema | getSchema()
Implements abstract org. Returns the schema instance that created this validator object, if known (and applicable). |
| public boolean | isNotation(String notationName)
Implements org. Checks if a notation is declared with the specified name. |
| public boolean | isUnparsedEntity(String entityName)
Implements org. Checks if an unparsed entity is declared with the specified name. |
| public void | onID(Datatype datatype, StringToken idToken)
Implements com. Note we have to throw a dummy marker exception, which merely signals that a validation problem is to be reported. |
| private void | |
| private void | |
| private void | |
| public String | resolveNamespacePrefix(String prefix)
Implements org. Resolves a namespace prefix to the corresponding namespace URI. |
| public String | validateAttribute(String localName, String uri, String prefix, String value)
Implements abstract org. Callback method called on validator to give it a chance to validate the value of an attribute, as well as to normalize its value if appropriate (remove leading/trailing/intervening white space for certain token types etc.). |
| public String | validateAttribute(String localName, String uri, String prefix, char[]
Character array that contains value (possibly
along with some other text) valueChars, int Index of the first character of the value in
in valueStart, int valueChars arrayIndex of the character AFTER the last character;
so that the length of the value String is
valueEnd)valueEnd - valueStartImplements abstract org. Callback method called on validator to give it a chance to validate the value of an attribute, as well as to normalize its value if appropriate (remove leading/trailing/intervening white space for certain token types etc.). |
| public int | validateElementAndAttributes()
Implements abstract org. Method called after calling |
| public int | Returns: Validation state that should be effective for the parent element stateImplements abstract org. Method called right after encountering an element close tag. |
| public void | validateElementStart(String localName, String uri, String prefix)
Implements abstract org. Method called to update information about the newly encountered (start) element. |
| public void | validateText(String
Text content to validate text, boolean Whether this text content is the last text
segment before a close element; true if it is, false if it is not,
or no determination can be made. Can be used for optimizing
validation -- if this is true, no text needs to be buffered since
no more will be sent before the current element closes. lastTextSegment)Implements abstract org. Method called to validate textual content. |
| public void | validateText(char[]
Character array that contains text content to validate cbuf, int Index of the first character of the content to
validate textStart, int Character following the last character of the
content to validate (that is, length of content to validate is
textEnd, boolean textEnd - textStart).Whether this text content is the last text
segment before a close element; true if it is, false if it is not,
or no determination can be made. Can be used for optimizing
validation -- if this is true, no text needs to be buffered since
no more will be sent before the current element closes. lastTextSegment)Implements abstract org. Method called to validate textual content. |
| public void | validationCompleted(boolean
Flag that indicates whether this method was called by the
context due to the end of the stream (true); or by an application
requesting end of validation (false). eod)Implements abstract org. Method called when the validation is completed; either due to the input stream ending, or due to an explicit 'stop validation' request by the application (via context object). |
| mAcceptors | back to summary |
|---|---|
| pack-priv final ArrayList<Object> mAcceptors | |
| mAttributeProxy | back to summary |
|---|---|
| pack-priv final AttributeProxy mAttributeProxy This object provides limited access to attribute values of the currently validated element. | |
| mContext | back to summary |
|---|---|
| pack-priv final ValidationContext mContext | |
| mCurrAcceptor | back to summary |
|---|---|
| pack-priv Acceptor mCurrAcceptor | |
| mCurrAttrLocalName | back to summary |
|---|---|
| pack-priv String mCurrAttrLocalName | |
| mCurrAttrPrefix | back to summary |
|---|---|
| pack-priv String mCurrAttrPrefix | |
| mErrorRef | back to summary |
|---|---|
| pack-priv final StringRef mErrorRef | |
| mIdDefs | back to summary |
|---|---|
| pack-priv ElementIdMap mIdDefs Map that contains information about element id (values of attributes or textual content with type ID) declarations and references | |
| mParentSchema | back to summary |
|---|---|
| pack-priv final XMLValidationSchema mParentSchema | |
| mProblem | back to summary |
|---|---|
| pack-priv XMLValidationProblem mProblem Sometimes a problem object has to be temporarily stored, and only reported later on. This happens when exceptions can not be thrown via code outside of Woodstox (like validation methods in MSV that do callbacks). | |
| mStartTag | back to summary |
|---|---|
| pack-priv final StartTagInfo mStartTag StartTagInfo instance need not be thread-safe, and it is not immutable so let's reuse one instance during a single validation. | |
| mStartTagPrefix | back to summary |
|---|---|
| protected String mStartTagPrefix Since `StartTagInfo` has no place for prefix, hold reference to one here | |
| mTextAccumulator | back to summary |
|---|---|
| pack-priv final TextAccumulator mTextAccumulator | |
| mVGM | back to summary |
|---|---|
| pack-priv final DocumentDeclaration mVGM | |
| GenericMsvValidator | back to summary |
|---|---|
| public GenericMsvValidator(XMLValidationSchema parent, ValidationContext ctxt, DocumentDeclaration vgm) | |
| _name | back to summary |
|---|---|
| private String _name(QName qn, String prefix, String suffix) | |
| _qname | back to summary |
|---|---|
| private QName _qname(String ns, String local, String prefix) | |
| _startTagAsQName | back to summary |
|---|---|
| private QName _startTagAsQName() | |
| doValidateText | back to summary |
|---|---|
| pack-priv void doValidateText(TextAccumulator textAcc) throws XMLStreamException | |
| getAttributeType | back to summary |
|---|---|
| public String getAttributeType(int index) Implements abstract org. Doc from org. Method for getting schema-specified type of an attribute, if information is available. If not, validators can return null to explicitly indicate no information was available.
| |
| getAttrPName | back to summary |
|---|---|
| pack-priv PrefixedName getAttrPName() | |
| getBaseUri | back to summary |
|---|---|
| public String getBaseUri() Implements org. Doc from org. Returns the base URI of the context. The null string may be returned if no base URI is known.
| |
| getElementPName | back to summary |
|---|---|
| pack-priv PrefixedName getElementPName() | |
| getIdAttrIndex | back to summary |
|---|---|
| public int getIdAttrIndex() Implements abstract org. Doc from org. Method for finding out the index of the attribute that is of type ID; derived from DTD, W4C Schema, or some other validation source. Usually schemas explicitly specifies that at most one attribute can have this type for any element.
| |
| getNotationAttrIndex | back to summary |
|---|---|
| public int getNotationAttrIndex() Implements abstract org. Doc from org. Method for finding out the index of the attribute (collected using the attribute collector; having DTD/Schema-derived info in same order) that is of type NOTATION. DTD explicitly specifies that at most one attribute can have this type for any element.
| |
| getSchema | back to summary |
|---|---|
| public XMLValidationSchema getSchema() Implements abstract org. Doc from org. Returns the schema instance that created this validator
object, if known (and applicable). May return null for
some instances: specifically,
| |
| isNotation | back to summary |
|---|---|
| public boolean isNotation(String notationName) Implements org. Doc from org. Checks if a notation is declared with the specified name.
| |
| isUnparsedEntity | back to summary |
|---|---|
| public boolean isUnparsedEntity(String entityName) Implements org. Doc from org. Checks if an unparsed entity is declared with the specified name.
| |
| onID | back to summary |
|---|---|
| public void onID(Datatype datatype, StringToken idToken) throws IllegalArgumentException Implements com. Note we have to throw a dummy marker exception, which merely signals that a validation problem is to be reported. This is obviously messy, but has to do for now.
| |
| reportError | back to summary |
|---|---|
| private void reportError(StringRef errorRef, int type, QName name) throws XMLStreamException | |
| reportError | back to summary |
|---|---|
| private void reportError(String msg) throws XMLStreamException | |
| reportError | back to summary |
|---|---|
| private void reportError(String msg, Location loc) throws XMLStreamException | |
| resolveNamespacePrefix | back to summary |
|---|---|
| public String resolveNamespacePrefix(String prefix) Implements org. Doc from org. Resolves a namespace prefix to the corresponding namespace URI. This method is used for validating the QName type, for example. If the prefix is "" (empty string), it indicates an unprefixed value. The callee should resolve it as for an unprefixed element, rather than for an unprefixed attribute. If the prefix is "xml", then the callee must resolve this prefix into "http://www.w3.org/XML/1998/namespace", as defined in the XML Namespaces Recommendation. | |
| validateAttribute | back to summary |
|---|---|
| public String validateAttribute(String localName, String uri, String prefix, String value) throws XMLStreamException Implements abstract org. Doc from org. Callback method called on validator to give it a chance to validate the value of an attribute, as well as to normalize its value if appropriate (remove leading/trailing/intervening white space for certain token types etc.).
| |
| validateAttribute | back to summary |
|---|---|
| public String validateAttribute(String localName, String uri, String prefix, char[] valueChars, int valueStart, int valueEnd) throws XMLStreamException Implements abstract org. Doc from org. Callback method called on validator to give it a chance to validate the value of an attribute, as well as to normalize its value if appropriate (remove leading/trailing/intervening white space for certain token types etc.).
| |
| validateElementAndAttributes | back to summary |
|---|---|
| public int validateElementAndAttributes() throws XMLStreamException Implements abstract org. Doc from org. Method called after calling
| |
| validateElementEnd | back to summary |
|---|---|
| public int validateElementEnd(String localName, String uri, String prefix) throws XMLStreamException Implements abstract org. Doc from org. Method called right after encountering an element close tag.
| |
| validateElementStart | back to summary |
|---|---|
| public void validateElementStart(String localName, String uri, String prefix) throws XMLStreamException Implements abstract org. Method called to update information about the newly encountered (start) element. At this point namespace information has been resolved, but no DTD validation has been done. Validator is to do these validations, including checking for attribute value (and existence) compatibility.
| |
| validateText | back to summary |
|---|---|
| public void validateText(String text, boolean lastTextSegment) throws XMLStreamException Implements abstract org. Doc from org. Method called to validate textual content. Note this method is only guaranteed to be called when
| |
| validateText | back to summary |
|---|---|
| public void validateText(char[] cbuf, int textStart, int textEnd, boolean lastTextSegment) throws XMLStreamException Implements abstract org. Doc from org. Method called to validate textual content. Note this method is only guaranteed to be called when
| |
| validationCompleted | back to summary |
|---|---|
| public void validationCompleted(boolean eod) throws XMLStreamException Implements abstract org. Doc from org. Method called when the validation is completed; either due to the input stream ending, or due to an explicit 'stop validation' request by the application (via context object).
| |