|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.net.ftp.FTPFileEntryParserImpl org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl
public abstract class RegexFTPFileEntryParserImpl
This abstract class implements both the older FTPFileListParser and newer FTPFileEntryParser interfaces with default functionality. All the classes in the parser subpackage inherit from this. This is the base class for all regular expression based FTPFileEntryParser classes
Field Summary | |
---|---|
protected Matcher |
_matcher_
Internal PatternMatcher object used by the parser. |
Constructor Summary | |
---|---|
RegexFTPFileEntryParserImpl(String regex)
The constructor for a RegexFTPFileEntryParserImpl object. |
Method Summary | |
---|---|
int |
getGroupCnt()
Convenience method |
String |
getGroupsAsString()
For debugging purposes - returns a string shows each match group by number. |
String |
group(int matchnum)
Convenience method delegates to the internal MatchResult's group() method. |
boolean |
matches(String s)
Convenience method delegates to the internal MatchResult's matches() method. |
boolean |
setRegex(String regex)
Alter the current regular expression being utilised for entry parsing and create a new Pattern instance. |
Methods inherited from class org.apache.commons.net.ftp.FTPFileEntryParserImpl |
---|
preParse, readNextEntry |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.net.ftp.FTPFileEntryParser |
---|
parseFTPEntry |
Field Detail |
---|
protected Matcher _matcher_
Constructor Detail |
---|
public RegexFTPFileEntryParserImpl(String regex)
regex
- The regular expression with which this object is
initialized.
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.Method Detail |
---|
public boolean matches(String s)
s
- the String to be matched
public int getGroupCnt()
public String group(int matchnum)
matchnum
- match group number to be retrieved
matchnum'th
group of the internal
match or null if this method is called without a match having
been made.public String getGroupsAsString()
public boolean setRegex(String regex)
Pattern
instance.
regex
- The new regular expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |