[DEV] reaname create model
This commit is contained in:
parent
c3e4b287e4
commit
6bd92d1a57
@ -21,7 +21,7 @@ public class CacheIntrospectionModel {
|
|||||||
} else if (classType.isEnum()) {
|
} else if (classType.isEnum()) {
|
||||||
out = IntrospectionModelFactory.createModelEnum(key);
|
out = IntrospectionModelFactory.createModelEnum(key);
|
||||||
} else {
|
} else {
|
||||||
out = IntrospectionModelFactory.createModelPlop(key);
|
out = IntrospectionModelFactory.createModel(key);
|
||||||
}
|
}
|
||||||
this.elements.put(key, out);
|
this.elements.put(key, out);
|
||||||
return out;
|
return out;
|
||||||
|
@ -6,22 +6,7 @@ import org.atriasoft.exml.exception.ExmlBuilderException;
|
|||||||
|
|
||||||
public class IntrospectionModelFactory {
|
public class IntrospectionModelFactory {
|
||||||
private IntrospectionModelFactory() {}
|
private IntrospectionModelFactory() {}
|
||||||
|
|
||||||
public static IntrospectionModel createModelsssss(final MapKey modelType) throws ExmlBuilderException {
|
|
||||||
/*
|
|
||||||
if (modelType.model() == ModelType.ARRAY) {
|
|
||||||
return new IntrospectionModelArray(modelType.type());
|
|
||||||
}
|
|
||||||
if (modelType.model() == ModelType.LIST) {
|
|
||||||
return new IntrospectionModelList(modelType.type());
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (StringSerializer.contains(modelType.type())) {
|
|
||||||
return new IntrospectionModelBaseType(modelType.type());
|
|
||||||
}
|
|
||||||
return new IntrospectionModelComplex(modelType.type());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IntrospectionModel createModelArray(final String nodeName, final MapKey modelType) throws ExmlBuilderException {
|
public static IntrospectionModel createModelArray(final String nodeName, final MapKey modelType) throws ExmlBuilderException {
|
||||||
return new IntrospectionModelArray(nodeName, modelType.type());
|
return new IntrospectionModelArray(nodeName, modelType.type());
|
||||||
}
|
}
|
||||||
@ -33,7 +18,7 @@ public class IntrospectionModelFactory {
|
|||||||
return new IntrospectionModelComplex(modelType.type());
|
return new IntrospectionModelComplex(modelType.type());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IntrospectionModel createModelPlop(final MapKey modelType) throws ExmlBuilderException {
|
public static IntrospectionModel createModel(final MapKey modelType) throws ExmlBuilderException {
|
||||||
if (StringSerializer.contains(modelType.type())) {
|
if (StringSerializer.contains(modelType.type())) {
|
||||||
return new IntrospectionModelBaseType(modelType.type());
|
return new IntrospectionModelBaseType(modelType.type());
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ public class GeneratorIntrospection implements Generator {
|
|||||||
this.rootClassType = classType;
|
this.rootClassType = classType;
|
||||||
MapKey key = new MapKey(model, classType);
|
MapKey key = new MapKey(model, classType);
|
||||||
// TODO pb if it is a List or an Array ...
|
// TODO pb if it is a List or an Array ...
|
||||||
this.elements.put(key, IntrospectionModelFactory.createModelPlop(key));
|
this.elements.put(key, IntrospectionModelFactory.createModel(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
IntrospectionModel findOrCreate(final ModelType model, final String name, final Class<?> classType) throws ExmlBuilderException {
|
IntrospectionModel findOrCreate(final ModelType model, final String name, final Class<?> classType) throws ExmlBuilderException {
|
||||||
@ -40,7 +40,7 @@ public class GeneratorIntrospection implements Generator {
|
|||||||
} else if (model == ModelType.LIST) {
|
} else if (model == ModelType.LIST) {
|
||||||
out = IntrospectionModelFactory.createModelList(key.nodeName(), key);
|
out = IntrospectionModelFactory.createModelList(key.nodeName(), key);
|
||||||
} else {
|
} else {
|
||||||
out = IntrospectionModelFactory.createModelPlop(key);
|
out = IntrospectionModelFactory.createModel(key);
|
||||||
}
|
}
|
||||||
this.elements.put(key, out);
|
this.elements.put(key, out);
|
||||||
return out;
|
return out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user