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

Java PropertyMap类代码示例

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

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



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

示例1: ValidatorImpl

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
ValidatorImpl(SymbolTable symbolTable, XMLGrammarPool grammarPool, PropertyMap properties) {
  this.symbolTable = symbolTable;
  XMLErrorHandler errorHandlerWrapper = new ErrorHandlerWrapper(properties.get(ValidateProperty.ERROR_HANDLER));
  components = new XMLComponent[] { errorReporter, schemaValidator, entityManager };
  for (int i = 0; i < components.length; i++) {
    addRecognizedFeatures(components[i].getRecognizedFeatures());
    addRecognizedProperties(components[i].getRecognizedProperties());
  }
  addRecognizedFeatures(recognizedFeatures);
  addRecognizedProperties(recognizedProperties);
  setFeature(Features.SCHEMA_AUGMENT_PSVI, false);
  setFeature(Features.SCHEMA_FULL_CHECKING, true);
  setFeature(Features.VALIDATION, true);
  setFeature(Features.SCHEMA_VALIDATION, true);
  setFeature(Features.ID_IDREF_CHECKING, true);
  setFeature(Features.IDC_CHECKING, true);
  setProperty(Properties.XMLGRAMMAR_POOL, grammarPool);
  setProperty(Properties.SYMBOL_TABLE, symbolTable);
  errorReporter.setDocumentLocator(this);
  setProperty(Properties.ERROR_REPORTER, errorReporter);
  setProperty(Properties.ERROR_HANDLER, errorHandlerWrapper);
  setProperty(Properties.VALIDATION_MANAGER, validationManager);
  setProperty(Properties.ENTITY_MANAGER, entityManager);
  setProperty(Properties.ENTITY_RESOLVER, this);
  reset();
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:27,代码来源:ValidatorImpl.java


示例2: createSchema

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
public Schema createSchema(SAXSource source, PropertyMap properties)
        throws IOException, SAXException, IncorrectSchemaException {
  SchemaPatternBuilder spb = new SchemaPatternBuilder();
  SAXResolver resolver = ResolverFactory.createResolver(properties);
  ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
  DatatypeLibraryFactory dlf = properties.get(RngProperty.DATATYPE_LIBRARY_FACTORY);
  if (dlf == null)
    dlf = new DatatypeLibraryLoader();
  try {
    Pattern start = SchemaBuilderImpl.parse(createParseable(source, resolver, eh, properties), eh, dlf, spb,
                                            properties.contains(WrapProperty.ATTRIBUTE_OWNER));
    return wrapPattern(start, spb, properties);
  }
  catch (IllegalSchemaException e) {
    throw new IncorrectSchemaException();
  }
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:18,代码来源:SchemaReaderImpl.java


示例3: wrapPattern

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
static Schema wrapPattern(Pattern start, SchemaPatternBuilder spb, PropertyMap properties) throws SAXException, IncorrectSchemaException {
  if (properties.contains(RngProperty.FEASIBLE))
    start = FeasibleTransform.transform(spb, start);
  properties = new SimplifiedSchemaPropertyMap(AbstractSchema.filterProperties(properties, supportedPropertyIds),
                                               start);
  Schema schema = new PatternSchema(spb, start, properties);
  if (spb.hasIdTypes() && properties.contains(RngProperty.CHECK_ID_IDREF)) {
    ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
    IdTypeMap idTypeMap = new IdTypeMapBuilder(eh, start).getIdTypeMap();
    if (idTypeMap == null)
      throw new IncorrectSchemaException();
    Schema idSchema;
    if (properties.contains(RngProperty.FEASIBLE))
      idSchema = new FeasibleIdTypeMapSchema(idTypeMap, properties);
    else
      idSchema = new IdTypeMapSchema(idTypeMap, properties);
    schema = new CombineSchema(schema, idSchema, properties);
  }
  return schema;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:21,代码来源:SchemaReaderImpl.java


示例4: createSubSchema

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
private Schema createSubSchema(boolean isAttributesSchema) throws IOException, IncorrectSchemaException, SAXException {
  PropertyMap requestedProperties = options.toPropertyMap();
  Schema schema = sr.createChildSchema(resolver.resolve(schemaUri, schemaUriBase),
                                       schemaType,
                                       requestedProperties,
                                       isAttributesSchema);
  PropertyMap actualProperties = schema.getProperties();
  for (Enumeration e = mustSupportOptions.elements(); e.hasMoreElements();) {
    MustSupportOption mso = (MustSupportOption)e.nextElement();
    Object actualValue = actualProperties.get(mso.pid);
    if (actualValue == null)
      error("unsupported_option", mso.name, mso.locator);
    else if (!actualValue.equals(requestedProperties.get(mso.pid)))
      error("unsupported_option_arg", mso.name, mso.locator);
  }
  return schema;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:18,代码来源:SchemaImpl.java


示例5: SchemaReceiverImpl

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


示例6: createSubSchema

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
/**
 * Creates a sub schema for the ending validate action (this is 
 * called from finishValidate).
 * 
 * @param isAttributesSchema If the schema is intended to validate only attributes.
 * @return A Schema.
 * @throws IOException
 * @throws IncorrectSchemaException
 * @throws SAXException
 */
private Schema createSubSchema(boolean isAttributesSchema) throws IOException, IncorrectSchemaException, SAXException {
  // the user specified options
  PropertyMap requestedProperties = md.options.toPropertyMap();
  // let the schema receiver create a child schema
  // XXX parse the media type to the resolver
  Schema schema = sr.createChildSchema(resolver.resolve(md.schemaUriRef, md.schemaUriBase),
                                       md.schemaType,
                                       requestedProperties,
                                       isAttributesSchema);
  // get the schema properties
  PropertyMap actualProperties = schema.getProperties();
  // Check if the actual properties match the must support properties.
  for (Enumeration e = md.mustSupportOptions.elements(); e.hasMoreElements();) {
    MustSupportOption mso = (MustSupportOption)e.nextElement();
    Object actualValue = actualProperties.get(mso.pid);
    if (actualValue == null)
      error("unsupported_option", mso.name, mso.locator);
    else if (!actualValue.equals(requestedProperties.get(mso.pid)))
      error("unsupported_option_arg", mso.name, mso.locator);
  }
  return schema;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:33,代码来源:SchemaImpl.java


示例7: createResolver

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
static public SAXResolver createResolver(PropertyMap properties) {
  Resolver[] resolvers = new Resolver[4];
  int i = 0;
  // user-specified Resolver first
  resolvers[0] = properties.get(ValidateProperty.RESOLVER);
  if (resolvers[0] != null)
    i++;
  // EntityResolver before uriResolver
  EntityResolver entityResolver = properties.get(ValidateProperty.ENTITY_RESOLVER);
  URIResolver uriResolver = properties.get(ValidateProperty.URI_RESOLVER);
  if (entityResolver != null)
    resolvers[i++] = SAX.createResolver(entityResolver, uriResolver == null);
  if (uriResolver != null)
    resolvers[i++] = Transform.createResolver(uriResolver);
  while (--i > 0)
    resolvers[i - 1] = new SequenceResolver(resolvers[i - 1], resolvers[i]);
  // XMLReaderCreator last, so it can create an EntityResolver
  XMLReaderCreator xrc = properties.get(ValidateProperty.XML_READER_CREATOR);
  if (xrc != null)
    return new CustomSAXResolver(resolvers[0], xrc);
  return new SAXResolver(resolvers[0]);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:23,代码来源:ResolverFactory.java


示例8: createParseable

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
@Override
protected com.thaiopensource.relaxng.parse.Parseable<Pattern, NameClass, Locator, VoidValue, CommentListImpl, AnnotationsImpl> createParseable(SAXSource source,
		SAXResolver resolver,
		ErrorHandler errorHandler,
		PropertyMap properties) throws SAXException
{
	Input inputSource = SAX.createInput(source.getInputSource());
	if(myDescriptorFile.getFileType() == RncFileType.getInstance())
	{
		return new com.thaiopensource.relaxng.parse.compact.CompactParseable<>(inputSource, resolver.getResolver(), errorHandler);
	}
	else
	{
		return new com.thaiopensource.relaxng.parse.sax.SAXParseable<>(source, resolver, errorHandler);
	}
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:17,代码来源:RngParser.java


示例9: process

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


示例10: ValidatorImpl

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
ValidatorImpl(Templates templates, SAXTransformerFactory factory, PropertyMap properties) {
  this.templates = templates;
  this.factory = factory;
  ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
  outputHandler = new OutputHandler(eh);
  resolver = ResolverFactory.createResolver(properties).getResolver();
  initTransformerHandler();
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:9,代码来源:ValidatorImpl.java


示例11: SchemaImpl

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
SchemaImpl(SymbolTable symbolTable,
           XMLGrammarPool grammarPool,
           PropertyMap properties,
           PropertyId<?>[] supportedPropertyIds) {
  super(properties, supportedPropertyIds);
  this.symbolTable = symbolTable;
  this.grammarPool = grammarPool;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:9,代码来源:SchemaImpl.java


示例12: createSchema

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
public Schema createSchema(SAXSource source, PropertyMap properties)
        throws IOException, SAXException, IncorrectSchemaException {
  SymbolTable symbolTable = new SymbolTable();
  XMLGrammarPreparser preparser = new XMLGrammarPreparser(symbolTable);
  XMLGrammarPool grammarPool = new XMLGrammarPoolImpl();
  preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
  preparser.setGrammarPool(grammarPool);
  ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
  SAXXMLErrorHandler xeh = new SAXXMLErrorHandler(eh);
  preparser.setErrorHandler(xeh);
  EntityResolver er = properties.get(ValidateProperty.ENTITY_RESOLVER);
  if (er != null)
    preparser.setEntityResolver(new EntityResolverWrapper(er));
  try {
    preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, toXMLInputSource(source.getInputSource()));
    Name attributeOwner = properties.get(WrapProperty.ATTRIBUTE_OWNER);
    if (attributeOwner != null) {
      Reader r = new StringReader(createWrapper(attributeOwner));
 	preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA,
                                new XMLInputSource(null, null, null, r, null));
    }
  }
  catch (XNIException e) {
    throw ValidatorImpl.toSAXException(e);
  }
  if (xeh.getHadError())
    throw new IncorrectSchemaException();
  return new SchemaImpl(new SynchronizedSymbolTable(symbolTable),
                        new CachingParserPool.SynchronizedGrammarPool(grammarPool),
                        properties,
                        supportedPropertyIds);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:33,代码来源:SchemaReaderImpl.java


示例13: createSchemaReceiver

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
public SchemaReceiver createSchemaReceiver(String namespaceUri,
                                           PropertyMap properties) {
  // XXX allow namespaces with incorrect version
  if (!WellKnownNamespaces.RELAX_NG.equals(namespaceUri))
    return null;
  SAXResolver resolver = ResolverFactory.createResolver(properties);
  ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
  return new SchemaReceiverImpl(new SAXParseReceiver(resolver, eh), properties);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:10,代码来源:SAXSchemaReceiverFactory.java


示例14: createValidator

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
public Validator createValidator(PropertyMap properties) {
  ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
  return new IdValidator(idTypeMap, eh) {
    public void endDocument() {
       setComplete();
    }
  };
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:9,代码来源:FeasibleIdTypeMapSchema.java


示例15: SchemaImpl

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
SchemaImpl(PropertyMap properties) {
  super(properties);
  this.attributesSchema = properties.contains(WrapProperty.ATTRIBUTE_OWNER);
  makeBuiltinMode("#allow", AllowAction.class);
  makeBuiltinMode("#attach", AttachAction.class);
  makeBuiltinMode("#unwrap", UnwrapAction.class);
  defaultBaseMode = makeBuiltinMode("#reject", RejectAction.class);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:9,代码来源:SchemaImpl.java


示例16: SchemaReceiverImpl

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


示例17: createChildSchema

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


示例18: ValidatorImpl

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
/**
 * Creates a NVDL validator. The initial mode is specified by the mode parameter.
 * Initializes the current section.
 * @param mode The start mode.
 * param triggers The triggers specified by the NVDL script.
 * @param properties Validation properties.
 */
ValidatorImpl(Mode mode, List triggers, PropertyMap properties) {
  this.properties = properties;
  this.triggers = triggers;
  this.eh = properties.get(ValidateProperty.ERROR_HANDLER);
  this.startMode = mode;
  this.elementsLocalNameStack = new Stack();
  initCurrentSection();
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:16,代码来源:ValidatorImpl.java


示例19: SchemaImpl

import com.thaiopensource.util.PropertyMap; //导入依赖的package包/类
/**
 * Creates a NVDL schema implementation.
 * Initializes the attributesSchema flag and the built in modes.
 * @param properties Properties.
 */
SchemaImpl(PropertyMap properties) {
  super(properties);
  this.attributesSchema = properties.contains(WrapProperty.ATTRIBUTE_OWNER);
  makeBuiltinMode("#allow", AllowAction.class);
  makeBuiltinMode("#attach", AttachAction.class);
  makeBuiltinMode("#unwrap", UnwrapAction.class);
  defaultBaseMode = makeBuiltinMode("#reject", RejectAction.class);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:14,代码来源:SchemaImpl.java


示例20: SchemaReceiverImpl

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java JSON类代码示例发布时间:2022-05-22
下一篇:
Java CustomTile类代码示例发布时间: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