private void generateEnumDecoder(
        final StringBuilder sb,
        final boolean inComposite,
        final CharSequence accessOrderListenerCall,
        final Token fieldToken,
        final String propertyName,
        final Token typeToken,
        final String indent)
    {
        final String enumName = formatClassName(typeToken.applicableTypeName());
        final Encoding encoding = typeToken.encoding();
        final String javaTypeName = javaTypeName(encoding.primitiveType());

        if (fieldToken.isConstantEncoding())
        {
            final String enumValueStr = formatClassName(
                fieldToken.encoding().constValue().toString());

            new Formatter(sb).format(
                "\n" +
                indent + "    public %s %sRaw()\n" +
                indent + "    {\n" +
                indent + "        return %s.value();\n" +
                indent + "    }\n\n",
                javaTypeName,
                propertyName,
                enumValueStr);

            new Formatter(sb).format(
                "\n" +
                indent + "    public %s %s()\n" +
                indent + "    {\n" +
                indent + "        return %s;\n" +
                indent + "    }\n\n",
                enumName,
                propertyName,
                enumValueStr);
        }
        else
        {
            final String rawGetStr = generateGet(
                encoding.primitiveType(), "offset + " + typeToken.offset(), byteOrderString(encoding));

            new Formatter(sb).format(
                "\n" +
                indent + "    public %s %sRaw()\n" +
                indent + "    {\n" +
                "%s" +
                "%s" +
                indent + "        return %s;\n" +
                indent + "    }\n",
                javaTypeName,
                formatPropertyName(propertyName),
                generateFieldNotPresentCondition(inComposite, fieldToken.version(), encoding, indent),
                accessOrderListenerCall,
                rawGetStr);

            new Formatter(sb).format(
                "\n" +
                indent + "    public %s %s()\n" +
                indent + "    {\n" +
                "%s" +
                "%s" +
                indent + "        return %s.get(%s);\n" +
                indent + "    }\n\n",
                enumName,
                propertyName,
                generatePropertyNotPresentCondition(inComposite, DECODER, fieldToken, enumName, indent),
                accessOrderListenerCall,
                enumName,
                rawGetStr);
        }
    }
\n" +
                "     * Field presence indication. Can be optional, required, or constant.\n" +
                "
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java