Class Methods
- java.lang.Object
-
- org.jboss.forge.roaster.model.util.Methods
-
public class Methods extends Object
Utility methods forMethodSourceobjects- Author:
- George Gastaldi
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]generateParameterNames(Class<?>[] parameterTypes)Generate the parameter names for given parameter typesstatic List<MethodSource<?>>implementAbstractMethods(Class<?> source, MethodHolderSource<?> target)Implement the abstract methods present in aClassto the specifiedMethodHolderSource.static List<MethodSource<?>>implementAbstractMethods(MethodHolder<?> source, MethodHolderSource<?> target)Implement the abstract methods present in aMethodHolderto the specifiedMethodHolderSource.static voidimplementMethod(MethodSource<?> source)Adds a default method implementation to the givenMethodSource.static voidremoveAllAnnotations(MethodSource<?> source)
-
-
-
Method Detail
-
implementAbstractMethods
public static List<MethodSource<?>> implementAbstractMethods(MethodHolder<?> source, MethodHolderSource<?> target)
Implement the abstract methods present in aMethodHolderto the specifiedMethodHolderSource.- Parameters:
source- theMethodHolderwhere the methods will be imported fromtarget- theMethodHolderSourcewhere the methods will be exported to- Returns:
- a
Listof the implemented methods added to the providedMethodHolderSource
-
removeAllAnnotations
public static void removeAllAnnotations(MethodSource<?> source)
-
implementAbstractMethods
public static List<MethodSource<?>> implementAbstractMethods(Class<?> source, MethodHolderSource<?> target)
Implement the abstract methods present in aClassto the specifiedMethodHolderSource.- Parameters:
source- theClasswhere the methods will be imported fromtarget- theMethodHolderSourcewhere the methods will be exported to- Returns:
- a
Listof the implemented methods added to the providedMethodHolderSource
-
implementMethod
public static void implementMethod(MethodSource<?> source)
Adds a default method implementation to the givenMethodSource. This method will callAbstractableSource.setAbstract(boolean)withfalsebefore setting the body if the origin is not an interface.- Parameters:
source- the method where the implementation should be added
-
-