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


Java PropertyMap.get方法代码示例

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


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

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

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

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

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

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

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

示例15: SchemaParser

import com.thaiopensource.util.PropertyMap; //导入方法依赖的package包/类
SchemaParser(PropertyMap properties, Schema piclSchema) {
  this.properties = properties;
  ceh = new CountingErrorHandler(properties.get(ValidateProperty.ERROR_HANDLER));
  Validator validator = piclSchema.createValidator(SinglePropertyMap.newInstance(ValidateProperty.ERROR_HANDLER, ceh));
  setDelegate(validator.getContentHandler());
  patternParser = new PatternParser(ceh, localizer);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:8,代码来源:SchemaParser.java


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