public class PathMacroManager extends java.lang.Object implements PathMacroSubstitutor
Constructor and Description |
---|
PathMacroManager(PathMacros pathMacros) |
Modifier and Type | Method and Description |
---|---|
protected static void |
addFileHierarchyReplacements(ExpandMacroToPathMap result,
java.lang.String macroName,
@SystemIndependent java.lang.String path) |
protected static void |
addFileHierarchyReplacements(ReplacePathToMacroMap result,
java.lang.String macroName,
java.lang.String path,
java.lang.String stopAt) |
java.lang.String |
collapsePath(java.lang.String text,
boolean recursively)
Convert paths inside
text to portable form by replacing all values of path variables by their names. |
void |
collapsePaths(Element element,
boolean recursively)
Process sub tags of
element recursively and convert paths to portable forms in all tag texts and attribute values. |
static void |
collapsePaths(Element element,
boolean recursively,
ReplacePathToMacroMap map) |
protected ReplacePathToMacroMap |
computeReplacePathMap() |
java.lang.String |
expandPath(java.lang.String text)
Convert path to absolute by replacing all names of path variables by its values
|
void |
expandPaths(Element element)
Process sub tags of
element recursively and convert paths to absolute forms in all tag texts and attribute values. |
ExpandMacroToPathMap |
getExpandMacroMap() |
static PathMacroManager |
getInstance(ComponentManager componentManager) |
PathMacroFilter |
getMacroFilter() |
ReplacePathToMacroMap |
getReplacePathMap() |
protected static boolean |
pathsEqual(java.lang.String path1,
java.lang.String path2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
collapsePath, collapsePaths, collapsePathsRecursively
public PathMacroManager(PathMacros pathMacros)
public static PathMacroManager getInstance(ComponentManager componentManager)
public PathMacroFilter getMacroFilter()
protected static void addFileHierarchyReplacements(ExpandMacroToPathMap result, java.lang.String macroName, @SystemIndependent java.lang.String path)
protected static void addFileHierarchyReplacements(ReplacePathToMacroMap result, java.lang.String macroName, java.lang.String path, java.lang.String stopAt)
public ExpandMacroToPathMap getExpandMacroMap()
public final ReplacePathToMacroMap getReplacePathMap()
protected ReplacePathToMacroMap computeReplacePathMap()
public java.lang.String expandPath(java.lang.String text)
PathMacroSubstitutor
expandPath
in interface PathMacroSubstitutor
public java.lang.String collapsePath(java.lang.String text, boolean recursively)
PathMacroSubstitutor
text
to portable form by replacing all values of path variables by their names.collapsePath
in interface PathMacroSubstitutor
recursively
- if true
all occurrences of paths inside text
will be processed, otherwise text
will be converted
only if its entire content is a path (or URL)public void expandPaths(Element element)
PathMacroSubstitutor
element
recursively and convert paths to absolute forms in all tag texts and attribute values.expandPaths
in interface PathMacroSubstitutor
public void collapsePaths(Element element, boolean recursively)
PathMacroSubstitutor
element
recursively and convert paths to portable forms in all tag texts and attribute values.collapsePaths
in interface PathMacroSubstitutor
recursively
- if true
all occurrences of paths inside tag texts and attribute values will be processed, otherwise
they will be converted only if their entire content is a path (or URL)public static void collapsePaths(Element element, boolean recursively, ReplacePathToMacroMap map)
protected static boolean pathsEqual(java.lang.String path1, java.lang.String path2)