当前位置: 首页>>代码示例>>Java>>正文


Java SchemaReader.createSchema方法代码示例

本文整理汇总了Java中com.thaiopensource.validate.SchemaReader.createSchema方法的典型用法代码示例。如果您正苦于以下问题:Java SchemaReader.createSchema方法的具体用法?Java SchemaReader.createSchema怎么用?Java SchemaReader.createSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.thaiopensource.validate.SchemaReader的用法示例。


在下文中一共展示了SchemaReader.createSchema方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createChildSchema

import com.thaiopensource.validate.SchemaReader; //导入方法依赖的package包/类
Schema createChildSchema(SAXSource source, String schemaType, PropertyMap options, boolean isAttributesSchema) throws IOException, IncorrectSchemaException, SAXException {
  SchemaReader reader = isRnc(schemaType) ? CompactSchemaReader.getInstance() : autoSchemaReader;
  PropertyMapBuilder builder = new PropertyMapBuilder(properties);
  if (isAttributesSchema)
    builder.put(WrapProperty.ATTRIBUTE_OWNER, ValidatorImpl.OWNER_NAME);
  builder.add(options);
  return reader.createSchema(source, builder.toPropertyMap());
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:9,代码来源:SchemaReceiverImpl.java

示例2: createChildSchema

import com.thaiopensource.validate.SchemaReader; //导入方法依赖的package包/类
Schema createChildSchema(InputSource inputSource, String schemaType, boolean isAttributesSchema) throws IOException, IncorrectSchemaException, SAXException {
  SchemaReader lang = isRnc(schemaType) ? CompactSchemaReader.getInstance() : autoSchemaLanguage;
  return lang.createSchema(inputSource,
                           isAttributesSchema ? attributeSchemaProperties : properties);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:6,代码来源:SchemaReceiverImpl.java

示例3: createChildSchema

import com.thaiopensource.validate.SchemaReader; //导入方法依赖的package包/类
/**
 * Creates a child schema. This schema is referred in a validate action.
 * 
 * @param source the SAXSource for the schema.
 * @param schemaType the schema type.
 * @param options options specified for this schema in the NVDL script.
 * @param isAttributesSchema flag indicating if the schema should be modified
 * to check attributes only. 
 * @return
 * @throws IOException In case of IO problems.
 * @throws IncorrectSchemaException In case of invalid schema.
 * @throws SAXException In case if XML problems while creating the schema.
 */
Schema createChildSchema(SAXSource source, String schemaType, PropertyMap options, boolean isAttributesSchema) throws IOException, IncorrectSchemaException, SAXException {
  SchemaReader reader = isRnc(schemaType) ? CompactSchemaReader.getInstance() : autoSchemaReader;
  PropertyMapBuilder builder = new PropertyMapBuilder(properties);
  if (isAttributesSchema)
    builder.put(WrapProperty.ATTRIBUTE_OWNER, ValidatorImpl.OWNER_NAME);
  builder.add(options);
  return reader.createSchema(source, builder.toPropertyMap());
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:22,代码来源:SchemaReceiverImpl.java

示例4: createSchema

import com.thaiopensource.validate.SchemaReader; //导入方法依赖的package包/类
/**
 * Creates a schema by parsing an XML document.  A non-null <code>XMLReaderCreator</code> must be specified
 * with <code>setXMLReaderCreator</code> before calling <code>createSchema</code>.  The <code>ErrorHandler</code>
 * is allowed to be <code>null</code>. The <code>DatatypeLibraryFactory</code> is allowed to be <code>null</code>.
 *
 * <p>Normally, if a schema cannot be created, <code>createSchema</code> will throw
 * a <code>IncorrectSchemaException</code>; however,
 * before doing so, one or more errors will be reported using the <code>ErrorHandler</code> if it is non-null.  If the
 * <code>ErrorHandler</code> throws a <code>SAXException</code>, then <code>createSchema</code> will pass this
 * through rather than throwing a <code>IncorrectSchemaException</code>. Similarly, if <code>XMLReader.parse</code>
 * throws a <code>SAXException</code> or <code>IOException</code>, then <code>createSchema</code> will pass
 * this through rather than throwing a <code>IncorrectSchemaException</code>. Thus, if an error handler
 * is specified that reports errors to the user, there is no need to report any additional message to the
 * user if <code>createSchema</code> throws <code>IncorrectSchemaException</code>.
 *
 * @param in the <code>InputSource</code> containing the XML document to be parsed;
 * must not be <code>null</code>
 * @return the <code>Schema</code> constructed from the XML document;
 * never <code>null</code>.
 *
 * @throws IOException if an I/O error occurs
 * @throws SAXException if there is an XML parsing error and the XMLReader or ErrorHandler
 * throws a SAXException
 * @throws com.thaiopensource.validate.IncorrectSchemaException if the XML document was not a correct RELAX NG schema
 * @throws NullPointerException if the current XMLReaderCreator is <code>null</code>
 */
public Schema createSchema(InputSource in) throws IOException, SAXException, IncorrectSchemaException {
  SchemaReader r = compactSyntax ? CompactSchemaReader.getInstance() : autoSchemaLanguage;
  return r.createSchema(in, properties.toPropertyMap());
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:31,代码来源:SchemaFactory.java


注:本文中的com.thaiopensource.validate.SchemaReader.createSchema方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。