Interface TypeHolderSource<T extends JavaSource<T>>

    • Method Detail

      • getNestedTypes

        java.util.List<JavaSource<?>> getNestedTypes()
        Return a list containing JavaSource instances for each nested Class declaration found within this. Any modification of returned JavaSource instances will result in modification of the contents contained by this the parent instance.
        Specified by:
        getNestedTypes in interface TypeHolder<T extends JavaSource<T>>
      • addNestedType

        <NESTED_TYPE extends JavaSource<?>> NESTED_TYPE addNestedType​(java.lang.Class<NESTED_TYPE> type)
        Creates a nested type in this JavaSource. Any modification of returned JavaSource instances will result in modification of the contents contained by this the parent instance.
      • addNestedType

        <NESTED_TYPE extends JavaSource<?>> NESTED_TYPE addNestedType​(java.lang.String declaration)
        Add a new type declaration to this instance, using the given String as the declaration.

        For example:
        JavaClassSource source = javaClass.addNested("public class InnerClass{}");

      • addNestedType

        <NESTED_TYPE extends JavaSource<?>> NESTED_TYPE addNestedType​(NESTED_TYPE type)
        Adds a type as a nested type in this JavaSource. Any modification of returned JavaSource instances will result in modification of the contents contained by this the parent instance.
      • removeNestedType

        T removeNestedType​(JavaSource<?> type)
        Remove the nested type instance, if it exists; otherwise, do nothing.