本文整理了Java中uk.co.real_logic.sbe.xml.XmlSchemaParser.validate()
方法的一些代码示例,展示了XmlSchemaParser.validate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlSchemaParser.validate()
方法的具体详情如下:
包路径:uk.co.real_logic.sbe.xml.XmlSchemaParser
类名称:XmlSchemaParser
方法名:validate
[英]Validate the document against a given schema. Error will be written to java.lang.System#err
[中]根据给定的架构验证文档。错误将被写入java。lang.System#err
代码示例来源:origin: real-logic/simple-binary-encoding
/**
* Validate the SBE Schema against the XSD.
*
* @param sbeSchemaFilename to be validated
* @param xsdFilename XSD against which to validate
* @throws Exception if an error occurs while validating
*/
public static void validateAgainstSchema(final String sbeSchemaFilename, final String xsdFilename)
throws Exception
{
final ParserOptions.Builder optionsBuilder = ParserOptions.builder()
.xsdFilename(System.getProperty(VALIDATION_XSD))
.xIncludeAware(Boolean.parseBoolean(System.getProperty(XINCLUDE_AWARE)))
.stopOnError(Boolean.parseBoolean(System.getProperty(VALIDATION_STOP_ON_ERROR)))
.warningsFatal(Boolean.parseBoolean(System.getProperty(VALIDATION_WARNINGS_FATAL)))
.suppressOutput(Boolean.parseBoolean(System.getProperty(VALIDATION_SUPPRESS_OUTPUT)));
try (InputStream in = new BufferedInputStream(Files.newInputStream(Paths.get(sbeSchemaFilename))))
{
XmlSchemaParser.validate(xsdFilename, in, optionsBuilder.build());
}
}
代码示例来源:origin: uk.co.real-logic/sbe
/**
* Validate the SBE Schema against the XSD.
*
* @param sbeSchemaFilename to be validated
* @param xsdFilename XSD against which to validate
* @throws Exception if an error occurs while validating
*/
public static void validateAgainstSchema(final String sbeSchemaFilename, final String xsdFilename)
throws Exception
{
try (final BufferedInputStream in = new BufferedInputStream(new FileInputStream(sbeSchemaFilename)))
{
XmlSchemaParser.validate(xsdFilename, in);
}
}
代码示例来源:origin: uk.co.real-logic/sbe-tool
/**
* Validate the SBE Schema against the XSD.
*
* @param sbeSchemaFilename to be validated
* @param xsdFilename XSD against which to validate
* @throws Exception if an error occurs while validating
*/
public static void validateAgainstSchema(final String sbeSchemaFilename, final String xsdFilename)
throws Exception
{
final ParserOptions.Builder optionsBuilder = ParserOptions.builder()
.xsdFilename(System.getProperty(VALIDATION_XSD))
.xIncludeAware(Boolean.parseBoolean(System.getProperty(XINCLUDE_AWARE)))
.stopOnError(Boolean.parseBoolean(System.getProperty(VALIDATION_STOP_ON_ERROR)))
.warningsFatal(Boolean.parseBoolean(System.getProperty(VALIDATION_WARNINGS_FATAL)))
.suppressOutput(Boolean.parseBoolean(System.getProperty(VALIDATION_SUPPRESS_OUTPUT)));
try (InputStream in = new BufferedInputStream(Files.newInputStream(Paths.get(sbeSchemaFilename))))
{
XmlSchemaParser.validate(xsdFilename, in, optionsBuilder.build());
}
}
代码示例来源:origin: uk.co.real-logic/sbe-all
/**
* Validate the SBE Schema against the XSD.
*
* @param sbeSchemaFilename to be validated
* @param xsdFilename XSD against which to validate
* @throws Exception if an error occurs while validating
*/
public static void validateAgainstSchema(final String sbeSchemaFilename, final String xsdFilename)
throws Exception
{
final ParserOptions.Builder optionsBuilder = ParserOptions.builder()
.xsdFilename(System.getProperty(VALIDATION_XSD))
.xIncludeAware(Boolean.parseBoolean(System.getProperty(XINCLUDE_AWARE)))
.stopOnError(Boolean.parseBoolean(System.getProperty(VALIDATION_STOP_ON_ERROR)))
.warningsFatal(Boolean.parseBoolean(System.getProperty(VALIDATION_WARNINGS_FATAL)))
.suppressOutput(Boolean.parseBoolean(System.getProperty(VALIDATION_SUPPRESS_OUTPUT)));
try (InputStream in = new BufferedInputStream(Files.newInputStream(Paths.get(sbeSchemaFilename))))
{
XmlSchemaParser.validate(xsdFilename, in, optionsBuilder.build());
}
}
内容来源于网络,如有侵权,请联系作者删除!