本文整理汇总了Java中org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute类的典型用法代码示例。如果您正苦于以下问题:Java TOAttribute类的具体用法?Java TOAttribute怎么用?Java TOAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TOAttribute类属于org.opendaylight.controller.config.yangjmxgenerator.attribute包,在下文中一共展示了TOAttribute类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getReturnTypeAttribute
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
private static AttributeIfc getReturnTypeAttribute(final DataSchemaNode child, final TypeProviderWrapper typeProviderWrapper,
final String packageName) {
if (child instanceof LeafSchemaNode) {
LeafSchemaNode leaf = (LeafSchemaNode) child;
return new JavaAttribute(leaf, typeProviderWrapper);
} else if (child instanceof ContainerSchemaNode) {
ContainerSchemaNode container = (ContainerSchemaNode) child;
TOAttribute toAttribute = TOAttribute.create(container, typeProviderWrapper, packageName);
return toAttribute;
} else if (child instanceof ListSchemaNode) {
return ListAttribute.create((ListSchemaNode) child, typeProviderWrapper, packageName);
} else if (child instanceof LeafListSchemaNode) {
return ListAttribute.create((LeafListSchemaNode) child, typeProviderWrapper);
} else {
throw new IllegalStateException("Unknown output data node " + child + " for rpc");
}
}
示例2: caseTOAttribute
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
@Override
protected AttributeWritingStrategy caseTOAttribute(final CompositeType openType) {
Preconditions.checkState(getLastAttribute() instanceof TOAttribute);
Map<String, AttributeWritingStrategy> innerStrats = Maps.newHashMap();
String currentKey = key;
for (Entry<String, AttributeIfc> innerAttrEntry : ((TOAttribute) getLastAttribute())
.getYangPropertiesToTypesMap().entrySet()) {
AttributeWritingStrategy innerStrategy = prepareWritingStrategy(innerAttrEntry.getKey(),
innerAttrEntry.getValue(), document);
innerStrats.put(innerAttrEntry.getKey(), innerStrategy);
}
return new CompositeAttributeWritingStrategy(document, currentKey, innerStrats);
}
示例3: checkUniqueAttributesWithGeneratedClass
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
private static void checkUniqueAttributesWithGeneratedClass(final Map<String, QName> uniqueGeneratedClassNames,
final QName parentQName, final Map<String, AttributeIfc> yangToAttributes) {
for (Map.Entry<String, AttributeIfc> attr : yangToAttributes.entrySet()) {
if (attr.getValue() instanceof TOAttribute) {
checkUniqueTOAttr(uniqueGeneratedClassNames, parentQName, (TOAttribute) attr.getValue());
} else if (attr.getValue() instanceof ListAttribute
&& ((ListAttribute) attr.getValue()).getInnerAttribute() instanceof TOAttribute) {
checkUniqueTOAttr(uniqueGeneratedClassNames, parentQName,
(TOAttribute) ((ListAttribute) attr.getValue()).getInnerAttribute());
}
}
}
示例4: checkUniqueTOAttr
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
private static void checkUniqueTOAttr(final Map<String, QName> uniqueGeneratedClassNames, final QName parentQName, final TOAttribute attr) {
final String upperCaseCamelCase = attr.getUpperCaseCammelCase();
if (uniqueGeneratedClassNames.containsKey(upperCaseCamelCase)) {
QName firstDefinedQName = uniqueGeneratedClassNames.get(upperCaseCamelCase);
throw new NameConflictException(upperCaseCamelCase, firstDefinedQName, parentQName);
} else {
uniqueGeneratedClassNames.put(upperCaseCamelCase, parentQName);
}
}
示例5: createJmxToYangMapping
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
private Map<String, String> createJmxToYangMapping(final TOAttribute attributeIfc) {
Map<String, String> retVal = Maps.newHashMap();
for (Entry<String, AttributeIfc> entry : attributeIfc.getJmxPropertiesToTypesMap().entrySet()) {
retVal.put(entry.getKey(), entry.getValue().getAttributeYangName());
}
return retVal;
}
示例6: caseTOAttribute
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
@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));
}
示例7: switchAttribute
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
public T switchAttribute(final AttributeIfc attributeIfc) {
this.lastAttribute = attributeIfc;
OpenType<?> openType = attributeIfc.getOpenType();
if (attributeIfc instanceof JavaAttribute) {
try {
if (((JavaAttribute) attributeIfc).getTypeDefinition() instanceof BinaryTypeDefinition) {
return caseJavaBinaryAttribute(openType);
} else if (((JavaAttribute) attributeIfc).isUnion()) {
return caseJavaUnionAttribute(openType);
} else if (((JavaAttribute) attributeIfc).isIdentityRef()) {
return caseJavaIdentityRefAttribute(openType);
} else if (((JavaAttribute) attributeIfc).isEnum()) {
return caseJavaEnumAttribute(openType);
} else {
return caseJavaAttribute(openType);
}
} catch (final UnknownOpenTypeException e) {
throw getIllegalArgumentException(attributeIfc);
}
} else if (attributeIfc instanceof DependencyAttribute) {
return caseDependencyAttribute(((DependencyAttribute) attributeIfc).getOpenType());
} else if (attributeIfc instanceof ListAttribute) {
return caseListAttribute((ArrayType<?>) openType);
} else if (attributeIfc instanceof ListDependenciesAttribute) {
return caseListDependeciesAttribute((ArrayType<?>) openType);
} else if (attributeIfc instanceof TOAttribute) {
return caseTOAttribute(((TOAttribute) attributeIfc).getOpenType());
}
throw getIllegalArgumentException(attributeIfc);
}
示例8: createYangToJmxMapping
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
private Map<String, String> createYangToJmxMapping(final TOAttribute attributeIfc) {
Map<String, String> retVal = Maps.newHashMap();
for (Entry<String, AttributeIfc> entry : attributeIfc.getYangPropertiesToTypesMap().entrySet()) {
retVal.put(entry.getKey(), entry.getValue().getLowerCaseCammelCase());
}
return retVal;
}
示例9: caseTOAttribute
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
@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));
}
示例10: caseTOAttribute
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
@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);
}
示例11: processAttributes
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
void processAttributes(final Map<String, AttributeIfc> attributes) {
for (final Entry<String, AttributeIfc> attrEntry : attributes.entrySet()) {
final AttributeIfc attributeIfc = attrEntry.getValue();
if (attributeIfc instanceof TOAttribute) {
createTOInternal((TOAttribute) attributeIfc);
}
if (attributeIfc instanceof ListAttribute) {
final AttributeIfc innerAttr = ((ListAttribute) attributeIfc)
.getInnerAttribute();
if (innerAttr instanceof TOAttribute) {
createTOInternal((TOAttribute) innerAttr);
}
}
}
}
示例12: createTOInternal
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
private void createTOInternal(final TOAttribute toAttribute) {
final Map<String, AttributeIfc> attrs = toAttribute.getCapitalizedPropertiesToTypesMap();
// recursive processing of TO's attributes
processAttributes(attrs);
this.tos.add(new TOInternal(toAttribute.getType(), attrs));
}
示例13: needsDepResolver
import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; //导入依赖的package包/类
private static boolean needsDepResolver(final AttributeIfc value) {
if(value instanceof TOAttribute) {
return true;
}
if(value instanceof ListAttribute) {
final AttributeIfc innerAttribute = ((ListAttribute) value).getInnerAttribute();
return needsDepResolver(innerAttribute);
}
return false;
}