Interface PreprocessorLexer.Includer

  • All Known Implementing Classes:
    PreprocessorLexer.DefaultIncluder
    Enclosing class:
    PreprocessorLexer

    public static interface PreprocessorLexer.Includer
    An interface that allows the user to resolve a resource by path when the PreprocessorLexer parses it.
    • Method Detail

      • getIncludeResourcePath

        String getIncludeResourcePath​(String streamName,
                                      String path)
                               throws IOException
        Returns a full path for a path when the parser needs a resource.
        Parameters:
        streamName - the current name of the stream. This includer may use this to procure a relative path.
        path - the stream path from the include directive.
        Returns:
        the path to a possible resource, or null if no possible path is available.
        Throws:
        IOException - if an error occurs procuring a potential stream.
      • getIncludeResource

        InputStream getIncludeResource​(String path)
                                throws IOException
        Returns an open InputStream for a path when the parser needs a resource. By default, this attempts to open a file at the provided path.
        Parameters:
        path - the resolved stream path from the include directive.
        Returns:
        an open InputStream for the requested resource, or null if not found.
        Throws:
        IOException - if an error occurs opening a stream.