Package com.saxonica.ee.validate
Class ValidationContext
java.lang.Object
net.sf.saxon.lib.ConversionRules
com.saxonica.ee.validate.ValidationContext
This class defines information about a validation episode
-
Field Summary
Fields inherited from class net.sf.saxon.lib.ConversionRules
DEFAULT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the tree builder used for XSD 1.1 assertion evaluationGet the AttributeInheritor, which keeps track of inherited attributes for use in conditional type assignment.protected ConstraintChecker
Get the constraint checker used in this pipelineGet the Controller used for this validation episodeprotected String
int
Get the number of validation errors found during the validation episodeGet details of the first failure that was reportedGet the callback for reporting validation errorsGet the error object.Get the validation parameters (as declared using saxon:param)Get the value of the xsi:type attribute.boolean
Ask whether there are any validation parameters definedboolean
incrementErrorCount
(ValidationFailure failure) Increment the count of validation errors foundvoid
setAssertionTreeBuilder
(AssertionTreeBuilder assertionTreeBuilder) Set the tree builder used for XSD 1.1 assertion evaluationvoid
setAttributeInheritor
(AttributeInheritor inheritor) Set the StartTagBuffer, which buffers attributes on the element start tag, and also acts as the namespaceResolver to be used for resolving QName-valued attributesvoid
setConstraintChecker
(ConstraintChecker checker) Set the constraint checker used in this pipelinevoid
setController
(Controller controller) Set the Controller used for this validation episodevoid
setErrorCode
(String errorCode) Set the error code to be used for error messagesvoid
setErrorLimit
(int limit) Set a limit on the number of errors to be reported before validation is abandonedvoid
setInitiatingLocation
(Location initiatingLocation) void
setInvalidityHandler
(InvalidityHandler invalidityHandler) Set the callback for reporting validation errorsvoid
setValidationParams
(ValidationParams validationParams) Set the validation parameters (as declared using saxon:param)void
setXSIType
(SchemaType xsiType) Set the value of the xsi:type attribute.void
startValidation
(String systemId) Methods inherited from class net.sf.saxon.lib.ConversionRules
copy, copyTo, getConverter, getStringToDoubleConverter, isAllowYearZero, isDeclaredNotation, isValidURI, makeStringConverter, setAllowYearZero, setNotationSet, setStringToDoubleConverter, setTypeHierarchy, setURIChecker
-
Constructor Details
-
ValidationContext
-
-
Method Details
-
getController
Get the Controller used for this validation episode- Returns:
- the Controller
-
setController
Set the Controller used for this validation episode- Parameters:
controller
- the controller to be used
-
getInvalidityHandler
Get the callback for reporting validation errors- Returns:
- the registered InvalidityHandler
-
setInvalidityHandler
Set the callback for reporting validation errors- Parameters:
invalidityHandler
- the InvalidityHandler to be used for reporting validation failures
-
getAssertionTreeBuilder
Get the tree builder used for XSD 1.1 assertion evaluation- Returns:
- the tree builder used for assertions
-
setAssertionTreeBuilder
Set the tree builder used for XSD 1.1 assertion evaluation- Parameters:
assertionTreeBuilder
- the tree builder used for assertions
-
startValidation
-
getValidationErrorObject
Get the error object. If an InvalidityReportGenerator was set as the InvalidityHandler, this will be supplied by the InvalidityHandler. The resulting value is accessible as the value of the $err:value variable within a catch clause. -
getValidationParams
Get the validation parameters (as declared using saxon:param)- Returns:
- the validation parameter values. May be null if none have been defined
-
hasValidationParams
public boolean hasValidationParams()Ask whether there are any validation parameters defined- Returns:
- true if one or more validation paameters are defined
-
setValidationParams
Set the validation parameters (as declared using saxon:param)- Parameters:
validationParams
- the validation parameter values. May be null if none are required.
-
setConstraintChecker
Set the constraint checker used in this pipeline- Parameters:
checker
- the constraint checker
-
getConstraintChecker
Get the constraint checker used in this pipeline- Returns:
- the constraint checker
-
setAttributeInheritor
Set the StartTagBuffer, which buffers attributes on the element start tag, and also acts as the namespaceResolver to be used for resolving QName-valued attributes- Parameters:
inheritor
- the namespace resolver
-
getAttributeInheritor
Get the AttributeInheritor, which keeps track of inherited attributes for use in conditional type assignment.- Returns:
- the AttributeInheritor
-
setXSIType
Set the value of the xsi:type attribute. This is called immediately before the call of startElement on which the xsi:type attribute appears.- Parameters:
xsiType
- the schema type identified by the xsi:type attribute
-
getXSIType
Get the value of the xsi:type attribute. This is called immediately before the call of startElement on which the xsi:type attribute appears.- Returns:
- the schema type identified by the xsi:type attribute
-
setErrorCode
Set the error code to be used for error messages- Parameters:
errorCode
- the error code
-
getErrorCode
-
setErrorLimit
public void setErrorLimit(int limit) Set a limit on the number of errors to be reported before validation is abandoned- Parameters:
limit
- the limit on the number of errors
-
incrementErrorCount
Increment the count of validation errors found- Parameters:
failure
- the invalidity that was found- Returns:
- true if the limit on the number of errors has been exceeded, otherwise false
-
getFirstFailure
Get details of the first failure that was reported- Returns:
- the first failure reported, if any; otherwise null
-
getErrorCount
public int getErrorCount()Get the number of validation errors found during the validation episode- Returns:
- the number of errors
-
getInitiatingLocation
-
setInitiatingLocation
-