Interface FieldHolderSource<O extends JavaSource<O>>
-
- All Superinterfaces:
FieldHolder<O>,MemberHolder<O>,MemberHolderSource<O>
- All Known Subinterfaces:
EnumConstantSource.Body,JavaClassSource,JavaEnumSource,JavaInterfaceSource,PropertyHolderSource<O>
public interface FieldHolderSource<O extends JavaSource<O>> extends FieldHolder<O>, MemberHolderSource<O>
Represents aJavaSourcethat may contain field definitions.- Author:
- Lincoln Baxter, III
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FieldSource<O>addField()Add a new JavaFieldto thisFieldHolderSourceinstance.FieldSource<O>addField(String declaration)Add a newFielddeclaration to thisFieldHolderSourceinstance, using the givenStringas the declaration.FieldSource<O>getField(String name)Get theFieldwith the given name and return it, otherwise, return null.List<FieldSource<O>>getFields()Get a list of allFields declared by thisFieldHolderSource, or return an empty list if noFields are declared.OremoveField(Field<O> field)Remove the givenFieldfrom thisFieldHolderSourceinstance, if it exists; otherwise, do nothing.-
Methods inherited from interface org.jboss.forge.roaster.model.FieldHolder
hasField, hasField
-
Methods inherited from interface org.jboss.forge.roaster.model.source.MemberHolderSource
getMembers
-
-
-
-
Method Detail
-
addField
FieldSource<O> addField()
Add a new JavaFieldto thisFieldHolderSourceinstance. This field will be a stub until further modified.
-
addField
FieldSource<O> addField(String declaration)
Add a newFielddeclaration to thisFieldHolderSourceinstance, using the givenStringas the declaration. For example:
Field f = javaClass.addField("private String newField;");
-
removeField
O removeField(Field<O> field)
Remove the givenFieldfrom thisFieldHolderSourceinstance, if it exists; otherwise, do nothing.
-
getField
FieldSource<O> getField(String name)
Get theFieldwith the given name and return it, otherwise, return null.- Specified by:
getFieldin interfaceFieldHolder<O extends JavaSource<O>>
-
getFields
List<FieldSource<O>> getFields()
Get a list of allFields declared by thisFieldHolderSource, or return an empty list if noFields are declared.- Specified by:
getFieldsin interfaceFieldHolder<O extends JavaSource<O>>
-
-