Package randoop.compile
Class SequenceJavaFileObject
- java.lang.Object
-
- javax.tools.SimpleJavaFileObject
-
- randoop.compile.SequenceJavaFileObject
-
- All Implemented Interfaces:
FileObject
,JavaFileObject
class SequenceJavaFileObject extends SimpleJavaFileObject
AJavaFileObject
for source code in memory.based on
javaxtools.compiler.JavaFileObjectImple
from Create dynamic applications with javax.tools.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.tools.JavaFileObject
JavaFileObject.Kind
-
-
Field Summary
Fields Modifier and Type Field Description private ByteArrayOutputStream
byteStream
The stream for reading the source code.private String
source
The source code text.-
Fields inherited from class javax.tools.SimpleJavaFileObject
kind, uri
-
-
Constructor Summary
Constructors Constructor Description SequenceJavaFileObject(String classFileName, String sequenceClass)
Creates aSequenceJavaFileObject
with the given name and class source.SequenceJavaFileObject(String classFileName, JavaFileObject.Kind kind)
Creates aSequenceJavaFileObject
for the given class name and kind.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) byte[]
getByteCode()
Returns the byte stream as a byte array.CharSequence
getCharContent(boolean ignoreEncodingErrors)
InputStream
openInputStream()
OutputStream
openOutputStream()
-
Methods inherited from class javax.tools.SimpleJavaFileObject
delete, getAccessLevel, getKind, getLastModified, getName, getNestingKind, isNameCompatible, openReader, openWriter, toString, toUri
-
-
-
-
Field Detail
-
source
private final String source
The source code text.
-
byteStream
private ByteArrayOutputStream byteStream
The stream for reading the source code.
-
-
Constructor Detail
-
SequenceJavaFileObject
SequenceJavaFileObject(String classFileName, JavaFileObject.Kind kind)
Creates aSequenceJavaFileObject
for the given class name and kind.- Parameters:
classFileName
- the name of the classkind
- eitherSOURCE
orCLASS
-
SequenceJavaFileObject
SequenceJavaFileObject(String classFileName, String sequenceClass)
Creates aSequenceJavaFileObject
with the given name and class source.- Parameters:
classFileName
- the name of the classsequenceClass
- the class source
-
-
Method Detail
-
getCharContent
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws UnsupportedOperationException
- Specified by:
getCharContent
in interfaceFileObject
- Overrides:
getCharContent
in classSimpleJavaFileObject
- Throws:
UnsupportedOperationException
-
openInputStream
public InputStream openInputStream()
- Specified by:
openInputStream
in interfaceFileObject
- Overrides:
openInputStream
in classSimpleJavaFileObject
-
openOutputStream
public OutputStream openOutputStream()
- Specified by:
openOutputStream
in interfaceFileObject
- Overrides:
openOutputStream
in classSimpleJavaFileObject
-
getByteCode
byte[] getByteCode()
Returns the byte stream as a byte array.- Returns:
- the byte array for the byte stream
-
-