You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by jk...@apache.org on 2007/08/23 13:01:35 UTC
svn commit: r568932 [17/36] - in
/incubator/woden/trunk/java/src/org/apache/woden: ./ ant/ internal/
internal/resolver/ internal/schema/ internal/util/ internal/util/dom/
internal/util/om/ internal/wsdl20/ internal/wsdl20/extensions/
internal/wsdl20/ex...
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java Thu Aug 23 04:01:23 2007
@@ -1,173 +1,173 @@
-/**
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.woden.internal.wsdl20;
-
-import javax.xml.namespace.QName;
-
-import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.Description;
-import org.apache.woden.wsdl20.ElementDeclaration;
-import org.apache.woden.wsdl20.Interface;
-import org.apache.woden.wsdl20.InterfaceFault;
-import org.apache.woden.wsdl20.InterfaceOperation;
-import org.apache.woden.wsdl20.xml.DescriptionElement;
-import org.apache.woden.wsdl20.xml.InterfaceElement;
-import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
-import org.apache.woden.wsdl20.xml.TypesElement;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-import org.apache.woden.wsdl20.fragids.InterfaceFaultPart;
-
-/**
- * This class represents the InterfaceFault component from the WSDL 2.0 Component
- * Model and the <fault> child element of the <interface> element.
- *
- * @author jkaputin@apache.org
- */
-public class InterfaceFaultImpl extends NestedImpl
- implements InterfaceFault,
- InterfaceFaultElement
-{
- //WSDL Component model data
- private NCName fName = null;
-
- //XML Element model data
- private String fElementAttr = null; //value of the 'element' attribute info item
- private QName fElementName = null; //present if 'element' value is of type xs:QName
-
- /* ************************************************************
- * InterfaceFault methods (i.e. WSDL Component model)
- * ************************************************************/
-
- /*
- * @see org.apache.woden.wsdl20.InterfaceFault#getName()
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getName()
- */
- public QName getName()
- {
- QName name = null;
- if (fName != null) {
- String[] tns = DescriptionImpl.getTargetNamespaceAndPrefix(this);
- name = new QName(tns[0], fName.toString(), tns[1]);
- }
- return name;
- }
-
- /*
- * @see org.apache.woden.wsdl20.InterfaceFault#getMessageContentModel()
- */
- public String getMessageContentModel() {
-
- //this property is derived from the 'element' attribute info item
- String messageContentModel = null;
-
- if(fElementName != null) {
- //the 'element' attribute contains an xs:QName
- messageContentModel = Constants.NMTOKEN_ELEMENT;
- }
- else if(Constants.NMTOKEN_ANY.equals(fElementAttr) ||
- Constants.NMTOKEN_NONE.equals(fElementAttr) ||
- Constants.NMTOKEN_OTHER.equals(fElementAttr) ) {
- messageContentModel = fElementAttr;
- }
- else {
- //'element' does not contain #any, #none, #other or an xs:QNname
- //so it defaults to #other
- messageContentModel = Constants.NMTOKEN_OTHER;
- }
-
- return messageContentModel;
- }
-
- /*
- * @see org.apache.woden.wsdl20.InterfaceFault#getElementDeclaration()
- */
- public ElementDeclaration getElementDeclaration()
- {
- Interface interfac = (Interface)getParent();
- Description desc = ((InterfaceImpl)interfac).getDescriptionComponent();
- return desc.getElementDeclaration(fElementName);
- }
-
- /*
- * @see org.apache.woden.wsdl20.InterfaceFault#toElement()
- */
- public InterfaceFaultElement toElement() {
- return this;
- }
-
- /* ************************************************************
- * InterfaceFaultElement methods (i.e. XML Element model)
- * ************************************************************/
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#setName(NCName)
- */
- public void setName(NCName name)
- {
- fName = name;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#setElementName(QName)
- */
- public void setElementName(QName qname)
- {
- fElementName = qname;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getElementName()
- */
- public QName getElementName()
- {
- return fElementName;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getElement()
- */
- public XmlSchemaElement getElement()
- {
- XmlSchemaElement xse = null;
- InterfaceElement interfac = (InterfaceElement)getParentElement();
- DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
- TypesElement types = desc.getTypesElement();
- if(types != null) {
- xse = ((TypesImpl)types).getElementDeclaration(fElementName);
- }
- return xse;
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
- */
- public FragmentIdentifier getFragmentIdentifier() {
- Interface interfaceComp = (Interface)getParent();
-
- NCName interfaceName = new NCName(interfaceComp.getName().getLocalPart());
-
- return new FragmentIdentifier(new InterfaceFaultPart(interfaceName, fName));
- }
-
- /* ************************************************************
- * Non-API implementation methods
- * ************************************************************/
-
-}
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.woden.internal.wsdl20;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.Description;
+import org.apache.woden.wsdl20.ElementDeclaration;
+import org.apache.woden.wsdl20.Interface;
+import org.apache.woden.wsdl20.InterfaceFault;
+import org.apache.woden.wsdl20.InterfaceOperation;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
+import org.apache.woden.wsdl20.xml.TypesElement;
+import org.apache.ws.commons.schema.XmlSchemaElement;
+
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.fragids.InterfaceFaultPart;
+
+/**
+ * This class represents the InterfaceFault component from the WSDL 2.0 Component
+ * Model and the <fault> child element of the <interface> element.
+ *
+ * @author jkaputin@apache.org
+ */
+public class InterfaceFaultImpl extends NestedImpl
+ implements InterfaceFault,
+ InterfaceFaultElement
+{
+ //WSDL Component model data
+ private NCName fName = null;
+
+ //XML Element model data
+ private String fElementAttr = null; //value of the 'element' attribute info item
+ private QName fElementName = null; //present if 'element' value is of type xs:QName
+
+ /* ************************************************************
+ * InterfaceFault methods (i.e. WSDL Component model)
+ * ************************************************************/
+
+ /*
+ * @see org.apache.woden.wsdl20.InterfaceFault#getName()
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getName()
+ */
+ public QName getName()
+ {
+ QName name = null;
+ if (fName != null) {
+ String[] tns = DescriptionImpl.getTargetNamespaceAndPrefix(this);
+ name = new QName(tns[0], fName.toString(), tns[1]);
+ }
+ return name;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.InterfaceFault#getMessageContentModel()
+ */
+ public String getMessageContentModel() {
+
+ //this property is derived from the 'element' attribute info item
+ String messageContentModel = null;
+
+ if(fElementName != null) {
+ //the 'element' attribute contains an xs:QName
+ messageContentModel = Constants.NMTOKEN_ELEMENT;
+ }
+ else if(Constants.NMTOKEN_ANY.equals(fElementAttr) ||
+ Constants.NMTOKEN_NONE.equals(fElementAttr) ||
+ Constants.NMTOKEN_OTHER.equals(fElementAttr) ) {
+ messageContentModel = fElementAttr;
+ }
+ else {
+ //'element' does not contain #any, #none, #other or an xs:QNname
+ //so it defaults to #other
+ messageContentModel = Constants.NMTOKEN_OTHER;
+ }
+
+ return messageContentModel;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.InterfaceFault#getElementDeclaration()
+ */
+ public ElementDeclaration getElementDeclaration()
+ {
+ Interface interfac = (Interface)getParent();
+ Description desc = ((InterfaceImpl)interfac).getDescriptionComponent();
+ return desc.getElementDeclaration(fElementName);
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.InterfaceFault#toElement()
+ */
+ public InterfaceFaultElement toElement() {
+ return this;
+ }
+
+ /* ************************************************************
+ * InterfaceFaultElement methods (i.e. XML Element model)
+ * ************************************************************/
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#setName(NCName)
+ */
+ public void setName(NCName name)
+ {
+ fName = name;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#setElementName(QName)
+ */
+ public void setElementName(QName qname)
+ {
+ fElementName = qname;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getElementName()
+ */
+ public QName getElementName()
+ {
+ return fElementName;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getElement()
+ */
+ public XmlSchemaElement getElement()
+ {
+ XmlSchemaElement xse = null;
+ InterfaceElement interfac = (InterfaceElement)getParentElement();
+ DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
+ TypesElement types = desc.getTypesElement();
+ if(types != null) {
+ xse = ((TypesImpl)types).getElementDeclaration(fElementName);
+ }
+ return xse;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
+ */
+ public FragmentIdentifier getFragmentIdentifier() {
+ Interface interfaceComp = (Interface)getParent();
+
+ NCName interfaceName = new NCName(interfaceComp.getName().getLocalPart());
+
+ return new FragmentIdentifier(new InterfaceFaultPart(interfaceName, fName));
+ }
+
+ /* ************************************************************
+ * Non-API implementation methods
+ * ************************************************************/
+
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultReferenceImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultReferenceImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultReferenceImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultReferenceImpl.java Thu Aug 23 04:01:23 2007
@@ -1,156 +1,156 @@
-/**
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.woden.internal.wsdl20;
-
-import javax.xml.namespace.QName;
-
-import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.Interface;
-import org.apache.woden.wsdl20.InterfaceFault;
-import org.apache.woden.wsdl20.InterfaceFaultReference;
-import org.apache.woden.wsdl20.InterfaceOperation;
-import org.apache.woden.wsdl20.enumeration.Direction;
-import org.apache.woden.wsdl20.xml.InterfaceElement;
-import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
-import org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement;
-import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
-
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-import org.apache.woden.wsdl20.fragids.InterfaceFaultReferencePart;
-
-/**
- * This class represents the InterfaceFaultReference component of the
- * WSDL 2.0 Component model and the <infault> and <outfault>
- * child elements of an interface <operation>.
- *
- * @author jkaputin@apache.org
- */
-public class InterfaceFaultReferenceImpl extends NestedImpl
- implements InterfaceFaultReference,
- InterfaceFaultReferenceElement
-{
- private NCName fMessageLabel = null;
- private Direction fDirection = null;
- private QName fRef = null;
-
- /* ************************************************************
- * InterfaceFaultReference methods (i.e. WSDL Component model)
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceFaultReference#getInterfaceFault()
- */
- public InterfaceFault getInterfaceFault()
- {
- InterfaceOperation oper = (InterfaceOperation)getParent();
- Interface interfac = (Interface)oper.getParent();
- InterfaceFault intFault = interfac.getFromAllInterfaceFaults(fRef);
- return intFault;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceFaultReference#getMessageLabel()
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#getMessageLabel()
- */
- public NCName getMessageLabel() {
- return fMessageLabel;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceFaultReference#getDirection()
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#getDirection()
- */
- public Direction getDirection() {
- return fDirection;
- }
-
- /*
- * @see org.apache.woden.wsdl20.InterfaceFaultReference#toElement()
- */
- public InterfaceFaultReferenceElement toElement() {
- return this;
- }
-
- /* ************************************************************
- * InterfaceFaultReferenceElement methods (i.e. XML Element model)
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#setRef(javax.xml.namespace.QName)
- */
- public void setRef(QName faultQName) {
- fRef = faultQName;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#getRef()
- */
- public QName getRef() {
- return fRef;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#getInterfaceFaultElement()
- */
- public InterfaceFaultElement getInterfaceFaultElement()
- {
- InterfaceFaultElement fault = null;
- InterfaceOperationElement oper = (InterfaceOperationElement)getParentElement();
- InterfaceElement interfac = (InterfaceElement)oper.getParentElement();
- if (interfac != null) {
- InterfaceFault faultComp = ((Interface)interfac).getFromAllInterfaceFaults(fRef);
- if (faultComp != null) {
- fault = faultComp.toElement();
- }
- }
- return fault;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.FaultReferenceElement#setMessageLabel(org.apache.woden.wsdl20.enumeration.MessageLabel)
- */
- public void setMessageLabel(NCName msgLabel) {
- fMessageLabel = msgLabel;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.FaultReferenceElement#setDirection(org.apache.woden.wsdl20.enumeration.Direction)
- */
- public void setDirection(Direction dir) {
- fDirection = dir;
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
- */
- public FragmentIdentifier getFragmentIdentifier() {
- //Find parent components.
- InterfaceOperation interfaceOperationComp = (InterfaceOperation)getParent();
- Interface interfaceComp = (Interface)interfaceOperationComp.getParent();
- //Get needed properties.
- NCName interfaceName = new NCName(interfaceComp.getName().getLocalPart());
- NCName interfaceOperation = new NCName(interfaceOperationComp.getName().getLocalPart());
- //Return a new FragmentIdentifier.
- return new FragmentIdentifier(new InterfaceFaultReferencePart(interfaceName, interfaceOperation, fMessageLabel, fRef));
- }
-
- /* ************************************************************
- * Non-API implementation methods
- * ************************************************************/
-
-}
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.woden.internal.wsdl20;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.Interface;
+import org.apache.woden.wsdl20.InterfaceFault;
+import org.apache.woden.wsdl20.InterfaceFaultReference;
+import org.apache.woden.wsdl20.InterfaceOperation;
+import org.apache.woden.wsdl20.enumeration.Direction;
+import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement;
+import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
+
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.fragids.InterfaceFaultReferencePart;
+
+/**
+ * This class represents the InterfaceFaultReference component of the
+ * WSDL 2.0 Component model and the <infault> and <outfault>
+ * child elements of an interface <operation>.
+ *
+ * @author jkaputin@apache.org
+ */
+public class InterfaceFaultReferenceImpl extends NestedImpl
+ implements InterfaceFaultReference,
+ InterfaceFaultReferenceElement
+{
+ private NCName fMessageLabel = null;
+ private Direction fDirection = null;
+ private QName fRef = null;
+
+ /* ************************************************************
+ * InterfaceFaultReference methods (i.e. WSDL Component model)
+ * ************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceFaultReference#getInterfaceFault()
+ */
+ public InterfaceFault getInterfaceFault()
+ {
+ InterfaceOperation oper = (InterfaceOperation)getParent();
+ Interface interfac = (Interface)oper.getParent();
+ InterfaceFault intFault = interfac.getFromAllInterfaceFaults(fRef);
+ return intFault;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceFaultReference#getMessageLabel()
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#getMessageLabel()
+ */
+ public NCName getMessageLabel() {
+ return fMessageLabel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceFaultReference#getDirection()
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#getDirection()
+ */
+ public Direction getDirection() {
+ return fDirection;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.InterfaceFaultReference#toElement()
+ */
+ public InterfaceFaultReferenceElement toElement() {
+ return this;
+ }
+
+ /* ************************************************************
+ * InterfaceFaultReferenceElement methods (i.e. XML Element model)
+ * ************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#setRef(javax.xml.namespace.QName)
+ */
+ public void setRef(QName faultQName) {
+ fRef = faultQName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#getRef()
+ */
+ public QName getRef() {
+ return fRef;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement#getInterfaceFaultElement()
+ */
+ public InterfaceFaultElement getInterfaceFaultElement()
+ {
+ InterfaceFaultElement fault = null;
+ InterfaceOperationElement oper = (InterfaceOperationElement)getParentElement();
+ InterfaceElement interfac = (InterfaceElement)oper.getParentElement();
+ if (interfac != null) {
+ InterfaceFault faultComp = ((Interface)interfac).getFromAllInterfaceFaults(fRef);
+ if (faultComp != null) {
+ fault = faultComp.toElement();
+ }
+ }
+ return fault;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.FaultReferenceElement#setMessageLabel(org.apache.woden.wsdl20.enumeration.MessageLabel)
+ */
+ public void setMessageLabel(NCName msgLabel) {
+ fMessageLabel = msgLabel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.FaultReferenceElement#setDirection(org.apache.woden.wsdl20.enumeration.Direction)
+ */
+ public void setDirection(Direction dir) {
+ fDirection = dir;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
+ */
+ public FragmentIdentifier getFragmentIdentifier() {
+ //Find parent components.
+ InterfaceOperation interfaceOperationComp = (InterfaceOperation)getParent();
+ Interface interfaceComp = (Interface)interfaceOperationComp.getParent();
+ //Get needed properties.
+ NCName interfaceName = new NCName(interfaceComp.getName().getLocalPart());
+ NCName interfaceOperation = new NCName(interfaceOperationComp.getName().getLocalPart());
+ //Return a new FragmentIdentifier.
+ return new FragmentIdentifier(new InterfaceFaultReferencePart(interfaceName, interfaceOperation, fMessageLabel, fRef));
+ }
+
+ /* ************************************************************
+ * Non-API implementation methods
+ * ************************************************************/
+
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultReferenceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java Thu Aug 23 04:01:23 2007
@@ -1,554 +1,554 @@
-/**
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.woden.internal.wsdl20;
-
-import java.net.URI;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.Description;
-import org.apache.woden.wsdl20.Interface;
-import org.apache.woden.wsdl20.InterfaceFault;
-import org.apache.woden.wsdl20.InterfaceOperation;
-import org.apache.woden.wsdl20.WSDLComponent;
-import org.apache.woden.wsdl20.xml.InterfaceElement;
-import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
-import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-import org.apache.woden.wsdl20.fragids.InterfacePart;
-
-/**
- * This class represents the Interface component from the
- * WSDL 2.0 Component Model and <interface> element.
- *
- * @author jkaputin@apache.org
- */
-public class InterfaceImpl extends WSDLComponentImpl
- implements Interface, InterfaceElement
-{
- private WSDLElement fParentElem = null;
-
- /* This field refers to the Description component which contains this Interface
- * component in its {interfaces} property. It is set whenever this Interface is
- * returned by that Description's getInterfaces() or getInterface(QName) methods.
- * Note that with modularization via a wsdl import or include, this
- * reference may be different to fDescriptionElement because it refers to the
- * importing or including description at the top of the wsdl tree (whereas the
- * latter refers to the description in which this interface is directly declared).
- * This field is used to retrieve components that are available (i.e. in-scope)
- * to the top-level Description component. e.g. it is used with interface extension
- * to retrieve Interface components in this Interface's {extended interfaces}
- * property from the set of Interfaces available (i.e. in-scope) to the Description.
- */
- private Description fDescriptionComponent = null;
-
- private NCName fName = null;
- private List fExtends = new Vector();
- private List fStyleDefault = new Vector();
- private List fInterfaceFaultElements = new Vector();
- private List fInterfaceOperationElements = new Vector();
-
- /* ************************************************************
- * Interface interface methods (the WSDL Component model)
- * ************************************************************/
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getName()
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#getName()
- */
- public QName getName()
- {
- QName name = null;
- if (fName != null) {
- String[] tns = DescriptionImpl.getTargetNamespaceAndPrefix(this);
- name = new QName(tns[0], fName.toString(), tns[1]);
- }
- return name;
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getExtendedInterface(javax.xml.namespace.QName)
- */
- public Interface getExtendedInterface(QName qname)
- {
- Interface intface = fDescriptionComponent.getInterface(qname);
- return intface;
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getExtendedInterfaces()
- */
- public Interface[] getExtendedInterfaces()
- {
- List interfaces = new Vector();
- for(Iterator it = fExtends.iterator(); it.hasNext();)
- {
- QName qn = (QName)it.next();
- Interface intface = getExtendedInterface(qn);
- if(intface != null) interfaces.add(intface);
- }
-
- Interface[] array = new Interface[interfaces.size()];
- interfaces.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getInterfaceFaults()
- */
- public InterfaceFault[] getInterfaceFaults()
- {
- InterfaceFault[] array = new InterfaceFault[fInterfaceFaultElements.size()];
- fInterfaceFaultElements.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getInterfaceFault(javax.xml.namespace.QName)
- */
- public InterfaceFault getInterfaceFault(QName faultName)
- {
- return (InterfaceFault)getInterfaceFaultElement(faultName);
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getAllInterfaceFaults()
- */
- public InterfaceFault[] getAllInterfaceFaults()
- {
- List allInterfaces = new Vector();
- List allInterfaceFaults = new Vector();
- getAllInterfaceFaults(this, allInterfaces, allInterfaceFaults);
-
- InterfaceFault[] array = new InterfaceFault[allInterfaceFaults.size()];
- allInterfaceFaults.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getFromAllInterfaceFaults(javax.xml.namespace.QName)
- */
- public InterfaceFault getFromAllInterfaceFaults(QName faultName)
- {
- InterfaceFault theFault = null;
- if(faultName != null) {
- InterfaceFault[] faults = getAllInterfaceFaults();
- for(int i=0; i<faults.length; i++) {
- InterfaceFault fault = faults[i];
- if(faultName.equals(fault.getName())) {
- theFault = fault;
- break;
- }
- }
- }
- return theFault;
- }
-
- /*
- /*
- * @see org.apache.woden.wsdl20.Interface#getInterfaceOperations()
- */
- public InterfaceOperation[] getInterfaceOperations()
- {
- InterfaceOperation[] array = new InterfaceOperation[fInterfaceOperationElements.size()];
- fInterfaceOperationElements.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getInterfaceOperation(javax.xml.namespace.QName)
- */
- public InterfaceOperation getInterfaceOperation(QName operName)
- {
- return (InterfaceOperation)getInterfaceOperationElement(operName);
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getAllInterfaceOperations()
- */
- public InterfaceOperation[] getAllInterfaceOperations()
- {
- List allInterfaces = new Vector();
- List allInterfaceOperations = new Vector();
- getAllInterfaceOperations(this, allInterfaces, allInterfaceOperations);
-
- InterfaceOperation[] array = new InterfaceOperation[allInterfaceOperations.size()];
- allInterfaceOperations.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#getFromAllInterfaceOperations(javax.xml.namespace.QName)
- */
- public InterfaceOperation getFromAllInterfaceOperations(QName operName)
- {
- InterfaceOperation theOper = null;
- if(operName != null) {
- InterfaceOperation[] opers = getAllInterfaceOperations();
- for(int i=0; i<opers.length; i++) {
- InterfaceOperation oper = opers[i];
- if(operName.equals(oper.getName())) {
- theOper = oper;
- break;
- }
- }
- }
- return theOper;
- }
-
- /*
- * @see org.apache.woden.wsdl20.Interface#toElement()
- */
- public InterfaceElement toElement() {
- return this;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.WSDLComponent#equals(WSDLComponent)
- */
- public boolean equals(WSDLComponent comp)
- {
- //compare object refs
- if(this == comp) return true;
-
- if(!(comp instanceof Interface)) {
- return false;
- }
-
- Interface other = (Interface)comp;
-
- //compare {name}
- QName myName = getName();
- if(myName != null && !myName.equals(other.getName())) return false;
-
- /* To compare {extended interfaces} we cannot just retrieve and compare the two sets
- * of extended Interface components because we'd enter a recursive loop. To get the
- * extended interfaces (i.e. to resolve the qnames in the 'extends' attribute)
- * we need to get the set of interfaces available to the Description, which in turn
- * invokes this equivalence checking method.
- * Instead, compare just the qnames in the 'extends' attributes, but we first
- * eliminate any duplicate qnames to ensure we make a logical test for
- * equivalence (i.e. use Set comparison).
- */
- Set thisExtendsSet = new HashSet(fExtends);
- QName[] otherExtends = ((InterfaceElement)other).getExtendedInterfaceNames();
- Set otherExtendsSet = new HashSet();
- for(int i=0; i<otherExtends.length; i++)
- {
- otherExtendsSet.add(otherExtends[i]);
- }
- if(thisExtendsSet.size() != otherExtendsSet.size()) return false;
- if(!(thisExtendsSet.containsAll(otherExtendsSet) && otherExtendsSet.containsAll(thisExtendsSet)))
- {
- return false;
- }
-
- //TODO compare {interface faults}
- //TODO compare {interface operations}
-
- return true;
- }
-
- /* ************************************************************
- * InterfaceElement interface methods (the XML Element model)
- * ************************************************************/
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#setName(NCName)
- */
- public void setName(NCName name) {
- fName = name;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#addStyleDefaultURI(URI)
- */
- public void addStyleDefaultURI(URI uri)
- {
- if(uri != null) {
- fStyleDefault.add(uri);
- }
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#getStyleDefault()
- */
- public URI[] getStyleDefault()
- {
- URI[] array = new URI[fStyleDefault.size()];
- fStyleDefault.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#addExtendedInterfaceName(javax.xml.namespace.QName)
- */
- public void addExtendedInterfaceName(QName interfaceName)
- {
- if(interfaceName != null) {
- fExtends.add(interfaceName);
- }
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#removeExtendedInterfaceName(javax.xml.namespace.QName)
- */
- public void removeExtendedInterfaceName(QName interfaceName)
- {
- if(interfaceName != null) {
- fExtends.remove(interfaceName);
- }
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#getExtendedInterfaceNames()
- */
- public QName[] getExtendedInterfaceNames()
- {
- QName[] array = new QName[fExtends.size()];
- fExtends.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#getExtendedInterfaceElement(javax.xml.namespace.QName)
- */
- public InterfaceElement getExtendedInterfaceElement(QName interfaceName)
- {
- //Cast the containing description element to a description component to re-use its
- //logic for navigating a composite wsdl to retrieve the in-scope top-level components.
- Description desc = (Description)fParentElem;
- InterfaceElement intface = (InterfaceElement)desc.getInterface(interfaceName);
- return intface;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#getExtendedInterfaceElements()
- */
- public InterfaceElement[] getExtendedInterfaceElements()
- {
- List interfaces = new Vector();
- for(Iterator it = fExtends.iterator(); it.hasNext();)
- {
- QName qn = (QName)it.next();
- InterfaceElement intface = getExtendedInterfaceElement(qn);
- if(intface != null) interfaces.add(intface);
- }
-
- InterfaceElement[] array = new InterfaceElement[interfaces.size()];
- interfaces.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#addInterfaceFaultElement()
- */
- public InterfaceFaultElement addInterfaceFaultElement()
- {
- InterfaceFaultImpl fault = new InterfaceFaultImpl();
- fInterfaceFaultElements.add(fault);
- fault.setParentElement(this);
- return fault;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#getInterfaceFaultElement(javax.xml.namespace.QName)
- */
- public InterfaceFaultElement getInterfaceFaultElement(QName faultName)
- {
- InterfaceFaultElement fault = null;
-
- if(faultName != null)
- {
- InterfaceFaultElement tempFault = null;
- for(Iterator i=fInterfaceFaultElements.iterator(); i.hasNext(); )
- {
- tempFault = (InterfaceFaultElement)i.next();
- if(faultName.equals(tempFault.getName()))
- {
- fault = tempFault;
- break;
- }
- }
- }
-
- return fault;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#getInterfaceFaultElements()
- */
- public InterfaceFaultElement[] getInterfaceFaultElements()
- {
- InterfaceFaultElement[] array = new InterfaceFaultElement[fInterfaceFaultElements.size()];
- fInterfaceFaultElements.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#addInterfaceOperationElement()
- */
- public InterfaceOperationElement addInterfaceOperationElement()
- {
- InterfaceOperationImpl operation = new InterfaceOperationImpl();
- fInterfaceOperationElements.add(operation);
- operation.setParentElement(this);
- return operation;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#getInterfaceOperationElement(javax.xml.namespace.QName)
- */
- public InterfaceOperationElement getInterfaceOperationElement(QName operName)
- {
- InterfaceOperationElement oper = null;
-
- if(operName != null)
- {
- InterfaceOperationElement tempOper = null;
- for(Iterator i=fInterfaceOperationElements.iterator(); i.hasNext(); )
- {
- tempOper = (InterfaceOperationElement)i.next();
- if(operName.equals(tempOper.getName()))
- {
- oper = tempOper;
- break;
- }
- }
- }
-
- return oper;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceElement#getInterfaceOperationElements()
- */
- public InterfaceOperationElement[] getInterfaceOperationElements()
- {
- InterfaceOperationElement[] array = new InterfaceOperationElement[fInterfaceOperationElements.size()];
- fInterfaceOperationElements.toArray(array);
- return array;
- }
-
- /*
- * package private, used only by factory methods in this package
- */
- void setParentElement(WSDLElement parent) {
- fParentElem = parent;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.NestedElement#getParentElement()
- */
- public WSDLElement getParentElement() {
- return fParentElem;
- }
-
- /* ************************************************************
- * Non-API implementation methods
- * ************************************************************/
-
- /*
- * Retrieve all the interface operations declared by a specified interface or derived
- * from interfaces that it extends, directly or indirectly, and accumulate them in
- * the specified List. Eliminate duplicate operations.
- */
- private void getAllInterfaceOperations(Interface interfac, List allInterfaces, List allOpers) {
- //check for circular Interface references to avoid infinite loop
- if(containsComponent(interfac, allInterfaces)) {
- return;
- } else {
- allInterfaces.add(interfac);
- }
-
- //get the declared operations for the specified Interface
- InterfaceOperation[] declaredOpers = interfac.getInterfaceOperations();
- for(int i=0; i<declaredOpers.length; i++) {
- InterfaceOperation oper = declaredOpers[i];
- if(!containsComponent(oper, allOpers)) {
- allOpers.add(oper);
- }
- }
-
- //get the derived operations from each extended interface
- Interface[] extInts = interfac.getExtendedInterfaces();
- for(int j=0; j<extInts.length; j++) {
- getAllInterfaceOperations(extInts[j], allInterfaces, allOpers);
- }
- }
-
- /*
- * Retrieve all the interface faults declared by a specified interface or derived
- * from interfaces that it extends, directly or indirectly, and accumulate them in
- * the specified List. Eliminate duplicate faults.
- */
- private void getAllInterfaceFaults(Interface interfac, List allInterfaces, List allFaults) {
- //check for circular Interface references to avoid infinite loop
- if(containsComponent(interfac, allInterfaces)) {
- return;
- } else {
- allInterfaces.add(interfac);
- }
-
- //get the declared faults for the specified Interface
- InterfaceFault[] declaredFaults = interfac.getInterfaceFaults();
- for(int i=0; i<declaredFaults.length; i++) {
- InterfaceFault fault = declaredFaults[i];
- if(!containsComponent(fault, allFaults)) {
- allFaults.add(fault);
- }
- }
-
- //get the derived faults from each extended interface
- Interface[] extInts = interfac.getExtendedInterfaces();
- for(int j=0; j<extInts.length; j++) {
- getAllInterfaceFaults(extInts[j], allInterfaces, allFaults);
- }
- }
-
- /*
- * These package private accessors refer to the Description component
- * in which this Interface is contained (i.e. contained in its {interfaces}
- * property). They are declared package private so that they can be used by the
- * Woden implementation without exposing them to the API (i.e. by DescriptionImpl)
- */
- void setDescriptionComponent(Description desc)
- {
- fDescriptionComponent = desc;
- }
-
- Description getDescriptionComponent() {
- return fDescriptionComponent;
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
- */
- public FragmentIdentifier getFragmentIdentifier() {
- return new FragmentIdentifier(new InterfacePart(fName));
- }
-
-}
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.woden.internal.wsdl20;
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.Description;
+import org.apache.woden.wsdl20.Interface;
+import org.apache.woden.wsdl20.InterfaceFault;
+import org.apache.woden.wsdl20.InterfaceOperation;
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
+import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.fragids.InterfacePart;
+
+/**
+ * This class represents the Interface component from the
+ * WSDL 2.0 Component Model and <interface> element.
+ *
+ * @author jkaputin@apache.org
+ */
+public class InterfaceImpl extends WSDLComponentImpl
+ implements Interface, InterfaceElement
+{
+ private WSDLElement fParentElem = null;
+
+ /* This field refers to the Description component which contains this Interface
+ * component in its {interfaces} property. It is set whenever this Interface is
+ * returned by that Description's getInterfaces() or getInterface(QName) methods.
+ * Note that with modularization via a wsdl import or include, this
+ * reference may be different to fDescriptionElement because it refers to the
+ * importing or including description at the top of the wsdl tree (whereas the
+ * latter refers to the description in which this interface is directly declared).
+ * This field is used to retrieve components that are available (i.e. in-scope)
+ * to the top-level Description component. e.g. it is used with interface extension
+ * to retrieve Interface components in this Interface's {extended interfaces}
+ * property from the set of Interfaces available (i.e. in-scope) to the Description.
+ */
+ private Description fDescriptionComponent = null;
+
+ private NCName fName = null;
+ private List fExtends = new Vector();
+ private List fStyleDefault = new Vector();
+ private List fInterfaceFaultElements = new Vector();
+ private List fInterfaceOperationElements = new Vector();
+
+ /* ************************************************************
+ * Interface interface methods (the WSDL Component model)
+ * ************************************************************/
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getName()
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#getName()
+ */
+ public QName getName()
+ {
+ QName name = null;
+ if (fName != null) {
+ String[] tns = DescriptionImpl.getTargetNamespaceAndPrefix(this);
+ name = new QName(tns[0], fName.toString(), tns[1]);
+ }
+ return name;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getExtendedInterface(javax.xml.namespace.QName)
+ */
+ public Interface getExtendedInterface(QName qname)
+ {
+ Interface intface = fDescriptionComponent.getInterface(qname);
+ return intface;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getExtendedInterfaces()
+ */
+ public Interface[] getExtendedInterfaces()
+ {
+ List interfaces = new Vector();
+ for(Iterator it = fExtends.iterator(); it.hasNext();)
+ {
+ QName qn = (QName)it.next();
+ Interface intface = getExtendedInterface(qn);
+ if(intface != null) interfaces.add(intface);
+ }
+
+ Interface[] array = new Interface[interfaces.size()];
+ interfaces.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getInterfaceFaults()
+ */
+ public InterfaceFault[] getInterfaceFaults()
+ {
+ InterfaceFault[] array = new InterfaceFault[fInterfaceFaultElements.size()];
+ fInterfaceFaultElements.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getInterfaceFault(javax.xml.namespace.QName)
+ */
+ public InterfaceFault getInterfaceFault(QName faultName)
+ {
+ return (InterfaceFault)getInterfaceFaultElement(faultName);
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getAllInterfaceFaults()
+ */
+ public InterfaceFault[] getAllInterfaceFaults()
+ {
+ List allInterfaces = new Vector();
+ List allInterfaceFaults = new Vector();
+ getAllInterfaceFaults(this, allInterfaces, allInterfaceFaults);
+
+ InterfaceFault[] array = new InterfaceFault[allInterfaceFaults.size()];
+ allInterfaceFaults.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getFromAllInterfaceFaults(javax.xml.namespace.QName)
+ */
+ public InterfaceFault getFromAllInterfaceFaults(QName faultName)
+ {
+ InterfaceFault theFault = null;
+ if(faultName != null) {
+ InterfaceFault[] faults = getAllInterfaceFaults();
+ for(int i=0; i<faults.length; i++) {
+ InterfaceFault fault = faults[i];
+ if(faultName.equals(fault.getName())) {
+ theFault = fault;
+ break;
+ }
+ }
+ }
+ return theFault;
+ }
+
+ /*
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getInterfaceOperations()
+ */
+ public InterfaceOperation[] getInterfaceOperations()
+ {
+ InterfaceOperation[] array = new InterfaceOperation[fInterfaceOperationElements.size()];
+ fInterfaceOperationElements.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getInterfaceOperation(javax.xml.namespace.QName)
+ */
+ public InterfaceOperation getInterfaceOperation(QName operName)
+ {
+ return (InterfaceOperation)getInterfaceOperationElement(operName);
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getAllInterfaceOperations()
+ */
+ public InterfaceOperation[] getAllInterfaceOperations()
+ {
+ List allInterfaces = new Vector();
+ List allInterfaceOperations = new Vector();
+ getAllInterfaceOperations(this, allInterfaces, allInterfaceOperations);
+
+ InterfaceOperation[] array = new InterfaceOperation[allInterfaceOperations.size()];
+ allInterfaceOperations.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#getFromAllInterfaceOperations(javax.xml.namespace.QName)
+ */
+ public InterfaceOperation getFromAllInterfaceOperations(QName operName)
+ {
+ InterfaceOperation theOper = null;
+ if(operName != null) {
+ InterfaceOperation[] opers = getAllInterfaceOperations();
+ for(int i=0; i<opers.length; i++) {
+ InterfaceOperation oper = opers[i];
+ if(operName.equals(oper.getName())) {
+ theOper = oper;
+ break;
+ }
+ }
+ }
+ return theOper;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Interface#toElement()
+ */
+ public InterfaceElement toElement() {
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.WSDLComponent#equals(WSDLComponent)
+ */
+ public boolean equals(WSDLComponent comp)
+ {
+ //compare object refs
+ if(this == comp) return true;
+
+ if(!(comp instanceof Interface)) {
+ return false;
+ }
+
+ Interface other = (Interface)comp;
+
+ //compare {name}
+ QName myName = getName();
+ if(myName != null && !myName.equals(other.getName())) return false;
+
+ /* To compare {extended interfaces} we cannot just retrieve and compare the two sets
+ * of extended Interface components because we'd enter a recursive loop. To get the
+ * extended interfaces (i.e. to resolve the qnames in the 'extends' attribute)
+ * we need to get the set of interfaces available to the Description, which in turn
+ * invokes this equivalence checking method.
+ * Instead, compare just the qnames in the 'extends' attributes, but we first
+ * eliminate any duplicate qnames to ensure we make a logical test for
+ * equivalence (i.e. use Set comparison).
+ */
+ Set thisExtendsSet = new HashSet(fExtends);
+ QName[] otherExtends = ((InterfaceElement)other).getExtendedInterfaceNames();
+ Set otherExtendsSet = new HashSet();
+ for(int i=0; i<otherExtends.length; i++)
+ {
+ otherExtendsSet.add(otherExtends[i]);
+ }
+ if(thisExtendsSet.size() != otherExtendsSet.size()) return false;
+ if(!(thisExtendsSet.containsAll(otherExtendsSet) && otherExtendsSet.containsAll(thisExtendsSet)))
+ {
+ return false;
+ }
+
+ //TODO compare {interface faults}
+ //TODO compare {interface operations}
+
+ return true;
+ }
+
+ /* ************************************************************
+ * InterfaceElement interface methods (the XML Element model)
+ * ************************************************************/
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#setName(NCName)
+ */
+ public void setName(NCName name) {
+ fName = name;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#addStyleDefaultURI(URI)
+ */
+ public void addStyleDefaultURI(URI uri)
+ {
+ if(uri != null) {
+ fStyleDefault.add(uri);
+ }
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#getStyleDefault()
+ */
+ public URI[] getStyleDefault()
+ {
+ URI[] array = new URI[fStyleDefault.size()];
+ fStyleDefault.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#addExtendedInterfaceName(javax.xml.namespace.QName)
+ */
+ public void addExtendedInterfaceName(QName interfaceName)
+ {
+ if(interfaceName != null) {
+ fExtends.add(interfaceName);
+ }
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#removeExtendedInterfaceName(javax.xml.namespace.QName)
+ */
+ public void removeExtendedInterfaceName(QName interfaceName)
+ {
+ if(interfaceName != null) {
+ fExtends.remove(interfaceName);
+ }
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#getExtendedInterfaceNames()
+ */
+ public QName[] getExtendedInterfaceNames()
+ {
+ QName[] array = new QName[fExtends.size()];
+ fExtends.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#getExtendedInterfaceElement(javax.xml.namespace.QName)
+ */
+ public InterfaceElement getExtendedInterfaceElement(QName interfaceName)
+ {
+ //Cast the containing description element to a description component to re-use its
+ //logic for navigating a composite wsdl to retrieve the in-scope top-level components.
+ Description desc = (Description)fParentElem;
+ InterfaceElement intface = (InterfaceElement)desc.getInterface(interfaceName);
+ return intface;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#getExtendedInterfaceElements()
+ */
+ public InterfaceElement[] getExtendedInterfaceElements()
+ {
+ List interfaces = new Vector();
+ for(Iterator it = fExtends.iterator(); it.hasNext();)
+ {
+ QName qn = (QName)it.next();
+ InterfaceElement intface = getExtendedInterfaceElement(qn);
+ if(intface != null) interfaces.add(intface);
+ }
+
+ InterfaceElement[] array = new InterfaceElement[interfaces.size()];
+ interfaces.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#addInterfaceFaultElement()
+ */
+ public InterfaceFaultElement addInterfaceFaultElement()
+ {
+ InterfaceFaultImpl fault = new InterfaceFaultImpl();
+ fInterfaceFaultElements.add(fault);
+ fault.setParentElement(this);
+ return fault;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#getInterfaceFaultElement(javax.xml.namespace.QName)
+ */
+ public InterfaceFaultElement getInterfaceFaultElement(QName faultName)
+ {
+ InterfaceFaultElement fault = null;
+
+ if(faultName != null)
+ {
+ InterfaceFaultElement tempFault = null;
+ for(Iterator i=fInterfaceFaultElements.iterator(); i.hasNext(); )
+ {
+ tempFault = (InterfaceFaultElement)i.next();
+ if(faultName.equals(tempFault.getName()))
+ {
+ fault = tempFault;
+ break;
+ }
+ }
+ }
+
+ return fault;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#getInterfaceFaultElements()
+ */
+ public InterfaceFaultElement[] getInterfaceFaultElements()
+ {
+ InterfaceFaultElement[] array = new InterfaceFaultElement[fInterfaceFaultElements.size()];
+ fInterfaceFaultElements.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#addInterfaceOperationElement()
+ */
+ public InterfaceOperationElement addInterfaceOperationElement()
+ {
+ InterfaceOperationImpl operation = new InterfaceOperationImpl();
+ fInterfaceOperationElements.add(operation);
+ operation.setParentElement(this);
+ return operation;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#getInterfaceOperationElement(javax.xml.namespace.QName)
+ */
+ public InterfaceOperationElement getInterfaceOperationElement(QName operName)
+ {
+ InterfaceOperationElement oper = null;
+
+ if(operName != null)
+ {
+ InterfaceOperationElement tempOper = null;
+ for(Iterator i=fInterfaceOperationElements.iterator(); i.hasNext(); )
+ {
+ tempOper = (InterfaceOperationElement)i.next();
+ if(operName.equals(tempOper.getName()))
+ {
+ oper = tempOper;
+ break;
+ }
+ }
+ }
+
+ return oper;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceElement#getInterfaceOperationElements()
+ */
+ public InterfaceOperationElement[] getInterfaceOperationElements()
+ {
+ InterfaceOperationElement[] array = new InterfaceOperationElement[fInterfaceOperationElements.size()];
+ fInterfaceOperationElements.toArray(array);
+ return array;
+ }
+
+ /*
+ * package private, used only by factory methods in this package
+ */
+ void setParentElement(WSDLElement parent) {
+ fParentElem = parent;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.NestedElement#getParentElement()
+ */
+ public WSDLElement getParentElement() {
+ return fParentElem;
+ }
+
+ /* ************************************************************
+ * Non-API implementation methods
+ * ************************************************************/
+
+ /*
+ * Retrieve all the interface operations declared by a specified interface or derived
+ * from interfaces that it extends, directly or indirectly, and accumulate them in
+ * the specified List. Eliminate duplicate operations.
+ */
+ private void getAllInterfaceOperations(Interface interfac, List allInterfaces, List allOpers) {
+ //check for circular Interface references to avoid infinite loop
+ if(containsComponent(interfac, allInterfaces)) {
+ return;
+ } else {
+ allInterfaces.add(interfac);
+ }
+
+ //get the declared operations for the specified Interface
+ InterfaceOperation[] declaredOpers = interfac.getInterfaceOperations();
+ for(int i=0; i<declaredOpers.length; i++) {
+ InterfaceOperation oper = declaredOpers[i];
+ if(!containsComponent(oper, allOpers)) {
+ allOpers.add(oper);
+ }
+ }
+
+ //get the derived operations from each extended interface
+ Interface[] extInts = interfac.getExtendedInterfaces();
+ for(int j=0; j<extInts.length; j++) {
+ getAllInterfaceOperations(extInts[j], allInterfaces, allOpers);
+ }
+ }
+
+ /*
+ * Retrieve all the interface faults declared by a specified interface or derived
+ * from interfaces that it extends, directly or indirectly, and accumulate them in
+ * the specified List. Eliminate duplicate faults.
+ */
+ private void getAllInterfaceFaults(Interface interfac, List allInterfaces, List allFaults) {
+ //check for circular Interface references to avoid infinite loop
+ if(containsComponent(interfac, allInterfaces)) {
+ return;
+ } else {
+ allInterfaces.add(interfac);
+ }
+
+ //get the declared faults for the specified Interface
+ InterfaceFault[] declaredFaults = interfac.getInterfaceFaults();
+ for(int i=0; i<declaredFaults.length; i++) {
+ InterfaceFault fault = declaredFaults[i];
+ if(!containsComponent(fault, allFaults)) {
+ allFaults.add(fault);
+ }
+ }
+
+ //get the derived faults from each extended interface
+ Interface[] extInts = interfac.getExtendedInterfaces();
+ for(int j=0; j<extInts.length; j++) {
+ getAllInterfaceFaults(extInts[j], allInterfaces, allFaults);
+ }
+ }
+
+ /*
+ * These package private accessors refer to the Description component
+ * in which this Interface is contained (i.e. contained in its {interfaces}
+ * property). They are declared package private so that they can be used by the
+ * Woden implementation without exposing them to the API (i.e. by DescriptionImpl)
+ */
+ void setDescriptionComponent(Description desc)
+ {
+ fDescriptionComponent = desc;
+ }
+
+ Description getDescriptionComponent() {
+ return fDescriptionComponent;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
+ */
+ public FragmentIdentifier getFragmentIdentifier() {
+ return new FragmentIdentifier(new InterfacePart(fName));
+ }
+
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceMessageReferenceImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceMessageReferenceImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceMessageReferenceImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceMessageReferenceImpl.java Thu Aug 23 04:01:23 2007
@@ -1,180 +1,180 @@
-/**
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.woden.internal.wsdl20;
-
-import javax.xml.namespace.QName;
-
-import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.Description;
-import org.apache.woden.wsdl20.ElementDeclaration;
-import org.apache.woden.wsdl20.Interface;
-import org.apache.woden.wsdl20.InterfaceMessageReference;
-import org.apache.woden.wsdl20.InterfaceOperation;
-import org.apache.woden.wsdl20.enumeration.Direction;
-import org.apache.woden.wsdl20.xml.DescriptionElement;
-import org.apache.woden.wsdl20.xml.InterfaceElement;
-import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
-import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
-import org.apache.woden.wsdl20.xml.TypesElement;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-import org.apache.woden.wsdl20.fragids.InterfaceMessageReferencePart;
-
-/**
- * This class represents the <input> and <output>
- * child elements of interface operation.
- *
- * @author jkaputin@apache.org
- */
-public class InterfaceMessageReferenceImpl extends NestedImpl
- implements InterfaceMessageReference,
- InterfaceMessageReferenceElement
-{
- //WSDL Component model data
- private NCName fMessageLabel = null;
- private Direction fDirection = null;
- private String fMessageContentModel = null;
-
- //XML Element model data
- private QName fElementName = null;
-
-
- /* ************************************************************
- * InterfaceMessageReference methods (the WSDL Component model)
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceMessageReference#getMessageLabel()
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getMessageLabel()
- */
- public NCName getMessageLabel() {
- return fMessageLabel;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceMessageReference#getDirection()
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getDirection()
- */
- public Direction getDirection() {
- return fDirection;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceMessageReference#getMessageContentModel()
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getMessageContentModel()
- */
- public String getMessageContentModel() {
- return fMessageContentModel;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceMessageReference#getElementDeclaration()
- */
- public ElementDeclaration getElementDeclaration()
- {
- InterfaceOperation oper = (InterfaceOperation)getParent();
- Interface interfac = (Interface)oper.getParent();
- Description desc = ((InterfaceImpl)interfac).getDescriptionComponent();
- ElementDeclaration elemDecl = desc.getElementDeclaration(fElementName);
- return elemDecl;
- }
-
- /*
- * @see org.apache.woden.wsdl20.InterfaceMessageReference#toElement()
- */
- public InterfaceMessageReferenceElement toElement() {
- return this;
- }
-
- /* ************************************************************
- * InterfaceMessageReferenceElement methods (the XML Element model)
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setMessageLabel(org.apache.woden.wsdl20.enumeration.MessageLabel)
- */
- public void setMessageLabel(NCName msgLabel) {
- fMessageLabel = msgLabel;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setMessageContentModel(java.lang.String)
- */
- public void setMessageContentModel(String nmToken) {
- fMessageContentModel = nmToken;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setElementName(javax.xml.namespace.QName)
- */
- public void setElementName(QName element) {
- fElementName = element;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getElementName()
- */
- public QName getElementName() {
- return fElementName;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getElement()
- */
- public XmlSchemaElement getElement()
- {
- XmlSchemaElement xse = null;
- if(Constants.NMTOKEN_ELEMENT.equals(fMessageContentModel))
- {
- InterfaceOperationElement oper = (InterfaceOperationElement)getParentElement();
- InterfaceElement interfac = (InterfaceElement)oper.getParentElement();
- DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
- TypesElement types = desc.getTypesElement();
- if(types != null) {
- xse = ((TypesImpl)types).getElementDeclaration(fElementName);
- }
- }
- return xse;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setDirection(org.apache.woden.wsdl20.enumeration.Direction)
- */
- public void setDirection(Direction dir) {
- fDirection = dir;
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
- */
- public FragmentIdentifier getFragmentIdentifier() {
- InterfaceOperation interfaceOperationComp = (InterfaceOperation)getParent();
- Interface interfaceComp = (Interface)interfaceOperationComp.getParent();
-
- NCName interfaceName = new NCName(interfaceComp.getName().getLocalPart());
- NCName interfaceOperation = new NCName(interfaceOperationComp.getName().getLocalPart());
-
- return new FragmentIdentifier(new InterfaceMessageReferencePart(interfaceName, interfaceOperation, fMessageLabel));
- }
-
- /* ************************************************************
- * Non-API implementation methods
- * ************************************************************/
-
-}
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.woden.internal.wsdl20;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.Description;
+import org.apache.woden.wsdl20.ElementDeclaration;
+import org.apache.woden.wsdl20.Interface;
+import org.apache.woden.wsdl20.InterfaceMessageReference;
+import org.apache.woden.wsdl20.InterfaceOperation;
+import org.apache.woden.wsdl20.enumeration.Direction;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
+import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
+import org.apache.woden.wsdl20.xml.TypesElement;
+import org.apache.ws.commons.schema.XmlSchemaElement;
+
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.fragids.InterfaceMessageReferencePart;
+
+/**
+ * This class represents the <input> and <output>
+ * child elements of interface operation.
+ *
+ * @author jkaputin@apache.org
+ */
+public class InterfaceMessageReferenceImpl extends NestedImpl
+ implements InterfaceMessageReference,
+ InterfaceMessageReferenceElement
+{
+ //WSDL Component model data
+ private NCName fMessageLabel = null;
+ private Direction fDirection = null;
+ private String fMessageContentModel = null;
+
+ //XML Element model data
+ private QName fElementName = null;
+
+
+ /* ************************************************************
+ * InterfaceMessageReference methods (the WSDL Component model)
+ * ************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceMessageReference#getMessageLabel()
+ * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getMessageLabel()
+ */
+ public NCName getMessageLabel() {
+ return fMessageLabel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceMessageReference#getDirection()
+ * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getDirection()
+ */
+ public Direction getDirection() {
+ return fDirection;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceMessageReference#getMessageContentModel()
+ * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getMessageContentModel()
+ */
+ public String getMessageContentModel() {
+ return fMessageContentModel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceMessageReference#getElementDeclaration()
+ */
+ public ElementDeclaration getElementDeclaration()
+ {
+ InterfaceOperation oper = (InterfaceOperation)getParent();
+ Interface interfac = (Interface)oper.getParent();
+ Description desc = ((InterfaceImpl)interfac).getDescriptionComponent();
+ ElementDeclaration elemDecl = desc.getElementDeclaration(fElementName);
+ return elemDecl;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.InterfaceMessageReference#toElement()
+ */
+ public InterfaceMessageReferenceElement toElement() {
+ return this;
+ }
+
+ /* ************************************************************
+ * InterfaceMessageReferenceElement methods (the XML Element model)
+ * ************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setMessageLabel(org.apache.woden.wsdl20.enumeration.MessageLabel)
+ */
+ public void setMessageLabel(NCName msgLabel) {
+ fMessageLabel = msgLabel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setMessageContentModel(java.lang.String)
+ */
+ public void setMessageContentModel(String nmToken) {
+ fMessageContentModel = nmToken;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setElementName(javax.xml.namespace.QName)
+ */
+ public void setElementName(QName element) {
+ fElementName = element;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getElementName()
+ */
+ public QName getElementName() {
+ return fElementName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getElement()
+ */
+ public XmlSchemaElement getElement()
+ {
+ XmlSchemaElement xse = null;
+ if(Constants.NMTOKEN_ELEMENT.equals(fMessageContentModel))
+ {
+ InterfaceOperationElement oper = (InterfaceOperationElement)getParentElement();
+ InterfaceElement interfac = (InterfaceElement)oper.getParentElement();
+ DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
+ TypesElement types = desc.getTypesElement();
+ if(types != null) {
+ xse = ((TypesImpl)types).getElementDeclaration(fElementName);
+ }
+ }
+ return xse;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setDirection(org.apache.woden.wsdl20.enumeration.Direction)
+ */
+ public void setDirection(Direction dir) {
+ fDirection = dir;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
+ */
+ public FragmentIdentifier getFragmentIdentifier() {
+ InterfaceOperation interfaceOperationComp = (InterfaceOperation)getParent();
+ Interface interfaceComp = (Interface)interfaceOperationComp.getParent();
+
+ NCName interfaceName = new NCName(interfaceComp.getName().getLocalPart());
+ NCName interfaceOperation = new NCName(interfaceOperationComp.getName().getLocalPart());
+
+ return new FragmentIdentifier(new InterfaceMessageReferencePart(interfaceName, interfaceOperation, fMessageLabel));
+ }
+
+ /* ************************************************************
+ * Non-API implementation methods
+ * ************************************************************/
+
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceMessageReferenceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org