com.saxonica.validate
Class ValidatingFilter
java.lang.Object
net.sf.saxon.event.SequenceReceiver
net.sf.saxon.event.ProxyReceiver
com.saxonica.validate.ValidatingFilter
- All Implemented Interfaces:
- Result, Receiver
- Direct Known Subclasses:
- ContentValidator, ValidationStack, XSIAttributeHandler
public class ValidatingFilter
- extends ProxyReceiver
This class is used for a filter on the validation pipeline. It provides error reporting services to each
of the filters.
Methods inherited from class net.sf.saxon.event.ProxyReceiver |
append, attribute, characters, close, comment, endDocument, endElement, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument, startElement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidatingFilter
public ValidatingFilter()
setErrorCode
public void setErrorCode(String errorCode)
- Set the error code to be used for error messages
- Parameters:
errorCode
- the error code
getErrorCode
protected String getErrorCode()
setInvalidity
protected void setInvalidity(int invalidity)
- Set invalidity level
- Parameters:
invalidity
- one of: 0=valid, 1=invalid but validation can continue, 2=structurally invalid
getInvalidity
protected int getInvalidity()
isInvalid
protected boolean isInvalid()
usesTypeAnnotations
public boolean usesTypeAnnotations()
- Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations
supplied on element and attribute events
- Specified by:
usesTypeAnnotations
in interface Receiver
- Overrides:
usesTypeAnnotations
in class ProxyReceiver
- Returns:
- true if the Receiver makes any use of this information. If false, the caller
may supply untyped nodes instead of supplying the type annotation. Validation
filters overwrite any type annotations arriving in the input event stream,
so this instance of the method returns false.
reportValidationError
protected void reportValidationError(ValidationException err,
boolean issueComment,
int locationId,
int severity)
throws XPathException
- Report a validation error
- Parameters:
err
- The validation exceptionissueComment
- true if the validation error message is to be written as an XML comment to the
result documentlocationId
- identifies the location in the source document or stylesheet/query where the
validation error was detectedseverity
- 1=validation can continue, 2=validation of children and siblings should stop
- Throws:
XPathException
reportIfInvalid
protected void reportIfInvalid()
throws ValidationException
- Throws:
ValidationException
Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.