|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAbstractVerifier
org.biojava.dasobert.das.validation.RegVerifier
public class RegVerifier
SAX ContentHandler that verifies incoming SAX event stream. This object can be reused to validate multiple documents. Just be careful NOT to use the same object to validate more than one documents at the same time.
| Nested Class Summary | |
|---|---|
static class |
RegVerifier.BadAttribute
Bad attribute. |
| Field Summary | |
|---|---|
protected Acceptor |
current
|
protected DocumentDeclaration |
docDecl
Schema object against which the validation will be done |
static String |
ERR_DUPLICATE_ID
|
static String |
ERR_MISSING_ATTRIBUTE
|
static String |
ERR_UNCOMPLETED_CONTENT
|
static String |
ERR_UNEXPECTED_ATTRIBUTE
|
static String |
ERR_UNEXPECTED_ELEMENT
|
static String |
ERR_UNEXPECTED_STARTTAG
|
static String |
ERR_UNEXPECTED_TEXT
|
static String |
ERR_UNSOLD_IDREF
|
protected ErrorHandler |
errorHandler
Error handler |
protected boolean |
hadError
This flag will be set to true if an error is found |
protected int |
panicLevel
Panic level. |
| Constructor Summary | |
|---|---|
RegVerifier(DocumentDeclaration documentDecl,
ErrorHandler errorHandler)
|
|
| Method Summary | |
|---|---|
void |
characters(char[] buf,
int start,
int len)
|
void |
endDocument()
|
void |
endElement(String namespaceUri,
String localName,
String qName)
|
protected Datatype[] |
feedAttribute(Acceptor child,
String uri,
String localName,
String qName,
String value)
|
Object |
getCurrentElementType()
|
ErrorHandler |
getErrorHandler()
|
Datatype[] |
getLastCharacterType()
|
void |
ignorableWhitespace(char[] buf,
int start,
int len)
|
protected void |
init()
|
boolean |
isValid()
|
static String |
localizeMessage(String propertyName,
Object[] args)
|
void |
onDuplicateId(String id)
|
protected ValidityViolation |
onError(String msg,
ErrorInfo ei)
|
protected ValidityViolation |
onError(StringRef ref,
String defaultMsg,
ErrorInfo ei)
signals an error. |
protected void |
onNextAcceptorReady(StartTagInfo sti,
Acceptor nextAcceptor)
this method is called from the startElement method after the tag name is processed and the child acceptor is created. |
void |
setErrorHandler(ErrorHandler handler)
|
void |
setPanicMode(boolean usePanicMode)
|
void |
startDocument()
|
void |
startElement(String namespaceUri,
String localName,
String qName,
Attributes atts)
|
protected void |
verifyText()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Acceptor current
protected ErrorHandler errorHandler
protected boolean hadError
protected final DocumentDeclaration docDecl
protected int panicLevel
public static final String ERR_UNEXPECTED_TEXT
public static final String ERR_UNEXPECTED_ATTRIBUTE
public static final String ERR_MISSING_ATTRIBUTE
public static final String ERR_UNEXPECTED_STARTTAG
public static final String ERR_UNCOMPLETED_CONTENT
public static final String ERR_UNEXPECTED_ELEMENT
public static final String ERR_UNSOLD_IDREF
public static final String ERR_DUPLICATE_ID
| Constructor Detail |
|---|
public RegVerifier(DocumentDeclaration documentDecl,
ErrorHandler errorHandler)
| Method Detail |
|---|
public final ErrorHandler getErrorHandler()
public final void setErrorHandler(ErrorHandler handler)
public final boolean isValid()
public final void setPanicMode(boolean usePanicMode)
public Datatype[] getLastCharacterType()
protected void verifyText()
throws SAXException
SAXException
public void startElement(String namespaceUri,
String localName,
String qName,
Attributes atts)
throws SAXException
SAXException
protected void onNextAcceptorReady(StartTagInfo sti,
Acceptor nextAcceptor)
throws SAXException
This method is called before the attributes are consumed.
derived class can use this method to do something useful.
SAXException
protected Datatype[] feedAttribute(Acceptor child,
String uri,
String localName,
String qName,
String value)
throws SAXException
SAXException
public void endElement(String namespaceUri,
String localName,
String qName)
throws SAXException
SAXException
protected ValidityViolation onError(StringRef ref,
String defaultMsg,
ErrorInfo ei)
throws SAXException
SAXException
protected ValidityViolation onError(String msg,
ErrorInfo ei)
throws SAXException
SAXExceptionpublic Object getCurrentElementType()
public void characters(char[] buf,
int start,
int len)
throws SAXException
SAXException
public void ignorableWhitespace(char[] buf,
int start,
int len)
throws SAXException
SAXExceptionprotected void init()
public void startDocument()
throws SAXException
SAXException
public void endDocument()
throws SAXException
SAXExceptionpublic void onDuplicateId(String id)
public static String localizeMessage(String propertyName,
Object[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||