org.ow2.easywsdl.schema.impl
Class SchemaReaderImpl

java.lang.Object
  extended by org.ow2.easywsdl.schema.api.abstractElmt.AbstractSchemaReader
      extended by org.ow2.easywsdl.schema.impl.SchemaReaderImpl
All Implemented Interfaces:
SchemaReader

public class SchemaReaderImpl
extends AbstractSchemaReader
implements SchemaReader

Author:
Nicolas Salatge - eBM WebSourcing, Gael Blondelle - EBM WebSourcing

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ow2.easywsdl.schema.api.SchemaReader
SchemaReader.FeatureConstants
 
Constructor Summary
SchemaReaderImpl()
           
 
Method Summary
 java.net.URI getDocumentBaseURI()
          Get the document base URI of the reader.
 java.lang.Object getFeature(SchemaReader.FeatureConstants name)
          Gets the value of the specified feature.
 java.util.Map<SchemaReader.FeatureConstants,java.lang.Object> getFeatures()
          Gets all features.
protected  java.util.Map<java.net.URI,AbsItfSchema> getImportList()
           
static SchemaJAXBContext getJaxbContext()
           
 Schema read(org.w3c.dom.Document doc)
           Read the XMLSchema definition accessible via the specified DOM Document, and bind it into a Schema object.
 Schema read(org.xml.sax.InputSource inputSource)
           Read the XMLSchema definition accessible via the specified InputSource, and bind it into a Schema object.
 Schema read(java.net.URL schemaURL)
           Read the XMLSchema definition available at the location identified by the specified URL, and bind it into a Schema object.
protected  Schema readExternalPart(java.net.URI schemaLocationURI, java.net.URI baseURI, java.util.Map<java.net.URI,AbsItfSchema> imports, boolean deleteImports)
          Read an external XML Schema URI according to a base URI.
 void setDocumentBaseURI(java.net.URI documentBaseURI)
          Set the document base URI of the reader to be able to resolve imported parts.
 void setFeature(SchemaReader.FeatureConstants name, java.lang.Object value)
          Sets the specified feature to the specified value.
 void setFeatures(java.util.Map<SchemaReader.FeatureConstants,java.lang.Object> features)
          Set the specified features.
protected  void setImportList(java.util.Map<java.net.URI,AbsItfSchema> importLists)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaReaderImpl

public SchemaReaderImpl()
                 throws SchemaException
Throws:
SchemaException
Method Detail

getJaxbContext

public static SchemaJAXBContext getJaxbContext()
                                        throws SchemaException
Throws:
SchemaException

setDocumentBaseURI

public void setDocumentBaseURI(java.net.URI documentBaseURI)
Set the document base URI of the reader to be able to resolve imported parts.

Specified by:
setDocumentBaseURI in interface SchemaReader

getDocumentBaseURI

public java.net.URI getDocumentBaseURI()
Get the document base URI of the reader.

Specified by:
getDocumentBaseURI in interface SchemaReader
Returns:
The document base URI.

read

public Schema read(java.net.URL schemaURL)
            throws SchemaException,
                   java.net.URISyntaxException,
                   java.io.IOException

Read the XMLSchema definition available at the location identified by the specified URL, and bind it into a Schema object.

Note: all relative URIs are resolved according to the specified URL.

Specified by:
read in interface SchemaReader
Parameters:
schemaURL - an URL pointing to a XMLSchema definition.
Returns:
the Schema definition.
Throws:
SchemaException - An error occurs during the parsing or the binding of the XMLSchema
java.net.URISyntaxException - If the URL is not formatted strictly according to to RFC2396 and cannot be converted to a URI.
java.io.IOException - An I/O error occurs openning the URL stream.

read

public Schema read(org.xml.sax.InputSource inputSource)
            throws SchemaException,
                   java.net.URISyntaxException,
                   java.net.MalformedURLException

Read the XMLSchema definition accessible via the specified InputSource, and bind it into a Schema object.

Note: To be able to resolve relative URIs, the InputSource system identifier must be set.

