Class SchemaLoaderUtils
java.lang.Object
org.springframework.xml.validation.SchemaLoaderUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StringgetSystemId(org.springframework.core.io.Resource resource) Retrieves the URL from the given resource as System ID.static SchemaloadSchema(org.springframework.core.io.Resource[] resources, String schemaLanguage) Load schema from the given resource.static SchemaloadSchema(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_URIorXMLConstants.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_URIorXMLConstants.RELAXNG_NS_URI.- Throws:
IOException- if loading failedSAXException- if loading failed- See Also:
-
getSystemId
Retrieves the URL from the given resource as System ID. Returnsnullif it cannot be opened.
-