use of org.apache.aries.blueprint.mutable.MutableValueMetadata in project karaf by apache.
the class NamespaceHandler method createValue.
private ValueMetadata createValue(ParserContext context, String value) {
MutableValueMetadata v = context.createMetadata(MutableValueMetadata.class);
v.setStringValue(value);
return v;
}
use of org.apache.aries.blueprint.mutable.MutableValueMetadata in project geronimo-xbean by apache.
the class CmNamespaceHandler method createValue.
private static ValueMetadata createValue(ParserContext context, String value, String type) {
MutableValueMetadata m = context.createMetadata(MutableValueMetadata.class);
m.setStringValue(value);
m.setType(type);
return m;
}
use of org.apache.aries.blueprint.mutable.MutableValueMetadata in project geronimo-xbean by apache.
the class XBeanNamespaceHandler method getValue.
protected Metadata getValue(String value, String propertyEditorName, ParserContext parserContext) {
if (value == null)
return null;
//
if (NULL_REFERENCE.equals(value)) {
return parserContext.createMetadata(NullMetadata.class);
}
//
if (value.startsWith(BEAN_REFERENCE_PREFIX)) {
// strip off the #
value = value.substring(BEAN_REFERENCE_PREFIX.length());
// if the new value starts with a #, then we had an excaped value (e.g. ##value)
if (!value.startsWith(BEAN_REFERENCE_PREFIX)) {
MutableRefMetadata ref = parserContext.createMetadata(MutableRefMetadata.class);
ref.setComponentId(value);
return ref;
}
}
//
if (propertyEditorName != null) {
MutableBeanMetadata factory = parserContext.createMetadata(MutableBeanMetadata.class);
factory.setRuntimeClass(propertyEditors.get(propertyEditorName));
MutableValueMetadata metadata = parserContext.createMetadata(MutableValueMetadata.class);
metadata.setStringValue(value);
factory.addProperty("asText", metadata);
MutableBeanMetadata bean = parserContext.createMetadata(MutableBeanMetadata.class);
bean.setFactoryComponent(factory);
bean.setFactoryMethod("getValue");
return bean;
}
MutableValueMetadata metadata = parserContext.createMetadata(MutableValueMetadata.class);
metadata.setStringValue(value);
return metadata;
}
use of org.apache.aries.blueprint.mutable.MutableValueMetadata in project controller by opendaylight.
the class OpendaylightNamespaceHandler method createValue.
private static ValueMetadata createValue(final ParserContext context, final String value) {
MutableValueMetadata metadata = context.createMetadata(MutableValueMetadata.class);
metadata.setStringValue(value);
return metadata;
}
use of org.apache.aries.blueprint.mutable.MutableValueMetadata in project service-proxy by membrane.
the class BlueprintElementParser method setProperty.
protected void setProperty(ParserContext context, String xmlPropertyName, String springPropertyName, Element element, MutableBeanMetadata mcm, boolean flexibleEnum) {
String value = element.getAttribute(xmlPropertyName);
if (flexibleEnum)
value = value.toUpperCase();
MutableValueMetadata vm = context.createMetadata(MutableValueMetadata.class);
vm.setStringValue(value);
mcm.addProperty(springPropertyName, vm);
}
Aggregations