public abstract class AbstractCopyright extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
allrights |
protected Copyright |
c |
protected static String |
licensor |
protected static String |
thisYear |
protected static Pattern |
ypat |
| Constructor and Description |
|---|
AbstractCopyright(Copyright c) |
| Modifier and Type | Method and Description |
|---|---|
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(List<Pattern> patlist,
String s)
Does the string match any of the patterns?
|
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.
|
protected Copyright c
protected static Pattern ypat
protected static final String licensor
protected static final String allrights
protected static final String thisYear
public AbstractCopyright(Copyright c)
protected abstract boolean supports(File file)
protected void checkCopyright(File file) throws IOException
IOExceptionprotected boolean matches(List<Pattern> patlist, String s)
protected void repair(File file, String comment, org.glassfish.copyright.AbstractCopyright.RepairType type) throws IOException
IOExceptionprotected void writeCopyright(BufferedWriter out, String year, String comment) throws IOException
IOExceptionprotected abstract void replaceCopyright(BufferedReader in, BufferedWriter out, String comment, String lastChanged) throws IOException
IOExceptionprotected 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
IOExceptionprotected void warnCopyright(File file, BufferedReader in) throws IOException
IOExceptionprotected void copy(BufferedReader in, BufferedWriter out, boolean skipBlanks) throws IOException
IOExceptionprotected String addCopyrightDate(String date, String lastChanged)
protected String fixCopyright(String cr, String date, String lic)
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
IOExceptionprotected boolean isModified(String file) throws IOException
IOExceptionprotected void err(String s)
Copyright © 2017 GlassFish Community. All Rights Reserved.