Go to the documentation of this file.00001 package com.rosalfred.core.ia.rivescript.lang.java;
00002
00003 import java.io.ByteArrayOutputStream;
00004 import java.io.IOException;
00005 import java.io.OutputStream;
00006 import java.net.URI;
00007
00008 import javax.tools.SimpleJavaFileObject;
00009
00010 public class JavaClassObject extends SimpleJavaFileObject {
00011
00018 protected final ByteArrayOutputStream bos =
00019 new ByteArrayOutputStream();
00020
00030 public JavaClassObject(String name, Kind kind) {
00031 super(URI.create("string:///" + name.replace('.', '/')
00032 + kind.extension), kind);
00033 }
00034
00041 public byte[] getBytes() {
00042 return bos.toByteArray();
00043 }
00044
00050 @Override
00051 public OutputStream openOutputStream() throws IOException {
00052 return bos;
00053 }
00054 }