DevFaqJavaModelRemoveFeatureJa

既存のクラスからFeature(例:フィールド)を削除する方法は?

注意: この FAQ 項目は NetBeans 4.x および 5.x にのみ適用されます。NetBeans 6 では Java 解析の基盤が新しいAPIに置き換えられました。


JavaClass givenClass;
.
.
Field field = givenClass.getField("foo", false);
givenClass.getFeatures().remove(field);

//if the field will not be used later and should be completely removed, use
//field.refDelete();



Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo