Constructor and Description |
---|
DefaultCode(String sourcesName,
Map<Source,CompiledSourceInfo> compiledSourceInfoMap,
Map<String,Bytecode> bytecodeMap)
constructor (typically called by the compiler).
|
Modifier and Type | Method and Description |
---|---|
Bytecode |
getBytecode(String className)
gets the bytecode for the given class name.
|
Set<String> |
getClassNames(Source source)
gets all class names of the given source.
|
Set<String> |
getClassNameSet()
gets the set of all class names for which bytecode is in this code.
|
long |
getLastModifiedAtCompileTime(Source source)
gets the last modified at compile time of the given source.
|
String |
getMainClassName(Source source)
gets the main class name of the given source.
|
Set<Source> |
getSourceSet()
gets the set of all sources which had been compiled to this code.
|
String |
getSourcesName()
gets the name of the originating
Sources instance,
or a similar name that can help a human reader to identify
the originating sources. |
boolean |
isForSource(Source source)
returns true if the given source is for this code,
i.e. had been part of the sources compiled to this code.
|
String |
toString()
returns a string suitable for logging.
|
public DefaultCode(String sourcesName, Map<Source,CompiledSourceInfo> compiledSourceInfoMap, Map<String,Bytecode> bytecodeMap)
sourcesName
- the name of the originating Sources
instancecompiledSourceInfoMap
- the map of originating Source
to CompiledSourceInfo
bytecodeMap
- the map of class name to Bytecode
NullPointerException
- if any argument is nullpublic String getSourcesName()
Code
Sources
instance,
or a similar name that can help a human reader to identify
the originating sources.getSourcesName
in interface Code
public boolean isForSource(Source source)
Code
isForSource
in interface Code
source
- sourcepublic String getMainClassName(Source source)
Code
getMainClassName
in interface Code
source
- sourcepublic Set<String> getClassNames(Source source)
Code
getClassNames
in interface Code
source
- sourcepublic long getLastModifiedAtCompileTime(Source source)
Code
getLastModifiedAtCompileTime
in interface Code
source
- sourcepublic Set<Source> getSourceSet()
Code
Note that if code is not in memory, this operation may be slow or expensive in terms of resources.
getSourceSet
in interface Code
public Bytecode getBytecode(String className)
Code
getBytecode
in interface Code
className
- class namepublic Set<String> getClassNameSet()
Code
Note that if code is not in memory, this operation may be slow or expensive in terms of resources.
getClassNameSet
in interface Code