public interface TypeHolderSource<T extends JavaSource<T>> extends TypeHolder<T>
JavaSource that may declare types.| Modifier and Type | Method and Description |
|---|---|
<NESTED_TYPE extends JavaSource<?>> |
addNestedType(Class<NESTED_TYPE> type)
Creates a nested type in this
JavaSource. |
<NESTED_TYPE extends JavaSource<?>> |
addNestedType(NESTED_TYPE type)
Adds a type as a nested type in this
JavaSource. |
<NESTED_TYPE extends JavaSource<?>> |
addNestedType(String declaration)
Add a new type declaration to this instance, using the given
String as the declaration. |
JavaSource<?> |
getNestedType(String name)
Get the
JavaType with the given name and return it, otherwise, return null. |
List<JavaSource<?>> |
getNestedTypes()
|
T |
removeNestedType(JavaSource<?> type)
Remove the nested type instance, if it exists; otherwise, do nothing.
|
hasNestedType, hasNestedType, hasNestedTypeList<JavaSource<?>> getNestedTypes()
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.getNestedTypes in interface TypeHolder<T extends JavaSource<T>>JavaSource<?> getNestedType(String name)
TypeHolderJavaType with the given name and return it, otherwise, return null.getNestedType in interface TypeHolder<T extends JavaSource<T>><NESTED_TYPE extends JavaSource<?>> NESTED_TYPE addNestedType(Class<NESTED_TYPE> type)
JavaSource. Any modification of returned JavaSource instances will
result in modification of the contents contained by this the parent instance.<NESTED_TYPE extends JavaSource<?>> NESTED_TYPE addNestedType(String declaration)
String as the declaration.
For example:JavaClassSource source = javaClass.addNested("public class InnerClass{}");<NESTED_TYPE extends JavaSource<?>> NESTED_TYPE addNestedType(NESTED_TYPE type)
JavaSource. Any modification of returned JavaSource instances
will result in modification of the contents contained by this the parent instance.T removeNestedType(JavaSource<?> type)
Copyright © 2016 JBoss by Red Hat. All rights reserved.