com.sun.msv.verifier.psvi

Class TypeDetector

Implemented Interfaces:
ContentHandler, DTDHandler, IDContextProvider2, IVerifier, ValidationContext, VerifierHandler

public class TypeDetector
extends Verifier

assign types to the incoming SAX2 events and reports them to the application handler through TypedContentHandler. This class "augment" infoset by adding type information. The application can receive augmented infoset by implementing TypedContentHandler.
Author:
Kohsuke KAWAGUCHI

Nested Class Summary

class
TypeDetector.AmbiguousDocumentException
signals that the document is ambiguous.

Field Summary

Fields inherited from class com.sun.msv.verifier.Verifier

ERR_DUPLICATE_ID, ERR_MISSING_ATTRIBUTE, ERR_UNCOMPLETED_CONTENT, ERR_UNEXPECTED_ATTRIBUTE, ERR_UNEXPECTED_ELEMENT, ERR_UNEXPECTED_STARTTAG, ERR_UNEXPECTED_TEXT, ERR_UNSOLD_IDREF

Constructor Summary

TypeDetector(DocumentDeclaration documentDecl, ErrorHandler errorHandler)
TypeDetector(DocumentDeclaration documentDecl, TypedContentHandler handler, ErrorHandler errorHandler)

Method Summary

void
characters(char[] buf, int start, int len)
void
endDocument()
void
endElement(String namespaceUri, String localName, String qName)
void
ignorableWhitespace(char[] buf, int start, int len)
void
setContentHandler(TypedContentHandler handler)
sets the TypedContentHandler which will received the type-augmented infoset.
void
startDocument()
void
startElement(String namespaceUri, String localName, String qName, Attributes atts)

Methods inherited from class com.sun.msv.verifier.Verifier

characters, endDocument, endElement, getCurrentElementType, getErrorHandler, getLastCharacterType, ignorableWhitespace, isValid, localizeMessage, onDuplicateId, setErrorHandler, setPanicMode, startDocument, startElement

Methods inherited from class com.sun.msv.verifier.AbstractVerifier

endElement, endPrefixMapping, getBaseUri, getLocator, isNotation, isUnparsedEntity, notationDecl, onID, processingInstruction, resolveNamespacePrefix, setDocumentLocator, skippedEntity, startElement, startPrefixMapping, unparsedEntityDecl

Constructor Details

TypeDetector

public TypeDetector(DocumentDeclaration documentDecl,
                    ErrorHandler errorHandler)

TypeDetector

public TypeDetector(DocumentDeclaration documentDecl,
                    TypedContentHandler handler,
                    ErrorHandler errorHandler)

Method Details

characters

public void characters(char[] buf,
                       int start,
                       int len)
            throws SAXException
Overrides:
characters in interface Verifier

endDocument

public void endDocument()
            throws SAXException
Overrides:
endDocument in interface Verifier

endElement

public void endElement(String namespaceUri,
                       String localName,
                       String qName)
            throws SAXException
Overrides:
endElement in interface Verifier

ignorableWhitespace

public void ignorableWhitespace(char[] buf,
                                int start,
                                int len)
            throws SAXException
Overrides:
ignorableWhitespace in interface Verifier

setContentHandler

public void setContentHandler(TypedContentHandler handler)
sets the TypedContentHandler which will received the type-augmented infoset.

startDocument

public void startDocument()
            throws SAXException
Overrides:
startDocument in interface Verifier

startElement

public void startElement(String namespaceUri,
                         String localName,
                         String qName,
                         Attributes atts)
            throws SAXException
Overrides:
startElement in interface Verifier