org.springframework.xml.xsd.commons
Class CommonsXsdSchema

java.lang.Object
  extended by org.springframework.xml.xsd.commons.CommonsXsdSchema
All Implemented Interfaces:
XsdSchema

public class CommonsXsdSchema
extends Object
implements XsdSchema

Implementation of the XsdSchema interface that uses Apache WS-Commons XML Schema.

Since:
1.5.0
Author:
Arjen Poutsma
See Also:
Commons XML Schema

Constructor Summary
protected CommonsXsdSchema(org.apache.ws.commons.schema.XmlSchema schema)
          Create a new instance of the CommonsXsdSchema class with the specified XmlSchema reference.
protected CommonsXsdSchema(org.apache.ws.commons.schema.XmlSchema schema, org.apache.ws.commons.schema.XmlSchemaCollection collection)
          Create a new instance of the CommonsXsdSchema class with the specified XmlSchema and XmlSchemaCollection reference.
 
Method Summary
 XmlValidator createValidator()
          Creates a XmlValidator based on the schema.
 javax.xml.namespace.QName[] getElementNames()
           
 org.apache.ws.commons.schema.XmlSchema getSchema()
          Returns the wrapped Commons XmlSchema object.
 javax.xml.transform.Source getSource()
          Returns the Source of the schema.
 String getTargetNamespace()
          Returns the target namespace of this schema.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommonsXsdSchema

protected CommonsXsdSchema(org.apache.ws.commons.schema.XmlSchema schema)
Create a new instance of the CommonsXsdSchema class with the specified XmlSchema reference.

Parameters:
schema - the Commons XmlSchema object; must not be null
Throws:
IllegalArgumentException - if the supplied schema is null

CommonsXsdSchema

protected CommonsXsdSchema(org.apache.ws.commons.schema.XmlSchema schema,
                           org.apache.ws.commons.schema.XmlSchemaCollection collection)
Create a new instance of the CommonsXsdSchema class with the specified XmlSchema and XmlSchemaCollection reference.

Parameters:
schema - the Commons XmlSchema object; must not be null
collection - the Commons XmlSchemaCollection object; can be null
Throws:
IllegalArgumentException - if the supplied schema is null
Method Detail

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

getElementNames

public javax.xml.namespace.QName[] getElementNames()

getSource

public javax.xml.transform.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

getSchema

public org.apache.ws.commons.schema.XmlSchema getSchema()
Returns the wrapped Commons XmlSchema object.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010. All Rights Reserved.