public class DefaultSingleSourceCode extends Object implements SingleSourceCode
SingleSourceCode with all bytecode in memory.| Constructor and Description |
|---|
DefaultSingleSourceCode(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()
gets all class names for the single source.
|
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()
gets the last modified at compile time for the single source.
|
long |
getLastModifiedAtCompileTime(Source source)
gets the last modified at compile time of the given source.
|
String |
getMainClassName()
gets the main class name for the single source.
|
String |
getMainClassName(Source source)
gets the main class name of the given source.
|
Source |
getSource()
gets the 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 DefaultSingleSourceCode(String sourcesName, Map<Source,CompiledSourceInfo> compiledSourceInfoMap, Map<String,Bytecode> bytecodeMap)
sourcesName - the name of the originating Sources instancecompiledSourceInfoMap - the map of originating Source to CompiledSourceInfobytecodeMap - the map of class name to BytecodeNullPointerException - if any argument is nullIllegalArgumentException - if not for a single sourcepublic String getSourcesName()
CodeSources instance,
or a similar name that can help a human reader to identify
the originating sources.getSourcesName in interface Codepublic boolean isForSource(Source source)
CodeisForSource in interface Codesource - sourcepublic String getMainClassName(Source source)
CodegetMainClassName in interface Codesource - sourcepublic String getMainClassName()
SingleSourceCodegetMainClassName in interface SingleSourceCodepublic Set<String> getClassNames(Source source)
CodegetClassNames in interface Codesource - sourcepublic Set<String> getClassNames()
SingleSourceCodegetClassNames in interface SingleSourceCodepublic long getLastModifiedAtCompileTime(Source source)
CodegetLastModifiedAtCompileTime in interface Codesource - sourcepublic long getLastModifiedAtCompileTime()
SingleSourceCodegetLastModifiedAtCompileTime in interface SingleSourceCodepublic Set<Source> getSourceSet()
CodeNote that if code is not in memory, this operation may be slow or expensive in terms of resources.
getSourceSet in interface Codepublic Source getSource()
SingleSourceCodegetSource in interface SingleSourceCodepublic Bytecode getBytecode(String className)
CodegetBytecode in interface CodeclassName - class namepublic Set<String> getClassNameSet()
CodeNote that if code is not in memory, this operation may be slow or expensive in terms of resources.
getClassNameSet in interface Code