[DEV] remove toStringList

This commit is contained in:
Edouard DUPIN 2021-07-08 14:09:58 +02:00
parent a9b4d39fc0
commit 1c8ad846a3
6 changed files with 13 additions and 47 deletions

View File

@ -75,7 +75,6 @@ public abstract class IntrospectionModel {
return false; return false;
} }
public abstract String toString(final Object data) throws ExmlBuilderException; public abstract String toString(final Object data) throws ExmlBuilderException;
public abstract String[] toStringList(final Object data);
public boolean isEnum() { public boolean isEnum() {
return this.classType.isEnum(); return this.classType.isEnum();
} }

View File

@ -67,9 +67,5 @@ public class IntrospectionModelArray extends IntrospectionModel {
public String toString(final Object data) { public String toString(final Object data) {
return null; return null;
} }
@Override
public String[] toStringList(final Object data) {
return null;
}
} }

View File

@ -43,9 +43,5 @@ public class IntrospectionModelBaseType extends IntrospectionModel {
public String toString(final Object data) { public String toString(final Object data) {
return StringSerializer.toString(data); return StringSerializer.toString(data);
} }
@Override
public String[] toStringList(final Object data) {
return StringSerializer.toStringList(data);
}
} }

View File

@ -906,12 +906,6 @@ public class IntrospectionModelComplex extends IntrospectionModel {
throw new ExmlBuilderException("Error in call 'toString()' for '" + this.classType.getCanonicalName() + "' " + e.getMessage()); throw new ExmlBuilderException("Error in call 'toString()' for '" + this.classType.getCanonicalName() + "' " + e.getMessage());
} }
} }
@Override
public String[] toStringList(final Object data) {
// TODO Auto-generated method stub
return null;
}
} }
class OrderData { class OrderData {

View File

@ -18,17 +18,16 @@ public class IntrospectionModelList extends IntrospectionModel {
@Override @Override
public Object createObject(final Map<String, Object> properties, final Map<String, List<Object>> nodes) throws ExmlBuilderException { public Object createObject(final Map<String, Object> properties, final Map<String, List<Object>> nodes) throws ExmlBuilderException {
if (nodeName == null) { if (this.nodeName == null) {
return nodes.get(IntrospectionObject.STUPID_TOCKEN); return nodes.get(IntrospectionObject.STUPID_TOCKEN);
} else {
return nodes.get(nodeName);
} }
return nodes.get(this.nodeName);
} }
@Override @Override
public List<String> getNodeAvaillable() { public List<String> getNodeAvaillable() {
if (nodeName != null) { if (this.nodeName != null) {
return Arrays.asList(nodeName); return Arrays.asList(this.nodeName);
} }
return null; return null;
} }
@ -51,9 +50,5 @@ public class IntrospectionModelList extends IntrospectionModel {
public String toString(final Object data) { public String toString(final Object data) {
return null; return null;
} }
@Override
public String[] toStringList(final Object data) {
return null;
}
} }

View File

@ -192,28 +192,14 @@ public class GeneratorIntrospection implements Generator {
public void generateNode(final Object data, final IntrospectionModel model, final String nodeName, final StringBuilder tmpp, final int indent) throws ExmlBuilderException { public void generateNode(final Object data, final IntrospectionModel model, final String nodeName, final StringBuilder tmpp, final int indent) throws ExmlBuilderException {
if (model.isNative()) { if (model.isNative()) {
if (model.isList()) { Tools.addIndent(tmpp, indent);
String[] listDatas = model.toStringList(data); tmpp.append("<");
for (int iii=0; iii<listDatas.length; iii++) { tmpp.append(nodeName);
Tools.addIndent(tmpp, indent); tmpp.append(">");
tmpp.append("<"); tmpp.append(model.toString(data));
tmpp.append(nodeName); tmpp.append("</");
tmpp.append(">"); tmpp.append(nodeName);
tmpp.append(listDatas[iii]); tmpp.append(">");
tmpp.append("</");
tmpp.append(nodeName);
tmpp.append(">");
}
} else {
Tools.addIndent(tmpp, indent);
tmpp.append("<");
tmpp.append(nodeName);
tmpp.append(">");
tmpp.append(model.toString(data));
tmpp.append("</");
tmpp.append(nodeName);
tmpp.append(">");
}
} else if (model.isArray()) { } else if (model.isArray()) {
List<String> baseName = model.getNodeAvaillable(); List<String> baseName = model.getNodeAvaillable();
IntrospectionModel introspectionSub = findOrCreate(ModelType.NORMAL, null, model.getClassType()); IntrospectionModel introspectionSub = findOrCreate(ModelType.NORMAL, null, model.getClassType());