@ThreadSafe public class SchemaCache extends com.helger.commons.cache.Cache<com.helger.commons.collection.impl.ICommonsList<? extends com.helger.commons.io.resource.IReadableResource>,Schema>
Schema objects. A Schema is
immutable and can therefore safely be used in multi-threaded environments.| Constructor and Description |
|---|
SchemaCache(String sSchemaTypeName,
SchemaFactory aSchemaFactory,
ErrorHandler aErrorHandler,
LSResourceResolver aResourceResolver) |
| Modifier and Type | Method and Description |
|---|---|
static Schema |
createSchema(SchemaFactory aSchemaFactory,
String sSchemaTypeName,
com.helger.commons.collection.impl.ICommonsList<? extends com.helger.commons.io.resource.IReadableResource> aResources) |
ErrorHandler |
getErrorHandler() |
LSResourceResolver |
getResourceResolver() |
Schema |
getSchema(Collection<? extends com.helger.commons.io.resource.IReadableResource> aResources)
Get a cached
Schema that consists of multiple resources. |
Schema |
getSchema(com.helger.commons.io.resource.IReadableResource... aResources)
Get a cached
Schema that consists of multiple resources. |
Schema |
getSchema(com.helger.commons.io.resource.IReadableResource aResource)
Get a cached
Schema from a single resource. |
SchemaFactory |
getSchemaFactory() |
String |
getSchemaTypeName() |
Validator |
getValidator(Collection<? extends com.helger.commons.io.resource.IReadableResource> aResources)
Get a new validator based on the
Schema that consists of multiple
resources. |
Validator |
getValidator(com.helger.commons.io.resource.IReadableResource... aResources)
Get a new validator based on the
Schema that consists of multiple
resources. |
Validator |
getValidator(com.helger.commons.io.resource.IReadableResource aResource)
Get a new validator based on the
Schema that consists of a single
resource. |
Validator |
getValidatorFromSchema(Schema aSchema)
Utility method to get the validator for a given schema using the error
handler provided in the constructor.
|
com.helger.commons.state.EChange |
removeFromCache(com.helger.commons.io.resource.IReadableResource aKey)
Utility method to remove a single resource from the schema cache.
|
String |
toString() |
clearCache, createCache, getCacheKeyProvider, getFromCache, getFromCacheNoStats, getFromCacheNoStatsNotLocked, getMaxSize, getName, getValueProvider, hasMaxSize, isAllowNullValues, isEmpty, isInCache, isNotEmpty, putInCache, putInCacheNotLocked, removeFromCache, sizepublic SchemaCache(@Nonnull String sSchemaTypeName, @Nonnull SchemaFactory aSchemaFactory, @Nullable ErrorHandler aErrorHandler, @Nullable LSResourceResolver aResourceResolver)
@Nonnull public final SchemaFactory getSchemaFactory()
@Nullable public ErrorHandler getErrorHandler()
@Nullable public LSResourceResolver getResourceResolver()
@Nonnull public static Schema createSchema(@Nonnull SchemaFactory aSchemaFactory, @Nonnull String sSchemaTypeName, @Nonnull @Nonempty com.helger.commons.collection.impl.ICommonsList<? extends com.helger.commons.io.resource.IReadableResource> aResources)
@Nonnull public final Schema getSchema(@Nonnull com.helger.commons.io.resource.IReadableResource aResource)
Schema from a single resource.@Nonnull public final Schema getSchema(@Nonnull @Nonempty com.helger.commons.io.resource.IReadableResource... aResources)
Schema that consists of multiple resources.@Nonnull public final Schema getSchema(@Nonnull @Nonempty Collection<? extends com.helger.commons.io.resource.IReadableResource> aResources)
Schema that consists of multiple resources.@Nonnull public final Validator getValidatorFromSchema(@Nonnull Schema aSchema)
aSchema - The schema for which the validator is to be retrieved. May not be
null.null.@Nonnull public final Validator getValidator(@Nonnull com.helger.commons.io.resource.IReadableResource aResource)
Schema that consists of a single
resource.aResource - The resource to parse into a single Schema. May not be
null.Validator object. Never null.getSchema(IReadableResource)@Nonnull public final Validator getValidator(@Nonnull @Nonempty com.helger.commons.io.resource.IReadableResource... aResources)
Schema that consists of multiple
resources.aResources - The resources to parse into a single Schema. May neither
null nor empty nor may it contain null
elements.Validator object. Never null.getSchema(IReadableResource...)@Nonnull public final Validator getValidator(@Nonnull @Nonempty Collection<? extends com.helger.commons.io.resource.IReadableResource> aResources)
Schema that consists of multiple
resources.aResources - The resources to parse into a single Schema. May neither
null nor empty nor may it contain null
elements.Validator object. Never null.getSchema(Collection)@Nonnull public com.helger.commons.state.EChange removeFromCache(@Nonnull com.helger.commons.io.resource.IReadableResource aKey)
aKey - The resource to remove. May not be null.EChange.public String toString()
toString in class com.helger.commons.cache.MappedCache<com.helger.commons.collection.impl.ICommonsList<? extends com.helger.commons.io.resource.IReadableResource>,com.helger.commons.collection.impl.ICommonsList<? extends com.helger.commons.io.resource.IReadableResource>,Schema>Copyright © 2014–2019 Philip Helger. All rights reserved.