public class CopyrightMatcher extends AbstractHeaderMatcher
Note also that the copyright owner is appended to the regex pattern and so
can support additional regex but also requires escaping where needed,
e.g. use "FooBar \\(www\\.foobar\\.com\\)" or "FooBar
\\Q(www.foobar.com)\\E" to match "FooBar (www.foobar.com)"
The matcher also accepts "(C)", "(c)", and "©" in place of (or in addition to) the "Copyright" or "copyright" keyword
IHeaderMatcher.Builder
Constructor and Description |
---|
CopyrightMatcher(String start,
String end,
String owner)
Constructs the CopyrightMatcher with the specified start, stop and owner
strings and a unique random id..
|
CopyrightMatcher(String id,
String start,
String end,
String owner)
Constructs the CopyrightMatcher with the specified start, stop and owner
strings.
|
Modifier and Type | Method and Description |
---|---|
String |
getEnd()
Gets the end date of the copyright.
|
String |
getOwner()
Gets the owner of the copyright.
|
String |
getStart()
Gets the start date of the copyright.
|
boolean |
matches(IHeaders headers)
Attempts to match text in the IHeaders instance.
|
getId, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDescription, reset
public CopyrightMatcher(String start, String end, String owner)
start
- the start date for the copyright may be null.end
- the stop date for the copyright, may be null. May not be
specified if start is not specified.owner
- the owner of the copyright. may be null.public CopyrightMatcher(String id, String start, String end, String owner)
id
- the id for the matcher.start
- the start date for the copyright may be null.end
- the end date for the copyright, may be null. May not be
specified if start is not specified.owner
- the owner of the copyright. may be null.public String getStart()
null
if not setpublic String getEnd()
null
if not setpublic String getOwner()
null
if not setpublic boolean matches(IHeaders headers)
IHeaderMatcher
headers
- the representations of the headers to checktrue
if the matcher matches the text, false
otherwise.Copyright © 2006–2024 Apache Software Foundation. All rights reserved.