use of org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc in project controller by opendaylight.
the class ObjectXmlWriter method prepareWriting.
@SuppressWarnings("checkstyle:hiddenField")
public Map<String, AttributeWritingStrategy> prepareWriting(final Map<String, AttributeIfc> yangToAttrConfig, final Document document) {
Map<String, AttributeWritingStrategy> preparedWriting = Maps.newHashMap();
for (Entry<String, AttributeIfc> mappedAttributeEntry : yangToAttrConfig.entrySet()) {
String key = mappedAttributeEntry.getKey();
AttributeIfc value = mappedAttributeEntry.getValue();
AttributeWritingStrategy strat = prepareWritingStrategy(key, value, document);
preparedWriting.put(key, strat);
}
return preparedWriting;
}
use of org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc in project controller by opendaylight.
the class ObjectResolver method caseTOAttribute.
@Override
protected AttributeResolvingStrategy<?, ? extends OpenType<?>> caseTOAttribute(final CompositeType openType) {
Preconditions.checkState(getLastAttribute() instanceof TOAttribute);
TOAttribute toAttribute = (TOAttribute) getLastAttribute();
Map<String, AttributeResolvingStrategy<?, ? extends OpenType<?>>> innerMap = Maps.newHashMap();
for (String innerName : openType.keySet()) {
AttributeIfc innerAttributeIfc = toAttribute.getJmxPropertiesToTypesMap().get(innerName);
innerMap.put(innerAttributeIfc.getAttributeYangName(), prepareStrategy(innerAttributeIfc));
}
return new CompositeAttributeResolvingStrategy(innerMap, openType, createYangToJmxMapping(toAttribute));
}
use of org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc in project controller by opendaylight.
the class ObjectMapper method caseTOAttribute.
@Override
protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseTOAttribute(final CompositeType openType) {
Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies = Maps.newHashMap();
Preconditions.checkState(getLastAttribute() instanceof TOAttribute);
TOAttribute lastTO = (TOAttribute) getLastAttribute();
for (Entry<String, AttributeIfc> innerAttrEntry : ((TOAttribute) getLastAttribute()).getJmxPropertiesToTypesMap().entrySet()) {
innerStrategies.put(innerAttrEntry.getKey(), prepareStrategy(innerAttrEntry.getValue()));
}
return new CompositeAttributeMappingStrategy(openType, innerStrategies, createJmxToYangMapping(lastTO));
}
use of org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc in project controller by opendaylight.
the class ObjectXmlReader method caseListDependeciesAttribute.
@Override
protected AttributeReadingStrategy caseListDependeciesAttribute(final ArrayType<?> openType) {
AttributeIfc lastAttribute = getLastAttribute();
Preconditions.checkState(lastAttribute instanceof ListDependenciesAttribute);
AttributeReadingStrategy innerStrategy = caseDependencyAttribute(SimpleType.OBJECTNAME);
return new ArrayAttributeReadingStrategy(lastAttribute.getNullableDefault(), innerStrategy);
}
use of org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc in project controller by opendaylight.
the class ObjectXmlReader method caseTOAttribute.
@Override
protected AttributeReadingStrategy caseTOAttribute(final CompositeType openType) {
AttributeIfc lastAttribute = getLastAttribute();
Preconditions.checkState(lastAttribute instanceof TOAttribute);
Map<String, AttributeIfc> inner = ((TOAttribute) lastAttribute).getYangPropertiesToTypesMap();
Map<String, AttributeReadingStrategy> innerStrategies = Maps.newHashMap();
for (Entry<String, AttributeIfc> innerAttrEntry : inner.entrySet()) {
AttributeReadingStrategy innerStrat = prepareReadingStrategy(innerAttrEntry.getKey(), innerAttrEntry.getValue());
innerStrategies.put(innerAttrEntry.getKey(), innerStrat);
}
return new CompositeAttributeReadingStrategy(lastAttribute.getNullableDefault(), innerStrategies);
}
Aggregations