org.apache.woden.internal
Class BaseWSDLReader

java.lang.Object
  extended by org.apache.woden.internal.BaseWSDLReader
All Implemented Interfaces:
WSDLReader
Direct Known Subclasses:
DOMWSDLReader, OMWSDLReader

public abstract class BaseWSDLReader
extends java.lang.Object
implements WSDLReader

This abstract class contains properties and methods common to WSDLReader implementations.

TODO a Template Inheritance pattern that ensures WSDL validation gets invoked (if turned on by some property) after the subclass has parsed the WSDL. Note, this class is currently WSDL version-independent and XML parser-independent; should try to keep it that way.

Author:
jkaputin@apache.org

Field Summary
protected  ReaderFeatures features
           
 
Fields inherited from interface org.apache.woden.WSDLReader
FEATURE_CONTINUE_ON_ERROR, FEATURE_VALIDATION, FEATURE_VERBOSE, PROPERTY_TYPE_SYSTEM_API, PROPERTY_XML_PARSER_API, TYPE_XSD_2001
 
Constructor Summary
protected BaseWSDLReader()
           
 
Method Summary
protected abstract  XMLElement createXMLElement(java.lang.Object elem)
          Returns an XMLElement object representing the specified element object.
 ErrorReporter getErrorReporter()
           
 ExtensionRegistry getExtensionRegistry()
           
protected  WSDLFactory getFactory()
          Get the cached WSDLFactory if there is one, otherwise create and cache a new one.
 java.lang.String getFactoryImplName()
           
 boolean getFeature(java.lang.String name)
          Returns the on/off setting of the named feature, represented as a boolean.
 java.lang.Object getProperty(java.lang.String name)
          Returns the value of the named property.
protected  java.net.URI getURI(java.lang.String anyURI)
           
 URIResolver getURIResolver()
          Find the current URI Resolver
protected abstract  DescriptionElement getWSDLFromLocation(java.lang.String locationURI, DescriptionElement desc, java.util.Map wsdlModules)
           
protected  DescriptionElement parseDescription(java.lang.String documentBaseURI, XMLElement descEl, java.util.Map wsdlModules)
           
protected  DocumentationElement parseDocumentation(XMLElement docEl, DescriptionElement desc, DocumentableElement parent)
           
protected abstract  void parseExtensionAttributes(XMLElement extEl, java.lang.Class wsdlClass, WSDLElement wsdlObj, DescriptionElement desc)
           
protected  ExtensionElement parseExtensionElement(java.lang.Class parentType, WSDLElement parent, XMLElement el, DescriptionElement desc)
           
protected abstract  void parseNamespaceDeclarations(XMLElement xmlElem, WSDLElement wsdlElem)
           
protected  void parseSchemaForXMLSchema(DescriptionElement desc)
           
protected abstract  Schema parseSchemaImport(XMLElement importEl, DescriptionElement desc)
           
protected abstract  Schema parseSchemaInline(XMLElement schemaEl, DescriptionElement desc)
           
protected  java.lang.String resolveURI(java.lang.String uri)
           
protected  java.net.URI resolveURI(java.net.URI uri)
           
 void setExtensionRegistry(ExtensionRegistry extReg)
           
 void setFactoryImplName(java.lang.String factoryImplName)
          Stores the name of the WSDLFactory implementation class to be used for any subsequent WSDLFactory requests, first discarding any cached factory object.
 void setFeature(java.lang.String name, boolean value)
          Set a named feature on or off with a boolean.
 void setProperty(java.lang.String name, java.lang.Object value)
          Set a named property to the specified object.
 void setURIResolver(URIResolver resolver)
          Provides the capability of setting a supplied URI Resolver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.woden.WSDLReader
createWSDLSource, readWSDL, readWSDL, readWSDL, readWSDL
 

Field Detail

features

protected ReaderFeatures features
Constructor Detail

BaseWSDLReader

protected BaseWSDLReader()
                  throws WSDLException
Throws:
WSDLException
Method Detail

getErrorReporter

public ErrorReporter getErrorReporter()
Specified by:
getErrorReporter in interface WSDLReader
Returns:
Returns the fErrorReporter.

getFactory

protected WSDLFactory getFactory()
                          throws WSDLException
Get the cached WSDLFactory if there is one, otherwise create and cache a new one.

Returns:
Returns a.
Throws:
WSDLException

setFactoryImplName

public void setFactoryImplName(java.lang.String factoryImplName)
Stores the name of the WSDLFactory implementation class to be used for any subsequent WSDLFactory requests, first discarding any cached factory object.

Specified by:
setFactoryImplName in interface WSDLReader
Parameters:
factoryImplName - the WSDLFactory implementation classname

getFactoryImplName

public java.lang.String getFactoryImplName()
Specified by:
getFactoryImplName in interface WSDLReader
Returns:
the WSDLFactory implementation classname

setExtensionRegistry

public void setExtensionRegistry(ExtensionRegistry extReg)
Specified by:
setExtensionRegistry in interface WSDLReader

