public class CopyrightHeader extends BaseLicense implements IHeaderMatcher
Note also that the copyright owner is appended to the regex pattern, so can support additional regex but also requires escaping where needed,
e.g. use "FooBar \(www\.foobar\.com\)" for matching "FooBar (www.foobar.com)"
Modifier and Type | Field and Description |
---|---|
static String |
COPYRIGHT_PREFIX_PATTERN_DEFN |
Modifier | Constructor and Description |
---|---|
|
CopyrightHeader() |
protected |
CopyrightHeader(MetaData.Datum licenseFamilyCategory,
MetaData.Datum licenseFamilyName,
String notes) |
protected |
CopyrightHeader(MetaData.Datum licenseFamilyCategory,
MetaData.Datum licenseFamilyName,
String notes,
String copyrightOwner) |
Modifier and Type | Method and Description |
---|---|
String |
getCopyRightOwner() |
boolean |
hasCopyrightPattern() |
protected boolean |
isCopyrightMatch() |
boolean |
match(Document subject,
String s)
Matches the text accumulated to licenses.
|
protected boolean |
matchCopyright(String s) |
void |
reset()
Resets this matches.
|
void |
setCopyrightOwner(String copyrightOwner) |
getLicenseFamilyCategory, getLicenseFamilyName, getNotes, prune, reportOnLicense, setLicenseFamilyCategory, setLicenseFamilyName, setNotes
public static final String COPYRIGHT_PREFIX_PATTERN_DEFN
public CopyrightHeader()
protected CopyrightHeader(MetaData.Datum licenseFamilyCategory, MetaData.Datum licenseFamilyName, String notes)
protected CopyrightHeader(MetaData.Datum licenseFamilyCategory, MetaData.Datum licenseFamilyName, String notes, String copyrightOwner)
public final void setCopyrightOwner(String copyrightOwner)
public String getCopyRightOwner()
public boolean hasCopyrightPattern()
protected boolean isCopyrightMatch()
protected boolean matchCopyright(String s)
public boolean match(Document subject, String s) throws RatHeaderAnalysisException
IHeaderMatcher
match
in interface IHeaderMatcher
subject
- current document.s
- next line of text, not nullRatHeaderAnalysisException
- in case of internal RAT errors.public void reset()
IHeaderMatcher
IHeaderMatcher.match(org.apache.rat.api.Document, java.lang.String)
will accumulate new text.reset
in interface IHeaderMatcher
Copyright © 2006–2021 Apache Software Foundation. All rights reserved.