public class ImportsTracker extends Object
getNameMap(), then further non-conflicting imports are allowed until the final import list is
constructed by calling freeze(String).| Constructor and Description |
|---|
ImportsTracker(String pkgname)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addImport(String fqname,
boolean force)
Add import for class.
|
void |
addLocalType(String name,
String fqname)
Add local definition name to those visible in class.
|
List |
freeze(String cname)
Freeze imports and return a list of imports.
|
String |
getName(String type)
Get the name to be used for a type.
|
Map |
getNameMap()
Get map from imported fully-qualified class names to short names.
|
boolean |
isQualified(String fqname)
Check if type needs qualified references.
|
public ImportsTracker(String pkgname)
pkgname - containing package namepublic void addLocalType(String name, String fqname)
name - simple class namefqname - fully qualified class nameprotected boolean addImport(String fqname, boolean force)
fqname - fully qualified class nameforce - force replacement of current importtrue if added as importpublic boolean isQualified(String fqname)
fqname - fully qualified class nametrue if needs qualificationpublic Map getNameMap()
public String getName(String type)
getNameMap(), which in
turn blocks removing any imports later.type - fully-qualified type nameCopyright © 2005-2014 jibx.org. All Rights Reserved.