|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.configuration.plist.PropertyListConfiguration.DateComponentParser
private abstract static class PropertyListConfiguration.DateComponentParser
A helper class for parsing and formatting date literals. Usually we would
use SimpleDateFormat
for this purpose, but in Java 1.3 the
functionality of this class is limited. So we have a hierarchy of parser
classes instead that deal with the different components of a date
literal.
Constructor Summary | |
---|---|
private |
PropertyListConfiguration.DateComponentParser()
|
Method Summary | |
---|---|
protected void |
checkLength(java.lang.String s,
int index,
int length)
Checks whether the given string has at least length
characters starting from the given parsing position. |
abstract void |
formatComponent(java.lang.StringBuffer buf,
java.util.Calendar cal)
Formats a date component. |
protected void |
padNum(java.lang.StringBuffer buf,
int num,
int length)
Adds a number to the given string buffer and adds leading '0' characters until the given length is reached. |
abstract int |
parseComponent(java.lang.String s,
int index,
java.util.Calendar cal)
Parses a component from the given input string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private PropertyListConfiguration.DateComponentParser()
Method Detail |
---|
public abstract int parseComponent(java.lang.String s, int index, java.util.Calendar cal) throws ParseException
s
- the string to be parsedindex
- the current parsing positioncal
- the calendar where to store the result
ParseException
- if the component cannot be extractedpublic abstract void formatComponent(java.lang.StringBuffer buf, java.util.Calendar cal)
buf
- the target buffercal
- the calendar with the current dateprotected void checkLength(java.lang.String s, int index, int length) throws ParseException
length
characters starting from the given parsing position. If this is not
the case, an exception will be thrown.
s
- the string to be testedindex
- the current indexlength
- the minimum length after the index
ParseException
- if the string is too shortprotected void padNum(java.lang.StringBuffer buf, int num, int length)
buf
- the target buffernum
- the number to addlength
- the required length
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |