Suggestion for Printer API in ASM 4.0
"Andrey Loskutov" <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
looking at the current org.objectweb.asm.util.Printer class code in 4.0
RC2 I wish me (due the transition from interfaces to classes) a clear
indication which methods are for which visitor. Sometimes it is clear from
the method name, but sometimes I really need to look at the call
hierarchy. As the Printer class now contains methods called from 4
different visitors, it is hard to understand.
I think one could put four annotations (with
@Retention(RetentionPolicy.SOURCE)) to appropriate "visit" method to make
clear which visitor calls which method. As those annotations are only for
the source, there should be no impact on the jar size/compatibility with
pre-1.5 VM's.
This would provide an extra documentation for both new ASM developers but
also for transition time to 4.0.
E.g. this would be those annotations:
@AnnotationEvent
@FieldEvent
@MethodEvent
@ClassEvent
and this would be the application of them to the current Printer code:
@ClassEvent
public abstract void visitSource(final String file, final String
debug);
@AnnotationEvent
public abstract void visit(final String name, final Object value);
@AnnotationEvent
public abstract Printer visitArray(final String name);
@MethodEvent
public abstract void visitCode();
etc pp.
What do you think?
--
Kind regards,
Mit freundlichen Grüßen
Andrey Loskutov
@Home: http://andrei.gmxhome.de/
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws