Special character like "/", no processing but just transferred to java name like "a/n"

asked 2015-04-30 02:10:38 -0700

Yesmanlucky gravatar image

an enum like "n/a" would be transferred to a java variable like N/A, "n-a" would be NA while ODL tool processing. Why do not the ODL have a processing about "/" character? is there any way to make ODL support "/" escaping?

Thanks,

yang define typedef Test_Timezone { description "test"; type enumeration { enum "n/a" { description "N/A"; value "0"; } enum "Africa/Asmara" { description "Africa Asmara"; value 145; } }

    exa:type-mode ENUM;
}

java src code public enum TestTimezone { /** * N/A */ N/a(0),

/**
 * Africa Asmara
 */
Africa/Asmara(145)
;


int value;
private static final java.util.Map<java.lang.Integer, TestTimezone> VALUE_MAP;

static {
    final com.google.common.collect.ImmutableMap.Builder<java.lang.Integer, TestTimezone> b = com.google.common.collect.ImmutableMap.builder();
    for (TestTimezone enumItem : TestTimezone.values())
    {
        b.put(enumItem.value, enumItem);
    }

    VALUE_MAP = b.build();
}

private TestTimezone(int value) {
    this.value = value;
}

/**
 * @return integer value
 */
public int getIntValue() {
    return value;
}

/**
 * @param valueArg
 * @return corresponding TestTimezone item
 */
public static TestTimezone forValue(int valueArg) {
    return VALUE_MAP.get(valueArg);
}

} public enum TestTimezone { /** * N/A */ N/a(0),

/**
 * Africa Asmara
 */
Africa/Asmara(145)
;


int value;
private static final java.util.Map<java.lang.Integer, TestTimezone> VALUE_MAP;

static {
    final com.google.common.collect.ImmutableMap.Builder<java.lang.Integer, TestTimezone> b = com.google.common.collect.ImmutableMap.builder();
    for (TestTimezone enumItem : TestTimezone.values())
    {
        b.put(enumItem.value, enumItem);
    }

    VALUE_MAP = b.build();
}

private TestTimezone(int value) {
    this.value = value;
}

/**
 * @return integer value
 */
public int getIntValue() {
    return value;
}

/**
 * @param valueArg
 * @return corresponding TestTimezone item
 */
public static TestTimezone forValue(int valueArg) {
    return VALUE_MAP.get(valueArg);
}

}

edit retag flag offensive close merge delete