users@jaxb.java.net

CodeModel Patch

From: Dan Diephouse <dan_at_envoisolutions.com>
Date: Sun, 14 Jan 2007 22:19:06 -0500

Hiya,

Was wondering if I could request a small change to the CodeModel API. I'd
like to be able to change a JMethod's return type after it has been created.
My use case is that I've created a kind of domain specific builder around
the code model APIs and in my builder interface you don't really specify the
return value until the end of your usage with it. While I could change my
API around it would require a lot more code to hold all the information
about what to build in memory until the very end - as opposed to just
writing this.

Any chance that this could be integrated?

Thanks,
- Dan


Index: codemodel/src/com/sun/codemodel/JMethod.java
===================================================================
RCS file:
/cvs/jaxb2-sources/jaxb-ri/codemodel/src/com/sun/codemodel/JMethod.java,v
retrieving revision 1.10
diff -u -r1.10 JMethod.java
--- codemodel/src/com/sun/codemodel/JMethod.java 1 Jun 2006 17:35:44
-0000 1.10
+++ codemodel/src/com/sun/codemodel/JMethod.java 15 Jan 2007 03:15:29
-0000
@@ -269,8 +269,12 @@
     public JType type() {
         return type;
     }
-
- /**
+
+ public void setType(JType type) {
+ this.type = type;
+ }
+
+ /**
      * Returns all the parameter types in an array.
      * @return
      * If there's no parameter, an empty array will be returned.

-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog