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/12 20:52:10 UTC
svn commit: r565115 - in /incubator/woden/trunk/java:
src/org/apache/woden/internal/wsdl20/ src/org/apache/woden/wsdl20/xml/
test/org/apache/woden/wsdl20/xml/
Author: jkaputin
Date: Sun Aug 12 11:52:09 2007
New Revision: 565115
URL: http://svn.apache.org/viewvc?view=rev&rev=565115
Log:
WODEN-175
ImportElement and IncludeElement extend NestedElement.
Modified:
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLReferenceImpl.java
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/ImportElement.java
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/IncludeElement.java
incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ImportElementTest.java
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java?view=diff&rev=565115&r1=565114&r2=565115
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java Sun Aug 12 11:52:09 2007
@@ -1,10 +1,10 @@
/**
- * 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
+ * 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
*
@@ -484,12 +484,14 @@
public ImportElement addImportElement() {
ImportElement importEl = new ImportImpl();
fImportElements.add(importEl);
+ importEl.setParentElement(this);
return importEl;
}
public IncludeElement addIncludeElement() {
IncludeElement include = new IncludeImpl();
fIncludeElements.add(include);
+ include.setParentElement(this);
return include;
}
@@ -497,7 +499,6 @@
InterfaceElement intface = new InterfaceImpl();
fInterfaceElements.add(intface);
intface.setParentElement(this);
-
return intface;
}
Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLReferenceImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLReferenceImpl.java?view=diff&rev=565115&r1=565114&r2=565115
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLReferenceImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/WSDLReferenceImpl.java Sun Aug 12 11:52:09 2007
@@ -1,10 +1,10 @@
/**
- * 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
+ * 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
*
@@ -22,6 +22,7 @@
import org.apache.woden.wsdl20.xml.DescriptionElement;
import org.apache.woden.wsdl20.xml.DocumentationElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
/**
* This abstract class defines the common behaviour for referencing WSDL
@@ -38,7 +39,21 @@
private List fDocumentationElements = new Vector();
private URI fLocation = null;
private DescriptionElement fDescriptionElement = null;
+ private WSDLElement fParentElem = null;
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.NestedElement#setParentElement(org.apache.woden.wsdl20.xml.WSDL20Element)
+ */
+ public void setParentElement(WSDLElement parent) {
+ fParentElem = parent;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.NestedElement#getParentElement()
+ */
+ public WSDLElement getParentElement() {
+ return fParentElem;
+ }
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.xml.ImportElement#setLocation(java.net.URI)
*/
Modified: incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/ImportElement.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/ImportElement.java?view=diff&rev=565115&r1=565114&r2=565115
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/ImportElement.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/ImportElement.java Sun Aug 12 11:52:09 2007
@@ -1,10 +1,10 @@
/**
- * 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
+ * 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
*
@@ -23,7 +23,7 @@
*
* @author John Kaputin (jkaputin@apache.org)
*/
-public interface ImportElement extends DocumentableElement
+public interface ImportElement extends DocumentableElement, NestedElement
{
public void setNamespace(URI nsURI);
public URI getNamespace();
Modified: incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/IncludeElement.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/IncludeElement.java?view=diff&rev=565115&r1=565114&r2=565115
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/IncludeElement.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/IncludeElement.java Sun Aug 12 11:52:09 2007
@@ -1,10 +1,10 @@
/**
- * 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
+ * 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
*
@@ -23,7 +23,7 @@
*
* @author John Kaputin (jkaputin@apache.org)
*/
-public interface IncludeElement extends DocumentableElement
+public interface IncludeElement extends DocumentableElement, NestedElement
{
public void setLocation(URI locURI);
public URI getLocation();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ImportElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ImportElementTest.java?view=diff&rev=565115&r1=565114&r2=565115
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ImportElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ImportElementTest.java Sun Aug 12 11:52:09 2007
@@ -1,10 +1,10 @@
/**
- * 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
+ * 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
*
@@ -103,5 +103,11 @@
assertNull("The namespace was unset but appears set.", fImport.getNamespace());
}
-
+ public void testGetParentElement() {
+ DescriptionElement desc = new DescriptionImpl();
+ ImportElement importEl = desc.addImportElement();
+ DescriptionElement parent = (DescriptionElement)importEl.getParentElement();
+ assertSame("The import's parent should be the description that created it", desc, parent);
+
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org