getExtensionRegistry

public ExtensionRegistry getExtensionRegistry()
Specified by:
getExtensionRegistry in interface WSDLReader

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
Set a named feature on or off with a boolean.

All feature names should be fully-qualified, Java package style to avoid name clashes. All names starting with org.apache.woden. are reserved for features defined by the Woden implementation. Features specific to other implementations should be fully-qualified to match the package name structure of that implementation. For example: com.abc.featureName

Specified by:
setFeature in interface WSDLReader
Parameters:
name - the name of the feature to be set
value - a boolean value where true sets the feature on, false sets it off
Throws:
java.lang.IllegalArgumentException - if the feature name is not recognized.

getFeature

public boolean getFeature(java.lang.String name)
Returns the on/off setting of the named feature, represented as a boolean.

Specified by:
getFeature in interface WSDLReader
Parameters:
name - the name of the feature to get the value of
Returns:
a boolean representing the on/off state of the named feature
Throws:
java.lang.IllegalArgumentException - if the feature name is not recognized.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Set a named property to the specified object.

All property names should be fully-qualified, Java package style to avoid name clashes. All names starting with org.apache.woden. are reserved for properties defined by the Woden implementation. Properties specific to other implementations should be fully-qualified to match the package name structure of that implementation. For example: com.abc.propertyName

Specified by:
setProperty in interface WSDLReader
Parameters:
name - the name of the property to be set
value - an Object representing the value to set the property to
Throws:
java.lang.IllegalArgumentException - if the property name is not recognized.

getProperty

public java.lang.Object getProperty(java.lang.String name)
Returns the value of the named property.

Specified by:
getProperty in interface WSDLReader
Parameters:
name - the name of the property to get the value of
Returns:
an Object representing the property's value
Throws:
java.lang.IllegalArgumentException - if the property name is not recognized.

parseDescription

protected DescriptionElement parseDescription(java.lang.String documentBaseURI,
                                              XMLElement descEl,
                                              java.util.Map wsdlModules)
                                       throws WSDLException
Throws:
WSDLException

parseDocumentation

protected DocumentationElement parseDocumentation(XMLElement docEl,
                                                  DescriptionElement desc,
                                                  DocumentableElement parent)
                                           throws WSDLException
Throws:
WSDLException

parseSchemaImport

protected abstract Schema parseSchemaImport(XMLElement importEl,
                                            DescriptionElement desc)
                                     throws WSDLException
Throws:
WSDLException

parseSchemaInline

protected abstract Schema parseSchemaInline(XMLElement schemaEl,
                                            DescriptionElement desc)
                                     throws WSDLException
Throws:
WSDLException

parseExtensionElement

protected ExtensionElement parseExtensionElement(java.lang.Class parentType,
                                                 WSDLElement parent,
                                                 XMLElement el,
                                                 DescriptionElement desc)
                                          throws WSDLException
Throws:
WSDLException

parseExtensionAttributes

protected abstract void parseExtensionAttributes(XMLElement extEl,
                                                 java.lang.Class wsdlClass,
                                                 WSDLElement wsdlObj,
                                                 DescriptionElement desc)
                                          throws WSDLException
Throws:
WSDLException

parseNamespaceDeclarations

protected abstract void parseNamespaceDeclarations(XMLElement xmlElem,
                                                   WSDLElement wsdlElem)
                                            throws WSDLException
Throws:
WSDLException

parseSchemaForXMLSchema

protected void parseSchemaForXMLSchema(DescriptionElement desc)

createXMLElement

protected abstract XMLElement createXMLElement(java.lang.Object elem)
                                        throws java.lang.IllegalArgumentException
Returns an XMLElement object representing the specified element object. The element object argument must be compatible with the concrete reader implementation. If so, this method returns an XMLElement object that is type-compatible with the reader implementatation (e.g. a DOMXMLElement for DOMWSDLReader).

Throws:
java.lang.IllegalArgumentException - if elem is not a type recognized by the WSDLReader implementation.

getURI

protected java.net.URI getURI(java.lang.String anyURI)
                       throws WSDLException
Throws:
WSDLException

getWSDLFromLocation

protected abstract DescriptionElement getWSDLFromLocation(java.lang.String locationURI,
                                                          DescriptionElement desc,
                                                          java.util.Map wsdlModules)
                                                   throws WSDLException
Throws:
WSDLException

setURIResolver

public void setURIResolver(URIResolver resolver)
Provides the capability of setting a supplied URI Resolver.

Specified by:
setURIResolver in interface WSDLReader

resolveURI

protected java.net.URI resolveURI(java.net.URI uri)
                           throws WSDLException
Throws:
WSDLException

resolveURI

protected java.lang.String resolveURI(java.lang.String uri)

getURIResolver

public URIResolver getURIResolver()
Find the current URI Resolver

Specified by:
getURIResolver in interface WSDLReader
Returns:
the URI resolver currently in use


Copyright © 2007. All Rights Reserved.