git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@198 30ef5769-5b8d-40dd-aea6-55b5d6557bb3tags/rel_3_17_1_ga
@@ -523,7 +523,11 @@ public final class ClassFile { | |||
} | |||
/** | |||
* Returns all the attributes. | |||
* Returns all the attributes. The returned <code>List</code> object | |||
* is shared with this object. If you add a new attribute to the list, | |||
* the attribute is also added to the classs file represented by this | |||
* object. If you remove an attribute from the list, it is also removed | |||
* from the class file. | |||
* | |||
* @return a list of <code>AttributeInfo</code> objects. | |||
* @see AttributeInfo | |||
@@ -533,10 +537,12 @@ public final class ClassFile { | |||
} | |||
/** | |||
* Returns the attribute with the specified name. | |||
* Returns the attribute with the specified name. If there are multiple | |||
* attributes with that name, this method returns either of them. It | |||
* returns null if the specified attributed is not found. | |||
* | |||
* @param name | |||
* attribute name | |||
* @param name attribute name | |||
* @see #getAttributes() | |||
*/ | |||
public AttributeInfo getAttribute(String name) { | |||
LinkedList list = attributes; | |||
@@ -553,6 +559,8 @@ public final class ClassFile { | |||
/** | |||
* Appends an attribute. If there is already an attribute with the same | |||
* name, the new one substitutes for it. | |||
* | |||
* @see #getAttributes() | |||
*/ | |||
public void addAttribute(AttributeInfo info) { | |||
AttributeInfo.remove(attributes, info.getName()); |
@@ -194,9 +194,11 @@ public final class FieldInfo { | |||
} | |||
/** | |||
* Returns all the attributes. | |||
* A new element can be added to the returned list | |||
* and an existing element can be removed from the list. | |||
* Returns all the attributes. The returned <code>List</code> object | |||
* is shared with this object. If you add a new attribute to the list, | |||
* the attribute is also added to the field represented by this | |||
* object. If you remove an attribute from the list, it is also removed | |||
* from the field. | |||
* | |||
* @return a list of <code>AttributeInfo</code> objects. | |||
* @see AttributeInfo | |||
@@ -210,8 +212,10 @@ public final class FieldInfo { | |||
/** | |||
* Returns the attribute with the specified name. | |||
* It returns null if the specified attribute is not found. | |||
* | |||
* @param name attribute name | |||
* @see #getAttributes() | |||
*/ | |||
public AttributeInfo getAttribute(String name) { | |||
return AttributeInfo.lookup(attribute, name); | |||
@@ -220,6 +224,8 @@ public final class FieldInfo { | |||
/** | |||
* Appends an attribute. If there is already an attribute with | |||
* the same name, the new one substitutes for it. | |||
* | |||
* @see #getAttributes() | |||
*/ | |||
public void addAttribute(AttributeInfo info) { | |||
if (attribute == null) |
@@ -236,8 +236,11 @@ public final class MethodInfo { | |||
} | |||
/** | |||
* Returns all the attributes. A new element can be added to the returned | |||
* list and an existing element can be removed from the list. | |||
* Returns all the attributes. The returned <code>List</code> object | |||
* is shared with this object. If you add a new attribute to the list, | |||
* the attribute is also added to the method represented by this | |||
* object. If you remove an attribute from the list, it is also removed | |||
* from the method. | |||
* | |||
* @return a list of <code>AttributeInfo</code> objects. | |||
* @see AttributeInfo | |||
@@ -253,9 +256,9 @@ public final class MethodInfo { | |||
* Returns the attribute with the specified name. If it is not found, this | |||
* method returns null. | |||
* | |||
* @param name | |||
* attribute name | |||
* @param name attribute name | |||
* @return an <code>AttributeInfo</code> object or null. | |||
* @see #getAttributes() | |||
*/ | |||
public AttributeInfo getAttribute(String name) { | |||
return AttributeInfo.lookup(attribute, name); | |||
@@ -264,6 +267,8 @@ public final class MethodInfo { | |||
/** | |||
* Appends an attribute. If there is already an attribute with the same | |||
* name, the new one substitutes for it. | |||
* | |||
* @see #getAttributes() | |||
*/ | |||
public void addAttribute(AttributeInfo info) { | |||
if (attribute == null) |