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 [18/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/InterfaceOperationImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceOperationImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceOperationImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceOperationImpl.java Thu Aug 23 04:01:23 2007
@@ -1,244 +1,244 @@
-/**
+/**
* 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.List;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.InterfaceFaultReference;
-import org.apache.woden.wsdl20.InterfaceMessageReference;
-import org.apache.woden.wsdl20.InterfaceOperation;
-import org.apache.woden.wsdl20.Interface;
-import org.apache.woden.wsdl20.xml.InterfaceElement;
-import org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement;
-import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
-import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
-
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-import org.apache.woden.wsdl20.fragids.InterfaceOperationPart;
-
-/**
- * This class represents the InterfaceOperation component from the WSDL 2.0 Component
- * Model and the <operation> child element of the <interface> element.
- *
- * @author jkaputin@apache.org
- */
-public class InterfaceOperationImpl extends NestedImpl
- implements InterfaceOperation,
- InterfaceOperationElement
-{
- //Component data
- private NCName fName = null;
- private URI fMessageExchangePattern = null;
- private List fStyle = new Vector();
-
- //XML data
- private List fMessageRefs = new Vector();
- private List fFaultRefs = new Vector();
-
- /* ************************************************************
- * InterfaceOperation methods (the WSDL Component model)
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceOperation#getName()
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#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;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceOperation#getMessageExchangePattern()
- */
- public URI getMessageExchangePattern()
- {
- return (fMessageExchangePattern != null) ?
- fMessageExchangePattern : Constants.MEP_URI_IN_OUT;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceOperation#getInterfaceMessageReferences()
- */
- public InterfaceMessageReference[] getInterfaceMessageReferences()
- {
- InterfaceMessageReference[] array = new InterfaceMessageReference[fMessageRefs.size()];
- fMessageRefs.toArray(array);
- return array;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceOperation#getInterfaceFaultReferences()
- */
- public InterfaceFaultReference[] getInterfaceFaultReferences()
- {
- InterfaceFaultReference[] array = new InterfaceFaultReference[fFaultRefs.size()];
- fFaultRefs.toArray(array);
- return array;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.InterfaceOperation#getStyle()
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#getStyle()
- */
- public URI[] getStyle()
- {
- URI[] array = new URI[0];
- if(fStyle.size() > 0)
- {
- array = new URI[fStyle.size()];
- fStyle.toArray(array);
- } else {
- InterfaceElement intf = (InterfaceElement)getParentElement();
- URI[] styleDef = intf.getStyleDefault();
- if(styleDef.length > 0) {
- array = styleDef;
- }
- }
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.InterfaceOperation#toElement()
- */
- public InterfaceOperationElement toElement() {
- return this;
- }
-
- /* ************************************************************
- * InterfaceOperationElement methods (the XML model)
- * ************************************************************/
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#setName(NCName)
- */
- public void setName(NCName name)
- {
- fName = name;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#setPattern(URI)
- */
- public void setPattern(URI uri)
- {
- fMessageExchangePattern = uri;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#getPattern()
- */
- public URI getPattern()
- {
- return fMessageExchangePattern;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#addStyleURI(URI)
- */
- public void addStyleURI(URI uri)
- {
- if(uri != null) {
- fStyle.add(uri);
- }
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#removeStyleURI(URI)
- */
- public void removeStyleURI(URI uri)
- {
- fStyle.remove(uri);
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#addInterfaceMessageReferenceElement()
- */
- public InterfaceMessageReferenceElement addInterfaceMessageReferenceElement()
- {
- InterfaceMessageReferenceImpl msgRef = new InterfaceMessageReferenceImpl();
- fMessageRefs.add(msgRef);
- msgRef.setParentElement(this);
- return msgRef;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#removeInterfaceMessageReferenceElement(InterfaceMessageReferenceElement)
- */
- public void removeInterfaceMessageReferenceElement(InterfaceMessageReferenceElement msgRef)
- {
- fMessageRefs.remove(msgRef);
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#getInterfaceMessageReferenceElements()
- */
- public InterfaceMessageReferenceElement[] getInterfaceMessageReferenceElements()
- {
- InterfaceMessageReferenceElement[] array = new InterfaceMessageReferenceElement[fMessageRefs.size()];
- fMessageRefs.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#addInterfaceFaultReferenceElement()
- */
- public InterfaceFaultReferenceElement addInterfaceFaultReferenceElement()
- {
- InterfaceFaultReferenceImpl faultRef = new InterfaceFaultReferenceImpl();
- fFaultRefs.add(faultRef);
- faultRef.setParentElement(this);
- return faultRef;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#removeInterfaceFaultReferenceElement(InterfaceFaultReferenceElement)
- */
- public void removeInterfaceFaultReferenceElement(InterfaceFaultReferenceElement faultRef)
- {
- fFaultRefs.remove(faultRef);
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#getInterfaceFaultReferenceElements()
- */
- public InterfaceFaultReferenceElement[] getInterfaceFaultReferenceElements()
- {
- InterfaceFaultReferenceElement[] array = new InterfaceFaultReferenceElement[fFaultRefs.size()];
- fFaultRefs.toArray(array);
- return array;
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
- */
- public FragmentIdentifier getFragmentIdentifier() {
- NCName interfaceName = new NCName(((Interface)this.getParent()).getName().getLocalPart());
- return new FragmentIdentifier(new InterfaceOperationPart(interfaceName, 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.List;
+import java.util.Vector;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.InterfaceFaultReference;
+import org.apache.woden.wsdl20.InterfaceMessageReference;
+import org.apache.woden.wsdl20.InterfaceOperation;
+import org.apache.woden.wsdl20.Interface;
+import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement;
+import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
+import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
+
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.fragids.InterfaceOperationPart;
+
+/**
+ * This class represents the InterfaceOperation component from the WSDL 2.0 Component
+ * Model and the <operation> child element of the <interface> element.
+ *
+ * @author jkaputin@apache.org
+ */
+public class InterfaceOperationImpl extends NestedImpl
+ implements InterfaceOperation,
+ InterfaceOperationElement
+{
+ //Component data
+ private NCName fName = null;
+ private URI fMessageExchangePattern = null;
+ private List fStyle = new Vector();
+
+ //XML data
+ private List fMessageRefs = new Vector();
+ private List fFaultRefs = new Vector();
+
+ /* ************************************************************
+ * InterfaceOperation methods (the WSDL Component model)
+ * ************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceOperation#getName()
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#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;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceOperation#getMessageExchangePattern()
+ */
+ public URI getMessageExchangePattern()
+ {
+ return (fMessageExchangePattern != null) ?
+ fMessageExchangePattern : Constants.MEP_URI_IN_OUT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceOperation#getInterfaceMessageReferences()
+ */
+ public InterfaceMessageReference[] getInterfaceMessageReferences()
+ {
+ InterfaceMessageReference[] array = new InterfaceMessageReference[fMessageRefs.size()];
+ fMessageRefs.toArray(array);
+ return array;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceOperation#getInterfaceFaultReferences()
+ */
+ public InterfaceFaultReference[] getInterfaceFaultReferences()
+ {
+ InterfaceFaultReference[] array = new InterfaceFaultReference[fFaultRefs.size()];
+ fFaultRefs.toArray(array);
+ return array;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.InterfaceOperation#getStyle()
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#getStyle()
+ */
+ public URI[] getStyle()
+ {
+ URI[] array = new URI[0];
+ if(fStyle.size() > 0)
+ {
+ array = new URI[fStyle.size()];
+ fStyle.toArray(array);
+ } else {
+ InterfaceElement intf = (InterfaceElement)getParentElement();
+ URI[] styleDef = intf.getStyleDefault();
+ if(styleDef.length > 0) {
+ array = styleDef;
+ }
+ }
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.InterfaceOperation#toElement()
+ */
+ public InterfaceOperationElement toElement() {
+ return this;
+ }
+
+ /* ************************************************************
+ * InterfaceOperationElement methods (the XML model)
+ * ************************************************************/
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#setName(NCName)
+ */
+ public void setName(NCName name)
+ {
+ fName = name;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#setPattern(URI)
+ */
+ public void setPattern(URI uri)
+ {
+ fMessageExchangePattern = uri;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#getPattern()
+ */
+ public URI getPattern()
+ {
+ return fMessageExchangePattern;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#addStyleURI(URI)
+ */
+ public void addStyleURI(URI uri)
+ {
+ if(uri != null) {
+ fStyle.add(uri);
+ }
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#removeStyleURI(URI)
+ */
+ public void removeStyleURI(URI uri)
+ {
+ fStyle.remove(uri);
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#addInterfaceMessageReferenceElement()
+ */
+ public InterfaceMessageReferenceElement addInterfaceMessageReferenceElement()
+ {
+ InterfaceMessageReferenceImpl msgRef = new InterfaceMessageReferenceImpl();
+ fMessageRefs.add(msgRef);
+ msgRef.setParentElement(this);
+ return msgRef;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#removeInterfaceMessageReferenceElement(InterfaceMessageReferenceElement)
+ */
+ public void removeInterfaceMessageReferenceElement(InterfaceMessageReferenceElement msgRef)
+ {
+ fMessageRefs.remove(msgRef);
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#getInterfaceMessageReferenceElements()
+ */
+ public InterfaceMessageReferenceElement[] getInterfaceMessageReferenceElements()
+ {
+ InterfaceMessageReferenceElement[] array = new InterfaceMessageReferenceElement[fMessageRefs.size()];
+ fMessageRefs.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#addInterfaceFaultReferenceElement()
+ */
+ public InterfaceFaultReferenceElement addInterfaceFaultReferenceElement()
+ {
+ InterfaceFaultReferenceImpl faultRef = new InterfaceFaultReferenceImpl();
+ fFaultRefs.add(faultRef);
+ faultRef.setParentElement(this);
+ return faultRef;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#removeInterfaceFaultReferenceElement(InterfaceFaultReferenceElement)
+ */
+ public void removeInterfaceFaultReferenceElement(InterfaceFaultReferenceElement faultRef)
+ {
+ fFaultRefs.remove(faultRef);
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.InterfaceOperationElement#getInterfaceFaultReferenceElements()
+ */
+ public InterfaceFaultReferenceElement[] getInterfaceFaultReferenceElements()
+ {
+ InterfaceFaultReferenceElement[] array = new InterfaceFaultReferenceElement[fFaultRefs.size()];
+ fFaultRefs.toArray(array);
+ return array;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
+ */
+ public FragmentIdentifier getFragmentIdentifier() {
+ NCName interfaceName = new NCName(((Interface)this.getParent()).getName().getLocalPart());
+ return new FragmentIdentifier(new InterfaceOperationPart(interfaceName, fName));
+ }
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/InterfaceOperationImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/NestedImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/NestedImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/NestedImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/NestedImpl.java Thu Aug 23 04:01:23 2007
@@ -1,58 +1,58 @@
-/**
+/**
* 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 org.apache.woden.wsdl20.NestedComponent;
-import org.apache.woden.wsdl20.WSDLComponent;
-import org.apache.woden.wsdl20.xml.NestedElement;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-
-/**
- * This abstract superclass implements support for accessing or
- * setting the 'parent' of a nested WSDL component.
- * All such classes will directly or indirectly extend this abstract
- * class.
- *
- * @author jkaputin@apache.org
- */
-public abstract class NestedImpl extends WSDLComponentImpl
- implements NestedComponent,
- NestedElement
-{
- private WSDLElement fParentElem = null;
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.NestedComponent#getParent()
- */
- public WSDLComponent getParent() {
- return (WSDLComponent)fParentElem;
- }
-
- /*
- * 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;
- }
-}
+ *
+ * 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 org.apache.woden.wsdl20.NestedComponent;
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.xml.NestedElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+
+/**
+ * This abstract superclass implements support for accessing or
+ * setting the 'parent' of a nested WSDL component.
+ * All such classes will directly or indirectly extend this abstract
+ * class.
+ *
+ * @author jkaputin@apache.org
+ */
+public abstract class NestedImpl extends WSDLComponentImpl
+ implements NestedComponent,
+ NestedElement
+{
+ private WSDLElement fParentElem = null;
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.NestedComponent#getParent()
+ */
+ public WSDLComponent getParent() {
+ return (WSDLComponent)fParentElem;
+ }
+
+ /*
+ * 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;
+ }
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/NestedImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/ServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/ServiceImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/ServiceImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/ServiceImpl.java Thu Aug 23 04:01:23 2007
@@ -1,230 +1,230 @@
-/**
+/**
* 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.util.Iterator;
-import java.util.List;
-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.Endpoint;
-import org.apache.woden.wsdl20.Interface;
-import org.apache.woden.wsdl20.Service;
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-import org.apache.woden.wsdl20.fragids.TypeDefinitionPart;
-import org.apache.woden.wsdl20.xml.EndpointElement;
-import org.apache.woden.wsdl20.xml.InterfaceElement;
-import org.apache.woden.wsdl20.xml.ServiceElement;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-import org.apache.woden.wsdl20.fragids.ServicePart;
-
-/**
- * This class represents the Service component and the
- * <service> element.
- *
- * @author John Kaputin (jkaputin@apache.org)
- */
-public class ServiceImpl extends WSDLComponentImpl
- implements Service, ServiceElement
-{
- private WSDLElement fParentElem = null;
-
- /* This field refers to the Description component which contains this Service
- * component in its {services} property. It is set whenever this Service is
- * returned by that Description's getServices() or getService(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 service is directly declared).
- * This field is used to retrieve components that are available (i.e. in-scope)
- * to the top-level Description component.
- */
- private Description fDescriptionComponent = null;
-
- private NCName fName = null;
- private QName fInterfaceName = null;
- private List fEndpoints = new Vector();
-
- /* ************************************************************
- * Service interface methods (the WSDL Component model)
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.Service#getName()
- * @see org.apache.woden.wsdl20.xml.ServiceElement#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;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.Service#getInterface()
- */
- public Interface getInterface()
- {
- Description desc = fDescriptionComponent;
- Interface interfac = desc.getInterface(fInterfaceName);
- return interfac;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.Service#getEndpoint(org.apache.woden.types.NCName)
- *
- * TODO add a testcase for this method
- */
- public Endpoint getEndpoint(NCName name)
- {
- Endpoint endpoint = null;
- if(name != null)
- {
- String nameString = name.toString();
- for(Iterator i=fEndpoints.iterator(); i.hasNext(); )
- {
- Endpoint tmpEP = (Endpoint)i.next();
- String tmpStr = tmpEP.getName() != null ? tmpEP.getName().toString() : null;
- if(nameString.equals(tmpStr))
- {
- endpoint = tmpEP;
- break;
- }
- }
- }
- return endpoint;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.Service#getEndpoints()
- */
- public Endpoint[] getEndpoints() {
- Endpoint[] array = new Endpoint[fEndpoints.size()];
- fEndpoints.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.Service#toElement()
- */
- public ServiceElement toElement() {
- return this;
- }
-
- /* ************************************************************
- * ServiceElement interface methods (the XML Element model)
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.ServiceElement#setName(NCName)
- */
- public void setName(NCName name) {
- fName = name;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.ServiceElement#setInterfaceName(javax.xml.namespace.QName)
- */
- public void setInterfaceName(QName qname) {
- fInterfaceName = qname;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.ServiceElement#getInterfaceName()
- */
- public QName getInterfaceName() {
- return fInterfaceName;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.ServiceElement#getInterfaceElement()
- */
- public InterfaceElement getInterfaceElement()
- {
- //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 interfac = (InterfaceElement)desc.getInterface(fInterfaceName);
- return interfac;
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.ServiceElement#addEndpointElement()
- */
- public EndpointElement addEndpointElement()
- {
- EndpointImpl endpoint = new EndpointImpl();
- fEndpoints.add(endpoint);
- endpoint.setParentElement(this);
- return endpoint;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.ServiceElement#getEndpointElements()
- */
- public EndpointElement[] getEndpointElements() {
- EndpointElement[] array = new EndpointElement[fEndpoints.size()];
- fEndpoints.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
- * ************************************************************/
-
- /*
- * These package private accessors refer to the Description component
- * in which this Service is contained (i.e. contained in its {services}
- * 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;
- }
-
- public FragmentIdentifier getFragmentIdentifier() {
- return new FragmentIdentifier(new ServicePart(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.util.Iterator;
+import java.util.List;
+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.Endpoint;
+import org.apache.woden.wsdl20.Interface;
+import org.apache.woden.wsdl20.Service;
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.fragids.TypeDefinitionPart;
+import org.apache.woden.wsdl20.xml.EndpointElement;
+import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.ServiceElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.fragids.ServicePart;
+
+/**
+ * This class represents the Service component and the
+ * <service> element.
+ *
+ * @author John Kaputin (jkaputin@apache.org)
+ */
+public class ServiceImpl extends WSDLComponentImpl
+ implements Service, ServiceElement
+{
+ private WSDLElement fParentElem = null;
+
+ /* This field refers to the Description component which contains this Service
+ * component in its {services} property. It is set whenever this Service is
+ * returned by that Description's getServices() or getService(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 service is directly declared).
+ * This field is used to retrieve components that are available (i.e. in-scope)
+ * to the top-level Description component.
+ */
+ private Description fDescriptionComponent = null;
+
+ private NCName fName = null;
+ private QName fInterfaceName = null;
+ private List fEndpoints = new Vector();
+
+ /* ************************************************************
+ * Service interface methods (the WSDL Component model)
+ * ************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.Service#getName()
+ * @see org.apache.woden.wsdl20.xml.ServiceElement#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;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.Service#getInterface()
+ */
+ public Interface getInterface()
+ {
+ Description desc = fDescriptionComponent;
+ Interface interfac = desc.getInterface(fInterfaceName);
+ return interfac;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.Service#getEndpoint(org.apache.woden.types.NCName)
+ *
+ * TODO add a testcase for this method
+ */
+ public Endpoint getEndpoint(NCName name)
+ {
+ Endpoint endpoint = null;
+ if(name != null)
+ {
+ String nameString = name.toString();
+ for(Iterator i=fEndpoints.iterator(); i.hasNext(); )
+ {
+ Endpoint tmpEP = (Endpoint)i.next();
+ String tmpStr = tmpEP.getName() != null ? tmpEP.getName().toString() : null;
+ if(nameString.equals(tmpStr))
+ {
+ endpoint = tmpEP;
+ break;
+ }
+ }
+ }
+ return endpoint;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.Service#getEndpoints()
+ */
+ public Endpoint[] getEndpoints() {
+ Endpoint[] array = new Endpoint[fEndpoints.size()];
+ fEndpoints.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.Service#toElement()
+ */
+ public ServiceElement toElement() {
+ return this;
+ }
+
+ /* ************************************************************
+ * ServiceElement interface methods (the XML Element model)
+ * ************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.ServiceElement#setName(NCName)
+ */
+ public void setName(NCName name) {
+ fName = name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.ServiceElement#setInterfaceName(javax.xml.namespace.QName)
+ */
+ public void setInterfaceName(QName qname) {
+ fInterfaceName = qname;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.ServiceElement#getInterfaceName()
+ */
+ public QName getInterfaceName() {
+ return fInterfaceName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.ServiceElement#getInterfaceElement()
+ */
+ public InterfaceElement getInterfaceElement()
+ {
+ //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 interfac = (InterfaceElement)desc.getInterface(fInterfaceName);
+ return interfac;
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.ServiceElement#addEndpointElement()
+ */
+ public EndpointElement addEndpointElement()
+ {
+ EndpointImpl endpoint = new EndpointImpl();
+ fEndpoints.add(endpoint);
+ endpoint.setParentElement(this);
+ return endpoint;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.ServiceElement#getEndpointElements()
+ */
+ public EndpointElement[] getEndpointElements() {
+ EndpointElement[] array = new EndpointElement[fEndpoints.size()];
+ fEndpoints.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
+ * ************************************************************/
+
+ /*
+ * These package private accessors refer to the Description component
+ * in which this Service is contained (i.e. contained in its {services}
+ * 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;
+ }
+
+ public FragmentIdentifier getFragmentIdentifier() {
+ return new FragmentIdentifier(new ServicePart(fName));
+ }
+
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/ServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java Thu Aug 23 04:01:23 2007
@@ -1,117 +1,117 @@
-/**
+/**
* 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 javax.xml.namespace.QName;
-
-import org.apache.woden.WSDLReader;
-import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.TypeDefinition;
-
-import org.apache.woden.wsdl20.fragids.ElementDeclarationPart;
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-import org.apache.woden.wsdl20.fragids.TypeDefinitionPart;
-
-/**
- * This class represents a TypeDefinition property of the Description component.
- * It refers to a global type definition provided by the underlying type
- * system (e.g. XML Schema)
- *
- * @author jkaputin@apache.org
- */
-public class TypeDefinitionImpl implements TypeDefinition {
-
- private QName fName = null;
- private URI fSystem = null;
- private String fContentModel = null;
- private Object fContent = null;
-
- /* ************************************************************
- * TypeDefinition interface methods (the WSDL Component model)
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.TypeDefinition#getName()
- */
- public QName getName()
- {
- return fName;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.TypeDefinition#getSystem()
- */
- public URI getSystem()
- {
- return fSystem;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.TypeDefinition#getContentModel()
- */
- public String getContentModel()
- {
- return fContentModel;
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.TypeDefinition#getContent()
- */
- public Object getContent()
- {
- return fContent;
- }
-
- /* ************************************************************
- * Non-API implementation methods
- * ************************************************************/
-
- public void setName(QName name)
- {
- fName = name;
- }
-
- public void setSystem(URI typeSystemURI)
- {
- fSystem = typeSystemURI;
- }
-
- public void setContentModel(String contentModel)
- {
- fContentModel = contentModel;
- }
-
- public void setContent(Object typeDefContent)
- {
- fContent = typeDefContent;
- }
-
- public FragmentIdentifier getFragmentIdentifier() {
- if (fSystem == null | fSystem.toString().equals(WSDLReader.TYPE_XSD_2001)) {
- return new FragmentIdentifier(new TypeDefinitionPart(fName));
- } else {
- return new FragmentIdentifier(new TypeDefinitionPart(fName, fSystem));
- }
- }
-
- public String toString() {
- return getFragmentIdentifier().toString();
- }
-
-}
+ *
+ * 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 javax.xml.namespace.QName;
+
+import org.apache.woden.WSDLReader;
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.TypeDefinition;
+
+import org.apache.woden.wsdl20.fragids.ElementDeclarationPart;
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.fragids.TypeDefinitionPart;
+
+/**
+ * This class represents a TypeDefinition property of the Description component.
+ * It refers to a global type definition provided by the underlying type
+ * system (e.g. XML Schema)
+ *
+ * @author jkaputin@apache.org
+ */
+public class TypeDefinitionImpl implements TypeDefinition {
+
+ private QName fName = null;
+ private URI fSystem = null;
+ private String fContentModel = null;
+ private Object fContent = null;
+
+ /* ************************************************************
+ * TypeDefinition interface methods (the WSDL Component model)
+ * ************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.TypeDefinition#getName()
+ */
+ public QName getName()
+ {
+ return fName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.TypeDefinition#getSystem()
+ */
+ public URI getSystem()
+ {
+ return fSystem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.TypeDefinition#getContentModel()
+ */
+ public String getContentModel()
+ {
+ return fContentModel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.TypeDefinition#getContent()
+ */
+ public Object getContent()
+ {
+ return fContent;
+ }
+
+ /* ************************************************************
+ * Non-API implementation methods
+ * ************************************************************/
+
+ public void setName(QName name)
+ {
+ fName = name;
+ }
+
+ public void setSystem(URI typeSystemURI)
+ {
+ fSystem = typeSystemURI;
+ }
+
+ public void setContentModel(String contentModel)
+ {
+ fContentModel = contentModel;
+ }
+
+ public void setContent(Object typeDefContent)
+ {
+ fContent = typeDefContent;
+ }
+
+ public FragmentIdentifier getFragmentIdentifier() {
+ if (fSystem == null | fSystem.toString().equals(WSDLReader.TYPE_XSD_2001)) {
+ return new FragmentIdentifier(new TypeDefinitionPart(fName));
+ } else {
+ return new FragmentIdentifier(new TypeDefinitionPart(fName, fSystem));
+ }
+ }
+
+ public String toString() {
+ return getFragmentIdentifier().toString();
+ }
+
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java Thu Aug 23 04:01:23 2007
@@ -1,318 +1,318 @@
-/**
+/**
* 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.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.apache.woden.internal.schema.SchemaImpl;
-import org.apache.woden.schema.ImportedSchema;
-import org.apache.woden.schema.InlinedSchema;
-import org.apache.woden.schema.Schema;
-import org.apache.woden.wsdl20.xml.TypesElement;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaType;
-
-/**
- * This class represents the WSDL <types> element.
- *
- * TODO consider methods to get directly declared schemas vs getting all 'in-scope' schemas from the wsdl tree.
- *
- * @author jkaputin@apache.org
- */
-public class TypesImpl extends DocumentableImpl
- implements TypesElement
-{
- private WSDLElement fParentElem = null;
- private String fTypeSystem = null;
- private List fSchemas = new Vector();
-
- //TODO extension attributes and elements
-
- /*
- * @see org.apache.woden.wsdl20.xml.TypesElement#setTypeSystem(java.lang.String)
- */
- public void setTypeSystem(String typeSystem)
- {
- fTypeSystem = typeSystem;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.TypesElement#getTypeSystem()
- */
- public String getTypeSystem()
- {
- return fTypeSystem;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.TypesElement#addSchema(org.apache.woden.schema.Schema)
- */
- public void addSchema(Schema schema)
- {
- if(schema != null) {
- fSchemas.add(schema);
- }
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.TypesElement#removeSchema(org.apache.woden.schema.Schema)
- */
- public void removeSchema(Schema schema)
- {
- fSchemas.remove(schema);
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.TypesElement#getSchemas()
- */
- public Schema[] getSchemas()
- {
- Schema[] array = new Schema[fSchemas.size()];
- fSchemas.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.TypesElement#getSchemas(java.net.URI)
- */
- public Schema[] getSchemas(URI namespace)
- {
- List schemas = new Vector();
- Iterator i = fSchemas.iterator();
-
- if(namespace != null)
- {
- while(i.hasNext()) {
- Schema s = (Schema)i.next();
- if(namespace.equals(s.getNamespace())) {
- schemas.add(s);
- }
- }
- }
- else
- {
- //get schemas whose namespace is missing
- while(i.hasNext()) {
- Schema s = (Schema)i.next();
- if(s.getNamespace() == null) {
- schemas.add(s);
- }
- }
- }
-
- Schema[] array = new Schema[schemas.size()];
- schemas.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.TypesElement#getInlinedSchemas()
- */
- public InlinedSchema[] getInlinedSchemas()
- {
- List schemas = new Vector();
- Iterator i = fSchemas.iterator();
- while(i.hasNext()) {
- Schema s = (Schema)i.next();
- if(s instanceof InlinedSchema) {
- schemas.add(s);
- }
- }
-
- InlinedSchema[] array = new InlinedSchema[schemas.size()];
- schemas.toArray(array);
- return array;
- }
-
- /*
- * @see org.apache.woden.wsdl20.xml.TypesElement#getImportedSchemas()
- */
- public ImportedSchema[] getImportedSchemas()
- {
- List schemas = new Vector();
- Iterator i = fSchemas.iterator();
- while(i.hasNext()) {
- Schema s = (Schema)i.next();
- if(s instanceof ImportedSchema) {
- schemas.add(s);
- }
- }
-
- ImportedSchema[] array = new ImportedSchema[schemas.size()];
- schemas.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
- * ************************************************************/
-
- /*
- * TODO decide if this helper method should be on the API, either as-is or replaced by method that returns all accessible schemas.
- *
- * Returns the schema element declaration identified by the QName,
- * providing the element declaration is referenceable to the
- * WSDL description (i.e. visible). This means it must exist in a
- * Schema that has been inlined or resolved from a schema import
- * within the <types> element according to the schema
- * referenceability rules in the WSDL 2.0 spec.
- * If the element declaration is not referenceable, null is returned.
- * If validation is disabled, the referenceability rules do not apply
- * so all schemas are considered referenceable by the WSDL.
- *
- * TODO tbd - @see org.apache.woden.wsdl20.xml.TypesElement#getElementDeclaration(javax.xml.namespace.QName)
- */
- public XmlSchemaElement getElementDeclaration(QName qname)
- {
- // Can't resolve the element if the QName is null.
- if(qname == null)
- return null;
-
- XmlSchemaElement xmlSchemaElement = null;
- List schemas = getReferenceableSchemaDefs(qname.getNamespaceURI());
- if(schemas != null)
- {
- //search the schemas with this qname's namespace
- Iterator i = schemas.iterator();
- while(i.hasNext())
- {
- XmlSchema xmlSchema = (XmlSchema)i.next();
- xmlSchemaElement = xmlSchema.getElementByName(qname);
- if(xmlSchemaElement != null) {
- break;
- }
- }
- }
- return xmlSchemaElement;
- }
-
- /*
- * TODO decide if this helper method should be on the API, either as-is or replaced by method that returns all accessible schemas.
- *
- * Returns the schema type definition identified by the QName,
- * providing the type definition is referenceable by the
- * WSDL description (i.e. visible). This means it must exist in a
- * Schema that has been inlined or resolved from a schema import
- * within the <types> element according to the schema
- * referenceability rules in the WSDL 2.0 spec.
- * If the type definition is not referenceable, null is returned.
- * If validation is disabled, the referenceability rules do not apply
- * so all schemas are considered referenceable by the WSDL.
- *
- * TODO tbd - @see org.apache.woden.wsdl20.xml.TypesElement#getTypeDefinition(javax.xml.namespace.QName)
- */
- public XmlSchemaType getTypeDefinition(QName qname)
- {
- XmlSchemaType xmlSchemaType = null;
- if(qname != null)
- {
- List schemaRefs = getReferenceableSchemaDefs(qname.getNamespaceURI());
- if(schemaRefs != null)
- {
- //search the schemas with this qname's namespace
- Iterator i = schemaRefs.iterator();
- while(i.hasNext())
- {
- XmlSchema xmlSchema = (XmlSchema)i.next();
- xmlSchemaType = xmlSchema.getTypeByName(qname);
- if(xmlSchemaType != null) {
- break;
- }
- }
- }
- }
- return xmlSchemaType;
- }
-
- /*
- * Returns a List of XmlSchema objects for all schemas that are referenceable
- * by the containing WSDL. Examples of schemas that are not referenceable include
- * schemas without a target namespace or schemas resolved from a schema import
- * whose target namespace does not match the imported namespace. Referenceability
- * is determined by validation.
- * NOTE: This is an implementation-only method used to build the ElementDeclarations
- * components (i.e. it is not an API method). If it is required on the API it must be
- * changed to use a type safe return value.
- *
- * TODO t.b.c. remove if made redundant by WODEN-123
- */
- private List getReferenceableSchemaDefs()
- {
- List schemas = new Vector();
- Iterator i = fSchemas.iterator();
- while(i.hasNext())
- {
- SchemaImpl s = (SchemaImpl)i.next();
- if(s.isReferenceable() &&
- s.getSchemaDefinition() != null)
- {
- schemas.add(s.getSchemaDefinition());
- }
- }
- return schemas;
- }
-
- /*
- * Return a Lists of XmlSchema for all schemas with the specified target namespace
- * or import namespace that are referenceable by the WSDL.
- * Note, this method requires a non-null namespace argument.
- *
- * TODO t.b.d. remove the notion of referenceability - just get ALL schemas?
- */
- private List getReferenceableSchemaDefs(String namespace)
- {
-
- List schemas = new Vector();
- if(namespace != null)
- {
- Iterator i = fSchemas.iterator();
- while(i.hasNext())
- {
- SchemaImpl s = (SchemaImpl)i.next();
- if(s.isReferenceable() &&
- namespace.equals(s.getNamespaceAsString()) &&
- s.getSchemaDefinition() != null)
- {
- schemas.add(s.getSchemaDefinition());
- }
- }
- }
- return schemas;
- }
-
-}
+ *
+ * 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.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.internal.schema.SchemaImpl;
+import org.apache.woden.schema.ImportedSchema;
+import org.apache.woden.schema.InlinedSchema;
+import org.apache.woden.schema.Schema;
+import org.apache.woden.wsdl20.xml.TypesElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.ws.commons.schema.XmlSchemaType;
+
+/**
+ * This class represents the WSDL <types> element.
+ *
+ * TODO consider methods to get directly declared schemas vs getting all 'in-scope' schemas from the wsdl tree.
+ *
+ * @author jkaputin@apache.org
+ */
+public class TypesImpl extends DocumentableImpl
+ implements TypesElement
+{
+ private WSDLElement fParentElem = null;
+ private String fTypeSystem = null;
+ private List fSchemas = new Vector();
+
+ //TODO extension attributes and elements
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.TypesElement#setTypeSystem(java.lang.String)
+ */
+ public void setTypeSystem(String typeSystem)
+ {
+ fTypeSystem = typeSystem;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.TypesElement#getTypeSystem()
+ */
+ public String getTypeSystem()
+ {
+ return fTypeSystem;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.TypesElement#addSchema(org.apache.woden.schema.Schema)
+ */
+ public void addSchema(Schema schema)
+ {
+ if(schema != null) {
+ fSchemas.add(schema);
+ }
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.TypesElement#removeSchema(org.apache.woden.schema.Schema)
+ */
+ public void removeSchema(Schema schema)
+ {
+ fSchemas.remove(schema);
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.TypesElement#getSchemas()
+ */
+ public Schema[] getSchemas()
+ {
+ Schema[] array = new Schema[fSchemas.size()];
+ fSchemas.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.TypesElement#getSchemas(java.net.URI)
+ */
+ public Schema[] getSchemas(URI namespace)
+ {
+ List schemas = new Vector();
+ Iterator i = fSchemas.iterator();
+
+ if(namespace != null)
+ {
+ while(i.hasNext()) {
+ Schema s = (Schema)i.next();
+ if(namespace.equals(s.getNamespace())) {
+ schemas.add(s);
+ }
+ }
+ }
+ else
+ {
+ //get schemas whose namespace is missing
+ while(i.hasNext()) {
+ Schema s = (Schema)i.next();
+ if(s.getNamespace() == null) {
+ schemas.add(s);
+ }
+ }
+ }
+
+ Schema[] array = new Schema[schemas.size()];
+ schemas.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.TypesElement#getInlinedSchemas()
+ */
+ public InlinedSchema[] getInlinedSchemas()
+ {
+ List schemas = new Vector();
+ Iterator i = fSchemas.iterator();
+ while(i.hasNext()) {
+ Schema s = (Schema)i.next();
+ if(s instanceof InlinedSchema) {
+ schemas.add(s);
+ }
+ }
+
+ InlinedSchema[] array = new InlinedSchema[schemas.size()];
+ schemas.toArray(array);
+ return array;
+ }
+
+ /*
+ * @see org.apache.woden.wsdl20.xml.TypesElement#getImportedSchemas()
+ */
+ public ImportedSchema[] getImportedSchemas()
+ {
+ List schemas = new Vector();
+ Iterator i = fSchemas.iterator();
+ while(i.hasNext()) {
+ Schema s = (Schema)i.next();
+ if(s instanceof ImportedSchema) {
+ schemas.add(s);
+ }
+ }
+
+ ImportedSchema[] array = new ImportedSchema[schemas.size()];
+ schemas.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
+ * ************************************************************/
+
+ /*
+ * TODO decide if this helper method should be on the API, either as-is or replaced by method that returns all accessible schemas.
+ *
+ * Returns the schema element declaration identified by the QName,
+ * providing the element declaration is referenceable to the
+ * WSDL description (i.e. visible). This means it must exist in a
+ * Schema that has been inlined or resolved from a schema import
+ * within the <types> element according to the schema
+ * referenceability rules in the WSDL 2.0 spec.
+ * If the element declaration is not referenceable, null is returned.
+ * If validation is disabled, the referenceability rules do not apply
+ * so all schemas are considered referenceable by the WSDL.
+ *
+ * TODO tbd - @see org.apache.woden.wsdl20.xml.TypesElement#getElementDeclaration(javax.xml.namespace.QName)
+ */
+ public XmlSchemaElement getElementDeclaration(QName qname)
+ {
+ // Can't resolve the element if the QName is null.
+ if(qname == null)
+ return null;
+
+ XmlSchemaElement xmlSchemaElement = null;
+ List schemas = getReferenceableSchemaDefs(qname.getNamespaceURI());
+ if(schemas != null)
+ {
+ //search the schemas with this qname's namespace
+ Iterator i = schemas.iterator();
+ while(i.hasNext())
+ {
+ XmlSchema xmlSchema = (XmlSchema)i.next();
+ xmlSchemaElement = xmlSchema.getElementByName(qname);
+ if(xmlSchemaElement != null) {
+ break;
+ }
+ }
+ }
+ return xmlSchemaElement;
+ }
+
+ /*
+ * TODO decide if this helper method should be on the API, either as-is or replaced by method that returns all accessible schemas.
+ *
+ * Returns the schema type definition identified by the QName,
+ * providing the type definition is referenceable by the
+ * WSDL description (i.e. visible). This means it must exist in a
+ * Schema that has been inlined or resolved from a schema import
+ * within the <types> element according to the schema
+ * referenceability rules in the WSDL 2.0 spec.
+ * If the type definition is not referenceable, null is returned.
+ * If validation is disabled, the referenceability rules do not apply
+ * so all schemas are considered referenceable by the WSDL.
+ *
+ * TODO tbd - @see org.apache.woden.wsdl20.xml.TypesElement#getTypeDefinition(javax.xml.namespace.QName)
+ */
+ public XmlSchemaType getTypeDefinition(QName qname)
+ {
+ XmlSchemaType xmlSchemaType = null;
+ if(qname != null)
+ {
+ List schemaRefs = getReferenceableSchemaDefs(qname.getNamespaceURI());
+ if(schemaRefs != null)
+ {
+ //search the schemas with this qname's namespace
+ Iterator i = schemaRefs.iterator();
+ while(i.hasNext())
+ {
+ XmlSchema xmlSchema = (XmlSchema)i.next();
+ xmlSchemaType = xmlSchema.getTypeByName(qname);
+ if(xmlSchemaType != null) {
+ break;
+ }
+ }
+ }
+ }
+ return xmlSchemaType;
+ }
+
+ /*
+ * Returns a List of XmlSchema objects for all schemas that are referenceable
+ * by the containing WSDL. Examples of schemas that are not referenceable include
+ * schemas without a target namespace or schemas resolved from a schema import
+ * whose target namespace does not match the imported namespace. Referenceability
+ * is determined by validation.
+ * NOTE: This is an implementation-only method used to build the ElementDeclarations
+ * components (i.e. it is not an API method). If it is required on the API it must be
+ * changed to use a type safe return value.
+ *
+ * TODO t.b.c. remove if made redundant by WODEN-123
+ */
+ private List getReferenceableSchemaDefs()
+ {
+ List schemas = new Vector();
+ Iterator i = fSchemas.iterator();
+ while(i.hasNext())
+ {
+ SchemaImpl s = (SchemaImpl)i.next();
+ if(s.isReferenceable() &&
+ s.getSchemaDefinition() != null)
+ {
+ schemas.add(s.getSchemaDefinition());
+ }
+ }
+ return schemas;
+ }
+
+ /*
+ * Return a Lists of XmlSchema for all schemas with the specified target namespace
+ * or import namespace that are referenceable by the WSDL.
+ * Note, this method requires a non-null namespace argument.
+ *
+ * TODO t.b.d. remove the notion of referenceability - just get ALL schemas?
+ */
+ private List getReferenceableSchemaDefs(String namespace)
+ {
+
+ List schemas = new Vector();
+ if(namespace != null)
+ {
+ Iterator i = fSchemas.iterator();
+ while(i.hasNext())
+ {
+ SchemaImpl s = (SchemaImpl)i.next();
+ if(s.isReferenceable() &&
+ namespace.equals(s.getNamespaceAsString()) &&
+ s.getSchemaDefinition() != null)
+ {
+ schemas.add(s.getSchemaDefinition());
+ }
+ }
+ }
+ return schemas;
+ }
+
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLComponentImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLComponentImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLComponentImpl.java Thu Aug 23 04:01:23 2007
@@ -1,110 +1,110 @@
-/**
+/**
* 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.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.woden.wsdl20.WSDLComponent;
-import org.apache.woden.wsdl20.extensions.ComponentExtensions;
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-
-/**
- * All classes implementing the WSDL 2.0 Component and Element
- * model interfaces directly or indirectly extend this
- * abstract class. It implements the WSDL20Component interface
- * which just provides a common reference for objects from the WSDL 2.0
- * Component API. This class also inherits common behaviour for
- * WSDL Elements from WSDLElementImpl, which in turn provides a common
- * reference for objects from the the WSDL 2.0 Element API.
- *
- * @author jkaputin@apache.org
- */
-public abstract class WSDLComponentImpl extends DocumentableImpl
- implements WSDLComponent
-{
- private Map fCompExtensions = new HashMap(); //map of ComponentExtensions keyed by namespace
-
- /* ************************************************************
- * WSDLComponent interface methods (i.e. WSDL Component API)
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.WSDLComponent#equals(WSDLComponent)
- *
- * TODO implement this method in all concrete component classes and make this
- * implementation abstract or throw UnsupportedExc.
- */
- public boolean equals(WSDLComponent comp)
- {
- return super.equals(comp);
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.WSDLComponent#getWSDLExtensionsForNamespace(java.net.URI)
- */
- public ComponentExtensions getComponentExtensionsForNamespace(URI namespace)
- {
- return (ComponentExtensions)fCompExtensions.get(namespace);
- }
-
- /* ************************************************************
- * Non-API implementation methods
- * ************************************************************/
-
- /*
- * Check if a component already exists in a list of those components. Used when
- * retrieving sets of components to de-duplicate logically equivalent components.
- */
- protected boolean containsComponent(WSDLComponent comp, List components)
- {
- for(Iterator i=components.iterator(); i.hasNext(); )
- {
- WSDLComponent tempComp = (WSDLComponent)i.next();
- if(tempComp.equals(comp)) {
- return true;
- }
- }
- return false;
- }
-
-
- /*
- * Store the extensions in a map using the namespace string as the key.
- * If the extensions value is null, delete any existing entry in the map
- * for this namespace. If the namespace string is null, do nothing.
- * TODO check if still needed after compbuilder refactored.
- */
- public void setComponentExtensions(URI namespace, ComponentExtensions extensions)
- {
- if(namespace != null)
- {
- if(extensions != null) {
- fCompExtensions.put(namespace, extensions);
- } else {
- fCompExtensions.remove(namespace);
- }
- }
- }
-
- public String toString() {
- return getFragmentIdentifier().toString();
- }
-}
+ *
+ * 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.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.ComponentExtensions;
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+
+/**
+ * All classes implementing the WSDL 2.0 Component and Element
+ * model interfaces directly or indirectly extend this
+ * abstract class. It implements the WSDL20Component interface
+ * which just provides a common reference for objects from the WSDL 2.0
+ * Component API. This class also inherits common behaviour for
+ * WSDL Elements from WSDLElementImpl, which in turn provides a common
+ * reference for objects from the the WSDL 2.0 Element API.
+ *
+ * @author jkaputin@apache.org
+ */
+public abstract class WSDLComponentImpl extends DocumentableImpl
+ implements WSDLComponent
+{
+ private Map fCompExtensions = new HashMap(); //map of ComponentExtensions keyed by namespace
+
+ /* ************************************************************
+ * WSDLComponent interface methods (i.e. WSDL Component API)
+ * ************************************************************/
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.WSDLComponent#equals(WSDLComponent)
+ *
+ * TODO implement this method in all concrete component classes and make this
+ * implementation abstract or throw UnsupportedExc.
+ */
+ public boolean equals(WSDLComponent comp)
+ {
+ return super.equals(comp);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.WSDLComponent#getWSDLExtensionsForNamespace(java.net.URI)
+ */
+ public ComponentExtensions getComponentExtensionsForNamespace(URI namespace)
+ {
+ return (ComponentExtensions)fCompExtensions.get(namespace);
+ }
+
+ /* ************************************************************
+ * Non-API implementation methods
+ * ************************************************************/
+
+ /*
+ * Check if a component already exists in a list of those components. Used when
+ * retrieving sets of components to de-duplicate logically equivalent components.
+ */
+ protected boolean containsComponent(WSDLComponent comp, List components)
+ {
+ for(Iterator i=components.iterator(); i.hasNext(); )
+ {
+ WSDLComponent tempComp = (WSDLComponent)i.next();
+ if(tempComp.equals(comp)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /*
+ * Store the extensions in a map using the namespace string as the key.
+ * If the extensions value is null, delete any existing entry in the map
+ * for this namespace. If the namespace string is null, do nothing.
+ * TODO check if still needed after compbuilder refactored.
+ */
+ public void setComponentExtensions(URI namespace, ComponentExtensions extensions)
+ {
+ if(namespace != null)
+ {
+ if(extensions != null) {
+ fCompExtensions.put(namespace, extensions);
+ } else {
+ fCompExtensions.remove(namespace);
+ }
+ }
+ }
+
+ public String toString() {
+ return getFragmentIdentifier().toString();
+ }
+}
Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLElementImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLElementImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLElementImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLElementImpl.java Thu Aug 23 04:01:23 2007
@@ -1,139 +1,139 @@
-/**
+/**
* 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 javax.xml.namespace.QName;
-
-import org.apache.woden.internal.WSDLContext;
-import org.apache.woden.internal.wsdl20.extensions.AttributeExtensibleImpl;
-import org.apache.woden.internal.wsdl20.extensions.ElementExtensibleImpl;
-import org.apache.woden.wsdl20.extensions.ExtensionElement;
-import org.apache.woden.wsdl20.xml.NestedElement;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-import org.apache.woden.xml.XMLAttr;
-
-/**
- * This abstract class defines the behaviour common to all WSDL elements.
- * That is, it implements support for extension attributes and elements.
- * This interface can be used as a common reference for all WSDL elements
- * represented by the Element API.
- *
- * @author jkaputin@apache.org
- */
-public class WSDLElementImpl implements WSDLElement
-{
- private AttributeExtensibleImpl fAttrExt = new AttributeExtensibleImpl();
- private ElementExtensibleImpl fElemExt = new ElementExtensibleImpl();
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#setExtensionAttribute(javax.xml.namespace.QName, org.apache.woden.xml.XMLAttr)
- */
- public void setExtensionAttribute(QName attrType, XMLAttr attr)
- {
- fAttrExt.setExtensionAttribute(attrType, attr);
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttribute(javax.xml.namespace.QName)
- */
- public XMLAttr getExtensionAttribute(QName attrType)
- {
- return fAttrExt.getExtensionAttribute(attrType);
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttributesForNamespace(java.net.URI)
- */
- public XMLAttr[] getExtensionAttributesForNamespace(URI namespace)
- {
- return fAttrExt.getExtensionAttributesForNamespace(namespace);
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttributes()
- */
- public XMLAttr[] getExtensionAttributes()
- {
- return fAttrExt.getExtensionAttributes();
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#hasExtensionAttributesForNamespace(java.net.URI)
- */
- public boolean hasExtensionAttributesForNamespace(URI namespace)
- {
- return fAttrExt.hasExtensionAttributesForNamespace(namespace);
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.ElementExtensible#addExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
- */
- public void addExtensionElement(ExtensionElement extEl)
- {
- fElemExt.addExtensionElement(extEl);
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.ElementExtensible#removeExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
- */
- public void removeExtensionElement(ExtensionElement extEl)
- {
- fElemExt.removeExtensionElement(extEl);
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElements()
- */
- public ExtensionElement[] getExtensionElements()
- {
- return fElemExt.getExtensionElements();
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElementsOfType(javax.xml.namespace.QName)
- */
- public ExtensionElement[] getExtensionElementsOfType(QName elemType)
- {
- return fElemExt.getExtensionElementsOfType(elemType);
- }
-
- /* (non-Javadoc)
- * @see org.apache.woden.wsdl20.extensions.ElementExtensible#hasExtensionElementsForNamespace(java.net.URI)
- */
- public boolean hasExtensionElementsForNamespace(URI namespace)
- {
- return fElemExt.hasExtensionElementsForNamespace(namespace);
- }
-
- //package private
- WSDLContext getWsdlContext() {
- return getWsdlContext(this);
- }
-
- static private WSDLContext getWsdlContext(WSDLElement wElem) {
- if (wElem instanceof NestedElement) {
- WSDLElement parent = ((NestedElement) wElem).getParentElement();
- return getWsdlContext(parent);
- }
-
- //This is not a nested element, so the WSDL context is in this element, at the top of the tree.
- //This element will override the getWsdlContext() method defined in WSDLElementImpl.
- return ((WSDLElementImpl)wElem).getWsdlContext();
- }
-}
+ *
+ * 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 javax.xml.namespace.QName;
+
+import org.apache.woden.internal.WSDLContext;
+import org.apache.woden.internal.wsdl20.extensions.AttributeExtensibleImpl;
+import org.apache.woden.internal.wsdl20.extensions.ElementExtensibleImpl;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+import org.apache.woden.wsdl20.xml.NestedElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+import org.apache.woden.xml.XMLAttr;
+
+/**
+ * This abstract class defines the behaviour common to all WSDL elements.
+ * That is, it implements support for extension attributes and elements.
+ * This interface can be used as a common reference for all WSDL elements
+ * represented by the Element API.
+ *
+ * @author jkaputin@apache.org
+ */
+public class WSDLElementImpl implements WSDLElement
+{
+ private AttributeExtensibleImpl fAttrExt = new AttributeExtensibleImpl();
+ private ElementExtensibleImpl fElemExt = new ElementExtensibleImpl();
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#setExtensionAttribute(javax.xml.namespace.QName, org.apache.woden.xml.XMLAttr)
+ */
+ public void setExtensionAttribute(QName attrType, XMLAttr attr)
+ {
+ fAttrExt.setExtensionAttribute(attrType, attr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttribute(javax.xml.namespace.QName)
+ */
+ public XMLAttr getExtensionAttribute(QName attrType)
+ {
+ return fAttrExt.getExtensionAttribute(attrType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttributesForNamespace(java.net.URI)
+ */
+ public XMLAttr[] getExtensionAttributesForNamespace(URI namespace)
+ {
+ return fAttrExt.getExtensionAttributesForNamespace(namespace);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttributes()
+ */
+ public XMLAttr[] getExtensionAttributes()
+ {
+ return fAttrExt.getExtensionAttributes();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#hasExtensionAttributesForNamespace(java.net.URI)
+ */
+ public boolean hasExtensionAttributesForNamespace(URI namespace)
+ {
+ return fAttrExt.hasExtensionAttributesForNamespace(namespace);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.ElementExtensible#addExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
+ */
+ public void addExtensionElement(ExtensionElement extEl)
+ {
+ fElemExt.addExtensionElement(extEl);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.ElementExtensible#removeExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
+ */
+ public void removeExtensionElement(ExtensionElement extEl)
+ {
+ fElemExt.removeExtensionElement(extEl);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElements()
+ */
+ public ExtensionElement[] getExtensionElements()
+ {
+ return fElemExt.getExtensionElements();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElementsOfType(javax.xml.namespace.QName)
+ */
+ public ExtensionElement[] getExtensionElementsOfType(QName elemType)
+ {
+ return fElemExt.getExtensionElementsOfType(elemType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.extensions.ElementExtensible#hasExtensionElementsForNamespace(java.net.URI)
+ */
+ public boolean hasExtensionElementsForNamespace(URI namespace)
+ {
+ return fElemExt.hasExtensionElementsForNamespace(namespace);
+ }
+
+ //package private
+ WSDLContext getWsdlContext() {
+ return getWsdlContext(this);
+ }
+
+ static private WSDLContext getWsdlContext(WSDLElement wElem) {
+ if (wElem instanceof NestedElement) {
+ WSDLElement parent = ((NestedElement) wElem).getParentElement();
+ return getWsdlContext(parent);
+ }
+
+ //This is not a nested element, so the WSDL context is in this element, at the top of the tree.
+ //This element will override the getWsdlContext() method defined in WSDLElementImpl.
+ return ((WSDLElementImpl)wElem).getWsdlContext();
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org