public interface Importer<O extends JavaSource<O>>
JavaSource that handles type imports.| Modifier and Type | Method and Description |
|---|---|
Import |
addImport(Class<?> type)
Add an import for the given
Class type. |
Import |
addImport(Import imprt)
Add an import for the given
Import type. |
Import |
addImport(String className)
Add an import by qualified class name.
|
<T extends JavaType<?>> |
addImport(T type)
Add an import for the given
JavaType type. |
Import |
addImport(Type<?> type)
Ensures the type passed as argument is included in the list of imports for this java source.
|
Import |
getImport(Class<?> type)
|
Import |
getImport(Import imprt)
|
Import |
getImport(String literalValue)
Get the
Import for the given fully-qualified class name, if it exists; otherwise, return null; |
<T extends JavaType<?>> |
getImport(T type)
Get the
Import for the given T type, if it exists; otherwise, return null; |
List<Import> |
getImports()
Get an immutable list of all
Imports currently imported by this O |
boolean |
hasImport(Class<?> type)
Return whether or not this
O has an import for the given Class type. |
boolean |
hasImport(Import imprt)
Return whether or not this
O has the given Import type. |
boolean |
hasImport(String type)
Return whether or not this
O has an import for the given fully-qualified class name. |
<T extends JavaType<T>> |
hasImport(T type)
Return whether or not this
O has an import for the given T type. |
O |
removeImport(Class<?> type)
|
O |
removeImport(Import imprt)
Remove the given
Import from this O instance, if it exists; otherwise, do nothing; |
O |
removeImport(String name)
Remove any
Import for the given fully-qualified class name, if it exists; otherwise, do nothing; |
<T extends JavaType<?>> |
removeImport(T type)
Remove any
Import for the given T type, if it exists; otherwise, do nothing; |
boolean |
requiresImport(Class<?> type)
Return whether or not this
O would require an import to reference the given Class type. |
boolean |
requiresImport(String type)
Return whether or not this
O would require an import to reference the given fully-qualified class name. |
String |
resolveType(String type)
Given a simple or qualified type, resolve that type against the available imports and return the referenced type.
|
boolean hasImport(Class<?> type)
O has an import for the given Class type.boolean hasImport(String type)
O has an import for the given fully-qualified class name.boolean requiresImport(Class<?> type)
O would require an import to reference the given Class type.boolean requiresImport(String type)
O would require an import to reference the given fully-qualified class name.<T extends JavaType<T>> boolean hasImport(T type)
O has an import for the given T type.Import getImport(String literalValue)
Import for the given fully-qualified class name, if it exists; otherwise, return null;<T extends JavaType<?>> Import getImport(T type)
Import for the given T type, if it exists; otherwise, return null;List<Import> getImports()
Imports currently imported by this OString resolveType(String type)
Import addImport(String className)
<T extends JavaType<?>> Import addImport(T type)
JavaType type.Import addImport(Type<?> type)
type - The Type to be imported.O removeImport(String name)
Import for the given fully-qualified class name, if it exists; otherwise, do nothing;<T extends JavaType<?>> O removeImport(T type)
Import for the given T type, if it exists; otherwise, do nothing;Copyright © 2016 JBoss by Red Hat. All rights reserved.