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


Java PropertyMapBuilder.put方法代码示例

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


在下文中一共展示了PropertyMapBuilder.put方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

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

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

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

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

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

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

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

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

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

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