Java URL Optimization API (SEO API) 2.1.1

com.endeca.soleng.urlformatter.seo
Class RegexStringFormatter

java.lang.Object
  extended by com.endeca.soleng.urlformatter.seo.RegexStringFormatter
All Implemented Interfaces:
StringFormatter

public class RegexStringFormatter
extends java.lang.Object
implements StringFormatter

A StringFormatter that specifies a regular expression for find/replace manipulations on strings. Uses the java.util.regex package from the core Java libraries. Please consult the core Java documentation for details on Java's regular expression capabilities.

Property Summary
Property Type Default Value
pattern String null
replacement String null
replaceAll boolean true


Constructor Summary
RegexStringFormatter()
           
 
Method Summary
 java.lang.String format(com.endeca.soleng.urlformatter.UrlState pUrlState, java.lang.String pString)
           
 java.lang.String getPattern()
           
 boolean getReplaceAll()
           
 java.lang.String getReplacement()
           
 void setPattern(java.lang.String pPattern)
          Specifies a pattern to find and replace with the replacement value.
 void setReplaceAll(boolean pReplaceAll)
          Specifies whether or not all matching patterns will be replaced.
 void setReplacement(java.lang.String pReplacement)
          Specifies the replacement value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexStringFormatter

public RegexStringFormatter()
Method Detail

getPattern

public java.lang.String getPattern()

setPattern

public void setPattern(java.lang.String pPattern)
Specifies a pattern to find and replace with the replacement value.

Parameters:
pPattern - specifies pattern to be replaced. If pPattern is "Wine Type", then any string or strings matching "Wine Type" will be found and replaced.

getReplacement

public java.lang.String getReplacement()

setReplacement

public void setReplacement(java.lang.String pReplacement)
Specifies the replacement value. The pattern or patterns found will be replaced with this value.

Parameters:
pReplacement - replacement value.

If pReplacement is "Wine", then any string or strings found will be replaced with "Wine".

getReplaceAll

public boolean getReplaceAll()

setReplaceAll

public void setReplaceAll(boolean pReplaceAll)
Specifies whether or not all matching patterns will be replaced.

Parameters:
pReplaceAll - Specifies whether only the first matching instance, or all matching patterns will be replaced. If the pattern is "te" and replacement is "t", and the string is "tetete", the result if pReplaceAll were set to true would be "ttt" and the result if pReplaceAll were set to false would be "ttete"

format

public java.lang.String format(com.endeca.soleng.urlformatter.UrlState pUrlState,
                               java.lang.String pString)
Specified by:
format in interface StringFormatter

Java URL Optimization API (SEO API) 2.1.1

Copyright © 2012 Endeca Technologies, Inc. All Rights Reserved.
@VERSION
PRODUCT: Java URL Optimization API (SEO API) (urlFormatterSeo)
VERSION: 2.1.1
BUILD:   12083DEV
ARCH_OS: n/a
DATE:    2012-02-16T20:40:10-0500