Interface MethodSource<O extends JavaSource<O>>

    • Method Detail

      • setDefault

        MethodSource<O> setDefault​(boolean value)
        Sets the default keyword in this method
        Parameters:
        value - if this method should have the default keywork set
        Returns:
        the generic element this interface is bound to
      • setSynchronized

        MethodSource<O> setSynchronized​(boolean value)
        Sets the synchronized keyword in this element.
        Parameters:
        value - if this element should be set to synchronized
        Returns:
        the generic element this interface is bound to
      • setNative

        MethodSource<O> setNative​(boolean value)
        Sets this method to be native IMPORTANT: Setting it to true will remove the method body.
      • setReturnType

        MethodSource<O> setReturnType​(java.lang.Class<?> type)
        Set this Method to return the given type. The type is properly imported if possible.
        Parameters:
        type - the return type
        Returns:
        this
        See Also:
        Importer.addImport(String)
      • setReturnType

        MethodSource<O> setReturnType​(java.lang.String type)
        Set this Method to return the given type. The type is properly imported if possible.
        Parameters:
        type - the return type
        Returns:
        this
        See Also:
        Importer.addImport(String)
      • setBody

        MethodSource<O> setBody​(java.lang.String body)
        Set the inner body of this Method
      • setConstructor

        MethodSource<O> setConstructor​(boolean constructor)
        Toggle this method as a constructor. If true, and the name of the Method is not the same as the name of its parent JavaClass , update the name of the method to match.
      • setParameters

        MethodSource<O> setParameters​(java.lang.String string)
        Set this Method's parameters.
      • addThrows

        MethodSource<O> addThrows​(java.lang.String type)
        Add a thrown Exception to this method's signature.
      • addThrows

        MethodSource<O> addThrows​(java.lang.Class<? extends java.lang.Exception> type)
        Add a thrown Exception to this method's signature.
      • removeThrows

        MethodSource<O> removeThrows​(java.lang.String type)
        Remove a thrown Exception to this method's signature.
      • removeThrows

        MethodSource<O> removeThrows​(java.lang.Class<? extends java.lang.Exception> type)
        Remove a thrown Exception to this method's signature.
      • addParameter

        ParameterSource<O> addParameter​(java.lang.Class<?> type,
                                        java.lang.String name)
        Add a parameter with the specified Class type and name to this method
      • addParameter

        ParameterSource<O> addParameter​(java.lang.String type,
                                        java.lang.String name)
        Add a parameter with the specified type and name to this method
      • addParameter

        ParameterSource<O> addParameter​(JavaType<?> type,
                                        java.lang.String name)
        Add a parameter with the specified JavaType type and name to this method
      • removeParameter

        MethodSource<O> removeParameter​(java.lang.Class<?> type,
                                        java.lang.String name)
        Remove a parameter with the specified Class type and name from this method
      • removeParameter

        MethodSource<O> removeParameter​(java.lang.String type,
                                        java.lang.String name)
        Remove a parameter with the specified type and name from this method
      • removeParameter

        MethodSource<O> removeParameter​(JavaType<?> type,
                                        java.lang.String name)
        Remove a parameter with the specified JavaType type and name to this method