public abstract class RegexFTPFileEntryParserImpl extends FTPFileEntryParserImpl
限定符和类型 | 字段和说明 |
---|---|
protected java.util.regex.Matcher |
_matcher_
Internal PatternMatcher object used by the parser.
|
构造器和说明 |
---|
RegexFTPFileEntryParserImpl(java.lang.String regex)
The constructor for a RegexFTPFileEntryParserImpl object.
|
RegexFTPFileEntryParserImpl(java.lang.String regex,
int flags)
The constructor for a RegexFTPFileEntryParserImpl object.
|
限定符和类型 | 方法和说明 |
---|---|
int |
getGroupCnt()
Convenience method
|
java.lang.String |
getGroupsAsString()
For debugging purposes - returns a string shows each match group by
number.
|
java.lang.String |
group(int matchnum)
Convenience method delegates to the internal MatchResult's group()
method.
|
boolean |
matches(java.lang.String s)
Convenience method delegates to the internal MatchResult's matches()
method.
|
boolean |
setRegex(java.lang.String regex)
Alter the current regular expression being utilised for entry parsing
and create a new
Pattern instance. |
boolean |
setRegex(java.lang.String regex,
int flags)
Alter the current regular expression being utilised for entry parsing
and create a new
Pattern instance. |
preParse, readNextEntry
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parseFTPEntry
protected java.util.regex.Matcher _matcher_
public RegexFTPFileEntryParserImpl(java.lang.String regex)
regex
- The regular expression with which this object is
initialized.java.lang.IllegalArgumentException
- Thrown if the regular expression is unparseable. Should not be seen in
normal conditions. It it is seen, this is a sign that a subclass has
been created with a bad regular expression. Since the parser must be
created before use, this means that any bad parser subclasses created
from this will bomb very quickly, leading to easy detection.public RegexFTPFileEntryParserImpl(java.lang.String regex, int flags)
regex
- The regular expression with which this object is
initialized.flags
- the flags to apply, see Pattern.compile(String, int)
. Use 0 for none.java.lang.IllegalArgumentException
- Thrown if the regular expression is unparseable. Should not be seen in
normal conditions. It it is seen, this is a sign that a subclass has
been created with a bad regular expression. Since the parser must be
created before use, this means that any bad parser subclasses created
from this will bomb very quickly, leading to easy detection.public boolean matches(java.lang.String s)
s
- the String to be matchedpublic int getGroupCnt()
public java.lang.String group(int matchnum)
matchnum
- match group number to be retrievedmatchnum'th
group of the internal
match or null if this method is called without a match having
been made.public java.lang.String getGroupsAsString()
public boolean setRegex(java.lang.String regex)
Pattern
instance.regex
- The new regular expressionjava.lang.IllegalArgumentException
- if the regex cannot be compiledpublic boolean setRegex(java.lang.String regex, int flags)
Pattern
instance.regex
- The new regular expressionflags
- the flags to apply, see Pattern.compile(String, int)
. Use 0 for none.java.lang.IllegalArgumentException
- if the regex cannot be compiled