XMLValidator
instances. Since the class itself implements XMLValidator,
multiple validators can be added by chaining these pairs; ordering
of validator calls depends on ordering of the pairs.
Default semantics are quite simple: first validator of the pair is always called first, and results as/if modified by that validator are passed on to the second validator.
It is expected that this class is mostly used by actual stream reader and writer implementations; not so much by validator implementations.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| protected XMLValidator | |
| protected XMLValidator |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| private boolean | |
| public String | getAttributeType(int index)
Implements abstract org. |
| public int | getIdAttrIndex()
Implements abstract org. |
| public int | getNotationAttrIndex()
Implements abstract org. |
| public XMLValidationSchema | getSchema()
Implements abstract org. |
| public static boolean | |
| public static boolean | |
| public String | validateAttribute(String localName, String uri, String prefix, String value)
Implements abstract org. |
| 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. |
| public int | validateElementAndAttributes()
Implements abstract org. validateAttribute on all
attributes (if any), but before starting to handle element
content.
|
| public int | validateElementEnd(String localName, String uri, String prefix)
Implements abstract org. |
| public void | validateElementStart(String localName, String uri, String prefix)
Implements abstract org. |
| 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. |
| 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. |
| 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. |
| ATTR_TYPE_DEFAULT | back to summary |
|---|---|
| public static final String ATTR_TYPE_DEFAULT | |
| mFirst | back to summary |
|---|---|
| protected XMLValidator mFirst | |
| mSecond | back to summary |
|---|---|
| protected XMLValidator mSecond | |
| ValidatorPair | back to summary |
|---|---|
| public ValidatorPair(XMLValidator first, XMLValidator second) | |
| doRemoveValidator | back to summary |
|---|---|
| private boolean doRemoveValidator(XMLValidationSchema schema, XMLValidator[] results) | |
| doRemoveValidator | back to summary |
|---|---|
| private boolean doRemoveValidator(XMLValidator vld, XMLValidator[] results) | |
| 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.
| |
| 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. Two choices here; could either return schema of the first child, or return null. Let's do latter, do avoid accidental matches.
| |
| removeValidator | back to summary |
|---|---|
| public static boolean removeValidator(XMLValidator root, XMLValidationSchema schema, XMLValidator[] results) | |
| removeValidator | back to summary |
|---|---|
| public static boolean removeValidator(XMLValidator root, XMLValidator vld, XMLValidator[] results) | |
| 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.
| |
| 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).
| |