|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dv.sbu.filehandler.ftl.dataprovider.DataProviderImpl
de.dv.sbu.filehandler.ftl.dataprovider.util.Util
public class Util
Various utility methods that can be used during templating.
Field Summary |
---|
Fields inherited from class de.dv.sbu.filehandler.ftl.dataprovider.DataProviderImpl |
---|
builderConfiguration, sourceFileInformation |
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static java.util.Date |
currentDate()
Returns the current date. |
static java.lang.String |
currentDate(java.lang.String formatPattern)
Returns the current date in the given SimpleDateFormat compatible format definition. |
static java.util.Map<java.lang.String,java.lang.String> |
extractAttributes(java.lang.String text)
Creates attributes as mapping from name to value from some given text. |
static java.io.File |
file(java.io.File parent,
java.lang.String child)
Creates a new File object via the related constructor. |
static java.io.File |
file(java.lang.String path)
Creates a new File object via the related constructor. |
java.lang.String |
resolvePath(java.lang.String path)
Builds a target path respecting the current file information. |
static java.lang.String |
resolveSourceFilePath(java.lang.String path,
SourceFileInformation fileInfo)
Builds a target path respecting the given file information. |
java.io.File |
resourceFile(java.lang.String relativePath)
Returns the resource File object defined by the given relative path. |
java.io.File |
sourceFile(java.lang.String relativePath)
Returns the source File object defined by the given relative path. |
java.io.File |
targetFile(java.lang.String relativePath)
Returns the target File object defined by the given relative path. |
static NodeModel |
xmlNodeModel(java.io.File file,
java.lang.String encoding)
Creates XML content from some given XML file. |
static NodeModel |
xmlNodeModel(java.lang.String text)
Creates XML content from some given text. |
Methods inherited from class de.dv.sbu.filehandler.ftl.dataprovider.DataProviderImpl |
---|
init, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public java.lang.String resolvePath(java.lang.String path)
path
- The path to transform.
public static java.lang.String resolveSourceFilePath(java.lang.String path, SourceFileInformation fileInfo)
path
- The path to transform.fileInfo
- The file information to use.
public java.io.File sourceFile(java.lang.String relativePath)
File
object defined by the given relative path.
relativePath
- The relative path.
public java.io.File targetFile(java.lang.String relativePath)
File
object defined by the given relative path.
relativePath
- The relative path.
public java.io.File resourceFile(java.lang.String relativePath)
File
object defined by the given relative path.
relativePath
- The relative path.
public static NodeModel xmlNodeModel(java.lang.String text)
text
- The text to use (must be valid).
public static NodeModel xmlNodeModel(java.io.File file, java.lang.String encoding) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
file
- Path to the XML file.encoding
- The char set to use for encoding.
java.io.FileNotFoundException
- The XML file was not found.
java.io.UnsupportedEncodingException
public static java.io.File file(java.lang.String path)
File
object via the related constructor.
path
- The (absolute or work directory relative) path to the file.
public static java.io.File file(java.io.File parent, java.lang.String child)
File
object via the related constructor.
parent
- The parent of directory.child
- The child path from the parent.
public static java.util.Map<java.lang.String,java.lang.String> extractAttributes(java.lang.String text)
text
- The text to analyze.
public static java.util.Date currentDate()
public static java.lang.String currentDate(java.lang.String formatPattern)
SimpleDateFormat
compatible format definition.
formatPattern
- The format pattern.
SimpleDateFormat
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |