diff --git a/xjx-serdes/src/main/java/io/jonasg/xjx/serdes/deserialize/PathWriterIndexFactory.java b/xjx-serdes/src/main/java/io/jonasg/xjx/serdes/deserialize/PathWriterIndexFactory.java index 63c4b1a..24b9383 100644 --- a/xjx-serdes/src/main/java/io/jonasg/xjx/serdes/deserialize/PathWriterIndexFactory.java +++ b/xjx-serdes/src/main/java/io/jonasg/xjx/serdes/deserialize/PathWriterIndexFactory.java @@ -189,34 +189,6 @@ private void indexSimpleType(FieldReflector field, Map index, } private void indexSetType(FieldReflector field, Map index, Path parentPath, Supplier parent) { -// Collection set = new HashSet<>(); -// Path path = getPathForField(field, parentPath); -// var pathWriter = PathWriter.objectInitializer(() -> { -// FieldAccessor.of(field, parent.get()).set(set); -// return set; -// }); -// if (parentPath.isRoot()) { -// pathWriter.setRootInitializer(() -> { -// FieldAccessor.of(field, parent.get()).set(set); -// return parent.get(); -// }); -// } -// index.put(path, pathWriter); -// Type actualTypeArgument = ((ParameterizedType) field.genericType()).getActualTypeArguments()[0]; -// Class typeArgument = (Class) actualTypeArgument; -// var tag = Reflector.reflect(typeArgument).annotation(Tag.class); -// if (tag != null) { -// Supplier listTypeInstanceSupplier = collectionSupplierForType(typeArgument); -// index.put(Path.parse(tag.path()), PathWriter.objectInitializer(() -> { -// collectionCacheType.clear(); -// Object listTypeInstance = listTypeInstanceSupplier.get(); -// set.add(listTypeInstance); -// return listTypeInstance; -// })); -// doBuildIndex(typeArgument, Path.parse(tag.path()), index, listTypeInstanceSupplier); -// } else { -// throw new XjxDeserializationException("Generics of type Set require @Tag pointing to mapped XML path (" + typeArgument.getSimpleName() + ")"); -// } Collection set = new HashSet<>(); Path path = getPathForField(field, parentPath); var pathWriter = PathWriter.objectInitializer(() -> { diff --git a/xjx-serdes/src/main/java/io/jonasg/xjx/serdes/deserialize/TypedValueMapSaxHandler.java b/xjx-serdes/src/main/java/io/jonasg/xjx/serdes/deserialize/TypedValueMapSaxHandler.java index 4831312..2acb286 100644 --- a/xjx-serdes/src/main/java/io/jonasg/xjx/serdes/deserialize/TypedValueMapSaxHandler.java +++ b/xjx-serdes/src/main/java/io/jonasg/xjx/serdes/deserialize/TypedValueMapSaxHandler.java @@ -1,6 +1,5 @@ package io.jonasg.xjx.serdes.deserialize; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -10,25 +9,19 @@ public class TypedValueMapSaxHandler implements SaxHandler { - private final LinkedList> mapsStack; - - private final Class valueType; - private PathBasedSaxHandler objectPathBasedSaxHandler; + private final Class valueType; + private final Map instance; - private Map instance; + private PathBasedSaxHandler objectPathBasedSaxHandler; private String activeKey; - private String rootTag; - - public TypedValueMapSaxHandler(MapWithTypeInfo instance) { - this.mapsStack = new LinkedList<>(); - this.instance = instance.map(); + public TypedValueMapSaxHandler(MapWithTypeInfo instance) { + this.instance = instance.map(); this.valueType = instance.valueType(); } - @Override public void startDocument() { }