- java.lang.Object
-
- com.sun.xml.ws.model.wsdl.WSDLModelImpl
-
- All Implemented Interfaces:
com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel,WSDLExtensible,WSDLModel,WSDLObject
public final class WSDLModelImpl extends Object implements com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel
Implementation ofWSDLModel- 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 createWSDLModelImplfrom 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(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundPortType boundPortType)Add BindingvoidaddExtension(WSDLExtension ex)Adds a newWSDLExtensionto this object.voidaddMessage(com.sun.xml.ws.api.model.wsdl.editable.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(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPortType pt)Add port typevoidaddService(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLService svc)Add servicebooleanareRequiredExtensionsUnderstood()This method should be called after freezing the WSDLModelvoidfinalizeRpcLitBinding(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundPortType boundPortType)Finalize rpc-lit bindingvoidfreeze()Invoked at the end of the model construction to fix up references, etc.com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundPortTypegetBinding(QName name)GetsWSDLBoundPortTypethat modelswsdl:bindingcom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundPortTypegetBinding(QName serviceName, QName portName)Give aWSDLBoundPortTypefor the given wsdl:service and wsdl:port names.Map<QName,? extends com.sun.xml.ws.api.model.wsdl.editable.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.com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLMessagegetMessage(QName name)Returns the message with the given QNameMap<QName,com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLMessage>getMessages()Gives aMapof wsdl:message qualified name andcom.sun.xml.ws.api.model.wsdl.WSDLMesageList<? extends com.sun.xml.ws.model.wsdl.AbstractExtensibleImpl.UnknownWSDLExtension>getNotUnderstoodExtensions()Lists extensions marked as not understoodcom.sun.xml.ws.policy.PolicyMapgetPolicyMap()Gives the PolicyMap associated with the WSDLModelcom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPortTypegetPortType(QName name)GetsWSDLPortTypethat modelswsdl:portTypeMap<QName,com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPortType>getPortTypes()com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLServicegetService(QName name)GetsWSDLServicethat modelswsdl:serviceMap<QName,com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLService>getServices()Gives aMapof wsdl:service qualified name andWSDLServicevoidsetPolicyMap(com.sun.xml.ws.policy.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 createWSDLModelImplfrom WSDL that doesn't have a system ID.
-
-
Method Detail
-
addMessage
public void addMessage(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLMessage msg)
Description copied from interface:com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModelAdd message- Specified by:
addMessagein interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Parameters:
msg- Message
-
getMessage
public com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLMessage getMessage(QName name)
Description copied from interface:WSDLModelReturns the message with the given QName- Specified by:
getMessagein interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Specified by:
getMessagein interfaceWSDLModel- Parameters:
name- Message name- Returns:
- Message
-
addPortType
public void addPortType(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPortType pt)
Description copied from interface:com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModelAdd port type- Specified by:
addPortTypein interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Parameters:
pt- Port type
-
getPortType
public com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPortType getPortType(QName name)
Description copied from interface:WSDLModelGetsWSDLPortTypethat modelswsdl:portType- Specified by:
getPortTypein interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- 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(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundPortType boundPortType)
Description copied from interface:com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModelAdd Binding- Specified by:
addBindingin interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Parameters:
boundPortType- Bound port type
-
getBinding
public com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundPortType getBinding(QName name)
Description copied from interface:WSDLModelGetsWSDLBoundPortTypethat modelswsdl:binding- Specified by:
getBindingin interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- 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(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLService svc)
Description copied from interface:com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModelAdd service- Specified by:
addServicein interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Parameters:
svc- Service
-
getService
public com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLService getService(QName name)
Description copied from interface:WSDLModelGetsWSDLServicethat modelswsdl:service- Specified by:
getServicein interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- 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,com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLMessage> getMessages()
Description copied from interface:WSDLModelGives aMapof wsdl:message qualified name andcom.sun.xml.ws.api.model.wsdl.WSDLMesage- Specified by:
getMessagesin interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Specified by:
getMessagesin interfaceWSDLModel- Returns:
- an empty Map if the wsdl document has no wsdl:message
-
getPortTypes
@NotNull public Map<QName,com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPortType> getPortTypes()
Description copied from interface:WSDLModel- Specified by:
getPortTypesin interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Specified by:
getPortTypesin interfaceWSDLModel- Returns:
- an empty Map if the wsdl document has no wsdl:portType
-
getBindings
@NotNull public Map<QName,? extends com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundPortType> getBindings()
Description copied from interface:WSDLModel- Specified by:
getBindingsin interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Specified by:
getBindingsin interfaceWSDLModel- Returns:
- an empty Map if the wsdl document has no wsdl:binding
-
getServices
@NotNull public Map<QName,com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLService> getServices()
Description copied from interface:WSDLModelGives aMapof wsdl:service qualified name andWSDLService- Specified by:
getServicesin interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- 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 com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundPortType getBinding(QName serviceName, QName portName)
Description copied from interface:WSDLModelGive aWSDLBoundPortTypefor the given wsdl:service and wsdl:port names.- Specified by:
getBindingin interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- 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(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundPortType boundPortType)
Description copied from interface:com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModelFinalize rpc-lit binding- Specified by:
finalizeRpcLitBindingin interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Parameters:
boundPortType- Binding
-
getPolicyMap
public com.sun.xml.ws.policy.PolicyMap getPolicyMap()
Gives the PolicyMap associated with the WSDLModel- Specified by:
getPolicyMapin interfaceWSDLModel- Returns:
- PolicyMap
-
setPolicyMap
public void setPolicyMap(com.sun.xml.ws.policy.PolicyMap policyMap)
Set PolicyMap for the WSDLModel.- Specified by:
setPolicyMapin interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel- Parameters:
policyMap-
-
freeze
public void freeze()
Invoked at the end of the model construction to fix up references, etc.- Specified by:
freezein interfacecom.sun.xml.ws.api.model.wsdl.editable.EditableWSDLModel
-
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
-
-