summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/assembly/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-09-18 16:42:34 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-09-18 16:42:34 +0000
commit911c30b9d3140d9f531c7eeff909b428265ebe69 (patch)
tree0f5126b87f2bf24f9bc6a2e9a0de737c7a9a852a /java/sca/modules/assembly/src
parentf92b34e113981f791d2b5c5004991d3f90ec5276 (diff)
Add toString()
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@816709 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/assembly/src')
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java9
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java9
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java2
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java4
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java3
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java5
6 files changed, 28 insertions, 4 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java
index 40ffb6a4b5..552d67fec6 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java
@@ -86,5 +86,14 @@ public abstract class BindingImpl extends ExtensibleImpl implements Binding {
public void setURI(String uri) {
this.uri = uri;
}
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append(getType()).append(" (");
+ buf.append("uri=").append(getURI());
+ buf.append(",name=").append(getName());
+ buf.append(")");
+ return buf.toString();
+ }
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java
index d819fb6aa2..34841196a3 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java
@@ -187,5 +187,14 @@ public class ComponentImpl extends ExtensibleImpl implements Component, Cloneabl
public void setExtensionType(ExtensionType type) {
this.type = type;
}
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer("Component (");
+ buf.append("uri=").append(uri);
+ buf.append(",name=").append(name);
+ buf.append(",implementation=").append(implementation);
+ buf.append(")");
+ return buf.toString();
+ }
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java
index 389f163a95..e93d5ebc25 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java
@@ -174,6 +174,6 @@ public class CompositeImpl extends ImplementationImpl implements Composite, Clon
@Override
public String toString() {
- return (this.name != null) ? getName().toString() : "null";
+ return "Composite (name=" + getName() + ")";
}
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java
index 2be96b9792..baa23450ab 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java
@@ -50,4 +50,8 @@ public abstract class ImplementationImpl extends ComponentTypeImpl implements Im
public QName getType() {
return type;
}
+
+ public String toString() {
+ return String.valueOf(getType());
+ }
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
index 979ff7c187..7a63bbedc5 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
@@ -20,6 +20,7 @@ package org.apache.tuscany.sca.definitions;
import java.util.List;
+import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.policy.BindingType;
import org.apache.tuscany.sca.policy.ImplementationType;
import org.apache.tuscany.sca.policy.Intent;
@@ -79,5 +80,5 @@ public interface Definitions {
*
* @return a list of domain wide binding definition objects
*/
- List<Object> getBindings();
+ List<Binding> getBindings();
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
index 1987b39abe..224bc0a69a 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
@@ -22,6 +22,7 @@ package org.apache.tuscany.sca.definitions.impl;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
+import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.definitions.Definitions;
import org.apache.tuscany.sca.policy.BindingType;
import org.apache.tuscany.sca.policy.ImplementationType;
@@ -39,7 +40,7 @@ public class DefinitionsImpl implements Definitions {
private List<PolicySet> policySets = new CopyOnWriteArrayList<PolicySet>();
private List<BindingType> bindingTypes = new CopyOnWriteArrayList<BindingType>();
private List<ImplementationType> implementationTypes = new CopyOnWriteArrayList<ImplementationType>();
- private List<Object> bindings = new CopyOnWriteArrayList<Object>();
+ private List<Binding> bindings = new CopyOnWriteArrayList<Binding>();
public List<BindingType> getBindingTypes() {
@@ -66,7 +67,7 @@ public class DefinitionsImpl implements Definitions {
this.targetNamespace = ns;
}
- public List<Object> getBindings() {
+ public List<Binding> getBindings() {
return bindings;
}
}