Class ImportListImpl
- java.lang.Object
-
- org.glassfish.pfl.dynamic.codegen.impl.ImportListImpl
-
- All Implemented Interfaces:
ImportList
public class ImportListImpl extends java.lang.Object implements ImportList
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ImportListImpl.Node
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,Type>
imports
private ImportListImpl.Node
root
private java.util.List<Pair<java.lang.String,java.lang.String>>
sortedImports
-
Constructor Summary
Constructors Constructor Description ImportListImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Type
addImport(java.lang.String name)
Add a fully-qualified type name to the imports.void
addImport(Type type)
private void
clearRoot()
boolean
contains(java.lang.String name)
Return whether or not this Type is in the imports.boolean
contains(Type type)
ImportList
copy()
Return a copy of this ImportList.java.util.List<Pair<java.lang.String,java.lang.String>>
getInOrderList()
Return a list of imports as (packageName,className) pairs.private void
insertType(Type type)
Type
lookup(java.lang.String className)
Lookup just the className, without package name.private void
updateRoot()
-
-
-
Field Detail
-
imports
private java.util.Map<java.lang.String,Type> imports
-
root
private ImportListImpl.Node root
-
sortedImports
private java.util.List<Pair<java.lang.String,java.lang.String>> sortedImports
-
-
Method Detail
-
copy
public ImportList copy()
Description copied from interface:ImportList
Return a copy of this ImportList.- Specified by:
copy
in interfaceImportList
-
clearRoot
private void clearRoot()
-
addImport
public Type addImport(java.lang.String name)
Add a fully-qualified type name to the imports. Returns the Type for the name.- Specified by:
addImport
in interfaceImportList
-
addImport
public void addImport(Type type)
- Specified by:
addImport
in interfaceImportList
-
contains
public boolean contains(java.lang.String name)
Return whether or not this Type is in the imports.- Specified by:
contains
in interfaceImportList
-
contains
public boolean contains(Type type)
- Specified by:
contains
in interfaceImportList
-
lookup
public Type lookup(java.lang.String className)
Lookup just the className, without package name.- Specified by:
lookup
in interfaceImportList
-
insertType
private void insertType(Type type)
-
updateRoot
private void updateRoot()
-
getInOrderList
public java.util.List<Pair<java.lang.String,java.lang.String>> getInOrderList()
Return a list of imports as (packageName,className) pairs. The list is sorted lexicographically.- Specified by:
getInOrderList
in interfaceImportList
-
-