Package com.blackrook.archetext.struct
Interface PreprocessorLexer.Includer
-
- All Known Implementing Classes:
PreprocessorLexer.DefaultIncluder
- Enclosing class:
- PreprocessorLexer
public static interface PreprocessorLexer.IncluderAn interface that allows the user to resolve a resource by path when the PreprocessorLexer parses it.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStreamgetIncludeResource(String path)Returns an openInputStreamfor a path when the parser needs a resource.StringgetIncludeResourcePath(String streamName, String path)Returns a full path for a path when the parser needs a resource.
-
-
-
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 openInputStreamfor 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
InputStreamfor the requested resource, or null if not found. - Throws:
IOException- if an error occurs opening a stream.
-
-