Search in sources :

Example 1 with MutableValueMetadata

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;
}
Also used : MutableValueMetadata(org.apache.aries.blueprint.mutable.MutableValueMetadata)

Example 2 with MutableValueMetadata

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;
}
Also used : MutableValueMetadata(org.apache.aries.blueprint.mutable.MutableValueMetadata)

Example 3 with MutableValueMetadata

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;
}
Also used : MutableBeanMetadata(org.apache.aries.blueprint.mutable.MutableBeanMetadata) MutableRefMetadata(org.apache.aries.blueprint.mutable.MutableRefMetadata) MutableValueMetadata(org.apache.aries.blueprint.mutable.MutableValueMetadata)

Example 4 with MutableValueMetadata

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;
}
Also used : MutableValueMetadata(org.apache.aries.blueprint.mutable.MutableValueMetadata)

Example 5 with MutableValueMetadata

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);
}
Also used : MutableValueMetadata(org.apache.aries.blueprint.mutable.MutableValueMetadata)

Aggregations

MutableValueMetadata (org.apache.aries.blueprint.mutable.MutableValueMetadata)14 MutableRefMetadata (org.apache.aries.blueprint.mutable.MutableRefMetadata)3 MutableBeanMetadata (org.apache.aries.blueprint.mutable.MutableBeanMetadata)2 BeanMetadata (org.osgi.service.blueprint.reflect.BeanMetadata)2 BeanProperty (org.osgi.service.blueprint.reflect.BeanProperty)2 ComponentMetadata (org.osgi.service.blueprint.reflect.ComponentMetadata)2 Metadata (org.osgi.service.blueprint.reflect.Metadata)2 NonNullMetadata (org.osgi.service.blueprint.reflect.NonNullMetadata)2 ReferenceMetadata (org.osgi.service.blueprint.reflect.ReferenceMetadata)2 Element (org.w3c.dom.Element)2 PropertyDescriptor (java.beans.PropertyDescriptor)1 LinkedHashMap (java.util.LinkedHashMap)1 NamespaceHandler (org.apache.aries.blueprint.NamespaceHandler)1 MutableCollectionMetadata (org.apache.aries.blueprint.mutable.MutableCollectionMetadata)1 MutableMapMetadata (org.apache.aries.blueprint.mutable.MutableMapMetadata)1 MutableReferenceMetadata (org.apache.aries.blueprint.mutable.MutableReferenceMetadata)1 MutableServiceMetadata (org.apache.aries.blueprint.mutable.MutableServiceMetadata)1 CollectionMetadata (org.osgi.service.blueprint.reflect.CollectionMetadata)1 NullMetadata (org.osgi.service.blueprint.reflect.NullMetadata)1 RefMetadata (org.osgi.service.blueprint.reflect.RefMetadata)1