|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.util.StringDataExtractor
public class StringDataExtractor
Nested Class Summary | |
---|---|
static interface |
StringDataExtractor.ExtractorDirective
This interface permits to implement several way to extract data from a string. |
static class |
StringDataExtractor.RegexpPatternDirective
Class that permits to specify the directives in order to extract data. |
Method Summary | |
---|---|
List<String> |
extract()
Extracts data from a strict by applying the specified extract pattern directives. |
String |
extractUnique()
Calls first extract() and then return the only contained value from the result, null
if no value extracted. |
static StringDataExtractor |
from(String source)
Gets an instance of StringDataExtractor |
StringDataExtractor |
withDirective(StringDataExtractor.ExtractorDirective directive)
Indicates a directive of data extraction. |
StringDataExtractor |
withDirectives(List<? extends StringDataExtractor.ExtractorDirective> directives)
Indicates a directive of data extraction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static StringDataExtractor from(String source)
StringDataExtractor
source
- the string from which data must be extracted.
StringDataExtractor
public StringDataExtractor withDirective(StringDataExtractor.ExtractorDirective directive)
directive
- the directive that will handle the data extraction.
StringDataExtractor
.public StringDataExtractor withDirectives(List<? extends StringDataExtractor.ExtractorDirective> directives)
directives
- the directives that will handle the data extraction.
StringDataExtractor
.public List<String> extract()
public String extractUnique() throws IllegalStateException
extract()
and then return the only contained value from the result, null
if no value extracted.
IllegalStateException
- if it exists several values behind the extraction
directive.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |