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 AssertionTreeBuilder
getAssertionTreeBuilder()
Get the tree builder used for XSD 1.1 assertion evaluationAttributeInheritor
getAttributeInheritor()
Get the AttributeInheritor, which keeps track of inherited attributes for use in conditional type assignment.protected ConstraintChecker
getConstraintChecker()
Get the constraint checker used in this pipelineController
getController()
Get the Controller used for this validation episodeprotected java.lang.String
getErrorCode()
int
getErrorCount()
Get the number of validation errors found during the validation episodeValidationFailure
getFirstFailure()
Get details of the first failure that was reportedLocation
getInitiatingLocation()
InvalidityHandler
getInvalidityHandler()
Get the callback for reporting validation errorsSequence
getValidationErrorObject()
Get the error object.ValidationParams
getValidationParams()
Get the validation parameters (as declared using saxon:param)SchemaType
getXSIType()
Get the value of the xsi:type attribute.boolean
hasValidationParams()
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(java.lang.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(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)
-
-