Package com.sun.xml.ws.model.wsdl
Class WSDLModelImpl
- java.lang.Object
-
- com.sun.xml.ws.model.wsdl.WSDLModelImpl
-
- All Implemented Interfaces:
EditableWSDLModel,WSDLExtensible,WSDLModel,WSDLObject
public final class WSDLModelImpl extends Object implements EditableWSDLModel
Implementation of WSDLModel- Author:
- Vivek Pandey
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.sun.xml.ws.api.model.wsdl.WSDLModel
WSDLModel.WSDLParser
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<WSDLExtension>extensionsprotected List<com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension>notUnderstoodExtensions
-
Constructor Summary
Constructors Constructor Description WSDLModelImpl()To create WSDLModelImpl from WSDL that doesn't have a system ID.WSDLModelImpl(String systemId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBinding(EditableWSDLBoundPortType boundPortType)Add BindingvoidaddExtension(WSDLExtension ex)Adds a newWSDLExtensionto this object.voidaddMessage(EditableWSDLMessage msg)Add messagevoidaddNotUnderstoodExtension(QName extnEl, Locator locator)This can be used if a WSDL extension element that has wsdl:required=true is not understoodvoidaddPortType(EditableWSDLPortType pt)Add port typevoidaddService(EditableWSDLService svc)Add servicebooleanareRequiredExtensionsUnderstood()This method should be called after freezing the WSDLModelvoidfinalizeRpcLitBinding(EditableWSDLBoundPortType boundPortType)Finalize rpc-lit bindingvoidfreeze()Invoked at the end of the model construction to fix up references, etc.EditableWSDLBoundPortTypegetBinding(QName name)GetsWSDLBoundPortTypethat modelswsdl:bindingEditableWSDLBoundPortTypegetBinding(QName serviceName, QName portName)Give aWSDLBoundPortTypefor the given wsdl:service and wsdl:port names.Map<QName,? extends EditableWSDLBoundPortType>getBindings()<T extends WSDLExtension>
TgetExtension(Class<T> type)Gets the extension that is assignable to the given type.Iterable<WSDLExtension>getExtensions()Gets all theWSDLExtensions added throughWSDLExtensible.addExtension(WSDLExtension).<T extends WSDLExtension>
Iterable<T>getExtensions(Class<T> type)Gets all the extensions that is assignable to the given type.QNamegetFirstServiceName()Returns the first service QName from insertion orderLocatorgetLocation()Gets the source location information in the parsed WSDL.EditableWSDLMessagegetMessage(QName name)Returns the message with the given QNameMap<QName,EditableWSDLMessage>getMessages()Gives aMapof wsdl:message qualified name andWSDLMessageList<? extends com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension>getNotUnderstoodExtensions()Lists extensions marked as not understoodPolicyMapgetPolicyMap()Gives the PolicyMap associated with the WSDLModelEditableWSDLPortTypegetPortType(QName name)GetsWSDLPortTypethat modelswsdl:portTypeMap<QName,EditableWSDLPortType>getPortTypes()EditableWSDLServicegetService(QName name)GetsWSDLServicethat modelswsdl:serviceMap<QName,EditableWSDLService>getServices()Gives aMapof wsdl:service qualified name andWSDLServicevoidsetPolicyMap(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, addNotUnderstoodExtension, areRequiredExtensionsUnderstood, getExtension, getExtensions, getExtensions, getNotUnderstoodExtensions
-
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(EditableWSDLMessage msg)
Description copied from interface:EditableWSDLModelAdd message- Specified by:
addMessagein interfaceEditableWSDLModel- Parameters:
msg- Message
-
getMessage
public EditableWSDLMessage getMessage(QName name)
Description copied from interface:WSDLModelReturns the message with the given QName- Specified by:
getMessagein interfaceEditableWSDLModel- Specified by:
getMessagein interfaceWSDLModel- Parameters:
name- Message name- Returns:
- Message
-
addPortType
public void addPortType(EditableWSDLPortType pt)
Description copied from interface:EditableWSDLModelAdd port type- Specified by:
addPortTypein interfaceEditableWSDLModel- Parameters:
pt- Port type
-
getPortType
public EditableWSDLPortType getPortType(QName name)
Description copied from interface:WSDLModelGetsWSDLPortTypethat modelswsdl:portType- Specified by:
getPortTypein interfaceEditableWSDLModel- Specified by:
getPortTypein interfaceWSDLModel- Parameters:
name- non-null quaified name of wsdl:message, where the localName is the value ofwsdl:portType@nameand the namespaceURI is the value of wsdl:definitions@targetNamespace- Returns:
- A
WSDLPortTypeor null if no wsdl:portType found.
-
addBinding
public void addBinding(EditableWSDLBoundPortType boundPortType)
Description copied from interface:EditableWSDLModelAdd Binding- Specified by:
addBindingin interfaceEditableWSDLModel- Parameters:
boundPortType- Bound port type
-
getBinding
public EditableWSDLBoundPortType getBinding(QName name)
Description copied from interface:WSDLModelGetsWSDLBoundPortTypethat modelswsdl:binding- Specified by:
getBindingin interfaceEditableWSDLModel- Specified by:
getBindingin interfaceWSDLModel- Parameters:
name- non-null quaified name of wsdl:binding, where the localName is the value ofwsdl:binding@nameand the namespaceURI is the value of wsdl:definitions@targetNamespace- Returns:
- A
WSDLBoundPortTypeor null if no wsdl:binding found
-
addService
public void addService(EditableWSDLService svc)
Description copied from interface:EditableWSDLModelAdd service- Specified by:
addServicein interfaceEditableWSDLModel- Parameters:
svc- Service
-
getService
public EditableWSDLService getService(QName name)
Description copied from interface:WSDLModelGetsWSDLServicethat modelswsdl:service- Specified by:
getServicein interfaceEditableWSDLModel- Specified by:
getServicein interfaceWSDLModel- Parameters:
name- non-null quaified name of wsdl:service, where the localName is the value ofwsdl:service@nameand the namespaceURI is the value of wsdl:definitions@targetNamespace- Returns:
- A
WSDLServiceor null if no wsdl:service found
-
getMessages
public Map<QName,EditableWSDLMessage> getMessages()
Description copied from interface:WSDLModelGives aMapof wsdl:message qualified name andWSDLMessage- Specified by:
getMessagesin interfaceEditableWSDLModel- Specified by:
getMessagesin interfaceWSDLModel- Returns:
- an empty Map if the wsdl document has no wsdl:message
-
getPortTypes
@NotNull public Map<QName,EditableWSDLPortType> getPortTypes()
Description copied from interface:WSDLModel- Specified by:
getPortTypesin interfaceEditableWSDLModel- Specified by:
getPortTypesin interfaceWSDLModel- Returns:
- an empty Map if the wsdl document has no wsdl:portType
-
getBindings
@NotNull public Map<QName,? extends EditableWSDLBoundPortType> getBindings()
Description copied from interface:WSDLModel- Specified by:
getBindingsin interfaceEditableWSDLModel- Specified by:
getBindingsin interfaceWSDLModel- Returns:
- an empty Map if the wsdl document has no wsdl:binding
-
getServices
@NotNull public Map<QName,EditableWSDLService> getServices()
Description copied from interface:WSDLModelGives aMapof wsdl:service qualified name andWSDLService- Specified by:
getServicesin interfaceEditableWSDLModel- Specified by:
getServicesin interfaceWSDLModel- Returns:
- an empty Map if the wsdl document has no wsdl:service
-
getFirstServiceName
public QName getFirstServiceName()
Returns the first service QName from insertion order- Specified by:
getFirstServiceNamein interfaceWSDLModel
-
getBinding
public EditableWSDLBoundPortType getBinding(QName serviceName, QName portName)
Description copied from interface:WSDLModelGive aWSDLBoundPortTypefor the given wsdl:service and wsdl:port names.- Specified by:
getBindingin interfaceEditableWSDLModel- Specified by:
getBindingin interfaceWSDLModel- Parameters:
serviceName- non-null service QNameportName- non-null port QName- Returns:
- WSDLBoundOperation on success otherwise null. throws NPE if any of the parameters null
-
finalizeRpcLitBinding
public void finalizeRpcLitBinding(EditableWSDLBoundPortType boundPortType)
Description copied from interface:EditableWSDLModelFinalize rpc-lit binding- Specified by:
finalizeRpcLitBindingin interfaceEditableWSDLModel- Parameters:
boundPortType- Binding
-
getPolicyMap
public PolicyMap getPolicyMap()
Gives the PolicyMap associated with the WSDLModel- Specified by:
getPolicyMapin interfaceWSDLModel- Returns:
- PolicyMap
-
setPolicyMap
public void setPolicyMap(PolicyMap policyMap)
Set PolicyMap for the WSDLModel.- Specified by:
setPolicyMapin interfaceEditableWSDLModel- Parameters:
policyMap-
-
freeze
public void freeze()
Invoked at the end of the model construction to fix up references, etc.- Specified by:
freezein interfaceEditableWSDLModel
-
getExtensions
public final Iterable<WSDLExtension> getExtensions()
Description copied from interface:WSDLExtensibleGets all theWSDLExtensions added throughWSDLExtensible.addExtension(WSDLExtension).- Specified by:
getExtensionsin interfaceWSDLExtensible- Returns:
- never null.
-
getExtensions
public final <T extends WSDLExtension> Iterable<T> getExtensions(Class<T> type)
Description copied from interface:WSDLExtensibleGets 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:
getExtensionsin interfaceWSDLExtensible- 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:WSDLExtensibleGets 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:
getExtensionin interfaceWSDLExtensible- Returns:
- null if the extension was not found.
-
addExtension
public void addExtension(WSDLExtension ex)
Description copied from interface:WSDLExtensibleAdds a newWSDLExtensionto this object.- Specified by:
addExtensionin interfaceWSDLExtensible- Parameters:
ex- must not be null.
-
getNotUnderstoodExtensions
public List<? extends com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension> getNotUnderstoodExtensions()
Description copied from interface:WSDLExtensibleLists extensions marked as not understood- Specified by:
getNotUnderstoodExtensionsin interfaceWSDLExtensible- Returns:
- List of not understood extensions
-
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- Specified by:
addNotUnderstoodExtensionin interfaceWSDLExtensible- Parameters:
extnEl-locator-
-
areRequiredExtensionsUnderstood
public boolean areRequiredExtensionsUnderstood()
This method should be called after freezing the WSDLModel- Specified by:
areRequiredExtensionsUnderstoodin interfaceWSDLExtensible- Returns:
- true if all wsdl required extensions on Port and Binding are understood
-
getLocation
@NotNull public final Locator getLocation()
Description copied from interface:WSDLObjectGets the source location information in the parsed WSDL. This is useful when producing error messages.- Specified by:
getLocationin interfaceWSDLObject
-
-