private void setupKeys(EntityRegistry registry) {
//        for (Field f : keyRegistry.getDeclaredFields()) {
//            FieldId ann = f.getAnnotation(FieldId.class);
//            if (ann != null) {
//                Object okey;
//                try {
//                    okey = f.get(TKey.class);
//                } catch (IllegalAccessException | IllegalArgumentException ex) {
//                    okey = null;
//                }
//                if (okey == null || !(okey instanceof TKey)) {
//                    continue;
//                }
//
//                TKey key = (TKey) okey;
//
//                elementNames.put(key.getName(), key);
//                if (!baseTypeConverters.containsKey(key.getType()) && !converters.containsKey(key.getType())) {
//                    converters.put(key.getType(), new AnnotationBasedXmlConverter(key.getType()));
//                }
//            }
//        }

        Set<TKey<?, ?>> keys = registry.getAvailableKeys();
        for (TKey<?, ?> key : keys) {
            elementNames.put(key.getName(), key);
            if (!baseTypeConverters.containsKey(key.getType()) && !converters.containsKey(key.getType())) {
//                if (Enum.class.isAssignableFrom(key.getType())) {
//                    converters.put(key.getType(), new BaseTypeEncoderBasedXmlSerializer<String>(new EnumEncoder((Class<? extends Enum>) key.getType())));
//                } else {
                    converters.put(key.getType(), new AnnotationBasedXmlConverter(key.getType()));
//                }
            }
        }
    }