diff options
Diffstat (limited to 'tutorial')
-rw-r--r-- | tutorial/tutorial2.html | 7 | ||||
-rw-r--r-- | tutorial/tutorial3.html | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tutorial/tutorial2.html b/tutorial/tutorial2.html index 63d75ce0..abac129a 100644 --- a/tutorial/tutorial2.html +++ b/tutorial/tutorial2.html @@ -1368,6 +1368,13 @@ CtField f = CtField.make("public int z = 0;", point); point.addField(f); </pre></ul> +<h4>Removing a member</h4> + +<p>To remove a field or a method, call <code>removeField()</code> +or <code>removeMethod()</code> in <code>CtClass</code>. A +<code>CtConstructor</code> can be removed by <code>removeConstructor()</code> +in <code>CtClass</code>. + <p><br> diff --git a/tutorial/tutorial3.html b/tutorial/tutorial3.html index af0a4c1b..635e01b6 100644 --- a/tutorial/tutorial3.html +++ b/tutorial/tutorial3.html @@ -84,7 +84,7 @@ In other words, a <code>FieldInfo</code> (or <code>MethodInfo</code> etc.) objec must not be shared among different <code>ClassFile</code> objects. <p> -To remove a field or a method, +To remove a field or a method from a <code>ClassFile</code> object, you must first obtain a <code>java.util.List</code> object containing all the fields of the class. <code>getFields()</code> and <code>getMethods()</code> return the lists. A field or a method can |