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

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

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

Author:
Lincoln Baxter, III

Method Summary
 Method<T> addMethod()
          Add an uninitialized Method declaration to this T instance.
 Method<T> addMethod(String method)
          Add a new Method declaration to this T instance, using the given String as the method declaration.
 Method<T> getMethod(String name)
          Return the Method with the given name and zero parameters; otherwise return null.
 Method<T> getMethod(String name, Class<?>... paramTypes)
          Return the Method with the given name and signature types; otherwise return null.
 Method<T> getMethod(String name, String... paramTypes)
          Return the Method with the given name and signature types; otherwise return null.
 List<Method<T>> getMethods()
          Get a List of all Methods declared by this T instance, if any; otherwise, return an empty List
 boolean hasMethod(Method<T> name)
          Return true if this T has a method with the given name and zero parameters; otherwise return false.
 boolean hasMethodSignature(Method<?> method)
          Return true if this T has a method with signature matching the given method's signature.
 boolean hasMethodSignature(String name)
          Return true if this T has a method with the given name and zero parameters; otherwise return false.
 boolean hasMethodSignature(String name, Class<?>... paramTypes)
          Return true if this T has a method with the given name and signature types; otherwise return false.
 boolean hasMethodSignature(String name, String... paramTypes)
          Return true if this T has a method with the given name and signature types; otherwise return false.
 T removeMethod(Method<T> method)
          Remove the given Method declaration from this T instance, if it exists; otherwise, do nothing.
 
Methods inherited from interface org.jboss.forge.parser.java.MemberHolder
getMembers
 

Method Detail

addMethod

Method<T> addMethod()
Add an uninitialized Method declaration to this T instance. This Method will be a stub until further modified.


addMethod

Method<T> addMethod(String method)
Add a new Method declaration to this T instance, using the given String as the method declaration.

For example:
Method m = javaClass.addMethod("public String method() {return \"hello!\";}")


hasMethod

boolean hasMethod(Method<T> name)
Return true if this T has a method with the given name and zero parameters; otherwise return false.


hasMethodSignature

boolean hasMethodSignature(Method<?> method)
Return true if this T has a method with signature matching the given method's signature.


hasMethodSignature

boolean hasMethodSignature(String name)
Return true if this T has a method with the given name and zero parameters; otherwise return false.


hasMethodSignature

boolean hasMethodSignature(String name,
                           String... paramTypes)
Return true if this T has a method with the given name and signature types; otherwise return false.


hasMethodSignature

boolean hasMethodSignature(String name,
                           Class<?>... paramTypes)
Return true if this T has a method with the given name and signature types; otherwise return false.


getMethod

Method<T> getMethod(String name)
Return the Method with the given name and zero parameters; otherwise return null.


getMethod

Method<T> getMethod(String name,
                    String... paramTypes)
Return the Method with the given name and signature types; otherwise return null.


getMethod

Method<T> getMethod(String name,
                    Class<?>... paramTypes)
Return the Method with the given name and signature types; otherwise return null.


getMethods

List<Method<T>> getMethods()
Get a List of all Methods declared by this T instance, if any; otherwise, return an empty List


removeMethod

T removeMethod(Method<T> method)
Remove the given Method declaration from this T instance, if it exists; otherwise, do nothing.



Copyright © 2011 Seam Framework. All Rights Reserved.