public static < T extends XNSerializable > List < T > parseList ( XNElement container , String itemName , Supplier < T > creator ) { List < T > result = new ArrayList <> ( ) ; for ( XNElement e : container . childrenWithName ( itemName ) ) { T obj = creator . get ( ) ; obj . load ( e ) ; result . add ( obj ) ; } return result ; }
Parses an container for the given itemName elements and loads them into the given Java XNSerializable object .