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, waitcollapsePath, collapsePaths, collapsePathsRecursivelypublic 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)
PathMacroSubstitutorexpandPath in interface PathMacroSubstitutorpublic java.lang.String collapsePath(java.lang.String text,
boolean recursively)
PathMacroSubstitutortext to portable form by replacing all values of path variables by their names.collapsePath in interface PathMacroSubstitutorrecursively - 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)
PathMacroSubstitutorelement recursively and convert paths to absolute forms in all tag texts and attribute values.expandPaths in interface PathMacroSubstitutorpublic void collapsePaths(Element element,
boolean recursively)
PathMacroSubstitutorelement recursively and convert paths to portable forms in all tag texts and attribute values.collapsePaths in interface PathMacroSubstitutorrecursively - 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)