public abstract class AbstractHeaderCheck extends AbstractFileSetCheck implements ExternalResourceHolder
AutomaticBean.OutputStreamOptions
Constructor and Description |
---|
AbstractHeaderCheck() |
Modifier and Type | Method and Description |
---|---|
protected void |
finishLocalSetup()
Provides a hook to finish the part of this component's setup that
was not handled by the bean introspection.
|
Set<String> |
getExternalResourceLocations()
Returns a set of external configuration resource locations which are used by the module.
|
protected List<String> |
getHeaderLines()
Return the header lines to check against.
|
protected abstract void |
postProcessHeaderLines()
Hook method for post processing header lines.
|
void |
setCharset(String charset)
Set the charset to use for loading the header from a file.
|
void |
setHeader(String header)
Set the header to check against.
|
void |
setHeaderFile(URI uri)
Set the header file to check against.
|
addMessages, beginProcessing, destroy, finishProcessing, fireErrors, getFileExtensions, getMessageDispatcher, init, log, log, process, processFiltered, setFileExtensions, setMessageDispatcher
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
configure, contextualize, getConfiguration, setupChild
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure
contextualize
public AbstractHeaderCheck()
protected abstract void postProcessHeaderLines()
protected List<String> getHeaderLines()
public void setCharset(String charset) throws UnsupportedEncodingException
charset
- the charset to use for loading the header from a fileUnsupportedEncodingException
- if charset is unsupportedpublic void setHeaderFile(URI uri) throws CheckstyleException
uri
- the uri of the header to load.CheckstyleException
- if fileName is empty.public void setHeader(String header)
header
- header content to check against.IllegalArgumentException
- if the header cannot be interpretedprotected final void finishLocalSetup() throws CheckstyleException
AutomaticBean
The default implementation does nothing.
finishLocalSetup
in class AbstractViolationReporter
CheckstyleException
- if there is a configuration error.public Set<String> getExternalResourceLocations()
ExternalResourceHolder
NullPointerException
in Checker
.
Such behaviour will signal that your module (check or filter) is designed incorrectly.
It make sense to return an empty set from 'getExternalResourceLocations()'
only for composite modules like TreeWalker
.getExternalResourceLocations
in interface ExternalResourceHolder
Copyright © 2001–2018. All rights reserved.