src/main/java/com/poiji/bind/mapping/PoijiHandler.java
private Object getInstance(Field field) {
        Object ins = null;
        try {
            if (fieldInstances.containsKey(field.getName())) {
                ins = fieldInstances.get(field.getName());
            } else {
                ins = field.getType().getDeclaredConstructor().newInstance();
                fieldInstances.put(field.getName(), ins);
            }
        } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException
                | InstantiationException e) {
            throw new PoijiInstantiationException("Cannot create a new instance of " + type.getName());
        }
        return ins;
    }
private Object getInstance(Field field) {
        Object ins = null;
        try {
            if (fieldInstances.containsKey(field.getName())) {
                ins = fieldInstances.get(field.getName());
            } else {
                ins = field.getType().getDeclaredConstructor().newInstance();
                fieldInstances.put(field.getName(), ins);
            }
        } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException
                | InstantiationException e) {
            throw new PoijiInstantiationException("Cannot create a new instance of " + type.getName());
        }
        return ins;
    }
private Object getInstance ( Field field ) { Object ins = null ; try { if ( fieldInstances . containsKey ( field . getName ( ) ) ) { ins = fieldInstances . get ( field . getName ( ) ) ; } else { ins = field . getType ( ) . getDeclaredConstructor ( ) . newInstance ( ) ; fieldInstances . put ( field . getName ( ) , ins ) ; } } catch ( NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException e ) { throw new PoijiInstantiationException ( "Cannot create a new instance of " + type . getName ( ) ) ; } return ins ; }
Using this to hold inner objects that will be mapped to the main object
*
Using this to hold inner objects that will be mapped to the main object *