Class Methods
java.lang.Object
org.jboss.forge.roaster.model.util.Methods
Utility methods for
MethodSource objects- Author:
- George Gastaldi
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
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
-
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
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
Generate the parameter names for given parameter types- Parameters:
parameterTypes- the parameter types to use- Returns:
- the parameter names of a given
Method
-