wise SVN: r594 - core/trunk/core/src/main/java/org/jboss/wise/tree/impl.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-10-14 10:58:56 -0400 (Mon, 14 Oct 2013)
New Revision: 594
Modified:
core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java
core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java
Log:
- [WISE-210] Properly deal with enums in tree view
- Improve exception handling in ElementImpl
Modified: core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java 2013-10-14 14:53:05 UTC (rev 593)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java 2013-10-14 14:58:56 UTC (rev 594)
@@ -20,10 +20,12 @@
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -261,11 +263,25 @@
return "0";
} else if ("javax.xml.datatype.XMLGregorianCalendar".equals(cn)) {
return "1970-01-01T00:00:00.000Z";
+ } else if (cl.isEnum()) {
+ return getValidEnumValues(cl).iterator().next();
} else {
return "";
}
}
+ public static List<String> getValidEnumValues(Class<?> classType) {
+ List<String> list = new ArrayList<String>();
+ for (Object obj : classType.getEnumConstants()) {
+ try {
+ list.add((String) obj.getClass().getMethod("value").invoke(obj));
+ } catch (Exception e) {
+ throw new WiseRuntimeException("Could not get enum values for " + classType, e);
+ }
+ }
+ return list;
+ }
+
protected String generateNewID() {
return IDGenerator.nextVal();
}
Modified: core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java 2013-10-14 14:53:05 UTC (rev 593)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java 2013-10-14 14:58:56 UTC (rev 594)
@@ -382,6 +382,12 @@
}
if (cl.isPrimitive()) {
cl = JavaUtils.getWrapperType(cl);
+ } else if (cl.isEnum()) {
+ try {
+ return cl.getMethod("fromValue", String.class).invoke(null, value);
+ } catch (Exception e) {
+ throw new WiseRuntimeException("Could not get enum from value '" + value + "'", e);
+ }
}
final String n = cl.getName();
if ("java.lang.String".equals(n)) {
@@ -479,6 +485,8 @@
}
}
return obj;
+ } catch (WiseRuntimeException wre) {
+ throw wre;
} catch (Exception e) {
throw new WiseRuntimeException("Error converting element to object", e);
}
11 years, 2 months
wise SVN: r593 - core/trunk/core/src/main/java/org/jboss/wise/core/client.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-10-14 10:53:05 -0400 (Mon, 14 Oct 2013)
New Revision: 593
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/client/WSMethod.java
Log:
Adding a convenient constant
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/WSMethod.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/WSMethod.java 2013-10-09 17:09:29 UTC (rev 592)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/WSMethod.java 2013-10-14 14:53:05 UTC (rev 593)
@@ -41,6 +41,7 @@
public static final String RESULT = "result";
public static final String RESULTS = "results";
public static final String TYPE_PREFIX = "type.";
+ public static final String TYPE_RESULT = TYPE_PREFIX + RESULT;
/**
* Invokes this method with the provided arguments applying provided mapper
11 years, 2 months
wise SVN: r592 - core/trunk/integration-testsuite.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-10-09 13:09:29 -0400 (Wed, 09 Oct 2013)
New Revision: 592
Modified:
core/trunk/integration-testsuite/pom.xml
Log:
Switch to widlfly 8.0.0.Beta1 release and rename profile
Modified: core/trunk/integration-testsuite/pom.xml
===================================================================
--- core/trunk/integration-testsuite/pom.xml 2013-08-15 06:35:38 UTC (rev 591)
+++ core/trunk/integration-testsuite/pom.xml 2013-10-09 17:09:29 UTC (rev 592)
@@ -166,12 +166,12 @@
</dependencies>
</profile>
<profile>
- <id>jboss800</id>
+ <id>wildfly800</id>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-webservices-tests-integration</artifactId>
- <version>8.0.0.Alpha1</version>
+ <version>8.0.0.Beta1</version>
<exclusions>
<exclusion>
<groupId>org.wildfly</groupId>
11 years, 2 months