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 a
JavaSource that may contain field definitions.- Author:
- Lincoln Baxter, III
-
Method Summary
Modifier and TypeMethodDescriptionaddField()Add a new JavaFieldto thisFieldHolderSourceinstance.Add a newFielddeclaration to thisFieldHolderSourceinstance, using the givenStringas the declaration.Get theFieldwith the given name and return it, otherwise, return null.List<FieldSource<O>>Get a list of allFields declared by thisFieldHolderSource, or return an empty list if noFields are declared.removeField(Field<O> field) Remove the givenFieldfrom thisFieldHolderSourceinstance, if it exists; otherwise, do nothing.Methods inherited from interface org.jboss.forge.roaster.model.FieldHolder
hasField, hasFieldMethods inherited from interface org.jboss.forge.roaster.model.source.MemberHolderSource
getMembers
-
Method Details
-
addField
FieldSource<O> addField()Add a new JavaFieldto thisFieldHolderSourceinstance. This field will be a stub until further modified. -
addField
Add a newFielddeclaration to thisFieldHolderSourceinstance, using the givenStringas the declaration. For example:
Field f = javaClass.addField("private String newField;"); -
removeField
Remove the givenFieldfrom thisFieldHolderSourceinstance, if it exists; otherwise, do nothing. -
getField
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>>
-