Spring Web Services Framework

org.springframework.xml.xsd
Class SimpleXsdSchema

java.lang.Object
  extended by org.springframework.xml.xsd.SimpleXsdSchema
All Implemented Interfaces:
InitializingBean, XsdSchema

public class SimpleXsdSchema
extends Object
implements XsdSchema, InitializingBean

The default XsdSchema implementation.

Allows a XSD to be set by the setXsd(Resource), or directly in the constructor.

Since:
1.5.0
Author:
Mark LaFond, Arjen Poutsma

Constructor Summary
SimpleXsdSchema()
          Create a new instance of the SimpleXsdSchema class.
SimpleXsdSchema(Resource xsdResource)
          Create a new instance of the SimpleXsdSchema class with the specified resource.
 
Method Summary
 void afterPropertiesSet()
           
 XmlValidator createValidator()
          Creates a XmlValidator based on the schema.
 Source getSource()
          Returns the Source of the schema.
 String getTargetNamespace()
          Returns the target namespace of this schema.
 void setXsd(Resource xsdResource)
          Set the XSD resource to be exposed by calls to this instances' getSource() method.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleXsdSchema

public SimpleXsdSchema()
Create a new instance of the SimpleXsdSchema class.

A subsequent call to the setXsd(Resource) method is required.


SimpleXsdSchema

public SimpleXsdSchema(Resource xsdResource)
Create a new instance of the SimpleXsdSchema class with the specified resource.

Parameters:
xsdResource - the XSD resource; must not be null
Throws:
IllegalArgumentException - if the supplied xsdResource is null
Method Detail

setXsd

public void setXsd(Resource xsdResource)
Set the XSD resource to be exposed by calls to this instances' getSource() method.

Parameters:
xsdResource - the XSD resource

getTargetNamespace

public String getTargetNamespace()
Description copied from interface: XsdSchema
Returns the target namespace of this schema.

Specified by:
getTargetNamespace in interface XsdSchema
Returns:
the target namespace

getSource

public Source getSource()
Description copied from interface: XsdSchema
Returns the Source of the schema.

Specified by:
getSource in interface XsdSchema
Returns:
the source of this XSD schema

createValidator

public XmlValidator createValidator()
                             throws IOException
Description copied from interface: XsdSchema
Creates a XmlValidator based on the schema.

Specified by:
createValidator in interface XsdSchema
Returns:
a validator for this schema
Throws:
IOException - in case of I/O errors

afterPropertiesSet

public void afterPropertiesSet()
                        throws ParserConfigurationException,
                               IOException,
                               SAXException
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
ParserConfigurationException
IOException
SAXException

toString

public String toString()
Overrides:
toString in class Object

Spring Web Services Framework

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