Cleaned code
This commit is contained in:
parent
16c26ad39f
commit
1376643817
|
@ -48,9 +48,7 @@ public abstract class ElementMapper {
|
||||||
protected static final ObjectMapper mapper;
|
protected static final ObjectMapper mapper;
|
||||||
|
|
||||||
protected static final Map<String, Class<? extends Element>> knownTypes;
|
protected static final Map<String, Class<? extends Element>> knownTypes;
|
||||||
// // protected static final Map<Class<? extends Element>, Class<? extends ElementImpl>> interfaceToImplementation;
|
//
|
||||||
// protected static final Map<String, Class<? extends ElementImpl>> nameToImplementation;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the ObjectMapper
|
* @return the ObjectMapper
|
||||||
*/
|
*/
|
||||||
|
@ -62,18 +60,13 @@ public abstract class ElementMapper {
|
||||||
mapper = new ObjectMapper();
|
mapper = new ObjectMapper();
|
||||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
|
||||||
|
|
||||||
knownTypes = new HashMap<>();
|
knownTypes = new HashMap<>();
|
||||||
//interfaceToImplementation = new HashMap<>();
|
|
||||||
// nameToImplementation = new HashMap<>();
|
|
||||||
|
|
||||||
List<Package> packages = new ArrayList<Package>();
|
List<Package> packages = new ArrayList<Package>();
|
||||||
|
|
||||||
/*
|
|
||||||
Class<Type> tdClz = Type.class;
|
Class<Type> tdClz = Type.class;
|
||||||
ElementMapper.registerSubtypes(tdClz);
|
ElementMapper.registerSubtypes(tdClz);
|
||||||
packages.add(tdClz.getPackage());
|
packages.add(tdClz.getPackage());
|
||||||
*/
|
|
||||||
|
|
||||||
AccessType[] accessTypes = AccessType.values();
|
AccessType[] accessTypes = AccessType.values();
|
||||||
for(AccessType accessType : accessTypes) {
|
for(AccessType accessType : accessTypes) {
|
||||||
|
@ -130,13 +123,6 @@ public abstract class ElementMapper {
|
||||||
public static <El extends Element> void registerSubtypes(Class<El> clz) {
|
public static <El extends Element> void registerSubtypes(Class<El> clz) {
|
||||||
String typeName = TypeMapper.getType(clz);
|
String typeName = TypeMapper.getType(clz);
|
||||||
knownTypes.put(typeName, clz);
|
knownTypes.put(typeName, clz);
|
||||||
|
|
||||||
// if(clz.isAnnotationPresent(JsonDeserialize.class)) {
|
|
||||||
// JsonDeserialize jsonDeserialize = clz.getAnnotation(JsonDeserialize.class);
|
|
||||||
// Class<? extends ElementImpl> impl = (Class<? extends ElementImpl>) jsonDeserialize.as();
|
|
||||||
// nameToImplementation.put(typeName, impl);
|
|
||||||
// }
|
|
||||||
|
|
||||||
mapper.registerSubtypes(clz);
|
mapper.registerSubtypes(clz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue