|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.suigeneris.jrcs.rcs.text.KeywordFormatter
public abstract class KeywordFormatter
Generic formatter for the RCS keywords. It is intended as an helper class to replace the use of gnu.regexp. This class is NOT threadsafe.
Field Summary | |
---|---|
private java.text.Format |
Author_FORMAT
|
protected java.util.regex.Pattern |
AUTHOR_RE
|
private java.text.Format |
Date_FORMAT
|
protected java.util.regex.Pattern |
DATE_RE
|
private static java.lang.String |
DOLLAR
|
private java.text.Format |
Header_FORMAT
|
protected java.util.regex.Pattern |
HEADER_RE
|
private java.text.Format |
Id_FORMAT
|
protected java.util.regex.Pattern |
ID_RE
|
private static KeywordFormatter |
K_FORMATTER
|
private static KeywordFormatter |
KV_FORMATTER
|
private java.text.Format |
Locker_FORMAT
|
protected java.util.regex.Pattern |
LOCKER_RE
|
protected java.util.regex.Pattern |
LOG_RE
|
protected java.util.regex.Pattern |
NAME_RE
|
private java.text.Format |
RCSFile_FORMAT
|
protected java.util.regex.Pattern |
RCSFILE_RE
|
private java.text.Format |
Revision_FORMAT
|
protected java.util.regex.Pattern |
REVISION_RE
|
private java.text.Format |
Source_FORMAT
|
protected java.util.regex.Pattern |
SOURCE_RE
|
private java.text.Format |
State_FORMAT
|
protected java.util.regex.Pattern |
STATE_RE
|
private static KeywordFormatter |
V_FORMATTER
|
Constructor Summary | |
---|---|
KeywordFormatter()
|
Method Summary | |
---|---|
java.text.Format |
getAuthorFormat()
|
java.text.Format |
getDateFormat()
|
java.text.Format |
getHeaderFormat()
|
java.text.Format |
getIdFormat()
|
static KeywordFormatter |
getKeywordAndValueFormatter()
|
static KeywordFormatter |
getKeywordOnlyFormatter()
|
java.text.Format |
getLockerFormat()
|
java.text.Format |
getRCSFileFormat()
|
java.text.Format |
getRevisionFormat()
|
java.text.Format |
getSourceFormat()
|
java.text.Format |
getStateFormat()
|
static KeywordFormatter |
getValueOnlyFormatter()
|
protected java.lang.String |
remove(java.lang.String text)
Remove all RCS keywords match. |
java.lang.String |
reset(java.lang.String text)
Reinitialize all RCS keywords match. |
private java.lang.String |
substitute(java.lang.String input,
java.util.regex.Pattern pattern,
java.lang.String substitution)
Helper method for substitution that will substitute all matches of a given pattern. |
java.lang.String |
update(java.lang.String text,
java.lang.Object[] revisionInfo)
update the given text made of RCS keywords with the appropriate revision info. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String DOLLAR
private final java.text.Format Header_FORMAT
private final java.text.Format Id_FORMAT
private final java.text.Format RCSFile_FORMAT
private final java.text.Format Revision_FORMAT
private final java.text.Format Date_FORMAT
private final java.text.Format Author_FORMAT
private final java.text.Format State_FORMAT
private final java.text.Format Locker_FORMAT
private final java.text.Format Source_FORMAT
protected final java.util.regex.Pattern ID_RE
protected final java.util.regex.Pattern HEADER_RE
protected final java.util.regex.Pattern SOURCE_RE
protected final java.util.regex.Pattern RCSFILE_RE
protected final java.util.regex.Pattern REVISION_RE
protected final java.util.regex.Pattern DATE_RE
protected final java.util.regex.Pattern AUTHOR_RE
protected final java.util.regex.Pattern STATE_RE
protected final java.util.regex.Pattern LOCKER_RE
protected final java.util.regex.Pattern NAME_RE
protected final java.util.regex.Pattern LOG_RE
private static final KeywordFormatter V_FORMATTER
private static final KeywordFormatter K_FORMATTER
private static final KeywordFormatter KV_FORMATTER
Constructor Detail |
---|
public KeywordFormatter()
Method Detail |
---|
public java.lang.String update(java.lang.String text, java.lang.Object[] revisionInfo)
text
- the input text containing the RCS keywords.revisionInfo
- the revision information.
public java.lang.String reset(java.lang.String text)
text
- the text to look for RCS keywords.
protected java.lang.String remove(java.lang.String text)
text
- the text to look for RCS keywords.
private final java.lang.String substitute(java.lang.String input, java.util.regex.Pattern pattern, java.lang.String substitution)
input
- the text to look for substitutions.pattern
- the pattern to replace in the input text.substitution
- the string to use as a replacement for the pattern.
public java.text.Format getAuthorFormat()
public java.text.Format getDateFormat()
public java.text.Format getHeaderFormat()
public java.text.Format getIdFormat()
public java.text.Format getLockerFormat()
public java.text.Format getRCSFileFormat()
public java.text.Format getRevisionFormat()
public java.text.Format getSourceFormat()
public java.text.Format getStateFormat()
public static KeywordFormatter getKeywordOnlyFormatter()
public static KeywordFormatter getKeywordAndValueFormatter()
public static KeywordFormatter getValueOnlyFormatter()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |