Class Methods
- java.lang.Object
-
- org.jboss.forge.roaster.model.util.Methods
-
public class Methods extends java.lang.ObjectUtility methods forMethodSourceobjects- Author:
- George Gastaldi
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String[]generateParameterNames(java.lang.Class<?>[] parameterTypes)Generate the parameter names for given parameter typesstatic java.util.List<MethodSource<?>>implementAbstractMethods(java.lang.Class<?> source, MethodHolderSource<?> target)Implement the abstract methods present in aClassto the specifiedMethodHolderSource.static java.util.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 java.util.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 java.util.List<MethodSource<?>> implementAbstractMethods(java.lang.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
-
generateParameterNames
public static java.lang.String[] generateParameterNames(java.lang.Class<?>[] parameterTypes)
Generate the parameter names for given parameter types- Parameters:
parameterTypes- the parameter types to use- Returns:
- the parameter names of a given
Method
-
-