com.sun.xml.ws.model.wsdl
Class WSDLModelImpl

java.lang.Object
  extended by com.sun.xml.ws.model.wsdl.WSDLModelImpl
All Implemented Interfaces:
WSDLExtensible, WSDLModel, WSDLObject

public final class WSDLModelImpl
extends Object
implements WSDLModel

Implementation of WSDLModel

Author:
Vivek Pandey

Nested Class Summary
protected static class com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension
           
 
Nested classes/interfaces inherited from interface com.sun.xml.ws.api.model.wsdl.WSDLModel
WSDLModel.WSDLParser
 
Field Summary
protected  Set<WSDLExtension> extensions
           
protected  List<com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension> notUnderstoodExtensions
           
 
Constructor Summary
WSDLModelImpl()
          To create WSDLModelImpl from WSDL that doesn't have a system ID.
WSDLModelImpl(String systemId)
           
 
Method Summary
 void addBinding(WSDLBoundPortTypeImpl boundPortType)
           
 void addExtension(WSDLExtension ex)
          Adds a new WSDLExtension to this object.
 void addMessage(WSDLMessageImpl msg)
           
 void addNotUnderstoodExtension(QName extnEl, Locator locator)
          This can be used if a WSDL extension element that has wsdl:required=true is not understood
 void addPortType(WSDLPortTypeImpl pt)
           
 void addService(WSDLServiceImpl svc)
           
 boolean areRequiredExtensionsUnderstood()
          This method should be called after freezing the WSDLModel
 void freeze()
          Invoked at the end of the model construction to fix up references, etc.
 WSDLBoundPortTypeImpl getBinding(QName name)
          Gets WSDLBoundPortType that models wsdl:binding
 WSDLBoundPortTypeImpl getBinding(QName serviceName, QName portName)
          Give a WSDLBoundPortType for the given wsdl:service and wsdl:port names.
 Map<QName,WSDLBoundPortType> getBindings()
          Gives a Map of wsdl:binding QName and WSDLBoundPortType
<T extends WSDLExtension>
T
getExtension(Class<T> type)
          Gets the extension that is assignable to the given type.
 Iterable<WSDLExtension> getExtensions()
          Gets all the WSDLExtensions added through WSDLExtensible.addExtension(WSDLExtension).
<T extends WSDLExtension>
Iterable<T>
getExtensions(Class<T> type)
          Gets all the extensions that is assignable to the given type.
 QName getFirstPortName()
          Returns first port QName from first service as per the insertion order
 QName getFirstServiceName()
          Returns the first service QName from insertion order
 Locator getLocation()
          Gets the source location information in the parsed WSDL.
 WSDLPortImpl getMatchingPort(QName serviceName, QName portType)
          gets the first port in the wsdl which matches the serviceName and portType
 WSDLMessageImpl getMessage(QName name)
           
 Map<QName,WSDLMessageImpl> getMessages()
           
 PolicyMap getPolicyMap()
          Gives the PolicyMap associated with the WSDLModel
 WSDLPortTypeImpl getPortType(QName name)
          Gets WSDLPortType that models wsdl:portType
 Map<QName,WSDLPortTypeImpl> getPortTypes()
          Gives a Map of wsdl:portType QName and WSDLPortType
 WSDLServiceImpl getService(QName name)
          Gets WSDLService that models wsdl:service
 Map<QName,WSDLServiceImpl> getServices()
          Gives a Map of wsdl:service qualified name and WSDLService
 void setPolicyMap(PolicyMap policyMap)
          Set PolicyMap for the WSDLModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.xml.ws.api.model.wsdl.WSDLExtensible
addExtension, getExtension, getExtensions, getExtensions
 
Methods inherited from interface com.sun.xml.ws.api.model.wsdl.WSDLObject
getLocation
 

Field Detail

extensions

protected final Set<WSDLExtension> extensions

notUnderstoodExtensions

protected List<com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension> notUnderstoodExtensions
Constructor Detail

WSDLModelImpl

public WSDLModelImpl(@NotNull
                     String systemId)

WSDLModelImpl

public WSDLModelImpl()
To create WSDLModelImpl from WSDL that doesn't have a system ID.

Method Detail

addMessage

public void addMessage(WSDLMessageImpl msg)

getMessage

public WSDLMessageImpl getMessage(QName name)

addPortType

public void addPortType(WSDLPortTypeImpl pt)

getPortType

public WSDLPortTypeImpl getPortType(QName name)
Description copied from interface: WSDLModel
Gets WSDLPortType that models wsdl:portType

Specified by:
getPortType in interface WSDLModel
Parameters:
name - non-null quaified name of wsdl:message, where the localName is the value of wsdl:portType@name and the namespaceURI is the value of wsdl:definitions@targetNamespace
Returns:
A WSDLPortType or null if no wsdl:portType found.

addBinding

public void addBinding(WSDLBoundPortTypeImpl boundPortType)

getBinding

public WSDLBoundPortTypeImpl getBinding(QName name)
Description copied from interface: WSDLModel
Gets WSDLBoundPortType that models wsdl:binding

