本文整理汇总了Java中org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc.getUpperCaseCammelCase方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeIfc.getUpperCaseCammelCase方法的具体用法?Java AttributeIfc.getUpperCaseCammelCase怎么用?Java AttributeIfc.getUpperCaseCammelCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc
的用法示例。
在下文中一共展示了AttributeIfc.getUpperCaseCammelCase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
}
}
示例2: getTOAndMXInterfaceFtlFiles
import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc; //导入方法依赖的package包/类
/**
* Get map of file name as key, FtlFile instance representing runtime mx
* bean as value that should be persisted from this instance.
*/
public static Map<String, FtlTemplate> getTOAndMXInterfaceFtlFiles(
final RuntimeBeanEntry entry) {
final Map<String, FtlTemplate> result = new HashMap<>();
{ // create GeneralInterfaceFtlFile for runtime MXBean. Attributes will
// be transformed to getter methods
final String mxBeanTypeName = entry.getJavaNameOfRuntimeMXBean();
final List<String> extendedInterfaces = Collections.singletonList(RuntimeBean.class
.getCanonicalName());
final List<MethodDeclaration> methods = new ArrayList<>();
// convert attributes to getters
for (final AttributeIfc attributeIfc : entry.getAttributes()) {
String returnType;
returnType = getReturnType(attributeIfc);
final String getterName = "get"
+ attributeIfc.getUpperCaseCammelCase();
final MethodDeclaration getter = new MethodDeclaration(returnType,
getterName, Collections.<Field> emptyList());
methods.add(getter);
}
// add rpc methods
for (final Rpc rpc : entry.getRpcs()) {
// convert JavaAttribute parameters into fields
final List<Field> fields = new ArrayList<>();
for (final JavaAttribute ja : rpc.getParameters()) {
final Field field = new Field(Collections.emptyList(),
ja.getType().getFullyQualifiedName(),
ja.getLowerCaseCammelCase(), ja.getNullableDefaultWrappedForCode());
fields.add(field);
}
final MethodDeclaration operation = new MethodDeclaration(
getReturnType(rpc.getReturnType()), rpc.getName(), fields);
methods.add(operation);
}
// FIXME header
final GeneralInterfaceTemplate runtimeMxBeanIfc = new GeneralInterfaceTemplate(
null, entry.getPackageName(), mxBeanTypeName,
extendedInterfaces, methods);
result.put(runtimeMxBeanIfc.getTypeDeclaration().getName()
+ ".java", runtimeMxBeanIfc);
}
result.putAll(TemplateFactory.tOsFromRbe(entry));
return result;
}