use of org.apache.aries.blueprint.mutable.MutableMapMetadata in project aries by apache.
the class ExtNamespaceHandler method parseDefaultProperties.
private Metadata parseDefaultProperties(ParserContext context, MutableBeanMetadata enclosingComponent, Element element) {
MutableMapMetadata props = context.createMetadata(MutableMapMetadata.class);
NodeList nl = element.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {
Node node = nl.item(i);
if (node instanceof Element) {
Element e = (Element) node;
if (isExtNamespace(e.getNamespaceURI())) {
if (nodeNameEquals(e, PROPERTY_ELEMENT)) {
BeanProperty prop = context.parseElement(BeanProperty.class, enclosingComponent, e);
props.addEntry(createValue(context, prop.getName(), String.class.getName()), prop.getValue());
}
}
}
}
return props;
}
use of org.apache.aries.blueprint.mutable.MutableMapMetadata in project aries by apache.
the class CmNamespaceHandler method parseDefaultProperties.
private Metadata parseDefaultProperties(ParserContext context, MutableBeanMetadata enclosingComponent, Element element) {
MutableMapMetadata props = context.createMetadata(MutableMapMetadata.class);
NodeList nl = element.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {
Node node = nl.item(i);
if (node instanceof Element) {
Element e = (Element) node;
if (isCmNamespace(e.getNamespaceURI())) {
if (nodeNameEquals(e, PROPERTY_ELEMENT)) {
BeanProperty prop = context.parseElement(BeanProperty.class, enclosingComponent, e);
props.addEntry(createValue(context, prop.getName(), String.class.getName()), prop.getValue());
}
}
}
}
return props;
}
use of org.apache.aries.blueprint.mutable.MutableMapMetadata in project aries by apache.
the class AbstractPropertyPlaceholder method processMapMetadata.
protected Metadata processMapMetadata(MapMetadata metadata) {
List<MapEntry> entries = new ArrayList<MapEntry>(metadata.getEntries());
if (!!!entries.isEmpty()) {
try {
if (metadata instanceof MutableMapMetadata) {
processingStack.add("Map->");
MutableMapMetadata mmm = (MutableMapMetadata) metadata;
for (MapEntry entry : entries) {
mmm.removeEntry(entry);
}
for (MapEntry entry : processMapEntries(entries)) {
mmm.addEntry(entry);
}
} else {
printWarning(metadata, "Map");
processingStack.add("Map->");
processMapEntries(entries);
}
} finally {
processingStack.removeLast();
}
}
return metadata;
}
Aggregations