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


Java SchemaReader类代码示例

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


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

示例1: createSchematronDriver

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
/**
 * Sets up the schematron reader with all the necessary parameters. Calls
 * initSchematronReader() to do further setup of the validation driver.
 * 
 * @param phase
 *            The string phase name (contained in schematron file)
 * @return The ValidationDriver to use in validating the XML document
 */
ValidationDriver createSchematronDriver(String phase) {
    SchemaReaderLoader loader = new SchemaReaderLoader();
    SchemaReader schReader = loader.createSchemaReader(SCHEMATRON_NS_URI);
    this.configPropBuilder = new PropertyMapBuilder();
    SchematronProperty.DIAGNOSE.add(this.configPropBuilder);

    if (this.outputLogger == null) {
        this.outputLogger = new PrintWriter(System.out);
    }
    if (null != phase && !phase.isEmpty()) {
        this.configPropBuilder.put(SchematronProperty.PHASE, phase);
    }
    ErrorHandler eh = new ErrorHandlerImpl("Schematron", outputLogger);
    this.configPropBuilder.put(ValidateProperty.ERROR_HANDLER, eh);
    ValidationDriver validator = new ValidationDriver(
            this.configPropBuilder.toPropertyMap(), schReader);
    return validator;
}
 
开发者ID:opengeospatial,项目名称:teamengine,代码行数:27,代码来源:SchematronValidatingParser.java

示例2: 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

示例3: createSchemaReader

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
public SchemaReader createSchemaReader(String namespaceUri) {
  try {
    VerifierFactory vf = VerifierFactory.newInstance(namespaceUri);
    if (vf != null)
      return new VerifierFactorySchemaReader(vf);
  }
  catch (VerifierConfigurationException e) { }
  return null;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:10,代码来源:JarvSchemaReaderFactory.java

示例4: createSchemaReceiver

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
public SchemaReceiver createSchemaReceiver(String namespaceUri,
                                           PropertyMap properties) {
  SchemaReader sr = srf.createSchemaReader(namespaceUri);
  if (sr == null)
    return null;
  return new SchemaReaderSchemaReceiver(sr, properties);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:8,代码来源:SchemaReaderFactorySchemaReceiverFactory.java

示例5: getOption

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
public static Option getOption(String uri) {
  if (!uri.startsWith(SchemaReader.BASE_URI))
    return null;
  uri = uri.substring(SchemaReader.BASE_URI.length());
  if (uri.equals("diagnose"))
    return new FlagOption(DIAGNOSE);
  if (uri.equals("phase"))
    return PHASE_OPTION;
  return null;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:11,代码来源:SchematronProperty.java

示例6: getOption

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
public static Option getOption(String uri) {
  if (!uri.startsWith(SchemaReader.BASE_URI))
    return null;
  uri = uri.substring(SchemaReader.BASE_URI.length());
  if (uri.equals("feasible"))
    return new FlagOption(FEASIBLE);
  if (uri.equals("check-id-idref"))
    return new FlagOption(CHECK_ID_IDREF);
  return null;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:11,代码来源:RngProperty.java

示例7: createSchemaReader

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
public SchemaReader createSchemaReader(String namespaceUri) {
  if (WellKnownNamespaces.XML_SCHEMA.equals(namespaceUri))
    return new SchemaReaderImpl();
  return null;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:6,代码来源:XsdSchemaReaderFactory.java

示例8: getInstance

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
public static SchemaReader getInstance() {
  return theInstance;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:4,代码来源:SAXSchemaReader.java

示例9: 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

示例10: SchemaReaderSchemaReceiver

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
public SchemaReaderSchemaReceiver(SchemaReader schemaLanguage, PropertyMap properties) {
  this.schemaLanguage = schemaLanguage;
  this.properties = properties;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:5,代码来源:SchemaReaderSchemaReceiver.java

示例11: 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

示例12: createDriver

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
/**
 * Creates and initializes a ValidationDriver to perform Schematron
 * validation. A schema must be loaded before an instance can be validated.
 * 
 * @param configProps
 *            A PropertyMap containing properties to configure schema
 *            construction and validation behavior; it typically includes
 *            {@code SchematronProperty} and {@code ValidationProperty}
 *            items.
 * @return A ValidationDriver that is ready to load a Schematron schema.
 */
ValidationDriver createDriver(PropertyMap configProps) {
    SchemaReaderLoader loader = new SchemaReaderLoader();
    SchemaReader schReader = loader.createSchemaReader(SCHEMATRON_NS_URI);
    ValidationDriver validator = new ValidationDriver(configProps,
            schReader);
    return validator;
}
 
开发者ID:opengeospatial,项目名称:teamengine,代码行数:19,代码来源:SchematronValidatingParser.java

示例13: 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

示例14: createSchemaReader

import com.thaiopensource.validate.SchemaReader; //导入依赖的package包/类
/**
 * Creates a SchemaReader for a particular schema language.
 *
 * @param namespaceUri a String identifing the schema language; must not be <code>null</code>;
 * for schema languages that use XML, this should be the namespace URI
 * of the root element if the root element has a non-absent namespace URI
 *
 * @return a SchemaReader for the specified schema language, or <code>null</code>,
 * if this SchemaReaderFactory cannot create a SchemaReader for the specified
 * schema language
 */
public SchemaReader createSchemaReader(String namespaceUri);
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:13,代码来源:SchemaReaderFactory.java


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