Search in sources :

Example 1 with ExtendedValueMetadata

use of org.apache.aries.blueprint.ExtendedValueMetadata in project aries by apache.

the class ValueRecipe method internalCreate.

@Override
protected Object internalCreate() throws ComponentDefinitionException {
    try {
        Type type = getValueType();
        Object v = null;
        if (value instanceof ExtendedValueMetadata) {
            v = ((ExtendedValueMetadata) value).getValue();
        }
        if (v == null) {
            v = value.getStringValue();
        }
        return convert(v, type);
    } catch (Exception e) {
        throw new ComponentDefinitionException(e);
    }
}
Also used : Type(java.lang.reflect.Type) ComponentDefinitionException(org.osgi.service.blueprint.container.ComponentDefinitionException) ExtendedValueMetadata(org.apache.aries.blueprint.ExtendedValueMetadata) ComponentDefinitionException(org.osgi.service.blueprint.container.ComponentDefinitionException)

Aggregations

Type (java.lang.reflect.Type)1 ExtendedValueMetadata (org.apache.aries.blueprint.ExtendedValueMetadata)1 ComponentDefinitionException (org.osgi.service.blueprint.container.ComponentDefinitionException)1