public final class GenericMsvValidator
extends org.codehaus.stax2.validation.XMLValidator
implements com.sun.msv.grammar.IDContextProvider2
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.
Constructor and Description |
---|
GenericMsvValidator(org.codehaus.stax2.validation.XMLValidationSchema parent,
org.codehaus.stax2.validation.ValidationContext ctxt,
com.sun.msv.verifier.DocumentDeclaration vgm) |
Modifier and Type | Method and Description |
---|---|
String |
getAttributeType(int index) |
String |
getBaseUri() |
int |
getIdAttrIndex() |
int |
getNotationAttrIndex() |
org.codehaus.stax2.validation.XMLValidationSchema |
getSchema() |
boolean |
isNotation(String notationName) |
boolean |
isUnparsedEntity(String entityName) |
void |
onID(org.relaxng.datatype.Datatype datatype,
com.sun.msv.verifier.regexp.StringToken idToken)
Note: we have to throw a dummy marker exception, which merely
signals that a validation problem is to be reported.
|
String |
resolveNamespacePrefix(String prefix) |
String |
validateAttribute(String localName,
String uri,
String prefix,
char[] valueChars,
int valueStart,
int valueEnd) |
String |
validateAttribute(String localName,
String uri,
String prefix,
String value) |
int |
validateElementAndAttributes() |
int |
validateElementEnd(String localName,
String uri,
String prefix) |
void |
validateElementStart(String localName,
String uri,
String prefix)
Method called to update information about the newly encountered (start)
element.
|
void |
validateText(char[] cbuf,
int textStart,
int textEnd,
boolean lastTextSegment) |
void |
validateText(String text,
boolean lastTextSegment) |
void |
validationCompleted(boolean eod) |
public GenericMsvValidator(org.codehaus.stax2.validation.XMLValidationSchema parent, org.codehaus.stax2.validation.ValidationContext ctxt, com.sun.msv.verifier.DocumentDeclaration vgm)
public String getBaseUri()
getBaseUri
in interface org.relaxng.datatype.ValidationContext
public boolean isNotation(String notationName)
isNotation
in interface org.relaxng.datatype.ValidationContext
public boolean isUnparsedEntity(String entityName)
isUnparsedEntity
in interface org.relaxng.datatype.ValidationContext
public String resolveNamespacePrefix(String prefix)
resolveNamespacePrefix
in interface org.relaxng.datatype.ValidationContext
public void onID(org.relaxng.datatype.Datatype datatype, com.sun.msv.verifier.regexp.StringToken idToken) throws IllegalArgumentException
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.
onID
in interface com.sun.msv.grammar.IDContextProvider2
IllegalArgumentException
public org.codehaus.stax2.validation.XMLValidationSchema getSchema()
getSchema
in class org.codehaus.stax2.validation.XMLValidator
public void validateElementStart(String localName, String uri, String prefix) throws XMLStreamException
validateElementStart
in class org.codehaus.stax2.validation.XMLValidator
XMLStreamException
public String validateAttribute(String localName, String uri, String prefix, String value) throws XMLStreamException
validateAttribute
in class org.codehaus.stax2.validation.XMLValidator
XMLStreamException
public String validateAttribute(String localName, String uri, String prefix, char[] valueChars, int valueStart, int valueEnd) throws XMLStreamException
validateAttribute
in class org.codehaus.stax2.validation.XMLValidator
XMLStreamException
public int validateElementAndAttributes() throws XMLStreamException
validateElementAndAttributes
in class org.codehaus.stax2.validation.XMLValidator
XMLStreamException
public int validateElementEnd(String localName, String uri, String prefix) throws XMLStreamException
validateElementEnd
in class org.codehaus.stax2.validation.XMLValidator
XMLStreamException
public void validateText(String text, boolean lastTextSegment) throws XMLStreamException
validateText
in class org.codehaus.stax2.validation.XMLValidator
XMLStreamException
public void validateText(char[] cbuf, int textStart, int textEnd, boolean lastTextSegment) throws XMLStreamException
validateText
in class org.codehaus.stax2.validation.XMLValidator
XMLStreamException
public void validationCompleted(boolean eod) throws XMLStreamException
validationCompleted
in class org.codehaus.stax2.validation.XMLValidator
XMLStreamException
public String getAttributeType(int index)
getAttributeType
in class org.codehaus.stax2.validation.XMLValidator
public int getIdAttrIndex()
getIdAttrIndex
in class org.codehaus.stax2.validation.XMLValidator
public int getNotationAttrIndex()
getNotationAttrIndex
in class org.codehaus.stax2.validation.XMLValidator
Copyright © 2012–2015 FasterXML. All rights reserved.