Currently I'm mapping an entire list of items, but is there a way for
me to only map items whose val is true?
public Object fromElement(XMLSimpleReader reader, MappingContext mappingContext, String defaultValue,I'm assuming here that you have a class Item with Item(String id, String val) consructor.
String format, Class targetType, Object targetObject) {
String id = reader.getAttribute(new QName("id"));
String val = reader.getAttribute(new QName("val"));
if(val.equals("true")) return new Item (id, val);
// result is not used if it's null
return null;
}