public class TargetedUrlByFileStrategy extends AbstractTargetedUrlStrategy
TargetedUrlStrategy implementation that recognizes the target ID in
the file name (e.g. /products/index_es_CR.xml).| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_TARGET_ID_SEPARATOR |
static int |
PREFIX_GROUP |
static int |
SUFFIX_GROUP |
static int |
TARGET_ID_GROUP |
static String |
TARGETED_URL_REGEX_FORMAT |
protected String |
targetIdSeparator |
targetIdManager| Constructor and Description |
|---|
TargetedUrlByFileStrategy() |
| Modifier and Type | Method and Description |
|---|---|
String |
buildTargetedUrl(String prefix,
String targetId,
String suffix)
Builds the targeted URL with the specified prefix, target ID and suffix.
|
protected String |
doToTargetedUrl(String url,
String currentTargetId) |
protected String |
getPrefix(Matcher matcher) |
protected String |
getSuffix(Matcher matcher) |
protected Pattern |
getTargetedUrlPattern() |
protected String |
getTargetId(Matcher matcher) |
boolean |
isFileNameBasedStrategy()
Returns true if the strategy is based on the name of the file.
|
void |
setTargetIdSeparator(String targetIdSeparator) |
getTargetedUrlComponents, matchUrl, parseTargetedUrl, setTargetIdManager, toTargetedUrlpublic static final String DEFAULT_TARGET_ID_SEPARATOR
public static final String TARGETED_URL_REGEX_FORMAT
public static final int PREFIX_GROUP
public static final int TARGET_ID_GROUP
public static final int SUFFIX_GROUP
protected String targetIdSeparator
public void setTargetIdSeparator(String targetIdSeparator)
public boolean isFileNameBasedStrategy()
TargetedUrlStrategypublic String buildTargetedUrl(String prefix, String targetId, String suffix)
TargetedUrlStrategybuildTargetedUrl in interface TargetedUrlStrategybuildTargetedUrl in class AbstractTargetedUrlStrategyprefix - the URL prefixtargetId - the target IDsuffix - the URL suffixprotected String getPrefix(Matcher matcher)
getPrefix in class AbstractTargetedUrlStrategyprotected String getTargetId(Matcher matcher)
getTargetId in class AbstractTargetedUrlStrategyprotected String getSuffix(Matcher matcher)
getSuffix in class AbstractTargetedUrlStrategyprotected Pattern getTargetedUrlPattern()
getTargetedUrlPattern in class AbstractTargetedUrlStrategyprotected String doToTargetedUrl(String url, String currentTargetId)
doToTargetedUrl in class AbstractTargetedUrlStrategyCopyright © 2020 CrafterCMS. All rights reserved.