diff options
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java | 4 | ||||
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/rebind/XmlBuilderGenerator.java | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java index 50d609f4..717fee32 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java @@ -95,7 +95,9 @@ public class JsonBuilderGenerator extends Generator { String name = nameAnnotation != null ? nameAnnotation.value() : methName.replaceFirst("^(get|set)", ""); - name = name.substring(0, 1).toLowerCase() + name.substring(1); + if (nameAnnotation != null) { + name = name.substring(0, 1).toLowerCase() + name.substring(1); + } attrs.add(name); generateMethod(sw, method, name, treeLogger); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/XmlBuilderGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/XmlBuilderGenerator.java index 1c70815b..e8bc27c0 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/XmlBuilderGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/XmlBuilderGenerator.java @@ -83,7 +83,11 @@ public class XmlBuilderGenerator extends Generator { throws UnableToCompleteException { Name nameAnnotation = method.getAnnotation(Name.class); String name = nameAnnotation != null ? nameAnnotation.value() - : method.getName().replaceFirst("^(get|set)", "").toLowerCase(); + : method.getName().replaceFirst("^(get|set)", ""); + + if (nameAnnotation != null) { + name = name.substring(0, 1).toLowerCase() + name.substring(1); + } String retType = method.getReturnType().getParameterizedQualifiedSourceName(); |