Package javax.tools

Examples of javax.tools.SimpleJavaFileObject


import javax.tools.ToolProvider;
import static javax.tools.JavaFileObject.Kind;

public class T6608214 {
    public static void main(String[] args) throws IOException {
        JavaFileObject sfo = new SimpleJavaFileObject(URI.create(""),Kind.SOURCE) {
            public CharSequence getCharContent(boolean ignoreEncodingErrors) {
                return "class Test<S> { <T extends S & Runnable> void test(){}}";
            }
        };
        List<? extends JavaFileObject> files = Arrays.asList(sfo);
View Full Code Here


    public static void main(String... args) {
        new T6733837().exec();
    }

    public void exec() {
        JavaFileObject sfo = new SimpleJavaFileObject(URI.create("myfo:/Test.java"),Kind.SOURCE) {
            public CharSequence getCharContent(boolean ignoreEncodingErrors) {
                return "\tclass ErroneousWithTab";
            }
        };
        StringWriter sw = new StringWriter();
View Full Code Here

      if (!config.getForce()) {
        return;
      }
      else {
        URI uri = URI.create("/Dumb.java");
        compilationUnits = Collections.<JavaFileObject>singleton(new SimpleJavaFileObject(uri, JavaFileObject.Kind.SOURCE) {
          @Override
          public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
            return "public class Dumb {}";
          }
        });
View Full Code Here

    }

    @Override
    public JavaFileObject getJavaFileForOutput(Location location, final String className,
        JavaFileObject.Kind kind, FileObject sibling) throws IOException {
      return new SimpleJavaFileObject(EMPTY_URI, kind) {
        public OutputStream openOutputStream() throws IOException {
          ByteArrayOutputStream outputStream = byteCodeForClasses.get(className);
          if (outputStream != null) {
            throw new IllegalStateException("Cannot write more than once");
          }
View Full Code Here

TOP

Related Classes of javax.tools.SimpleJavaFileObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.