• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PropertyMapBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SchemaReceiverImpl

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
public SchemaReceiverImpl(PropertyMap properties) {
  Name attributeOwner = properties.get(WrapProperty.ATTRIBUTE_OWNER);
  attributesSchema = (attributeOwner != null);
  PropertyMapBuilder builder = new PropertyMapBuilder(properties);
  if (ValidatorImpl.OWNER_NAME.equals(attributeOwner)) {
    attributeSchemaProperties = properties;
    builder.put(WrapProperty.ATTRIBUTE_OWNER, null);
    this.properties = builder.toPropertyMap();
  }
  else {
    if (attributeOwner == null)
      this.properties = properties;
    else {
      builder.put(WrapProperty.ATTRIBUTE_OWNER, null);
      this.properties = builder.toPropertyMap();
    }
    builder.put(WrapProperty.ATTRIBUTE_OWNER, ValidatorImpl.OWNER_NAME);
    attributeSchemaProperties = builder.toPropertyMap();
  }
  this.autoSchemaLanguage = new AutoSchemaReader(properties.get(SchemaReceiverFactory.PROPERTY));
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:22,代码来源:SchemaReceiverImpl.java


示例2: parseValidate

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
/**
 * Parse a validate action.
 * @param attributes The validate element attributes.
 * @throws SAXException
 */
private void parseValidate(Attributes attributes) throws SAXException {
  // get the resolved URI pointing to the schema.
  md.schemaUriRef = getSchema(attributes);
  md.schemaUriBase = xmlBaseHandler.getBaseUri();
  // get the schema type
  md.schemaType = getSchemaType(attributes);
  // if no schemaType attribute, use the default schema type.
  if (md.schemaType == null)
    md.schemaType = defaultSchemaType;
  if (SchemaReceiverImpl.LEGACY_RNC_MEDIA_TYPE.equals(md.schemaType))
    warning("legacy_rnc_media_type", locator);
  // if we matched on elements create a mode usage.
  if (md.actions != null)
    md.modeUsage = getModeUsage(attributes);
  else
    md.modeUsage = null;
  // prepare to receive validate options.
  md.options = new PropertyMapBuilder();
  md.mustSupportOptions.clear();
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:26,代码来源:SchemaImpl.java


示例3: createValidator

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
protected ContentHandler createValidator() {
  String rnc;
  if (xtm_version == XTMVersion.XTM_1_0)
    rnc = XTM_1_RNC;
  else if (xtm_version == XTMVersion.XTM_2_0 ||
           xtm_version == XTMVersion.XTM_2_1)
    rnc = XTM_2_RNC;
  else
    throw new OntopiaRuntimeException("Unknown XTM version: " + xtm_version);
    
  InputSource src = new InputSource(XTMValidatingContentHandler.class.getResourceAsStream(rnc));
  try {
    SchemaFactory factory = new SchemaFactory();
    factory.setXMLReaderCreator(new Jaxp11XMLReaderCreator());
    factory.setErrorHandler(new DraconianErrorHandler());
    factory.setDatatypeLibraryFactory(new DatatypeLibraryLoader());
    Schema schema = factory.createSchema(src);
    PropertyMapBuilder pmb = new PropertyMapBuilder();
    pmb.put(ValidateProperty.ERROR_HANDLER, new DraconianErrorHandler());
    return schema.createValidator(pmb.toPropertyMap()).getContentHandler();
  } catch (Exception e) {
    throw new OntopiaRuntimeException("INTERNAL ERROR: " + e, e);
  }
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:25,代码来源:XTMValidatingContentHandler.java


示例4: addValidator

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
public void addValidator(XMLValidator xv)
{
  PropertyMapBuilder propertyMapBuilder = new PropertyMapBuilder();
  propertyMapBuilder.put(ValidateProperty.ERROR_HANDLER, this);
  Validator validator = xv.schema.createValidator(propertyMapBuilder.toPropertyMap());
  ContentHandler contentHandler = validator.getContentHandler();
  if (contentHandler != null)
  {
    validatorContentHandlers.add(contentHandler);
  }
  DTDHandler dtdHandler = validator.getDTDHandler();
  if (dtdHandler != null)
  {
    validatorDTDHandlers.add(dtdHandler);
  }
}
 
开发者ID:jcdarwin,项目名称:epubcheck-web,代码行数:17,代码来源:XMLParser.java


示例5: createSchematronDriver

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的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


示例6: process

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
public void process(Exchange exchange) throws Exception {
    Jaxp11XMLReaderCreator xmlCreator = new Jaxp11XMLReaderCreator();
    DefaultValidationErrorHandler errorHandler = new DefaultValidationErrorHandler();

    PropertyMapBuilder mapBuilder = new PropertyMapBuilder();
    mapBuilder.put(ValidateProperty.XML_READER_CREATOR, xmlCreator);
    mapBuilder.put(ValidateProperty.ERROR_HANDLER, errorHandler);
    PropertyMap propertyMap = mapBuilder.toPropertyMap();

    Validator validator = getSchema().createValidator(propertyMap);

    Message in = exchange.getIn();
    SAXSource saxSource = in.getBody(SAXSource.class);
    if (saxSource == null) {
        Source source = exchange.getIn().getMandatoryBody(Source.class);
        saxSource = ExchangeHelper.convertToMandatoryType(exchange, SAXSource.class, source);
    }
    InputSource bodyInput = saxSource.getInputSource();

    // now lets parse the body using the validator
    XMLReader reader = xmlCreator.createXMLReader();
    reader.setContentHandler(validator.getContentHandler());
    reader.setDTDHandler(validator.getDTDHandler());
    reader.setErrorHandler(errorHandler);
    reader.parse(bodyInput);

    errorHandler.handleErrors(exchange, schema);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:29,代码来源:JingValidator.java


示例7: parseValidate

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
private void parseValidate(Attributes attributes) throws SAXException {
  schemaUri = getSchema(attributes);
  schemaUriBase = xmlBaseHandler.getBaseUri();
  schemaType = getSchemaType(attributes);
  if (schemaType == null)
    schemaType = defaultSchemaType;
  if (actions != null)
    modeUsage = getModeUsage(attributes);
  else
    modeUsage = null;
  options = new PropertyMapBuilder();
  mustSupportOptions.clear();
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:14,代码来源:SchemaImpl.java


示例8: SchemaReceiverImpl

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
public SchemaReceiverImpl(PropertyMap properties) {
  this.attributeOwner = properties.get(WrapProperty.ATTRIBUTE_OWNER);
  PropertyMapBuilder builder = new PropertyMapBuilder();
  for (int i = 0; i < subSchemaProperties.length; i++) {
    Object value = properties.get(subSchemaProperties[i]);
    if (value != null)
      builder.put(subSchemaProperties[i], value);
  }
  this.properties = builder.toPropertyMap();
  this.autoSchemaReader = new AutoSchemaReader(properties.get(SchemaReceiverFactory.PROPERTY));
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:12,代码来源:SchemaReceiverImpl.java


示例9: createChildSchema

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的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


示例10: SchemaReceiverImpl

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
/**
 * Creates a schema receiver for NVDL schemas.
 * 
 * @param properties Properties.
 */
public SchemaReceiverImpl(PropertyMap properties) {
  this.attributeOwner = properties.get(WrapProperty.ATTRIBUTE_OWNER);
  PropertyMapBuilder builder = new PropertyMapBuilder();
  for (int i = 0; i < subSchemaProperties.length; i++) {
    Object value = properties.get(subSchemaProperties[i]);
    if (value != null)
      builder.put(subSchemaProperties[i], value);
  }
  this.properties = builder.toPropertyMap();
  this.autoSchemaReader = new AutoSchemaReader(properties.get(SchemaReceiverFactory.PROPERTY));
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:17,代码来源:SchemaReceiverImpl.java


示例11: instanceProperties

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
private PropertyMap instanceProperties() {
    PropertyMapBuilder builder = new PropertyMapBuilder();
    builder.put(ValidateProperty.ERROR_HANDLER, errorHandler);
    return builder.toPropertyMap();
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:6,代码来源:SchemaValidator.java


示例12: installHandlers

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
public SchemaFuture installHandlers(XMLReader xr) {
  PropertyMapBuilder builder = new PropertyMapBuilder(properties);
  if (attributeOwner != null)
    builder.put(WrapProperty.ATTRIBUTE_OWNER, attributeOwner);
  return new SchemaImpl(builder.toPropertyMap()).installHandlers(xr, this);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:7,代码来源:SchemaReceiverImpl.java


示例13: filterProperties

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
static public PropertyMap filterProperties(PropertyMap properties, PropertyId<?>[] supportedPropertyIds) {
  PropertyMapBuilder builder = new PropertyMapBuilder();
  for (int i = 0; i < supportedPropertyIds.length; i++)
    copy(builder, supportedPropertyIds[i], properties);
  return builder.toPropertyMap();
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:7,代码来源:AbstractSchema.java


示例14: copy

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
static private <T> void copy(PropertyMapBuilder builder, PropertyId<T> pid, PropertyMap properties) {
  T value = properties.get(pid);
  if (value != null)
    builder.put(pid, value);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:6,代码来源:AbstractSchema.java


示例15: createChildSchema

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的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


示例16: add

import com.thaiopensource.util.PropertyMapBuilder; //导入依赖的package包/类
/**
 * Adds this property to a PropertyMapBuilder. Modifies
 * the PropertyMapBuilder so that this PropertyId is
 * mapped to Flag.PRESENT.
 *
 * @param builder the PropertyMapBuilder to be modified
 */
public void add(PropertyMapBuilder builder) {
  builder.put(this, Flag.PRESENT);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:11,代码来源:FlagPropertyId.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CloseReason类代码示例发布时间:2022-05-22
下一篇:
Java CriteriaSet类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap