Class JavaFileImpl


  • public class JavaFileImpl
    extends JavaFile
    PacMan implementation of a JavaFile. This will parse out the file and determine package, class, and imports
    • Field Detail

      • classTypes

        private final java.util.List<java.lang.String> classTypes
    • Constructor Detail

      • JavaFileImpl

        public JavaFileImpl​(java.nio.file.Path path,
                            java.lang.String encoding)
                     throws java.io.IOException
        Constructor of a new object that points to a given file.
        Parameters:
        path - path of the file
        encoding - encoding of the file
        Throws:
        java.io.IOException - on parsing failure
    • Method Detail

      • parse

        private void parse()
                    throws java.io.IOException
        Opens up the file and try to determine package, class and import statements.
        Throws:
        java.io.IOException
      • parseRecursive

        private void parseRecursive​(java.lang.String nestedPrefix,
                                    java.io.StreamTokenizer stok)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getTokenizer

        private java.io.StreamTokenizer getTokenizer​(java.io.Reader reader)
        Gets a StreamTokenizer for this file.
      • getReader

        private java.io.Reader getReader()
                                  throws java.io.IOException
        Throws:
        java.io.IOException