Class TestJavaFileObject

  • All Implemented Interfaces:
    javax.tools.FileObject, javax.tools.JavaFileObject

    public final class TestJavaFileObject
    extends javax.tools.SimpleJavaFileObject
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface javax.tools.JavaFileObject

        javax.tools.JavaFileObject.Kind
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static javax.tools.JavaFileObject HELLO_WORLD  
      static java.lang.Iterable<javax.tools.JavaFileObject> ONLY_HELLO_WORLD  
      private java.lang.CharSequence programText  
      • Fields inherited from class javax.tools.SimpleJavaFileObject

        kind, uri
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TestJavaFileObject​(java.lang.String className, java.lang.CharSequence programText)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.tools.JavaFileObject create​(java.lang.String className, java.lang.String content)  
      java.lang.CharSequence getCharContent​(boolean ignoreEncodingErrors)  
      static java.lang.Iterable<? extends javax.tools.JavaFileObject> read​(FileType type, java.lang.String... names)  
      private static java.lang.CharSequence readFile​(FileType type, java.lang.String name)  
      private static java.net.URI uri​(java.lang.String className)  
      • Methods inherited from class javax.tools.SimpleJavaFileObject

        delete, getAccessLevel, getKind, getLastModified, getName, getNestingKind, isNameCompatible, openInputStream, openOutputStream, openReader, openWriter, toString, toUri
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • HELLO_WORLD

        public static final javax.tools.JavaFileObject HELLO_WORLD
      • ONLY_HELLO_WORLD

        public static final java.lang.Iterable<javax.tools.JavaFileObject> ONLY_HELLO_WORLD
      • programText

        private final java.lang.CharSequence programText
    • Constructor Detail

      • TestJavaFileObject

        private TestJavaFileObject​(java.lang.String className,
                                   java.lang.CharSequence programText)
    • Method Detail

      • getCharContent

        public java.lang.CharSequence getCharContent​(boolean ignoreEncodingErrors)
                                              throws java.io.IOException
        Specified by:
        getCharContent in interface javax.tools.FileObject
        Overrides:
        getCharContent in class javax.tools.SimpleJavaFileObject
        Throws:
        java.io.IOException
      • uri

        private static java.net.URI uri​(java.lang.String className)
      • create

        public static javax.tools.JavaFileObject create​(java.lang.String className,
                                                        java.lang.String content)
      • read

        public static java.lang.Iterable<? extends javax.tools.JavaFileObject> read​(FileType type,
                                                                                    java.lang.String... names)
                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • readFile

        private static java.lang.CharSequence readFile​(FileType type,
                                                       java.lang.String name)
                                                throws java.io.FileNotFoundException,
                                                       java.io.IOException
        Throws:
        java.io.FileNotFoundException
        java.io.IOException