Details
Description
There are some cases when accessing the bodies of methods is essential at runtime (such as code browsing tools).
To get at these, Ideally there should be a method like 'String getBody()' available on JavaMethod and JavaField.
No attempt to parse the body of the method is necessary - it should just be made available as a single string.
Because this adds a memory overhead, it should ideally be optional and disabled by default. Maybe a method like JavaDocBuilder.setExposeBody(boolean) to enable it.
Attached are some modifications by Shawn Chain that can help implement this.
---- From Shawn Chain ----
(1) lexer.flex
added StringBuffer codeBody in class JFlexLexer to read the body of
CODEBLOCK.
(2) parser.y
added type memberend so that the "codeBody" can be passed to the
MethodDef's body field .
(3) Lexer.java
added method getCodeBody():String
(4) MethodDef.java
added public field body
(5) JavaMethod.java
added property codeBody and the setter/getter methods modified the method
writeBody() to dump the codeBody
(6) ModelBuilder.java
modified the method addMethod(MethodDef) to pass the codeBody to the
instance of JavaMethod
TODO
Support the static codeblock
Activity
Field | Original Value | New Value |
---|---|---|
Attachment | qdox-method-body-patch.zip [ 13924 ] |
Attachment | qdox-1.6-codebody-patch-u.txt [ 13925 ] |
Fix Version/s | 1.6 [ 10814 ] | |
Fix Version/s | 1.7 [ 11160 ] |
Assignee | Joe Walnes [ jwalnes1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] | |
Fix Version/s | 1.6.1 [ 14090 ] | |
Fix Version/s | 1.7 [ 11160 ] |
Shawn's changes