Package ma.glasnost.orika.impl.generator

Examples of ma.glasnost.orika.impl.generator.MultiOccurrenceVariableRef.declare()


         *  fill it, and then assign it to the destination using the setter.
         */
      
        MultiOccurrenceVariableRef newDest = new MultiOccurrenceVariableRef(d.type(), "new_" + d.name());
        if (d.isAssignable()) {
            out.append(statement(newDest.declare(d.newInstance(source.size()))));
        } else {
            out.append(statement(newDest.declare(""+d)));
            out.append(statement("%s.clear()", newDest));
        }
       
View Full Code Here


      
        MultiOccurrenceVariableRef newDest = new MultiOccurrenceVariableRef(d.type(), "new_" + d.name());
        if (d.isAssignable()) {
            out.append(statement(newDest.declare(d.newInstance(source.size()))));
        } else {
            out.append(statement(newDest.declare(""+d)));
            out.append(statement("%s.clear()", newDest));
        }
       
        if (s.isArray()) {
            if (s.elementType().isPrimitive()) {
View Full Code Here

        out.append(s.ifNotNull());
        out.append("{\n");
       
        MultiOccurrenceVariableRef newDest = new MultiOccurrenceVariableRef(destination.type(), "new_" + destination.name());
        if (d.isAssignable()) {
            out.append(statement(newDest.declare(d.newMap())));
        } else {
            out.append(statement(newDest.declare(d)));
            out.append(statement("%s.clear()", newDest));
        }
       
View Full Code Here

       
        MultiOccurrenceVariableRef newDest = new MultiOccurrenceVariableRef(destination.type(), "new_" + destination.name());
        if (d.isAssignable()) {
            out.append(statement(newDest.declare(d.newMap())));
        } else {
            out.append(statement(newDest.declare(d)));
            out.append(statement("%s.clear()", newDest));
        }
       
       
        if (d.mapKeyType().equals(s.mapKeyType()) && d.mapValueType().equals(s.mapValueType())) {
View Full Code Here

       
        append(out,
                s.ifNotNull() + " {");
       
        if (d.isAssignable()) {
            out.append(statement(newDest.declare(newDest.newInstance(d.newMap()))));
        } else {
            out.append(statement(newDest.declare(d)));
            out.append(statement("%s.clear()", newDest));
        }
       
View Full Code Here

                s.ifNotNull() + " {");
       
        if (d.isAssignable()) {
            out.append(statement(newDest.declare(newDest.newInstance(d.newMap()))));
        } else {
            out.append(statement(newDest.declare(d)));
            out.append(statement("%s.clear()", newDest));
        }
       
        VariableRef element = new VariableRef(s.elementType(), "source" + StringUtil.capitalize(s.name()) + "Element");
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.