本文整理汇总了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));
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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));
}
示例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());
}
示例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));
}
示例8: instanceProperties
import com.thaiopensource.util.PropertyMapBuilder; //导入方法依赖的package包/类
private PropertyMap instanceProperties() {
PropertyMapBuilder builder = new PropertyMapBuilder();
builder.put(ValidateProperty.ERROR_HANDLER, errorHandler);
return builder.toPropertyMap();
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}