Search in sources :

Example 1 with MutablePropsMetadata

use of org.apache.aries.blueprint.mutable.MutablePropsMetadata in project aries by apache.

the class AbstractPropertyPlaceholder method processPropsMetadata.

protected Metadata processPropsMetadata(PropsMetadata metadata) {
    List<MapEntry> entries = new ArrayList<MapEntry>(metadata.getEntries());
    if (!!!entries.isEmpty()) {
        try {
            if (metadata instanceof MutablePropsMetadata) {
                processingStack.add("Properties->");
                MutablePropsMetadata mpm = (MutablePropsMetadata) metadata;
                for (MapEntry entry : entries) {
                    mpm.removeEntry(entry);
                }
                for (MapEntry entry : processMapEntries(entries)) {
                    mpm.addEntry(entry);
                }
            } else {
                printWarning(metadata, "Properties");
                processingStack.add("Properties->");
                processMapEntries(entries);
            }
        } finally {
            processingStack.removeLast();
        }
    }
    return metadata;
}
Also used : MutableMapEntry(org.apache.aries.blueprint.mutable.MutableMapEntry) MapEntry(org.osgi.service.blueprint.reflect.MapEntry) MutablePropsMetadata(org.apache.aries.blueprint.mutable.MutablePropsMetadata) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 MutableMapEntry (org.apache.aries.blueprint.mutable.MutableMapEntry)1 MutablePropsMetadata (org.apache.aries.blueprint.mutable.MutablePropsMetadata)1 MapEntry (org.osgi.service.blueprint.reflect.MapEntry)1