org.sonar.api.batch
Class AbstractViolationsStaxParser
java.lang.Object
org.sonar.api.batch.AbstractViolationsStaxParser
public abstract class AbstractViolationsStaxParser
- extends java.lang.Object
- Since:
- 1.10
Method Summary |
protected abstract org.codehaus.staxmate.in.SMInputCursor |
cursorForResources(org.codehaus.staxmate.in.SMInputCursor rootCursor)
Cursor for child resources to parse, the returned input cursor should be filtered on SMEvent.START_ELEMENT
for optimal perfs |
protected abstract org.codehaus.staxmate.in.SMInputCursor |
cursorForViolations(org.codehaus.staxmate.in.SMInputCursor resourcesCursor)
Cursor for violations to parse for a given resource, the returned input cursor should be filtered on SMEvent.START_ELEMENT
for optimal perfs |
protected abstract java.lang.String |
keyForPlugin()
|
protected abstract java.lang.String |
lineNumberForViolation(org.codehaus.staxmate.in.SMInputCursor violationCursor)
|
protected abstract java.lang.String |
messageFor(org.codehaus.staxmate.in.SMInputCursor violationCursor)
|
void |
parse(java.io.File violationsXMLFile)
|
void |
parse(java.io.InputStream input)
|
protected java.lang.Integer |
parseLineIndex(java.lang.String line)
|
protected abstract java.lang.String |
ruleKey(org.codehaus.staxmate.in.SMInputCursor violationCursor)
|
protected abstract Resource |
toResource(org.codehaus.staxmate.in.SMInputCursor resourceCursor)
Transforms a given xml resource to a resource Object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rulesManager
protected RulesManager rulesManager
context
protected SensorContext context
AbstractViolationsStaxParser
@Deprecated
protected AbstractViolationsStaxParser(SensorContext context,
RulesManager rulesManager,
RulesProfile profile)
- Deprecated. since 1.11.
AbstractViolationsStaxParser
protected AbstractViolationsStaxParser(SensorContext context,
RulesManager rulesManager)
cursorForResources
protected abstract org.codehaus.staxmate.in.SMInputCursor cursorForResources(org.codehaus.staxmate.in.SMInputCursor rootCursor)
throws javax.xml.stream.XMLStreamException
- Cursor for child resources to parse, the returned input cursor should be filtered on SMEvent.START_ELEMENT
for optimal perfs
- Parameters:
rootCursor
- the root xml doc cursor
- Returns:
- a cursor with child resources elements to parse
- Throws:
javax.xml.stream.XMLStreamException
cursorForViolations
protected abstract org.codehaus.staxmate.in.SMInputCursor cursorForViolations(org.codehaus.staxmate.in.SMInputCursor resourcesCursor)
throws javax.xml.stream.XMLStreamException
- Cursor for violations to parse for a given resource, the returned input cursor should be filtered on SMEvent.START_ELEMENT
for optimal perfs
- Parameters:
resourcesCursor
- the current resource cursor
- Returns:
- a cursor with child violations elements to parse
- Throws:
javax.xml.stream.XMLStreamException
toResource
protected abstract Resource toResource(org.codehaus.staxmate.in.SMInputCursor resourceCursor)
throws javax.xml.stream.XMLStreamException
- Transforms a given xml resource to a resource Object
- Throws:
javax.xml.stream.XMLStreamException
messageFor
protected abstract java.lang.String messageFor(org.codehaus.staxmate.in.SMInputCursor violationCursor)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
ruleKey
protected abstract java.lang.String ruleKey(org.codehaus.staxmate.in.SMInputCursor violationCursor)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
keyForPlugin
protected abstract java.lang.String keyForPlugin()
lineNumberForViolation
protected abstract java.lang.String lineNumberForViolation(org.codehaus.staxmate.in.SMInputCursor violationCursor)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
parse
public void parse(java.io.File violationsXMLFile)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
parse
public final void parse(java.io.InputStream input)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
parseLineIndex
protected java.lang.Integer parseLineIndex(java.lang.String line)
Copyright © 2009-2010 SonarSource. All Rights Reserved.