Specified by:
getBinding in interface WSDLModel
Parameters:
name - non-null quaified name of wsdl:binding, where the localName is the value of wsdl:binding@name and the namespaceURI is the value of wsdl:definitions@targetNamespace
Returns:
A WSDLBoundPortType or null if no wsdl:binding found

addService

public void addService(WSDLServiceImpl svc)

getService

public WSDLServiceImpl getService(QName name)
Description copied from interface: WSDLModel
Gets WSDLService that models wsdl:service

Specified by:
getService in interface WSDLModel
Parameters:
name - non-null quaified name of wsdl:service, where the localName is the value of wsdl:service@name and the namespaceURI is the value of wsdl:definitions@targetNamespace
Returns:
A WSDLService or null if no wsdl:service found

getMessages

public Map<QName,WSDLMessageImpl> getMessages()

getPortTypes

@NotNull
public Map<QName,WSDLPortTypeImpl> getPortTypes()
Description copied from interface: WSDLModel
Gives a Map of wsdl:portType QName and WSDLPortType

Specified by:
getPortTypes in interface WSDLModel
Returns:
an empty Map if the wsdl document has no wsdl:portType

getBindings

@NotNull
public Map<QName,WSDLBoundPortType> getBindings()
Description copied from interface: WSDLModel
Gives a Map of wsdl:binding QName and WSDLBoundPortType

Specified by:
getBindings in interface WSDLModel
Returns:
an empty Map if the wsdl document has no wsdl:binding

getServices

@NotNull
public Map<QName,WSDLServiceImpl> getServices()
Description copied from interface: WSDLModel
Gives a Map of wsdl:service qualified name and WSDLService

Specified by:
getServices in interface WSDLModel
Returns:
an empty Map if the wsdl document has no wsdl:service

getFirstServiceName

public QName getFirstServiceName()
Returns the first service QName from insertion order


getFirstPortName

public QName getFirstPortName()
Returns first port QName from first service as per the insertion order


getMatchingPort

public WSDLPortImpl getMatchingPort(QName serviceName,
                                    QName portType)
gets the first port in the wsdl which matches the serviceName and portType


getBinding

public WSDLBoundPortTypeImpl getBinding(QName serviceName,
                                        QName portName)
Description copied from interface: WSDLModel
Give a WSDLBoundPortType for the given wsdl:service and wsdl:port names.

Specified by:
getBinding in interface WSDLModel
Parameters:
serviceName - non-null service QName
portName - non-null port QName
Returns:
WSDLBoundOperation on success otherwise null. throws NPE if any of the parameters null

getPolicyMap

public PolicyMap getPolicyMap()
Gives the PolicyMap associated with the WSDLModel

Specified by:
getPolicyMap in interface WSDLModel
Returns:
PolicyMap

setPolicyMap

public void setPolicyMap(PolicyMap policyMap)
Set PolicyMap for the WSDLModel.

Parameters:
policyMap -

freeze

public void freeze()
Invoked at the end of the model construction to fix up references, etc.


getExtensions

public final Iterable<WSDLExtension> getExtensions()
Description copied from interface: WSDLExtensible
Gets all the WSDLExtensions added through WSDLExtensible.addExtension(WSDLExtension).

Specified by:
getExtensions in interface WSDLExtensible
Returns:
never null.

getExtensions

public final <T extends WSDLExtension> Iterable<T> getExtensions(Class<T> type)
Description copied from interface: WSDLExtensible
Gets all the extensions that is assignable to the given type.

This allows clients to find specific extensions in a type-safe and convenient way.

Specified by:
getExtensions in interface WSDLExtensible
Parameters:
type - The type of the extension to obtain. Must not be null.
Returns:
Can be an empty fromjava.collection but never null.

getExtension

public <T extends WSDLExtension> T getExtension(Class<T> type)
Description copied from interface: WSDLExtensible
Gets the extension that is assignable to the given type.

This is just a convenient version that does

 Iterator itr = getExtensions(type);
 if(itr.hasNext())  return itr.next();
 else               return null;
 

Specified by:
getExtension in interface WSDLExtensible
Returns:
null if the extension was not found.

addExtension

public void addExtension(WSDLExtension ex)
Description copied from interface: WSDLExtensible
Adds a new WSDLExtension to this object.

Specified by:
addExtension in interface WSDLExtensible
Parameters:
ex - must not be null.

addNotUnderstoodExtension

public void addNotUnderstoodExtension(QName extnEl,
                                      Locator locator)
This can be used if a WSDL extension element that has wsdl:required=true is not understood

Parameters:
extnEl -
locator -

areRequiredExtensionsUnderstood

public boolean areRequiredExtensionsUnderstood()
This method should be called after freezing the WSDLModel

Returns:
true if all wsdl required extensions on Port and Binding are understood

getLocation

@NotNull
public final Locator getLocation()
Description copied from interface: WSDLObject
Gets the source location information in the parsed WSDL. This is useful when producing error messages.

Specified by:
getLocation in interface WSDLObject


Copyright © 2005-2013 Oracle Corporation. All Rights Reserved.