Package com.helger.schematron.pure.bound
Class PSBoundSchemaCacheKey
java.lang.Object
com.helger.schematron.pure.bound.PSBoundSchemaCacheKey
This class represents keys for the
PSBoundSchemaCache. It is a
combination of a resource and a phase. It is the responsible class for
reading and binding a Schematron resource.- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionPSBoundSchemaCacheKey(com.helger.commons.io.resource.IReadableResource aResource, String sPhase, IPSErrorHandler aErrorHandler, IPSValidationHandler aCustomValidationHandler, IXPathConfig aXPathConfig, EntityResolver aEntityResolver, boolean bLenient) -
Method Summary
Modifier and TypeMethodDescriptionThe main routine to create a bound schema from the passed resource and phase.createPreprocessedSchema(PSSchema aSchema, IPSQueryBinding aQueryBinding) Pre-process the read schema, using the determined query binding.createPreprocessor(IPSQueryBinding aQueryBinding) Create the pre-processor to be used forcreatePreprocessedSchema(PSSchema, IPSQueryBinding).booleanfinal IPSValidationHandlerfinal EntityResolverfinal IPSErrorHandlerfinal StringgetPhase()getQueryBinding(PSSchema aSchema) Determine the query binding for the read schema.final com.helger.commons.io.resource.IReadableResourcefinal IXPathConfiginthashCode()booleanreadSchema(com.helger.commons.io.resource.IReadableResource aResource, IPSErrorHandler aErrorHandler, EntityResolver aEntityResolver) Read the specified schema from the passed resource.toString()
-
Constructor Details
-
PSBoundSchemaCacheKey
public PSBoundSchemaCacheKey(@Nonnull com.helger.commons.io.resource.IReadableResource aResource, @Nullable String sPhase, @Nullable IPSErrorHandler aErrorHandler, @Nullable IPSValidationHandler aCustomValidationHandler, @Nonnull IXPathConfig aXPathConfig, @Nullable EntityResolver aEntityResolver, boolean bLenient)
-
-
Method Details
-
isLenient
public boolean isLenient() -
getResource
- Returns:
- The resource passed in the constructor. Never
null.
-
getPhase
- Returns:
- The phase selected in the constructor. May be
null.
-
getErrorHandler
- Returns:
- The error handler passed in the constructor. May be
null.
-
getCustomValidationHandler
- Returns:
- The custom validation handler. May be
null. - Since:
- 5.3.0
-
getXPathConfig
- Returns:
- The XPath configuration to be used. May be
null. - Since:
- 5.5.0
-
getEntityResolver
- Returns:
- The XML entity resolver to be used. May be
null.
-
readSchema
@Nonnull @OverrideOnDemand public PSSchema readSchema(@Nonnull com.helger.commons.io.resource.IReadableResource aResource, @Nullable IPSErrorHandler aErrorHandler, @Nullable EntityResolver aEntityResolver) throws com.helger.schematron.SchematronException Read the specified schema from the passed resource.- Parameters:
aResource- The resource to read from. Nevernull.aErrorHandler- The error handler to use. May benull.aEntityResolver- The XML entity resolver to be used. May benull.- Returns:
- The read schema. May not be
null. - Throws:
com.helger.schematron.SchematronException- In case there is an error reading.
-
getQueryBinding
@Nonnull @OverrideOnDemand public IPSQueryBinding getQueryBinding(@Nonnull PSSchema aSchema) throws com.helger.schematron.SchematronException Determine the query binding for the read schema.- Parameters:
aSchema- The read schema. Nevernull.- Returns:
- The query binding to use. Never
null. - Throws:
com.helger.schematron.SchematronException- In case the determination fails.
-
createPreprocessor
@Nonnull @OverrideOnDemand public PSPreprocessor createPreprocessor(@Nonnull IPSQueryBinding aQueryBinding) Create the pre-processor to be used forcreatePreprocessedSchema(PSSchema, IPSQueryBinding).- Parameters:
aQueryBinding- The query binding to be determined from the read schema. Nevernull.- Returns:
- The pre-processor to be used.
-
createPreprocessedSchema
@Nonnull @OverrideOnDemand public PSSchema createPreprocessedSchema(@Nonnull PSSchema aSchema, @Nonnull IPSQueryBinding aQueryBinding) throws com.helger.schematron.SchematronException Pre-process the read schema, using the determined query binding.- Parameters:
aSchema- The read schema. Nevernull.aQueryBinding- The determined query binding. Nevernull.- Returns:
- The pre-processed schema and never
null. - Throws:
com.helger.schematron.SchematronException- In case pre-processing fails
-
createBoundSchema
The main routine to create a bound schema from the passed resource and phase. The usual routine is to- read the schema from the resource - see
readSchema(IReadableResource, IPSErrorHandler, EntityResolver) - resolve the query binding - see
getQueryBinding(PSSchema) - pre-process the schema -
createPreprocessedSchema(PSSchema, IPSQueryBinding) - and finally bind it -
IPSQueryBinding.bind(PSSchema, String, IPSErrorHandler, IPSValidationHandler, IXPathConfig)
- Returns:
- The bound schema. Never
null. - Throws:
com.helger.schematron.SchematronException- In case reading or binding fails.
- read the schema from the resource - see
-
equals
-
hashCode
public int hashCode() -
toString
-