|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.glassfish.copyright.AbstractCopyright
public abstract class AbstractCopyright
| Field Summary | |
|---|---|
protected static String |
allrights
|
protected Copyright |
c
|
protected static String |
licensor
|
protected static String |
thisYear
|
protected static Pattern |
ypat
|
| Constructor Summary | |
|---|---|
AbstractCopyright(Copyright c)
|
|
| Method Summary | |
|---|---|
protected String |
addCopyrightDate(String date,
String lastChanged)
Update the given copyright date to include the lastChanged date (assumed to be a date greater than any date included in "date"). |
protected void |
checkCopyright(File file)
Check a file for the correct copyright notice. |
protected void |
copy(BufferedReader in,
BufferedWriter out,
boolean skipBlanks)
Copy "in" to "out", skipping blank lines at the beginning of "in" if skipBlanks is true, and canonicalizing the line terminators to '\n'. |
protected void |
err(String s)
|
protected static String |
findPrefix(String line)
Find the prefix (if any) for the current line. |
protected String |
fixCopyright(String cr,
String date,
String lic)
Update the copyright line in cr to use "date" as the copyright date and "lic" as the licensor. |
protected boolean |
isModified(String file)
Exec the "svn status" command to find out if the file has been modified locally. |
protected String |
lastChanged(String file)
Exec the "svn info" command to get the date the file was last changed. |
protected boolean |
matches(Pattern pat,
String s)
Does the string match the pattern? |
protected abstract String |
readComment(BufferedReader r)
Read the first comment block in the file. |
protected void |
repair(File file,
String comment,
org.glassfish.copyright.AbstractCopyright.RepairType type)
Repair the errors in the file. |
protected abstract void |
replaceCopyright(BufferedReader in,
BufferedWriter out,
String comment,
String lastChanged)
Skip the first comment block, replacing it with the correct copyright. |
protected static boolean |
startsWith(File file,
String prefix)
Does the file start with the specified prefix? |
protected static boolean |
startsWith(String s,
String prefix)
Like String.startsWith, but ignores case and skips leading whitespace. |
protected static String |
strip(String line)
Strip any trailing whitespace. |
protected abstract boolean |
supports(File file)
Does this class support this file? Subclasses will use the file name, and possibly examine the content of the file, to determine whether it's supported. |
protected abstract String |
toComment(String comment)
Convert the comment text to the appropriate syntax. |
protected abstract void |
updateCopyright(BufferedReader in,
BufferedWriter out,
String lastChanged)
Update the existing copyright statement, changing the copyright year to include lastChanged. |
protected void |
warnCopyright(File file,
BufferedReader in)
Warn if there's another copyright statement in the file. |
protected void |
writeCopyright(BufferedWriter out,
String year,
String comment)
Write the correct copyright to "out", using "year" as the copyright date. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Copyright c
protected static Pattern ypat
protected static final String licensor
protected static final String allrights
protected static final String thisYear
| Constructor Detail |
|---|
public AbstractCopyright(Copyright c)
| Method Detail |
|---|
protected abstract boolean supports(File file)
protected void checkCopyright(File file)
throws IOException
IOException
protected boolean matches(Pattern pat,
String s)
protected void repair(File file,
String comment,
org.glassfish.copyright.AbstractCopyright.RepairType type)
throws IOException
IOException
protected void writeCopyright(BufferedWriter out,
String year,
String comment)
throws IOException
IOException
protected abstract void replaceCopyright(BufferedReader in,
BufferedWriter out,
String comment,
String lastChanged)
throws IOException
IOException
protected abstract void updateCopyright(BufferedReader in,
BufferedWriter out,
String lastChanged)
throws IOException
IOExceptionprotected abstract String toComment(String comment)
protected abstract String readComment(BufferedReader r)
throws IOException
IOException
protected void warnCopyright(File file,
BufferedReader in)
throws IOException
IOException
protected void copy(BufferedReader in,
BufferedWriter out,
boolean skipBlanks)
throws IOException
IOException
protected String addCopyrightDate(String date,
String lastChanged)
protected String fixCopyright(String cr,
String date,
String lic)
protected static String strip(String line)
protected static String findPrefix(String line)
protected static boolean startsWith(String s,
String prefix)
protected static boolean startsWith(File file,
String prefix)
protected String lastChanged(String file)
throws IOException
IOException
protected boolean isModified(String file)
throws IOException
IOExceptionprotected void err(String s)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||