-
1. Re: Mapping comments?
starksm64 Jun 21, 2005 12:43 PM (in response to dimitris)Without javadoc annotations (which are scheduled for java6), I don't see how this can be done in general as we have no requirement for source code creation. I don't see that the current jaxb2.0 spec (Early Draft 2
Tuesday, March 15, 2005) has any annotation for this purpose either. Perhaps that is something that could be suggested via an email to spec-comments@jsr222.dev.java.net -
2. Re: Mapping comments?
aloubyansky Jun 22, 2005 5:33 AM (in response to dimitris)I think, Dimitris meant to bind comments from XML content to, e.g., Java fields, not to Java comments.
-
3. Re: Mapping comments?
dimitris Jun 22, 2005 5:54 AM (in response to dimitris)Yes, just a simple mapping of xml comments to fields. If this could be optionally mapped to annotations, thats fine.
-
4. Re: Mapping comments?
starksm64 Jun 22, 2005 8:50 AM (in response to dimitris)I guess I don't understand the difference between mapping to a java field and a java comment. Are you saying there should be treatment of comments as text to map onto an object the same as a text element?
The problem is how is there a meaningful indexing of the comments to the java objects? -
5. Re: Mapping comments?
aloubyansky Jun 22, 2005 9:08 AM (in response to dimitris)"Scott" wrote:
Are you saying there should be treatment of comments as text to map onto an object the same as a text element?
Yes."Scott" wrote:
The problem is how is there a meaningful indexing of the comments to the java objects?
I don't know any rule for that. But there are use-cases, e.g. if there is no element 'description' the text could appear in comments instead and be bound to a field 'description' in a class. -
6. Re: Mapping comments?
dimitris Jun 22, 2005 9:19 AM (in response to dimitris)I was thinking of a simple binding that would let you get/set the comments before the beggining of an element (and after the end of the previous element).
... </prev-element> <!-- comment1 --> <!-- comment2 --> <element1> ... </element1>
public class PojoForElement1 { String[] getComments() void setComments(String[]) ... }