Class SchemaLoaderUtils
java.lang.Object
org.springframework.xml.validation.SchemaLoaderUtils
Convenient utility methods for loading of
Schema
objects, performing standard handling of input streams.- Since:
- 1.0.0
- Author:
- Arjen Poutsma
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getSystemId
(org.springframework.core.io.Resource resource) Retrieves the URL from the given resource as System ID.static Schema
loadSchema
(org.springframework.core.io.Resource[] resources, String schemaLanguage) Load schema from the given resource.static Schema
loadSchema
(org.springframework.core.io.Resource resource, String schemaLanguage) Load schema from the given resource.
-
Constructor Details
-
SchemaLoaderUtils
public SchemaLoaderUtils()
-
-
Method Details
-
loadSchema
public static Schema loadSchema(org.springframework.core.io.Resource resource, String schemaLanguage) throws IOException, SAXException Load schema from the given resource.- Parameters:
resource
- the resource to load fromschemaLanguage
- the language of the schema. Can beXMLConstants.W3C_XML_SCHEMA_NS_URI
orXMLConstants.RELAXNG_NS_URI
.- Throws:
IOException
- if loading failedSAXException
- if loading failed- See Also:
-
loadSchema
public static Schema loadSchema(org.springframework.core.io.Resource[] resources, String schemaLanguage) throws IOException, SAXException Load schema from the given resource.- Parameters:
resources
- the resources to load fromschemaLanguage
- the language of the schema. Can beXMLConstants.W3C_XML_SCHEMA_NS_URI
orXMLConstants.RELAXNG_NS_URI
.- Throws:
IOException
- if loading failedSAXException
- if loading failed- See Also:
-
getSystemId
Retrieves the URL from the given resource as System ID. Returnsnull
if it cannot be opened.
-