|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.stax2.validation.XMLValidator
com.ctc.wstx.msv.GenericMsvValidator
public final class GenericMsvValidator
Generic validator instance to be used for all Multi-Schema Validator backed implementations. A common class can be used since functionality is almost identical between variants (RNG, W3C SChema); minor differences that exist can be configured by settings provided.
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.
| Field Summary | |
|---|---|
protected ArrayList |
mAcceptors
|
protected org.codehaus.stax2.validation.ValidationContext |
mContext
|
protected com.sun.msv.verifier.Acceptor |
mCurrAcceptor
|
protected String |
mCurrAttrLocalName
|
protected String |
mCurrAttrPrefix
|
protected ElementIdMap |
mIdDefs
Map that contains information about element id (values of attributes or textual content with type ID) declarations and references |
protected org.codehaus.stax2.validation.XMLValidationSchema |
mParentSchema
|
protected org.codehaus.stax2.validation.XMLValidationProblem |
mProblem
Sometimes a problem object has to be temporarily stored, and only reported later on. |
protected TextAccumulator |
mTextAccumulator
|
protected com.sun.msv.verifier.DocumentDeclaration |
mVGM
|
| Fields inherited from class org.codehaus.stax2.validation.XMLValidator |
|---|
CONTENT_ALLOW_ANY_TEXT, CONTENT_ALLOW_NONE, CONTENT_ALLOW_UNDEFINED, CONTENT_ALLOW_VALIDATABLE_TEXT, CONTENT_ALLOW_WS, CONTENT_ALLOW_WS_NONSTRICT |
| Constructor Summary | |
|---|---|
GenericMsvValidator(org.codehaus.stax2.validation.XMLValidationSchema parent,
org.codehaus.stax2.validation.ValidationContext ctxt,
com.sun.msv.verifier.DocumentDeclaration vgm)
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class org.codehaus.stax2.validation.XMLValidator |
|---|
getSchemaType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.codehaus.stax2.validation.XMLValidationSchema mParentSchema
protected final org.codehaus.stax2.validation.ValidationContext mContext
protected final com.sun.msv.verifier.DocumentDeclaration mVGM
protected final ArrayList mAcceptors
protected com.sun.msv.verifier.Acceptor mCurrAcceptor
protected final TextAccumulator mTextAccumulator
protected ElementIdMap mIdDefs
protected String mCurrAttrPrefix
protected String mCurrAttrLocalName
protected org.codehaus.stax2.validation.XMLValidationProblem mProblem
| Constructor Detail |
|---|
public GenericMsvValidator(org.codehaus.stax2.validation.XMLValidationSchema parent,
org.codehaus.stax2.validation.ValidationContext ctxt,
com.sun.msv.verifier.DocumentDeclaration vgm)
| Method Detail |
|---|
public String getBaseUri()
getBaseUri in interface org.relaxng.datatype.ValidationContextpublic boolean isNotation(String notationName)
isNotation in interface org.relaxng.datatype.ValidationContextpublic boolean isUnparsedEntity(String entityName)
isUnparsedEntity in interface org.relaxng.datatype.ValidationContextpublic 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.IDContextProvider2IllegalArgumentExceptionpublic 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.XMLValidatorXMLStreamException
public String validateAttribute(String localName,
String uri,
String prefix,
String value)
throws XMLStreamException
validateAttribute in class org.codehaus.stax2.validation.XMLValidatorXMLStreamException
public String validateAttribute(String localName,
String uri,
String prefix,
char[] valueChars,
int valueStart,
int valueEnd)
throws XMLStreamException
validateAttribute in class org.codehaus.stax2.validation.XMLValidatorXMLStreamException
public int validateElementAndAttributes()
throws XMLStreamException
validateElementAndAttributes in class org.codehaus.stax2.validation.XMLValidatorXMLStreamException
public int validateElementEnd(String localName,
String uri,
String prefix)
throws XMLStreamException
validateElementEnd in class org.codehaus.stax2.validation.XMLValidatorXMLStreamException
public void validateText(String text,
boolean lastTextSegment)
throws XMLStreamException
validateText in class org.codehaus.stax2.validation.XMLValidatorXMLStreamException
public void validateText(char[] cbuf,
int textStart,
int textEnd,
boolean lastTextSegment)
throws XMLStreamException
validateText in class org.codehaus.stax2.validation.XMLValidatorXMLStreamException
public void validationCompleted(boolean eod)
throws XMLStreamException
validationCompleted in class org.codehaus.stax2.validation.XMLValidatorXMLStreamExceptionpublic String getAttributeType(int index)
getAttributeType in class org.codehaus.stax2.validation.XMLValidatorpublic int getIdAttrIndex()
getIdAttrIndex in class org.codehaus.stax2.validation.XMLValidatorpublic int getNotationAttrIndex()
getNotationAttrIndex in class org.codehaus.stax2.validation.XMLValidator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||