Interface NodeWithParameters<N extends Node>

    • Method Detail

      • getParameter

        default Parameter getParameter​(int i)
      • tryAddImportToParentCompilationUnit

        void tryAddImportToParentCompilationUnit​(Class<?> clazz)
      • setParameter

        default N setParameter​(int i,
                               Parameter parameter)
      • addParameter

        default N addParameter​(Type type,
                               String name)
      • addParameter

        default N addParameter​(Class<?> paramClass,
                               String name)
      • addParameter

        default N addParameter​(String className,
                               String name)
        Remember to import the class in the compilation unit yourself
        Parameters:
        className - the name of the class, ex : org.test.Foo or Foo if you added manually the import
        name - the name of the parameter
      • addParameter

        default N addParameter​(Parameter parameter)
      • addAndGetParameter

        default Parameter addAndGetParameter​(String className,
                                             String name)
        Remember to import the class in the compilation unit yourself
        Parameters:
        className - the name of the class, ex : org.test.Foo or Foo if you added manually the import
        name - the name of the parameter
        Returns:
        the Parameter created
      • getParameterByName

        default Optional<Parameter> getParameterByName​(String name)
        Try to find a Parameter by its name
        Parameters:
        name - the name of the param
        Returns:
        null if not found, the param found otherwise
      • getParameterByType

        default Optional<Parameter> getParameterByType​(String type)
        Try to find a Parameter by its type
        Parameters:
        type - the type of the param
        Returns:
        null if not found, the param found otherwise
      • getParameterByType

        default Optional<Parameter> getParameterByType​(Class<?> type)
        Try to find a Parameter by its type
        Parameters:
        type - the type of the param take care about generics, it wont work
        Returns:
        null if not found, the param found otherwise
      • hasParametersOfType

        default boolean hasParametersOfType​(String... paramTypes)
        Check if the parameters have certain types.
        Parameters:
        paramTypes - the types of parameters like "Map<Integer,String>","int" to match
        void foo(Map<Integer,String> myMap,int number)
        Returns:
        true if all parameters match
      • hasParametersOfType

        default boolean hasParametersOfType​(Class<?>... paramTypes)
        Check if the parameters have certain types. Note that this is a match in SimpleName, so "java.awt.List" and "java.util.List" are identical to this algorithm.
        Parameters:
        paramTypes - the types of parameters like "Map<Integer,String>","int" to match
        void foo(Map<Integer,String> myMap,int number)
        Returns:
        true if all parameters match