public class FilterInvocationDefinitionSourceDynamicExtentionEditor extends
PropertyEditorSupport {
public static final String ANT_PATH_KEY = "PATTERN_TYPE_APACHE_ANT";
public static final String LOWER_CASE_URL_KEY = "CONVERT_URL_TO_LOWERCASE_BE
FORE_COMPARISON";
public static final String DONT_USE_ME_KEY = "DONT_USE_ME";
public static final String STAND_DELIM_CHARACTER = ",";
private static final Log logger = LogFactory. getLog( FilterInvocationDefinitionSourceDynamicExt
entionEditor. class) ;
/**
* @see java.beans.PropertyEditorSupport#setAsText(java.lang.String)
*/
public void setAsText (String text ) throws IllegalArgumentException {
FilterInvocationDefinitionMap source = new RegExpBasedFilterInvocationDefinitionMap ();
if (StringUtils. isBlank( text )) {
// Leave target object empty
} else {
// Check if we need to override the default definition map
if (text. lastIndexOf( ANT_PATH_KEY ) != -1) {
source = new PathBasedFilterInvocationDefinitionMap ();
if (logger. isDebugEnabled()) {
logger. debug(( "Detected PATTERN_TYPE_APACHE_ANT directive; using Apache
Ant style path expressions" ));
}
}
if (text. lastIndexOf( LOWER_CASE_URL_KEY ) != -1) {
if (logger. isDebugEnabled()) {
logger. debug( "Instructing mapper to convert URLs to lowercase before compariso
n");
}
source. setConvertUrlToLowercaseBeforeComparison( true );
}
if (text. indexOf( DONT_USE_ME_KEY ) != -1) {
评论0
最新资源