gpt4 book ai didi

uk.co.real_logic.sbe.xml.XmlSchemaParser.validate()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 01:49:05 29 4
gpt4 key购买 nike

本文整理了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

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());
  }
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com