Package org.openehealth.ipf.commons.xml
Class XsdValidator
java.lang.Object
org.openehealth.ipf.commons.xml.AbstractCachingXmlProcessor<Schema>
org.openehealth.ipf.commons.xml.XsdValidator
public class XsdValidator
extends AbstractCachingXmlProcessor<Schema>
implements Validator<Source,String>
Validation of XML documents based on a XML Schema. Before using this class
consider using a validating Parser class.
- Author:
- Christian Ohr
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openehealth.ipf.commons.xml.AbstractCachingXmlProcessor
AbstractCachingXmlProcessor.Loader<S>
-
Field Summary
Fields inherited from class org.openehealth.ipf.commons.xml.AbstractCachingXmlProcessor
RESOURCE_LOCATION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Schema
createResource
(Object... params) Creates a ready-to-use resource (e.g.protected List<ValidationException>
doValidate
(Source message, String schemaResource) protected ConcurrentMap<String,
AbstractCachingXmlProcessor.Loader<Schema>> getCache()
void
setSchemaLanguage
(String schemaLanguage) void
Methods inherited from class org.openehealth.ipf.commons.xml.AbstractCachingXmlProcessor
resource, resourceCacheKey, resourceContent, resourceLocation, resourceParameters
-
Constructor Details
-
XsdValidator
public XsdValidator() -
XsdValidator
-
-
Method Details
-
getCache
- Specified by:
getCache
in classAbstractCachingXmlProcessor<Schema>
- Returns:
- static cache for the configured resource type. Note that the returned Map is not necessarily synchronized.
-
validate
-
doValidate
- Parameters:
message
- the message to be validatedschemaResource
- the XML schema to validate against- Returns:
- an array of validation exceptions
-
createResource
Description copied from class:AbstractCachingXmlProcessor
Creates a ready-to-use resource (e.g. an XML Schema instance) for the given key. Insertion into the cache will happen externally, this method's purpose is only to instantiate the resource to be cached. This method does not need to be re-entrant, but its result MUST be thread-safe.- Specified by:
createResource
in classAbstractCachingXmlProcessor<Schema>
- Parameters:
params
- validator/transmogrifier parameters.- Returns:
- resource of the configured type.
-
getSchemaLanguage
-
setSchemaLanguage
-