Class DirectiveClassBytes
java.lang.Object
org.ek9lang.compiler.directives.DirectiveClassBytes
THE shared recovery of a symbol's generated
.class bytes for the back-end directive
listeners (@BYTECODE, @DEBUG).
Both directives resolve a construct to an ISymbol and then need the exact bytes the back
end just produced for it. The bytes are asked of the ConstructOutputSink, not the
filesystem, because a caller may legitimately have chosen a sink that holds them in memory rather
than writing them (see ConstructOutputSink.read). The dev-then-main lookup mirrors
OutputFileAccess. Extracted from ByteCodeDirectiveListener when @DEBUG
became a second consumer, so the path derivation is not re-derived.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) FilemainClassFile(CompilationEvent compilationEvent, ISymbol symbol) The main (non-dev) class file location for a symbol — used for the "not found" diagnostic.(package private) Optional<byte[]> read(CompilationEvent compilationEvent, ISymbol symbol) The bytes for a symbol's generated class, using the dev-then-main lookup — but asking the sink rather than the filesystem.
-
Constructor Details
-
DirectiveClassBytes
DirectiveClassBytes(ConstructOutputSink outputSink)
-
-
Method Details
-
read
The bytes for a symbol's generated class, using the dev-then-main lookup — but asking the sink rather than the filesystem. -
mainClassFile
The main (non-dev) class file location for a symbol — used for the "not found" diagnostic.
-