net.sf.mavenhist.extractor
Class AbstractXPathValueExtractor
java.lang.Object
net.sf.mavenhist.extractor.AbstractXMLValueExtractor
net.sf.mavenhist.extractor.AbstractValidatingXMLValueExtractor
net.sf.mavenhist.extractor.AbstractXPathValueExtractor
- All Implemented Interfaces:
- INamedExtractor, IValueExtractor, IXMLValueExtractor
- Direct Known Subclasses:
- AbstractCheckstyleSingleValueExtractor, AbstractCoberturaSingleValueExtractor, AbstractCPDDuplicatedLinesExtractor, AbstractFindbugsExtractor, AbstractJNCSSExtractor, AbstractJUnitExtractor, AbstractPMDExtractor
public abstract class AbstractXPathValueExtractor
- extends AbstractValidatingXMLValueExtractor
Default implementation for a IValueExtractor
. Supports the easy usage of
a XPath query.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractXPathValueExtractor
public AbstractXPathValueExtractor()
extractValidatedDocument
public final MultiMetric[] extractValidatedDocument(Document document)
throws TransformerException
- Extracts muliple values from one result document.
- Specified by:
extractValidatedDocument
in class AbstractValidatingXMLValueExtractor
- Parameters:
document
- to parse for the values.
- Returns:
- Array of metrics with the differentiated locations and values.
- Throws:
TransformerException
- the XML-Queries failed.
getXPath
protected abstract String getXPath(String version)
- Returns the XPath to get the required value of a specified XML version.
- Returns:
- XPath to get the required value.
getVersion
protected final String getVersion(Document document)
throws TransformerException
- Returns the version of the underlying XML file. If nothing is defined
null is returned.
- Returns:
- version of the underlying XML file or
null
if no version is provided.
- Throws:
TransformerException
- if version could not be found in the document
getVersionXPath
protected String getVersionXPath()
- Returns the XPath to get the version of the underlying XML file.
- Returns:
- XPath to get the version of the underlying XML file or
null
if no version is available.
Copyright © 2009. All Rights Reserved.