本文整理汇总了Java中org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc.getClass方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeIfc.getClass方法的具体用法?Java AttributeIfc.getClass怎么用?Java AttributeIfc.getClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc
的用法示例。
在下文中一共展示了AttributeIfc.getClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getReturnType
import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc; //导入方法依赖的package包/类
private static String getReturnType(final AttributeIfc attributeIfc) {
String returnType;
if (attributeIfc instanceof TypedAttribute) {
final Type type = ((TypedAttribute) attributeIfc).getType();
returnType = serializeType(type);
} else if (attributeIfc == VoidAttribute.getInstance()) {
return "void";
} else {
throw new UnsupportedOperationException(
"Attribute not supported: "
+ attributeIfc.getClass());
}
return returnType;
}
示例2: processAttributes
import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc; //导入方法依赖的package包/类
void processAttributes(final Map<String, AttributeIfc> attributes) {
for (final Entry<String, AttributeIfc> attrEntry : attributes.entrySet()) {
String returnType;
final AttributeIfc attributeIfc = attrEntry.getValue();
if (attributeIfc instanceof TypedAttribute) {
final TypedAttribute typedAttribute = (TypedAttribute) attributeIfc;
returnType = serializeType(typedAttribute.getType());
if ((attributeIfc instanceof JavaAttribute) && ((JavaAttribute)attrEntry.getValue()).isIdentityRef()) {
returnType = serializeType(identityRefType);
}
} else {
throw new UnsupportedOperationException(
"Attribute not supported: "
+ attributeIfc.getClass());
}
final String getterName = "get"
+ attributeIfc.getUpperCaseCammelCase();
final MethodDeclaration getter = new MethodDeclaration(returnType,
getterName, Collections.<Field> emptyList());
final String varName = BindingMapping.getPropertyName(attrEntry.getKey());
final String setterName = "set"
+ attributeIfc.getUpperCaseCammelCase();
final MethodDeclaration setter = new MethodDeclaration("void",
setterName, Lists.newArrayList(new Field(returnType,
varName)));
this.methods.add(getter);
this.methods.add(setter);
if (attributeIfc.getNullableDescription() != null) {
setter.setJavadoc(attrEntry.getValue()
.getNullableDescription());
}
}
}
示例3: getIllegalArgumentException
import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc; //导入方法依赖的package包/类
private IllegalArgumentException getIllegalArgumentException(final AttributeIfc attributeIfc) {
return new IllegalArgumentException("Unknown attribute type " + attributeIfc.getClass() + ", " + attributeIfc
+ " with open type:" + attributeIfc.getOpenType());
}