Interface MethodHolderSource<O extends JavaSource<O>>
-
- All Superinterfaces:
MemberHolder<O>,MemberHolderSource<O>,MethodHolder<O>
- All Known Subinterfaces:
EnumConstantSource.Body,JavaClassSource,JavaEnumSource,JavaInterfaceSource,PropertyHolderSource<O>
public interface MethodHolderSource<O extends JavaSource<O>> extends MethodHolder<O>, MemberHolderSource<O>
Represents aJavaSourcethat may declare methods.- Author:
- Lincoln Baxter, III
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MethodSource<O>addMethod()Add an uninitializedMethodSourcedeclaration to thisMethodHolderSourceinstance.MethodSource<O>addMethod(java.lang.reflect.Method method)Add a newMethodSourcedeclaration to thisMethodHolderSourceinstance, using the givenMethodas the method declaration.MethodSource<O>addMethod(java.lang.String method)Add a newMethodSourcedeclaration to thisMethodHolderSourceinstance, using the givenStringas the method declaration.MethodSource<O>addMethod(Method<?,?> method)Add a newMethodSourcedeclaration to thisMethodHolderSourceinstance, using the givenMethodas the method declaration.MethodSource<O>getMethod(java.lang.String name)Return theMethodSourcewith the given name and zero parameters; otherwise return null.MethodSource<O>getMethod(java.lang.String name, java.lang.Class<?>... paramTypes)Return theMethodSourcewith the given name and signature types; otherwise return null.MethodSource<O>getMethod(java.lang.String name, java.lang.String... paramTypes)Return theMethodSourcewith the given name and signature types; otherwise return null.java.util.List<MethodSource<O>>getMethods()Get aListof allMethodSources declared by thisMethodHolderSourceinstance, if any; otherwise, return an emptyListOremoveMethod(Method<O,?> method)Remove the givenMethodSourcedeclaration from thisMethodHolderSourceinstance, if it exists; otherwise, do nothing.-
Methods inherited from interface org.jboss.forge.roaster.model.source.MemberHolderSource
getMembers
-
Methods inherited from interface org.jboss.forge.roaster.model.MethodHolder
hasMethod, hasMethodSignature, hasMethodSignature, hasMethodSignature, hasMethodSignature
-
-
-
-
Method Detail
-
getMethod
MethodSource<O> getMethod(java.lang.String name)
Return theMethodSourcewith the given name and zero parameters; otherwise return null.- Specified by:
getMethodin interfaceMethodHolder<O extends JavaSource<O>>
-
getMethod
MethodSource<O> getMethod(java.lang.String name, java.lang.String... paramTypes)
Return theMethodSourcewith the given name and signature types; otherwise return null.- Specified by:
getMethodin interfaceMethodHolder<O extends JavaSource<O>>
-
getMethod
MethodSource<O> getMethod(java.lang.String name, java.lang.Class<?>... paramTypes)
Return theMethodSourcewith the given name and signature types; otherwise return null.- Specified by:
getMethodin interfaceMethodHolder<O extends JavaSource<O>>
-
getMethods
java.util.List<MethodSource<O>> getMethods()
Get aListof allMethodSources declared by thisMethodHolderSourceinstance, if any; otherwise, return an emptyList- Specified by:
getMethodsin interfaceMethodHolder<O extends JavaSource<O>>
-
addMethod
MethodSource<O> addMethod()
Add an uninitializedMethodSourcedeclaration to thisMethodHolderSourceinstance. ThisMethodSourcewill be a stub until further modified.
-
addMethod
MethodSource<O> addMethod(java.lang.String method)
Add a newMethodSourcedeclaration to thisMethodHolderSourceinstance, using the givenStringas the method declaration. For example:
Method m = javaClass.addMethod("public String method() {return \"hello!\";}")
-
addMethod
MethodSource<O> addMethod(java.lang.reflect.Method method)
Add a newMethodSourcedeclaration to thisMethodHolderSourceinstance, using the givenMethodas the method declaration. AbstractMethodobjects are not implemented in this method. SeeMethods.implementMethod(MethodSource)for more information- Parameters:
method- TheMethodto be added- Returns:
- a
MethodSourcedeclaration based on theMethodparameter. - See Also:
Methods.implementMethod(MethodSource)
-
addMethod
MethodSource<O> addMethod(Method<?,?> method)
Add a newMethodSourcedeclaration to thisMethodHolderSourceinstance, using the givenMethodas the method declaration. AbstractMethodobjects are not implemented in this method. SeeMethods.implementMethod(MethodSource)for more information- Parameters:
method- TheMethodto be added- Returns:
- a
MethodSourcedeclaration based on theMethodparameter. - See Also:
Methods.implementMethod(MethodSource)
-
removeMethod
O removeMethod(Method<O,?> method)
Remove the givenMethodSourcedeclaration from thisMethodHolderSourceinstance, if it exists; otherwise, do nothing.
-
-