Spring Web Services Framework

org.springframework.xml.validation
Class SchemaLoaderUtils

java.lang.Object
  extended by org.springframework.xml.validation.SchemaLoaderUtils

public abstract class SchemaLoaderUtils
extends Object

Convenient utility methods for loading of Schema objects, performing standard handling of input streams.

Since:
1.0.0
Author:
Arjen Poutsma

Constructor Summary
SchemaLoaderUtils()
           
 
Method Summary
static String getSystemId(Resource resource)
          Retrieves the URL from the given resource as System ID.
static Schema loadSchema(Resource[] resources, String schemaLanguage)
          Load schema from the given resource.
static Schema loadSchema(Resource resource, String schemaLanguage)
          Load schema from the given resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaLoaderUtils

public SchemaLoaderUtils()
Method Detail

loadSchema

public static Schema loadSchema(Resource resource,
                                String schemaLanguage)
                         throws IOException,
                                SAXException
Load schema from the given resource.

Parameters:
resource - the resource to load from
schemaLanguage - the language of the schema. Can be XMLConstants.W3C_XML_SCHEMA_NS_URI or XMLConstants.RELAXNG_NS_URI.
Throws:
IOException - if loading failed
SAXException - if loading failed
See Also:
XMLConstants.W3C_XML_SCHEMA_NS_URI, XMLConstants.RELAXNG_NS_URI

loadSchema

public static Schema loadSchema(Resource[] resources,
                                String schemaLanguage)
                         throws IOException,
                                SAXException
Load schema from the given resource.

Parameters:
resources - the resources to load from
schemaLanguage - the language of the schema. Can be XMLConstants.W3C_XML_SCHEMA_NS_URI or XMLConstants.RELAXNG_NS_URI.
Throws:
IOException - if loading failed
SAXException - if loading failed
See Also:
XMLConstants.W3C_XML_SCHEMA_NS_URI, XMLConstants.RELAXNG_NS_URI

getSystemId

public static String getSystemId(Resource resource)
Retrieves the URL from the given resource as System ID. Returns null if it cannot be opened.


Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.