Package org.springframework.xml.xsd
Class SimpleXsdSchema
java.lang.Object
org.springframework.xml.xsd.SimpleXsdSchema
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,XsdSchema
public class SimpleXsdSchema
extends Object
implements XsdSchema, org.springframework.beans.factory.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, Greg Turnquist
-
Constructor Summary
ConstructorDescriptionCreate a new instance of theSimpleXsdSchema
class.SimpleXsdSchema
(org.springframework.core.io.Resource xsdResource) Create a new instance of theSimpleXsdSchema
class with the specified resource. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates aXmlValidator
based on the schema.Returns theSource
of the schema.Returns the target namespace of this schema.void
setXsd
(org.springframework.core.io.Resource xsdResource) Set the XSD resource to be exposed by calls to this instances'getSource()
method.toString()
-
Constructor Details
-
SimpleXsdSchema
public SimpleXsdSchema()Create a new instance of theSimpleXsdSchema
class.A subsequent call to the
setXsd(Resource)
method is required. -
SimpleXsdSchema
public SimpleXsdSchema(org.springframework.core.io.Resource xsdResource) Create a new instance of theSimpleXsdSchema
class with the specified resource.- Parameters:
xsdResource
- the XSD resource; must not benull
- Throws:
IllegalArgumentException
- if the suppliedxsdResource
isnull
-
-
Method Details
-
setXsd
public void setXsd(org.springframework.core.io.Resource xsdResource) Set the XSD resource to be exposed by calls to this instances'getSource()
method.- Parameters:
xsdResource
- the XSD resource
-
getTargetNamespace
Description copied from interface:XsdSchema
Returns the target namespace of this schema.- Specified by:
getTargetNamespace
in interfaceXsdSchema
- Returns:
- the target namespace
-
getSource
Description copied from interface:XsdSchema
Returns theSource
of the schema. -
createValidator
Description copied from interface:XsdSchema
Creates aXmlValidator
based on the schema.- Specified by:
createValidator
in interfaceXsdSchema
- Returns:
- a validator for this schema
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
ParserConfigurationException
IOException
SAXException
-
toString
-