public abstract class AbstractRegexSpecificationBase extends AbstractFlatFileSpecificationBase
Modifier and Type | Field and Description |
---|---|
protected boolean |
fullMatch |
protected List<Pattern> |
insignificantPatterns |
protected List<String> |
insignificantRegexPatterns |
protected boolean |
trimLineBeforeMatch |
defaultBusinessObjectClass, objectSpecifications
Constructor and Description |
---|
AbstractRegexSpecificationBase() |
Modifier and Type | Method and Description |
---|---|
Class<?> |
determineClassForLine(String line)
Matches the given line with an object to parse into, or null if no object could be found
|
List<Pattern> |
getInsignificantPatterns() |
boolean |
isFullMatch() |
boolean |
isTrimLineBeforeMatch() |
protected boolean |
matches(Pattern pattern,
String line)
Determines if the given line matches the given pattern, following the full match rule
|
void |
setFullMatch(boolean fullMatch)
Sets whether the regular expression associated with this object specification will attempt to match against the whole line or search for the pattern within the line.
|
void |
setInsignificantRegexPatterns(List<String> insignificantRegexPatterns)
Sets the insignificant regex patterns
|
void |
setTrimLineBeforeMatch(boolean trimLineBeforeMatch)
Sets whether this will strip trailing spaces before parsing the line.
|
protected String |
trimLine(String line)
Trims the trailing space only from the given line, though only if trimLineBeforeMatch is true
|
afterPropertiesSet, getObjectSpecification, getObjectSpecifications, setDefaultBusinessObjectClass, setObjectSpecifications
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parseLineIntoObject
protected List<String> insignificantRegexPatterns
protected List<Pattern> insignificantPatterns
protected boolean trimLineBeforeMatch
protected boolean fullMatch
public AbstractRegexSpecificationBase()
public Class<?> determineClassForLine(String line)
line
- the current line of the flat file parser being parsedFlatFileSpecification.determineClassForLine(java.lang.String)
protected String trimLine(String line)
line
- the line to perhaps trim trailing spaces frompublic void setInsignificantRegexPatterns(List<String> insignificantRegexPatterns)
insignificantRegexPatterns
- the regex patterns for lines to ignoreprotected boolean matches(Pattern pattern, String line)
pattern
- the pattern to match againstline
- the parsed line to matchpublic List<Pattern> getInsignificantPatterns()
public boolean isTrimLineBeforeMatch()
public void setTrimLineBeforeMatch(boolean trimLineBeforeMatch)
trimLineBeforeMatch
- true if trailing spaces should be stripped, false otherwisepublic boolean isFullMatch()
public void setFullMatch(boolean fullMatch)
fullMatch
- true if match against the full line should be carried out, false otherwiseCopyright © 2004–2015 The Kuali Foundation. All rights reserved.