Interface TypeHolderSource<T extends JavaSource<T>>
-
- All Superinterfaces:
TypeHolder<T>
- All Known Subinterfaces:
EnumConstantSource.Body,JavaAnnotationSource,JavaClassSource,JavaEnumSource,JavaInterfaceSource
public interface TypeHolderSource<T extends JavaSource<T>> extends TypeHolder<T>
Represents aJavaSourcethat may declare types.- Author:
- George Gastaldi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <NESTED_TYPE extends JavaSource<?>>
NESTED_TYPEaddNestedType(java.lang.Class<NESTED_TYPE> type)Creates a nested type in thisJavaSource.<NESTED_TYPE extends JavaSource<?>>
NESTED_TYPEaddNestedType(java.lang.String declaration)Add a new type declaration to this instance, using the givenStringas the declaration.<NESTED_TYPE extends JavaSource<?>>
NESTED_TYPEaddNestedType(NESTED_TYPE type)Adds a type as a nested type in thisJavaSource.JavaSource<?>getNestedType(java.lang.String name)Get theJavaTypewith the given name and return it, otherwise, return null.java.util.List<JavaSource<?>>getNestedTypes()TremoveNestedType(JavaSource<?> type)Remove the nested type instance, if it exists; otherwise, do nothing.-
Methods inherited from interface org.jboss.forge.roaster.model.TypeHolder
hasNestedType, hasNestedType, hasNestedType
-
-
-
-
Method Detail
-
getNestedTypes
java.util.List<JavaSource<?>> getNestedTypes()
Return a list containingJavaSourceinstances for each nestedClassdeclaration found withinthis. Any modification of returnedJavaSourceinstances will result in modification of the contents contained bythisthe parent instance.- Specified by:
getNestedTypesin interfaceTypeHolder<T extends JavaSource<T>>
-
getNestedType
JavaSource<?> getNestedType(java.lang.String name)
Description copied from interface:TypeHolderGet theJavaTypewith the given name and return it, otherwise, return null.- Specified by:
getNestedTypein interfaceTypeHolder<T extends JavaSource<T>>
-
addNestedType
<NESTED_TYPE extends JavaSource<?>> NESTED_TYPE addNestedType(java.lang.Class<NESTED_TYPE> type)
Creates a nested type in thisJavaSource. Any modification of returnedJavaSourceinstances will result in modification of the contents contained bythisthe parent instance.
-
addNestedType
<NESTED_TYPE extends JavaSource<?>> NESTED_TYPE addNestedType(java.lang.String declaration)
Add a new type declaration to this instance, using the givenStringas 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 thisJavaSource. Any modification of returnedJavaSourceinstances will result in modification of the contents contained bythisthe parent instance.
-
removeNestedType
T removeNestedType(JavaSource<?> type)
Remove the nested type instance, if it exists; otherwise, do nothing.
-
-