org.jboss.forge.parser.java
Interface FieldHolder<T>

All Superinterfaces:
MemberHolder<T,Member>
All Known Subinterfaces:
JavaClass, JavaInterface, JavaType<T>

public interface FieldHolder<T>
extends MemberHolder<T,Member>

Author:
Lincoln Baxter, III

Method Summary
 Field<T> addField()
          Add a new Java Field to this T instance.
 Field<T> addField(String declaration)
          Add a new Field declaration to this T instance, using the given String as the declaration.
 Field<T> getField(String name)
          Get the Field with the given name and return it, otherwise, return null.
 List<Field<T>> getFields()
          Get a list of all Fields declared by this T, or return an empty list if no Fields are declared.
 boolean hasField(Field<T> field)
          Return whether or not this T declares the given Field instance.
 boolean hasField(String name)
          Return whether or not this T declares a Field with the given name.
 T removeField(Field<T> field)
          Remove the given Field from this T instance, if it exists; otherwise, do nothing.
 
Methods inherited from interface org.jboss.forge.parser.java.MemberHolder
getMembers
 

Method Detail

addField

Field<T> addField()
Add a new Java Field to this T instance. This field will be a stub until further modified.


addField

Field<T> addField(String declaration)
Add a new Field declaration to this T instance, using the given String as the declaration.

For example:
Field f = javaClass.addField("private String newField;");


hasField

boolean hasField(String name)
Return whether or not this T declares a Field with the given name.


hasField

boolean hasField(Field<T> field)
Return whether or not this T declares the given Field instance.


getField

Field<T> getField(String name)
Get the Field with the given name and return it, otherwise, return null.


getFields

List<Field<T>> getFields()
Get a list of all Fields declared by this T, or return an empty list if no Fields are declared.


removeField

T removeField(Field<T> field)
Remove the given Field from this T instance, if it exists; otherwise, do nothing.



Copyright © 2011 Seam Framework. All Rights Reserved.