Class FileRenderer

    • Constructor Summary

      Constructors 
      Constructor Description
      FileRenderer​(java.lang.String sourceExtension, java.lang.String targetExtension, boolean isCaseSensitive, TemplateCompiler... compilers)
      Create a file renderer from a source extension to a target extension, which will yield the virtual contents of the target file by applying a set of renderers to the source file data.
    • Constructor Detail

      • FileRenderer

        public FileRenderer​(java.lang.String sourceExtension,
                            java.lang.String targetExtension,
                            boolean isCaseSensitive,
                            TemplateCompiler... compilers)
        Create a file renderer from a source extension to a target extension, which will yield the virtual contents of the target file by applying a set of renderers to the source file data.
        Parameters:
        sourceExtension - The extension of the source (actual) file, including the dot and extension name.
        targetExtension - The extension of the target (virtual) file, including the dot and extension name.
        isCaseSensitive - Whether or not to do case-sensitive matching against the source and target extensions.
        compilers - A lookup function which can create a renderer for a specific path as needed.
    • Method Detail

      • getSourcePattern

        public java.util.regex.Pattern getSourcePattern()
        Specified by:
        getSourcePattern in interface FileContentRenderer
        Returns:
        a pattern that can be used to match path names which serve as the source data of rendered files.
      • getTargetPattern

        public java.util.regex.Pattern getTargetPattern()
        Specified by:
        getTargetPattern in interface FileContentRenderer
        Returns:
        a pattern that can be used to match path names which are to be dynamically rendered from source file content.
      • getSourceExtension

        public java.lang.String getSourceExtension()
      • getTargetExtension

        public java.lang.String getTargetExtension()
      • getSourcePath

        public java.nio.file.Path getSourcePath​(java.nio.file.Path targetName)
        Description copied from interface: FileContentRenderer
        Return the matching source path, but only if the target name matches the target extension.
        Specified by:
        getSourcePath in interface FileContentRenderer
        Parameters:
        targetName - The target Path which represents the intended to be rendered
        Returns:
        A source path, or null if the target name does not match for this renderer
      • render

        public java.nio.ByteBuffer render​(java.nio.file.Path sourcePath,
                                          java.nio.file.Path targetPath,
                                          java.nio.ByteBuffer byteBuffer)
        Specified by:
        render in interface FileContentRenderer
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object