Class ExecutableFactory

    • Constructor Detail

      • ExecutableFactory

        public ExecutableFactory​(Factory factory)
        Creates a new executable sub-factory.
        Parameters:
        factory - the parent factory
    • Method Detail

      • createAnonymous

        public CtAnonymousExecutable createAnonymous​(CtClass<?> target,
                                                     CtBlock<java.lang.Void> body)
        Creates an anonymous executable (initializer block) in a target class).
      • createParameterReference

        public <T> CtParameterReference<T> createParameterReference​(CtParameter<T> parameter)
        Creates a parameter reference from an existing parameter.
        Type Parameters:
        T - the parameter's type
        Parameters:
        parameter - the parameter
      • createReference

        public <T> CtExecutableReference<T> createReference​(CtTypeReference<?> declaringType,
                                                            CtTypeReference<T> type,
                                                            java.lang.String methodName,
                                                            CtTypeReference<?>... parameterTypes)
        Creates an executable reference.
        Parameters:
        declaringType - reference to the declaring type
        type - the executable's type
        methodName - simple name
        parameterTypes - list of parameter's types
      • createReference

        public <T> CtExecutableReference<T> createReference​(CtTypeReference<?> declaringType,
                                                            boolean isStatic,
                                                            CtTypeReference<T> type,
                                                            java.lang.String methodName,
                                                            CtTypeReference<?>... parameterTypes)
        Creates an executable reference.
        Parameters:
        declaringType - reference to the declaring type
        isStatic - if this reference references a static executable
        type - the return type of the executable
        methodName - simple name
        parameterTypes - list of parameter's types
      • createReference

        public <T> CtExecutableReference<T> createReference​(CtTypeReference<?> declaringType,
                                                            boolean isStatic,
                                                            CtTypeReference<T> type,
                                                            java.lang.String methodName,
                                                            java.util.List<CtTypeReference<?>> parameterTypes)
        Creates an executable reference.
        Parameters:
        declaringType - reference to the declaring type
        isStatic - if this reference references a static executable
        type - the return type of the executable
        methodName - simple name
        parameterTypes - list of parameter's types
      • createReference

        public <T> CtExecutableReference<T> createReference​(CtTypeReference<?> declaringType,
                                                            CtTypeReference<T> type,
                                                            java.lang.String methodName,
                                                            java.util.List<CtTypeReference<?>> parameterTypes)
        Creates an executable reference.
        Parameters:
        declaringType - reference to the declaring type
        type - the return type of the executable
        methodName - simple name
        parameterTypes - list of parameter's types
      • createReference

        public <T> CtExecutableReference<T> createReference​(java.lang.String signature)
        Creates an executable reference from its signature, as defined by the executable reference's toString.