Package com.saxonica.ee.validate
Class ValidationContext
- java.lang.Object
-
- net.sf.saxon.lib.ConversionRules
-
- com.saxonica.ee.validate.ValidationContext
-
public class ValidationContext extends ConversionRules
This class defines information about a validation episode
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.lib.ConversionRules
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description ValidationContext(ConversionRules rules)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AssertionTreeBuildergetAssertionTreeBuilder()Get the tree builder used for XSD 1.1 assertion evaluationAttributeInheritorgetAttributeInheritor()Get the AttributeInheritor, which keeps track of inherited attributes for use in conditional type assignment.protected ConstraintCheckergetConstraintChecker()Get the constraint checker used in this pipelineControllergetController()Get the Controller used for this validation episodeprotected java.lang.StringgetErrorCode()intgetErrorCount()Get the number of validation errors found during the validation episodeValidationFailuregetFirstFailure()Get details of the first failure that was reportedLocationgetInitiatingLocation()InvalidityHandlergetInvalidityHandler()Get the callback for reporting validation errorsSequencegetValidationErrorObject()Get the error object.ValidationParamsgetValidationParams()Get the validation parameters (as declared using saxon:param)SchemaTypegetXSIType()Get the value of the xsi:type attribute.booleanhasValidationParams()Ask whether there are any validation parameters definedbooleanincrementErrorCount(ValidationFailure failure)Increment the count of validation errors foundvoidsetAssertionTreeBuilder(AssertionTreeBuilder assertionTreeBuilder)Set the tree builder used for XSD 1.1 assertion evaluationvoidsetAttributeInheritor(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 attributesvoidsetConstraintChecker(ConstraintChecker checker)Set the constraint checker used in this pipelinevoidsetController(Controller controller)Set the Controller used for this validation episodevoidsetErrorCode(java.lang.String errorCode)Set the error code to be used for error messagesvoidsetErrorLimit(int limit)Set a limit on the number of errors to be reported before validation is abandonedvoidsetInitiatingLocation(Location initiatingLocation)voidsetInvalidityHandler(InvalidityHandler invalidityHandler)Set the callback for reporting validation errorsvoidsetValidationParams(ValidationParams validationParams)Set the validation parameters (as declared using saxon:param)voidsetXSIType(SchemaType xsiType)Set the value of the xsi:type attribute.voidstartValidation(java.lang.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 Detail
-
ValidationContext
public ValidationContext(ConversionRules rules)
-
-
Method Detail
-
getController
public Controller getController()
Get the Controller used for this validation episode- Returns:
- the Controller
-
setController
public void setController(Controller controller)
Set the Controller used for this validation episode- Parameters:
controller- the controller to be used
-
getInvalidityHandler
public InvalidityHandler getInvalidityHandler()
Get the callback for reporting validation errors- Returns:
- the registered InvalidityHandler
-
setInvalidityHandler
public void setInvalidityHandler(InvalidityHandler invalidityHandler)
Set the callback for reporting validation errors- Parameters:
invalidityHandler- the InvalidityHandler to be used for reporting validation failures
-
getAssertionTreeBuilder
public AssertionTreeBuilder getAssertionTreeBuilder()
Get the tree builder used for XSD 1.1 assertion evaluation- Returns:
- the tree builder used for assertions
-
setAssertionTreeBuilder
public void setAssertionTreeBuilder(AssertionTreeBuilder assertionTreeBuilder)
Set the tree builder used for XSD 1.1 assertion evaluation- Parameters:
assertionTreeBuilder- the tree builder used for assertions
-
startValidation
public void startValidation(java.lang.String systemId)
-
getValidationErrorObject
public Sequence 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
public ValidationParams 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
public void setValidationParams(ValidationParams validationParams)
Set the validation parameters (as declared using saxon:param)- Parameters:
validationParams- the validation parameter values. May be null if none are required.
-
setConstraintChecker
public void setConstraintChecker(ConstraintChecker checker)
Set the constraint checker used in this pipeline- Parameters:
checker- the constraint checker
-
getConstraintChecker
protected ConstraintChecker getConstraintChecker()
Get the constraint checker used in this pipeline- Returns:
- the constraint checker
-
setAttributeInheritor
public void 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 attributes- Parameters:
inheritor- the namespace resolver
-
getAttributeInheritor
public AttributeInheritor getAttributeInheritor()
Get the AttributeInheritor, which keeps track of inherited attributes for use in conditional type assignment.- Returns:
- the AttributeInheritor
-
setXSIType
public void setXSIType(SchemaType xsiType)
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
public SchemaType 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
public void setErrorCode(java.lang.String errorCode)
Set the error code to be used for error messages- Parameters:
errorCode- the error code
-
getErrorCode
protected java.lang.String 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
public boolean incrementErrorCount(ValidationFailure failure)
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
public ValidationFailure 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
public Location getInitiatingLocation()
-
setInitiatingLocation
public void setInitiatingLocation(Location initiatingLocation)
-
-