use of com.helger.schematron.pure.bound.PSBoundSchemaCacheKey in project ph-schematron by phax.
the class SchematronResourcePure method createBoundSchema.
@Nonnull
protected IPSBoundSchema createBoundSchema() {
final IReadableResource aResource = getResource();
final IPSErrorHandler aErrorHandler = getErrorHandler();
final PSBoundSchemaCacheKey aCacheKey = new PSBoundSchemaCacheKey(aResource, getPhase(), aErrorHandler, getVariableResolver(), getFunctionResolver(), getEntityResolver());
if (aResource instanceof AbstractMemoryReadableResource || !isUseCache()) {
// No need to cache anything for memory resources
try {
return aCacheKey.createBoundSchema();
} catch (final SchematronException ex) {
// Convert to runtime exception
throw new IllegalStateException("Failed to bind Schematron", ex);
}
}
// happens
return PSBoundSchemaCache.getInstance().getFromCache(aCacheKey);
}
Aggregations