Package com.day.cq.wcm.contentsync
Class PathRewriterOptions
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,PathRewriterOptions.RewriteMode>
-
- com.day.cq.wcm.contentsync.PathRewriterOptions
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,PathRewriterOptions.RewriteMode>
public class PathRewriterOptions extends HashMap<String,PathRewriterOptions.RewriteMode>
ThePathRewriterOptionsconfigure in which way links and references should be rewritten. To enable path rewriting you have to set an instance ofPathRewriterOptionsas a request attribute.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPathRewriterOptions.RewriteModeAvailable rewrite modes.-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTRIBUTE_PATH_REWRITING_OPTIONSThe request attribute name.static StringOPTION_REWRITE_CLIENTLIBSstatic StringOPTION_REWRITE_IMAGESstatic StringOPTION_REWRITE_LINKSstatic StringOPTION_TEMP_DESIGNS
-
Constructor Summary
Constructors Constructor Description PathRewriterOptions(PathRewriterOptions.RewriteMode links, PathRewriterOptions.RewriteMode clientlibs, PathRewriterOptions.RewriteMode images)PathRewriterOptions(String tempDesignPath, PathRewriterOptions.RewriteMode links, PathRewriterOptions.RewriteMode clientlibs, PathRewriterOptions.RewriteMode images)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRelativeParentPath()Get configured relative parent path.PathRewriterOptions.RewriteModegetRewriteMode(String option)Get configured rewrite mode.StringgetTempDesignPath()booleanhasRelativeParent()booleanisExternal(String option)booleanisRelative(String option)voidsetRelativeParentPath(String path)Set a new relative parent.voidsetRewriteMode(String option, PathRewriterOptions.RewriteMode mode)Set a new rewrite mode.-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Field Detail
-
ATTRIBUTE_PATH_REWRITING_OPTIONS
public static final String ATTRIBUTE_PATH_REWRITING_OPTIONS
The request attribute name.- See Also:
- Constant Field Values
-
OPTION_REWRITE_LINKS
public static final String OPTION_REWRITE_LINKS
- See Also:
- Constant Field Values
-
OPTION_REWRITE_CLIENTLIBS
public static final String OPTION_REWRITE_CLIENTLIBS
- See Also:
- Constant Field Values
-
OPTION_REWRITE_IMAGES
public static final String OPTION_REWRITE_IMAGES
- See Also:
- Constant Field Values
-
OPTION_TEMP_DESIGNS
public static final String OPTION_TEMP_DESIGNS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PathRewriterOptions
public PathRewriterOptions(PathRewriterOptions.RewriteMode links, PathRewriterOptions.RewriteMode clientlibs, PathRewriterOptions.RewriteMode images)
-
PathRewriterOptions
public PathRewriterOptions(String tempDesignPath, PathRewriterOptions.RewriteMode links, PathRewriterOptions.RewriteMode clientlibs, PathRewriterOptions.RewriteMode images)
-
-
Method Detail
-
isExternal
public boolean isExternal(String option)
-
isRelative
public boolean isRelative(String option)
-
hasRelativeParent
public boolean hasRelativeParent()
-
getRewriteMode
public PathRewriterOptions.RewriteMode getRewriteMode(String option)
Get configured rewrite mode.- Returns:
- the rewriteLinks
-
setRewriteMode
public void setRewriteMode(String option, PathRewriterOptions.RewriteMode mode)
Set a new rewrite mode.- Parameters:
mode- The new rewrite mode
-
getTempDesignPath
public String getTempDesignPath()
-
getRelativeParentPath
public String getRelativeParentPath()
Get configured relative parent path.- Returns:
- the relative parent path
-
setRelativeParentPath
public void setRelativeParentPath(String path)
Set a new relative parent.- Parameters:
path- The new relative parent path
-
-