Specified by:
read in interface SchemaReader
Parameters:
inputSource - an InputSource pointing to a XMLSchema definition.
Returns:
the Schema definition.
Throws:
SchemaException - An error occurs during the parsing or the binding of the XMLSchema
java.net.URISyntaxException - If the system identifier URL is not formatted strictly according to to RFC2396 and cannot be converted to a URI.
java.net.MalformedURLException - The system identifier URL is not a well-formed URL

read

public Schema read(org.w3c.dom.Document doc)
            throws SchemaException

Read the XMLSchema definition accessible via the specified DOM Document, and bind it into a Schema object.

Note: To be able to resolve relative URIs, the Document base URI must be set.

Specified by:
read in interface SchemaReader
Parameters:
doc - a DOM Document pointing to a XMLSchema definition.
Returns:
the Schema definition.
Throws:
SchemaException - An error occurs during the parsing or the binding of the XMLSchema

readExternalPart

protected Schema readExternalPart(java.net.URI schemaLocationURI,
                                  java.net.URI baseURI,
                                  java.util.Map<java.net.URI,AbsItfSchema> imports,
                                  boolean deleteImports)
                           throws SchemaException,
                                  java.net.MalformedURLException,
                                  java.net.URISyntaxException
Read an external XML Schema URI according to a base URI.

Specified by:
readExternalPart in class AbstractSchemaReader
Throws:
SchemaException
java.net.MalformedURLException - The URL based on the external XSD URI and the current base URI is a malformed URL.
java.net.URISyntaxException - The URL based on the external XSD URI and the current base URI is an URL not formatted strictly according to to RFC2396 and cannot be converted to a URI.

setFeature

public void setFeature(SchemaReader.FeatureConstants name,
                       java.lang.Object value)
                throws java.lang.IllegalArgumentException
Description copied from interface: SchemaReader
Sets the specified feature to the specified value.

The minimum features that must be supported are:

Name Description Default Value
org.ow2.easywsdl.schema.verbose
If set to true, status messages will be displayed.
type: boolean - default value: false
org.ow2.easywsdl.schema.importDocuments
If set to true, imported WSDL documents will be retrieved and processed.
type: boolean - default value: true
org.ow2.easywsdl.schema.pathDirectoryOfImportLocations
If the location is set, imported WSDL documents will be retrieved at this location (Set the importDocuments Features at true).
type: String

All feature names must be fully-qualified, Java package style. All names starting with com.ebmwebsourcing. are reserved for features defined by the specification. It is recommended that implementation- specific features be fully-qualified to match the package name of that implementation. For example: com.abc.featureName

Specified by:
setFeature in interface SchemaReader
Parameters:
name - the name of the feature to be set.
value - the value to set the feature to.
Throws:
java.lang.IllegalArgumentException - if the feature name is not recognized.
See Also:
#getFeature(String)

getFeature

public java.lang.Object getFeature(SchemaReader.FeatureConstants name)
                            throws java.lang.IllegalArgumentException
Description copied from interface: SchemaReader
Gets the value of the specified feature.

Specified by:
getFeature in interface SchemaReader
Parameters:
name - the name of the feature to get the value of.
Returns:
the value of feature
Throws:
java.lang.IllegalArgumentException - if the feature name is not recognized.
See Also:
#setFeature(String, boolean)

getFeatures

public java.util.Map<SchemaReader.FeatureConstants,java.lang.Object> getFeatures()
Description copied from interface: SchemaReader
Gets all features.

Specified by:
getFeatures in interface SchemaReader
Returns:
the features
See Also:
#setFeature(String, boolean)

setFeatures

public void setFeatures(java.util.Map<SchemaReader.FeatureConstants,java.lang.Object> features)
Description copied from interface: SchemaReader
Set the specified features. See SchemaReader.setFeature(FeatureConstants, Object) for more information on available features.

Specified by:
setFeatures in interface SchemaReader
Parameters:
features - Set of features to set.

getImportList

protected java.util.Map<java.net.URI,AbsItfSchema> getImportList()
Specified by:
getImportList in class AbstractSchemaReader

setImportList

protected void setImportList(java.util.Map<java.net.URI,AbsItfSchema> importLists)


Copyright © 2008-2010 Petals Link (previously EBM WebSourcing). All Rights Reserved.