X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fyang-jmx-generator%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyangjmxgenerator%2Fattribute%2FJavaAttribute.java;h=3e20e4a55ad47f58e538a33594d1f5d4f0e70d32;hb=616a88111ea9603f0d6f93c7462e6dab39644fcf;hp=325ca9ee06fd1bd9d29d56a94cedc0871aac77c7;hpb=a8e8f161be05a865c5ae364b57e76521944c13cf;p=controller.git diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java index 325ca9ee06..3e20e4a55a 100644 --- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java +++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java @@ -22,7 +22,7 @@ import javax.management.openmbean.SimpleType; public class JavaAttribute extends AbstractAttribute implements TypedAttribute { private final Type type; - private final String nullableDescription, nullableDefault; + private final String nullableDescription, nullableDefault, nullableDefaultWrappedForCode; private final TypeProviderWrapper typeProviderWrapper; private final TypeDefinition typeDefinition; @@ -33,6 +33,7 @@ public class JavaAttribute extends AbstractAttribute implements TypedAttribute { this.typeDefinition = leaf.getType(); this.typeProviderWrapper = typeProviderWrapper; this.nullableDefault = leaf.getDefault(); + this.nullableDefaultWrappedForCode = leaf.getDefault() == null ? null : typeProviderWrapper.getDefault(leaf); this.nullableDescription = leaf.getDescription(); } @@ -42,10 +43,14 @@ public class JavaAttribute extends AbstractAttribute implements TypedAttribute { this.type = typeProviderWrapper.getType(leaf); this.typeDefinition = leaf.getType(); this.typeProviderWrapper = typeProviderWrapper; - this.nullableDefault = null; + this.nullableDefault = nullableDefaultWrappedForCode = null; this.nullableDescription = leaf.getDescription(); } + public TypeDefinition getTypeDefinition() { + return typeDefinition; + } + /** * Returns the most base type */ @@ -56,6 +61,10 @@ public class JavaAttribute extends AbstractAttribute implements TypedAttribute { return baseType; } + public String getNullableDefaultWrappedForCode() { + return nullableDefaultWrappedForCode; + } + @Override public Type getType() { return type;