public class XpathFileGeneratorAstFilter extends AutomaticBean implements TreeWalkerFilter
TreeWalkerAuditEvent and generates corresponding xpath query.
Stores violations and xpath queries map inside static variable
for XpathFileGeneratorAuditListener.
See issue #102 https://github.com/checkstyle/checkstyle/issues/102AutomaticBean.OutputStreamOptions| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
DELIMITER
The delimiter between xpath queries.
|
private static java.util.Map<Violation,java.lang.String> |
MESSAGE_QUERY_MAP
Map from
Violation objects to xpath queries. |
private int |
tabWidth
The distance between tab stop position.
|
| Constructor and Description |
|---|
XpathFileGeneratorAstFilter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(TreeWalkerAuditEvent event)
Determines whether or not a filtered
TreeWalkerAuditEvent is accepted. |
static java.lang.String |
findCorrespondingXpathQuery(AuditEvent event)
Returns xpath query corresponding to violation of the
TreeWalkerAuditEvent object which points to the same AST element as specified
AuditEvent object. |
protected void |
finishLocalSetup()
Provides a hook to finish the part of this component's setup that
was not handled by the bean introspection.
|
void |
setTabWidth(int tabWidth)
Sets tab width.
|
configure, contextualize, getConfiguration, setupChildprivate static final java.lang.String DELIMITER
private static final java.util.Map<Violation,java.lang.String> MESSAGE_QUERY_MAP
Violation objects to xpath queries.private int tabWidth
public XpathFileGeneratorAstFilter()
public void setTabWidth(int tabWidth)
tabWidth - the distance between tab stopspublic static java.lang.String findCorrespondingXpathQuery(AuditEvent event)
TreeWalkerAuditEvent object which points to the same AST element as specified
AuditEvent object.event - the AuditEvent object.protected void finishLocalSetup()
AutomaticBeanThe default implementation does nothing.
finishLocalSetup in class AutomaticBeanpublic boolean accept(TreeWalkerAuditEvent event)
TreeWalkerFilterTreeWalkerAuditEvent is accepted.accept in interface TreeWalkerFilterevent - the TreeWalkerAuditEvent to filter.Copyright © 2001-2022. All Rights Reserved.