Class SchemaReaderImpl
- java.lang.Object
-
- org.ow2.easywsdl.schema.api.abstractElmt.AbstractSchemaReader
-
- 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
Constructors Constructor Description SchemaReaderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URIgetDocumentBaseURI()Get the document base URI of the reader.ObjectgetFeature(SchemaReader.FeatureConstants name)Gets the value of the specified feature.Map<SchemaReader.FeatureConstants,Object>getFeatures()Gets all features.Schemaread(URL schemaURL)Read the XMLSchema definition available at the location identified by the specified URL, and bind it into aSchemaobject.Schemaread(Document doc)Schemaread(InputSource inputSource)Read the XMLSchema definition accessible via the specifiedInputSource, and bind it into aSchemaobject.protected SchemareadExternalPart(URI schemaLocationURI, URI baseURI, Map<URI,AbsItfSchema> imports)Read an external XML Schema URI according to a base URI.protected SchemareadSchema(InputSource source, Map<URI,AbsItfSchema> imports)voidsetDocumentBaseURI(URI documentBaseURI)Set the document base URI of the reader to be able to resolve imported parts.voidsetFeature(SchemaReader.FeatureConstants name, Object value)Sets the specified feature to the specified value.voidsetFeatures(Map<SchemaReader.FeatureConstants,Object> features)Set the specified features.
-
-
-
Constructor Detail
-
SchemaReaderImpl
public SchemaReaderImpl() throws SchemaException- Throws:
SchemaException
-
-
Method Detail
-
setDocumentBaseURI
public void setDocumentBaseURI(URI documentBaseURI)
Set the document base URI of the reader to be able to resolve imported parts.- Specified by:
setDocumentBaseURIin interfaceSchemaReader
-
getDocumentBaseURI
public URI getDocumentBaseURI()
Get the document base URI of the reader.- Specified by:
getDocumentBaseURIin interfaceSchemaReader- Returns:
- The document base URI.
-
read
public Schema read(URL schemaURL) throws SchemaException, URISyntaxException, IOException
Read the XMLSchema definition available at the location identified by the specified URL, and bind it into a
Schemaobject.Note: all relative URIs are resolved according to the specified URL.
- Specified by:
readin interfaceSchemaReader- Parameters:
schemaURL- an URL pointing to a XMLSchema definition.- Returns:
- the
Schemadefinition. - Throws:
SchemaException- An error occurs during the parsing or the binding of the XMLSchemaURISyntaxException- If the URL is not formatted strictly according to to RFC2396 and cannot be converted to a URI.IOException- An I/O error occurs openning the URL stream.
-
read
public Schema read(InputSource inputSource) throws SchemaException, URISyntaxException, MalformedURLException
Read the XMLSchema definition accessible via the specified
InputSource, and bind it into aSchemaobject.Note: To be able to resolve relative URIs, the
InputSourcesystem identifier must be set.- Specified by:
readin interfaceSchemaReader- Parameters:
inputSource- anInputSourcepointing to a XMLSchema definition.- Returns:
- the
Schemadefinition. - Throws:
SchemaException- An error occurs during the parsing or the binding of the XMLSchemaURISyntaxException- If the system identifier URL is not formatted strictly according to to RFC2396 and cannot be converted to a URI.MalformedURLException- The system identifier URL is not a well-formed URL
-
read
public Schema read(Document doc) throws SchemaException
Read the XMLSchema definition accessible via the specified DOM
Document, and bind it into aSchemaobject.Note: To be able to resolve relative URIs, the
Documentbase URI must be set.- Specified by:
readin interfaceSchemaReader- Parameters:
doc- a DOMDocumentpointing to a XMLSchema definition.- Returns:
- the
Schemadefinition. - Throws:
SchemaException- An error occurs during the parsing or the binding of the XMLSchema
-
readExternalPart
protected Schema readExternalPart(URI schemaLocationURI, URI baseURI, Map<URI,AbsItfSchema> imports) throws SchemaException, MalformedURLException, URISyntaxException
Read an external XML Schema URI according to a base URI.- Specified by:
readExternalPartin classAbstractSchemaReader- Throws:
SchemaExceptionMalformedURLException- The URL based on the external XSD URI and the current base URI is a malformed URL.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.
-
readSchema
protected Schema readSchema(InputSource source, Map<URI,AbsItfSchema> imports) throws SchemaException, MalformedURLException, URISyntaxException
-
setFeature
public void setFeature(SchemaReader.FeatureConstants name, Object value) throws IllegalArgumentException
Description copied from interface:SchemaReaderSets the specified feature to the specified value.
The minimum features that must be supported are:
Minimal features to support 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:
setFeaturein interfaceSchemaReader- Parameters:
name- the name of the feature to be set.value- the value to set the feature to.- Throws:
IllegalArgumentException- if the feature name is not recognized.- See Also:
SchemaReader.getFeature(FeatureConstants)
-
getFeature
public Object getFeature(SchemaReader.FeatureConstants name) throws IllegalArgumentException
Description copied from interface:SchemaReaderGets the value of the specified feature.- Specified by:
getFeaturein interfaceSchemaReader- Parameters:
name- the name of the feature to get the value of.- Returns:
- the value of feature
- Throws:
IllegalArgumentException- if the feature name is not recognized.- See Also:
SchemaReader.setFeature(FeatureConstants, Object)
-
getFeatures
public Map<SchemaReader.FeatureConstants,Object> getFeatures()
Description copied from interface:SchemaReaderGets all features.- Specified by:
getFeaturesin interfaceSchemaReader- Returns:
- the features
- See Also:
SchemaReader.setFeature(FeatureConstants, Object)
-
setFeatures
public void setFeatures(Map<SchemaReader.FeatureConstants,Object> features)
Description copied from interface:SchemaReaderSet the specified features. SeeSchemaReader.setFeature(FeatureConstants, Object)for more information on available features.- Specified by:
setFeaturesin interfaceSchemaReader- Parameters:
features- Set of features to set.
-
-