public abstract class CompilationUnit extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static Comparator<CompilationUnit> |
COMPARATOR |
protected static DiskCache |
diskCache |
Constructor and Description |
---|
CompilationUnit() |
Modifier and Type | Method and Description |
---|---|
abstract CachedCompilationUnit |
asCachedCompilationUnit()
Returns the unit as an instance of
CachedCompilationUnit , making a
copy if necessary. |
boolean |
constructAnonymousClassMappings(TreeLogger logger)
Deprecated.
|
boolean |
createdClassMapping()
Deprecated.
|
boolean |
equals(Object obj)
Overridden to finalize; always returns object identity.
|
Map<String,String> |
getAnonymousClassMap()
Deprecated.
|
abstract Collection<CompiledClass> |
getCompiledClasses()
Returns all contained classes.
|
abstract List<JsniMethod> |
getJsniMethods() |
abstract long |
getLastModified()
Returns the last modified time of the compilation unit.
|
abstract MethodArgNamesLookup |
getMethodArgs() |
abstract String |
getResourceLocation()
This is the resource location from the classpath or some deterministic
virtual location (in the case of generators or mock data) where the source
for this unit originated.
|
abstract String |
getResourcePath()
Returns the full abstract path of the resource.
|
JDeclaredType |
getTypeByName(String typeName)
Returns the contained type with the given name.
|
abstract String |
getTypeName()
Returns the source name of the top level public type.
|
List<JDeclaredType> |
getTypes()
Returns a copy of the GWT AST types in this unit.
Callers are free to modify the returned type instances without worrying about modifying the original CompilationUnit instances. |
abstract byte[] |
getTypesSerialized()
Returns the GWT AST types in this unit in serialized form.
|
boolean |
hasAnonymousClasses()
Deprecated.
|
int |
hashCode()
Overridden to finalize; always returns identity hash code.
|
static boolean |
isClassnameGenerated(String className)
Deprecated.
|
abstract boolean |
isError()
Returns
true if this unit had errors. |
abstract boolean |
isGenerated()
Deprecated.
|
abstract boolean |
isSuperSource()
Deprecated.
|
String |
toString()
Overridden to finalize; always returns
getResourceLocation() . |
protected Object |
writeReplace()
The canonical serialized form of a CompilatinUnit is
CachedCompilationUnit . |
public static final Comparator<CompilationUnit> COMPARATOR
protected static final DiskCache diskCache
@Deprecated public static boolean isClassnameGenerated(String className)
If new compilers have different conventions for anonymous and synthetic classes, this code needs to be updated.
className
- name of the class to be checked.public abstract CachedCompilationUnit asCachedCompilationUnit()
CachedCompilationUnit
, making a
copy if necessary.@Deprecated public final boolean constructAnonymousClassMappings(TreeLogger logger)
@Deprecated public final boolean createdClassMapping()
public final boolean equals(Object obj)
@Deprecated public final Map<String,String> getAnonymousClassMap()
public abstract Collection<CompiledClass> getCompiledClasses()
public abstract List<JsniMethod> getJsniMethods()
public abstract long getLastModified()
public abstract MethodArgNamesLookup getMethodArgs()
public abstract String getResourceLocation()
Resource.getLocation()
public abstract String getResourcePath()
Resource.getPath()
,
Resource.getPathPrefix()
public JDeclaredType getTypeByName(String typeName)
public abstract String getTypeName()
public List<JDeclaredType> getTypes()
public abstract byte[] getTypesSerialized()
@Deprecated public final boolean hasAnonymousClasses()
public final int hashCode()
public abstract boolean isError()
true
if this unit had errors.@Deprecated public abstract boolean isGenerated()
true
if this unit was generated by a
Generator
.@Deprecated public abstract boolean isSuperSource()
public final String toString()
getResourceLocation()
.protected final Object writeReplace()
CachedCompilationUnit
.Copyright © 2018. All rights reserved.