diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2005-01-31 14:09:56 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2005-01-31 14:09:56 +0000 |
commit | bd0d1580a7f9f92558eabe7b1fe9f49b259203e4 (patch) | |
tree | f475fb6abf7857b061f4aa7e4ae43436ccf1f6b7 /src/main/javassist/bytecode | |
parent | 7d35a76c5dbaf7cecb72a334f7910b622d932adf (diff) | |
download | javassist-bd0d1580a7f9f92558eabe7b1fe9f49b259203e4.tar.gz javassist-bd0d1580a7f9f92558eabe7b1fe9f49b259203e4.zip |
Added javadoc comments.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@157 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/bytecode')
-rw-r--r-- | src/main/javassist/bytecode/AnnotationsAttribute.java | 19 | ||||
-rw-r--r-- | src/main/javassist/bytecode/annotation/MemberValueVisitor.java | 3 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/main/javassist/bytecode/AnnotationsAttribute.java b/src/main/javassist/bytecode/AnnotationsAttribute.java index a9fda536..42ac8a59 100644 --- a/src/main/javassist/bytecode/AnnotationsAttribute.java +++ b/src/main/javassist/bytecode/AnnotationsAttribute.java @@ -35,6 +35,22 @@ import javassist.bytecode.annotation.*; * <code>AnnotationAttribute.visibleTag</code>, then the obtained * attribute is a runtime visible one. * + * <p>For example, + * + * <ul><pre> + * CtMethod m = ... ; + * MethodInfo minfo = m.getMethodInfo(); + * AnnotationsAttribute attr = (AnnotationsAttribute) + * minfo.getAttribute(AnnotationsAttribute.invisibleTag); + * Annotation an = attr.getAnnotation("Author"); + * String s = ((StringMemberValue)a.getMemberValue("name")).getValue(); + * System.out.println("@Author(name=" + s + ")"); + * </pre></ul> + * + * <p>This code snippet retrieves an annotation of the type <code>Author</code> + * from the <code>MethodInfo</code> object specified by <code>minfo</code>. + * Then, it prints the value of <code>name</code> in <code>Author</code>. + * * <p>If you want to record a new AnnotationAttribute object, execute the * following snippet: * @@ -48,6 +64,8 @@ import javassist.bytecode.annotation.*; * attr.setAnnotation(a); * cf.addAttribute(attr); * </pre></ul> + * + * @see javassist.bytecode.annotation.Annotation */ public class AnnotationsAttribute extends AttributeInfo { /** @@ -125,6 +143,7 @@ public class AnnotationsAttribute extends AttributeInfo { * <code>getAnnotations()</code> as to the returned data structure. * * @param type the annotation type. + * @return null if the specified annotation type is not included. * @see #getAnnotations() */ public Annotation getAnnotation(String type) { diff --git a/src/main/javassist/bytecode/annotation/MemberValueVisitor.java b/src/main/javassist/bytecode/annotation/MemberValueVisitor.java index d302e9bb..55aabb8f 100644 --- a/src/main/javassist/bytecode/annotation/MemberValueVisitor.java +++ b/src/main/javassist/bytecode/annotation/MemberValueVisitor.java @@ -20,8 +20,7 @@ package javassist.bytecode.annotation; * * @author <a href="mailto:bill@jboss.org">Bill Burke</a> */ -public interface MemberValueVisitor -{ +public interface MemberValueVisitor { public void visitAnnotationMemberValue(AnnotationMemberValue node); public void visitArrayMemberValue(ArrayMemberValue node); public void visitBooleanMemberValue(BooleanMemberValue node); |