◆ SearchFormatter()
org.turro.elephant.search.SearchFormatter.SearchFormatter |
( |
String |
query, |
|
|
boolean |
ignoreCase |
|
) |
| |
◆ getFound()
int org.turro.elephant.search.SearchFormatter.getFound |
( |
| ) |
|
◆ getResult()
String org.turro.elephant.search.SearchFormatter.getResult |
( |
| ) |
|
◆ processLine()
void org.turro.elephant.search.SearchFormatter.processLine |
( |
String |
line | ) |
|
Definition at line 44 of file SearchFormatter.java.
45 if(line ==
null)
return;
49 line = removeMacros(line);
50 Matcher mat =
pat.matcher(line);
56 line = line.replaceAll(
"(" + reQuery +
")",
"<span class='found'>$1</span>");
◆ queryToRegExp()
String org.turro.elephant.search.SearchFormatter.queryToRegExp |
( |
String |
query | ) |
|
Definition at line 78 of file SearchFormatter.java.
79 if(
query ==
null)
return "";
80 String[] values =
query.split(
"\\s+");
81 count = values.length;
82 String result =
"(", sep =
"";
83 for(
int i = 0; i <
count; i++) {
84 result += sep +
"(" + values[i] +
")";
87 return (
ignoreCase ?
"(?i)" :
"") + result +
")";
◆ queryToSQL()
static String org.turro.elephant.search.SearchFormatter.queryToSQL |
( |
String |
field, |
|
|
String |
query, |
|
|
boolean |
ignoreCase |
|
) |
| |
|
static |
Definition at line 90 of file SearchFormatter.java.
91 String[] values =
query.split(
"\\s+");
92 String result =
"(", sep =
"";
93 for(
int i = 0; i < values.length; i++) {
95 result += sep +
"UCASE(" + field +
") LIKE '%" + values[i].toUpperCase() +
"%' ";
98 result += sep + field +
" LIKE '%" + values[i] +
"%' ";
◆ removeHTML()
static String org.turro.elephant.search.SearchFormatter.removeHTML |
( |
String |
line | ) |
|
|
static |
Definition at line 105 of file SearchFormatter.java.
106 return line.replaceAll(
"\\<\\/?[\\?a-zA-Z\\-\\:\\_0-9]+\\ ?.*?\\>",
"");
◆ removeHTMLTag()
static String org.turro.elephant.search.SearchFormatter.removeHTMLTag |
( |
String |
line, |
|
|
String |
string |
|
) |
| |
|
static |
Definition at line 109 of file SearchFormatter.java.
110 return line.replaceAll(
"\\<" +
string +
" .*?\\<\\/" +
string +
"\\>",
"");
◆ wasFound()
boolean org.turro.elephant.search.SearchFormatter.wasFound |
( |
| ) |
|
◆ count
int org.turro.elephant.search.SearchFormatter.count |
|
protected |
◆ ignoreCase
boolean org.turro.elephant.search.SearchFormatter.ignoreCase |
|
protected |
◆ lines
Stack org.turro.elephant.search.SearchFormatter.lines |
|
protected |
◆ pat
Pattern org.turro.elephant.search.SearchFormatter.pat |
|
protected |
◆ query
String org.turro.elephant.search.SearchFormatter.query |
|
protected |
The documentation for this class was generated from the following file: