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 CompiledSourceInfo
bytecodeMap
- the map of class name to Bytecode
NullPointerException
- if any argument is nullIllegalArgumentException
- if not for a single sourcepublic 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 String getMainClassName()
SingleSourceCode
getMainClassName
in interface SingleSourceCode
public Set<String> getClassNames(Source source)
Code
getClassNames
in interface Code
source
- sourcepublic Set<String> getClassNames()
SingleSourceCode
getClassNames
in interface SingleSourceCode
public long getLastModifiedAtCompileTime(Source source)
Code
getLastModifiedAtCompileTime
in interface Code
source
- sourcepublic long getLastModifiedAtCompileTime()
SingleSourceCode
getLastModifiedAtCompileTime
in interface SingleSourceCode
public 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 Source getSource()
SingleSourceCode
getSource
in interface SingleSourceCode
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