com.cisco.oss.foundation.logging.structured
Class AbstractFoundationLoggingMarker.JavaClassObject
java.lang.Object
javax.tools.SimpleJavaFileObject
com.cisco.oss.foundation.logging.structured.AbstractFoundationLoggingMarker.JavaClassObject
- All Implemented Interfaces:
- FileObject, JavaFileObject
- Enclosing class:
- AbstractFoundationLoggingMarker
public static class AbstractFoundationLoggingMarker.JavaClassObject
- extends SimpleJavaFileObject
|
Field Summary |
protected ByteArrayOutputStream |
bos
Byte code created by the compiler will be stored in this
ByteArrayOutputStream so that we can later get the byte array out of
it and put it in the memory as an instance of our class. |
|
Method Summary |
byte[] |
getBytes()
Will be used by our file manager to get the byte code that can be put
into memory to instantiate our class |
OutputStream |
openOutputStream()
Will provide the compiler with an output stream that leads to our
byte array. |
| Methods inherited from class javax.tools.SimpleJavaFileObject |
delete, getAccessLevel, getCharContent, getKind, getLastModified, getName, getNestingKind, isNameCompatible, openInputStream, openReader, openWriter, toString, toUri |
bos
protected final ByteArrayOutputStream bos
- Byte code created by the compiler will be stored in this
ByteArrayOutputStream so that we can later get the byte array out of
it and put it in the memory as an instance of our class.
AbstractFoundationLoggingMarker.JavaClassObject
public AbstractFoundationLoggingMarker.JavaClassObject(String name,
JavaFileObject.Kind kind)
- Registers the compiled class object under URI containing the class
full name
- Parameters:
name - Full name of the compiled classkind - Kind of the data. It will be CLASS in our case
getBytes
public byte[] getBytes()
- Will be used by our file manager to get the byte code that can be put
into memory to instantiate our class
- Returns:
- compiled byte code
openOutputStream
public OutputStream openOutputStream()
throws IOException
- Will provide the compiler with an output stream that leads to our
byte array. This way the compiler will write everything into the byte
array that we will instantiate later
- Specified by:
openOutputStream in interface FileObject- Overrides:
openOutputStream in class SimpleJavaFileObject
- Throws:
IOException
Copyright © 2014 Cisco. All Rights Reserved.