Cleaning code
This commit is contained in:
parent
1376643817
commit
0e6b9f4854
|
@ -65,9 +65,10 @@ public abstract class ElementMapper {
|
|||
List<Package> packages = new ArrayList<Package>();
|
||||
|
||||
Class<Type> tdClz = Type.class;
|
||||
ElementMapper.registerSubtypes(tdClz);
|
||||
ElementMapper.registerSubtype(tdClz);
|
||||
packages.add(tdClz.getPackage());
|
||||
|
||||
|
||||
AccessType[] accessTypes = AccessType.values();
|
||||
for(AccessType accessType : accessTypes) {
|
||||
@SuppressWarnings("rawtypes")
|
||||
|
@ -77,15 +78,15 @@ public abstract class ElementMapper {
|
|||
if(dummyClz != null) {
|
||||
ElementMapper.registerSubtypes(clz, dummyClz);
|
||||
}else {
|
||||
ElementMapper.registerSubtypes(clz);
|
||||
ElementMapper.registerSubtype(clz);
|
||||
}
|
||||
packages.add(clz.getPackage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
registerPackages(packages);
|
||||
|
||||
|
||||
ServiceLoader<? extends RegistrationProvider> regsitrationProviders = ServiceLoader
|
||||
.load(RegistrationProvider.class);
|
||||
for(RegistrationProvider registrationProvider : regsitrationProviders) {
|
||||
|
@ -117,10 +118,10 @@ public abstract class ElementMapper {
|
|||
SimpleModule isModule = new SimpleModule(typeName);
|
||||
isModule.addDeserializer(clz, new ElementDeserializer<>(clz, mapper));
|
||||
mapper.registerModule(isModule);
|
||||
registerSubtypes(implementationClass);
|
||||
registerSubtype(implementationClass);
|
||||
}
|
||||
|
||||
public static <El extends Element> void registerSubtypes(Class<El> clz) {
|
||||
public static <El extends Element> void registerSubtype(Class<El> clz) {
|
||||
String typeName = TypeMapper.getType(clz);
|
||||
knownTypes.put(typeName, clz);
|
||||
mapper.registerSubtypes(clz);
|
||||
|
|
|
@ -20,19 +20,19 @@ class ElementMappingAction implements SchemaAction {
|
|||
@Override
|
||||
public <P extends PropertyElement> void managePropertyClass(Class<P> e)
|
||||
throws Exception {
|
||||
ElementMapper.registerSubtypes(e);
|
||||
ElementMapper.registerSubtype(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E extends EntityElement> void manageEntityClass(Class<E> e)
|
||||
throws Exception {
|
||||
ElementMapper.registerSubtypes(e);
|
||||
ElementMapper.registerSubtype(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R extends RelationElement<? extends EntityElement, ? extends EntityElement>> void manageRelationClass(
|
||||
Class<R> r) throws Exception {
|
||||
ElementMapper.registerSubtypes(r);
|
||||
ElementMapper.registerSubtype(r);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue