|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gisgraphy.helper.StringHelper
public class StringHelper
Provide some usefull method to copute strinfg for autocompletion and fulltextsearch
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
logger
|
static int |
MAX_STRING_INDEXABLE_LENGTH
|
static char |
WHITESPACE_CHAR_DELIMITER
|
| Constructor Summary | |
|---|---|
StringHelper()
|
|
| Method Summary | |
|---|---|
static String |
getStackTraceAsString(Throwable aThrowable)
|
static boolean |
isEmptyString(String string)
Usefull method to be compatible with jdk1.5 (jdk 1.6 already have this method) |
static boolean |
isNotEmptyString(String string)
Usefull method to be compatible with jdk1.5 (jdk 1.6 already have this method) |
static String |
normalize(String originalString)
Process a string to apply filter as lucene and solr does : - remove accent - lowercase - word delimiter ('-', '.' |
static String |
splitCamelCase(String s)
|
static String |
transformStringForPartialWordIndexation(String originalString,
char delimiter)
Process a string to in order to be stored in a specific postgres field to allow the index usage for ilike (ilike(%String%): e.g : 'it s ok'=> s ok, s o, it s, t s o, t s, it s ok, ok, it s o, it, t s ok it remove duplicates and don't put single character. |
static String |
transformStringForPartialWordSearch(String originalString,
char delimiter)
|
static OpenStreetMap |
updateOpenStreetMapEntityForIndexation(OpenStreetMap openStreetMap)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_STRING_INDEXABLE_LENGTH
public static final char WHITESPACE_CHAR_DELIMITER
protected static final org.slf4j.Logger logger
| Constructor Detail |
|---|
public StringHelper()
| Method Detail |
|---|
public static final String normalize(String originalString)
originalString - the string to process
public static final String transformStringForPartialWordIndexation(String originalString,
char delimiter)
originalString - the string to processdelimiter - words will be delimited by this char
(it should be the same as the one in transformStringForPartialWordSearch(String, char).
For gisgraphy the char is WHITESPACE_CHAR_DELIMITER
IMPORTANT NOTE : if the string is greater than MAX_STRING_INDEXABLE_LENGTH, the method will return null;
transformStringForPartialWordSearch(String, char)
public static final String transformStringForPartialWordSearch(String originalString,
char delimiter)
originalString - the string to transformdelimiter - the delimiter
(it should be the same as the one use in transformStringForPartialWordIndexation(String, char))
For gisgraphy the char is WHITESPACE_CHAR_DELIMITER
transformStringForPartialWordIndexation(String, char)public static OpenStreetMap updateOpenStreetMapEntityForIndexation(OpenStreetMap openStreetMap)
openStreetMap - the openStreetMap Entity to update
OpenStreetMap.PARTIALSEARCH_COLUMN_NAME and OpenStreetMap.FULLTEXTSEARCH_COLUMN_NAMEpublic static String splitCamelCase(String s)
s - a camel Case string
public static boolean isNotEmptyString(String string)
string - the string to test
public static boolean isEmptyString(String string)
string - the string to test
public static String getStackTraceAsString(Throwable aThrowable)
aThrowable -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||