- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.sonar.api.utils.XmlParserException
类的一些代码示例,展示了XmlParserException
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlParserException
类的具体详情如下:
包路径:org.sonar.api.utils.XmlParserException
类名称:XmlParserException
暂无
代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api
public Object executeXPath(Node node, QName qname, String xPathExpression) {
XPathExpression expr = compiledExprs.get(xPathExpression);
try {
if (expr == null) {
expr = xpath.compile(xPathExpression);
compiledExprs.put(xPathExpression, expr);
}
return expr.evaluate(node, qname);
} catch (XPathExpressionException e) {
throw new XmlParserException("Unable to evaluate xpath expression :" + xPathExpression, e);
}
}
代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api
public void parse(String xml) {
try {
String fixedXml = fixUnicodeChar(xml);
doc = builder.parse(new ByteArrayInputStream(fixedXml.getBytes(Charsets.UTF_8)));
XPathFactory factory = XPathFactory.newInstance();
xpath = factory.newXPath();
} catch (IOException | SAXException e) {
throw new XmlParserException(CAN_NOT_PARSE_XML + xml, e);
}
}
代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api
public void parse(@Nullable File file) {
if (file == null || !file.exists()) {
throw new XmlParserException("File not found : " + file);
}
BufferedReader buffer = null;
try {
buffer = new BufferedReader(new InputStreamReader(new FileInputStream(file), Charsets.UTF_8));
parse(buffer);
} catch (IOException e) {
throw new XmlParserException("can not parse the file " + file.getAbsolutePath(), e);
} finally {
IOUtils.closeQuietly(buffer);
}
}
代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api
public void parse(InputStream stream) {
BufferedReader buffer = null;
try {
buffer = new BufferedReader(new InputStreamReader(stream, Charsets.UTF_8));
parse(buffer);
} catch (IOException e) {
throw new XmlParserException("can not parse the stream", e);
} finally {
IOUtils.closeQuietly(buffer);
}
}
代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api
public XpathParser() {
DocumentBuilderFactory bf = DocumentBuilderFactory.newInstance();
try {
bf.setFeature("http://apache.org/xml/features/validation/schema", false);
bf.setFeature("http://xml.org/sax/features/external-general-entities", false);
bf.setFeature("http://xml.org/sax/features/validation", false);
bf.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);
bf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
bf.setFeature("http://apache.org/xml/features/allow-java-encodings", true);
} catch (ParserConfigurationException e) {
Logger log = Loggers.get(this.getClass().getName());
log.error("Error occured during features set up.", e);
}
try {
bf.setNamespaceAware(false);
bf.setValidating(false);
builder = bf.newDocumentBuilder();
} catch (ParserConfigurationException e) {
throw new XmlParserException("can not create a XML parser", e);
}
}
代码示例来源:origin: mrprince/sonar-p3c-pmd
@Override
public void analyse(Project project, SensorContext context) {
try {
Report report = executor.execute();
for (RuleViolation violation : report) {
pmdViolationRecorder.saveViolation(violation);
}
} catch (Exception e) {
throw new XmlParserException(e);
}
}
代码示例来源:origin: org.codehaus.sonar-plugins/sonar-clover-plugin
protected void collect(File xmlFile) {
try {
if (reportExists(xmlFile)) {
files = 0;
unmatchedFile = 0;
unmatchedFiles = "";
LOG.info("Parsing " + xmlFile.getCanonicalPath());
createStaxParser().parse(xmlFile);
LOG.info("Matched files in report : {}", getMatchedPercentage());
if (!unmatchedFiles.isEmpty()) {
LOG.warn("{} files in clover report did not match any file in SonarQube Index : {}", unmatchedFile, unmatchedFiles);
}
}
} catch (IllegalStateException e) {
LOG.error("Format of clover report file is unexpected ", e);
throw new XmlParserException(e);
} catch (Exception e) {
LOG.error("An error occured while parsing clover xml report : ", e);
throw new XmlParserException(e);
}
}
代码示例来源:origin: org.codehaus.sonar.plugins/sonar-pmd-plugin
public void analyse(Project project, SensorContext context) {
try {
Report report = executor.execute();
reportViolations(report.iterator(), context);
} catch (Exception e) {
throw new XmlParserException(e);
}
}
代码示例来源:origin: org.codehaus.sonar-plugins/sonar-php-plugin
/**
* @return
*/
public List<PhpCodeSnifferViolation> getViolations(File reportFile) {
LOG.debug("Report file for PHP_CodeSniffer is " + reportFile);
if (reportFile == null || !reportFile.exists()) {
throw new SonarException("The XML report '" + reportFile + "' can't be found");
}
String reportPath = reportFile.getAbsolutePath();
LOG.debug("Getting violations form report file");
List<PhpCodeSnifferViolation> violations = new ArrayList<PhpCodeSnifferViolation>();
try {// <checkstyle>
SMInputFactory inputFactory = new SMInputFactory(XMLInputFactory.newInstance());// <checkstyle>
SMInputCursor rootNodeCursor = inputFactory.rootElementCursor(reportFile).advance(); // <file>
SMInputCursor fileNodeCursor = rootNodeCursor.childElementCursor(FILE_NODE_NAME).advance();
while (fileNodeCursor.asEvent() != null) {
String fileName = fileNodeCursor.getAttrValue(FILE_NAME_ATTRIBUTE_NAME);
SMInputCursor violationNodeCursor = fileNodeCursor.childElementCursor().advance(); // <error>
while (violationNodeCursor.asEvent() != null) {
violations.add(getViolation(fileName, violationNodeCursor));
violationNodeCursor.advance();
}
fileNodeCursor.advance();
}
rootNodeCursor.getStreamReader().closeCompletely();
} catch (XMLStreamException e) {
throw new XmlParserException("Unable to parse the XML Report '" + reportPath + "'", e);
}
return violations;
}
代码示例来源:origin: org.codehaus.sonar-plugins/sonar-php-plugin
throw new XmlParserException("Unable to parse the XML Report", e);
代码示例来源:origin: octo-technology/sonar-objective-c
throw new XmlParserException("Can not parse surefire reports", e);
本文整理了Java中org.mybatis.generator.exception.XMLParserException.printStackTrace()方法的一些代码示例,展示了XMLParser
本文整理了Java中org.mybatis.generator.exception.XMLParserException.()方法的一些代码示例,展示了XMLParserException.()的具体
本文整理了Java中org.mybatis.generator.exception.XMLParserException.getMessage()方法的一些代码示例,展示了XMLParserExcep
本文整理了Java中org.mybatis.generator.exception.XMLParserException.getErrors()方法的一些代码示例,展示了XMLParserExcept
本文整理了Java中org.sonar.api.utils.XmlParserException.()方法的一些代码示例,展示了XmlParserException.()的具体用法。这些代码示例主要来
我是一名优秀的程序员,十分优秀!