Class FileRenderer
- java.lang.Object
-
- io.virtdata.docsys.metafs.fs.renderfs.api.FileContentRenderer
-
- io.virtdata.docsys.metafs.fs.renderfs.api.FileRenderer
-
public class FileRenderer extends FileContentRenderer
-
-
Constructor Summary
Constructors Constructor Description FileRenderer(java.lang.String fromext, java.lang.String toext, boolean cased, TemplateCompiler compiler)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.
-
Method Summary
Modifier and Type Method Description java.nio.file.PathgetRenderedTargetName(java.nio.file.Path sourceName)java.lang.StringgetSourceExtension()java.nio.file.PathgetSourcePath(java.nio.file.Path targetName)java.util.regex.PatterngetSourcePattern()java.lang.StringgetTargetExtension()java.util.regex.PatterngetTargetPattern()java.util.List<java.nio.file.Path>getVirtualPathsFor(java.nio.file.Path path)booleanisWrapperPath(java.nio.file.Path p)RenderedContentrender(java.nio.file.Path sourcePath, java.nio.file.Path targetPath, java.util.function.Supplier<java.nio.ByteBuffer> byteBuffer)java.lang.StringtoString()-
Methods inherited from class io.virtdata.docsys.metafs.fs.renderfs.api.FileContentRenderer
canRender, getVirtualFile, hasSource, matchesSource, matchesTarget
-
-
-
-
Constructor Detail
-
FileRenderer
public FileRenderer(java.lang.String fromext, java.lang.String toext, boolean cased, TemplateCompiler compiler)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:
fromext- The extension of the source (actual) file, including the dot and extension name.toext- The extension of the target (virtual) file, including the dot and extension name.cased- Whether or not to do case-sensitive matching against the source and target extensions.compiler- A lookup function which can create a renderer for a specific path as needed.
-
-
Method Detail
-
getVirtualPathsFor
public java.util.List<java.nio.file.Path> getVirtualPathsFor(java.nio.file.Path path)
-
getSourcePattern
public java.util.regex.Pattern getSourcePattern()
-
getTargetPattern
public java.util.regex.Pattern getTargetPattern()
-
isWrapperPath
public boolean isWrapperPath(java.nio.file.Path p)
-
getSourceExtension
public java.lang.String getSourceExtension()
-
getTargetExtension
public java.lang.String getTargetExtension()
-
getSourcePath
public java.nio.file.Path getSourcePath(java.nio.file.Path targetName)
-
getRenderedTargetName
public java.nio.file.Path getRenderedTargetName(java.nio.file.Path sourceName)
-
render
public RenderedContent render(java.nio.file.Path sourcePath, java.nio.file.Path targetPath, java.util.function.Supplier<java.nio.ByteBuffer> byteBuffer)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-