これが私が使用するパターンです:
enum X {
    A("a"), B("b"), ...;
    private final static Map<String,X> MAP = new HashMap<String,X>();
    static {
        for( X elem: X.values() ) {
            if( null != MAP.put( elem.getValue(), elem ) ) {
                throw new IllegalArgumentException( "Duplicate value " + elem.getValue() );
            }
        }
    }
    private final String value;
    private X(String value) { this.value = value; }
    public String getValue() { return value; }
    // You may want to throw an error here if the map doesn't contain the key
    public static X byValue( String value ) { return MAP.get( value ); } 
}
宣言内のブロック内のenum型のインスタンスにアクセスするのは少し奇妙に見えますが、このコードは機能します。staticenum
あなたの場合、は次のようになります。
String fieldName = Code.valueOf(Code.class).getValue();