public abstract class AbstractCopyright
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
allrights |
protected Copyright |
c |
protected static java.lang.String |
thisYear |
protected static java.util.regex.Pattern |
ylpat |
protected static int |
ylpat_YEAR |
protected static java.util.regex.Pattern |
ypat |
protected static int |
ypat_YEAR |
protected static java.util.regex.Pattern |
ytpat |
| Constructor and Description |
|---|
AbstractCopyright(Copyright c) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
addCopyrightDate(java.lang.String date,
java.lang.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(java.io.File file)
Check a file for the correct copyright notice.
|
protected void |
copy(java.io.BufferedReader in,
java.io.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(java.lang.String s) |
protected static java.lang.String |
findPrefix(java.lang.String line)
Find the prefix (if any) for the current line.
|
protected java.lang.String |
fixCopyright(java.lang.String cr,
java.util.List<java.lang.String> crs,
java.lang.String date,
java.lang.String lic)
Update the copyright line in cr using the supplied copyright lines.
|
protected java.lang.String |
fixCopyright(java.lang.String cr,
java.lang.String date,
java.lang.String lic)
Update the copyright line in cr to use "date" as the copyright date
and "lic" as the licensor.
|
protected java.util.List<java.lang.String> |
getCopyrights(java.lang.String s)
Get the copyright lines in the string.
|
protected boolean |
isModified(java.lang.String file)
Exec the "svn status" command to find out if the file has been
modified locally.
|
protected java.lang.String |
lastChanged(java.lang.String file)
Exec the "svn info" command to get the date the file was
last changed.
|
protected boolean |
matches(java.util.List<java.util.regex.Pattern> patlist,
java.lang.String s)
Does the string match any of the patterns?
|
protected boolean |
matches(java.util.regex.Pattern pat,
java.lang.String s)
Does the string match the pattern?
|
protected abstract java.lang.String |
readComment(java.io.BufferedReader r)
Read the first comment block in the file.
|
protected void |
repair(java.io.File file,
java.lang.String comment,
org.glassfish.copyright.AbstractCopyright.RepairType type)
Repair the errors in the file.
|
protected abstract void |
replaceCopyright(java.io.BufferedReader in,
java.io.BufferedWriter out,
java.lang.String comment,
java.lang.String lastChanged)
Skip the first comment block, replacing it with the correct copyright.
|
protected static boolean |
startsWith(java.io.File file,
java.lang.String prefix)
Does the file start with the specified prefix?
|
protected static boolean |
startsWith(java.lang.String s,
java.lang.String prefix)
Like String.startsWith, but ignores case and skips leading whitespace.
|
protected static java.lang.String |
strip(java.lang.String line)
Strip any trailing whitespace.
|
protected abstract boolean |
supports(java.io.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 java.lang.String |
toComment(java.lang.String comment)
Convert the comment text to the appropriate syntax.
|
protected abstract void |
updateCopyright(java.io.BufferedReader in,
java.io.BufferedWriter out,
java.lang.String lastChanged)
Update the existing copyright statement, changing the copyright
year to include lastChanged.
|
protected void |
warnCopyright(java.io.File file,
java.io.BufferedReader in)
Warn if there's another copyright statement in the file.
|
protected void |
writeCopyright(java.io.BufferedWriter out,
java.lang.String year,
java.lang.String comment)
Write the correct copyright to "out", using "year" as the copyright date.
|
protected Copyright c
protected static java.util.regex.Pattern ypat
protected static final int ypat_YEAR
protected static java.util.regex.Pattern ylpat
protected static final int ylpat_YEAR
protected static java.util.regex.Pattern ytpat
protected static final java.lang.String allrights
protected static final java.lang.String thisYear
public AbstractCopyright(Copyright c)
protected abstract boolean supports(java.io.File file)
protected void checkCopyright(java.io.File file)
throws java.io.IOException
java.io.IOExceptionprotected boolean matches(java.util.regex.Pattern pat,
java.lang.String s)
protected boolean matches(java.util.List<java.util.regex.Pattern> patlist,
java.lang.String s)
protected void repair(java.io.File file,
java.lang.String comment,
org.glassfish.copyright.AbstractCopyright.RepairType type)
throws java.io.IOException
java.io.IOExceptionprotected void writeCopyright(java.io.BufferedWriter out,
java.lang.String year,
java.lang.String comment)
throws java.io.IOException
java.io.IOExceptionprotected abstract void replaceCopyright(java.io.BufferedReader in,
java.io.BufferedWriter out,
java.lang.String comment,
java.lang.String lastChanged)
throws java.io.IOException
java.io.IOExceptionprotected abstract void updateCopyright(java.io.BufferedReader in,
java.io.BufferedWriter out,
java.lang.String lastChanged)
throws java.io.IOException
java.io.IOExceptionprotected abstract java.lang.String toComment(java.lang.String comment)
protected abstract java.lang.String readComment(java.io.BufferedReader r)
throws java.io.IOException
java.io.IOExceptionprotected void warnCopyright(java.io.File file,
java.io.BufferedReader in)
throws java.io.IOException
java.io.IOExceptionprotected void copy(java.io.BufferedReader in,
java.io.BufferedWriter out,
boolean skipBlanks)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String addCopyrightDate(java.lang.String date,
java.lang.String lastChanged)
protected java.util.List<java.lang.String> getCopyrights(java.lang.String s)
protected java.lang.String fixCopyright(java.lang.String cr,
java.lang.String date,
java.lang.String lic)
protected java.lang.String fixCopyright(java.lang.String cr,
java.util.List<java.lang.String> crs,
java.lang.String date,
java.lang.String lic)
protected static java.lang.String strip(java.lang.String line)
protected static java.lang.String findPrefix(java.lang.String line)
protected static boolean startsWith(java.lang.String s,
java.lang.String prefix)
protected static boolean startsWith(java.io.File file,
java.lang.String prefix)
protected java.lang.String lastChanged(java.lang.String file)
throws java.io.IOException
java.io.IOExceptionprotected boolean isModified(java.lang.String file)
throws java.io.IOException
java.io.IOExceptionprotected void err(java.lang.String s)
Copyright © 2018 GlassFish Community. All Rights Reserved.