Java Code Examples for com.sun.codemodel.internal.JBlock#decl()

The following examples show how to use com.sun.codemodel.internal.JBlock#decl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ElementCollectionAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void toRawValue(JBlock block, JVar $var) {
    JCodeModel cm = outline().getCodeModel();
    JClass elementType = ei.toType(outline(),EXPOSED).boxify();

    // [RESULT]
    // $var = new ArrayList();
    // for( JAXBElement e : [core.toRawValue] ) {
    //   if(e==null)
    //     $var.add(null);
    //   else
    //     $var.add(e.getValue());
    // }

    block.assign($var,JExpr._new(cm.ref(ArrayList.class).narrow(itemType().boxify())));
    JVar $col = block.decl(core.getRawType(), "col" + hashCode());
    acc.toRawValue(block,$col);
    JForEach loop = block.forEach(elementType, "v" + hashCode()/*unique string handling*/, $col);

    JConditional cond = loop.body()._if(loop.var().eq(JExpr._null()));
    cond._then().invoke($var,"add").arg(JExpr._null());
    cond._else().invoke($var,"add").arg(loop.var().invoke("getValue"));
}
 
Example 2
Source File: ElementCollectionAdapter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
    JCodeModel cm = outline().getCodeModel();
    JClass elementType = ei.toType(outline(),EXPOSED).boxify();

    // [RESULT]
    // $t = new ArrayList();
    // for( Type e : $var ) {
    //     $var.add(new JAXBElement(e));
    // }
    // [core.fromRawValue]

    JClass col = cm.ref(ArrayList.class).narrow(elementType);
    JVar $t = block.decl(col,uniqueName+"_col",JExpr._new(col));

    JForEach loop = block.forEach(itemType(), uniqueName+"_i", $t);
    loop.body().invoke($var,"add").arg(createJAXBElement(loop.var()));

    acc.fromRawValue(block, uniqueName, $t);
}
 
Example 3
Source File: ElementCollectionAdapter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void toRawValue(JBlock block, JVar $var) {
    JCodeModel cm = outline().getCodeModel();
    JClass elementType = ei.toType(outline(),EXPOSED).boxify();

    // [RESULT]
    // $var = new ArrayList();
    // for( JAXBElement e : [core.toRawValue] ) {
    //   if(e==null)
    //     $var.add(null);
    //   else
    //     $var.add(e.getValue());
    // }

    block.assign($var,JExpr._new(cm.ref(ArrayList.class).narrow(itemType().boxify())));
    JVar $col = block.decl(core.getRawType(), "col" + hashCode());
    acc.toRawValue(block,$col);
    JForEach loop = block.forEach(elementType, "v" + hashCode()/*unique string handling*/, $col);

    JConditional cond = loop.body()._if(loop.var().eq(JExpr._null()));
    cond._then().invoke($var,"add").arg(JExpr._null());
    cond._else().invoke($var,"add").arg(loop.var().invoke("getValue"));
}
 
Example 4
Source File: ServiceGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void writeResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(wsdlLocation));
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null()));
    ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(
            "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath."));
    staticBlock.assign(exField, exVar);
}
 
Example 5
Source File: ServiceGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void writeAbsWSDLLocation(JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());

    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    catchBlock.param("ex");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(JExpr.ref("ex")));

    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
 
Example 6
Source File: ServiceGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void writeClassLoaderBaseResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(".")).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    JVar murlVar = catchBlock.param("murl");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(murlVar));
    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
 
Example 7
Source File: ServiceGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void writeAbsWSDLLocation(JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());

    JTryBlock tryBlock = staticBlock._try();
    tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(wsdlLocation));
    JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
    catchBlock.param("ex");
    catchBlock.body().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(JExpr.ref("ex")));

    staticBlock.assign(urlField, urlVar);
    staticBlock.assign(exField, exVar);
}
 
Example 8
Source File: ServiceGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void writeResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getResource").arg(wsdlLocation));
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null()));
    ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(
            "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath."));
    staticBlock.assign(exField, exVar);
}
 
Example 9
Source File: ServiceGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void writeClassLoaderResourceWSDLLocation(String className, JDefinedClass cls, JFieldVar urlField, JFieldVar exField) {
    JBlock staticBlock = cls.init();
    staticBlock.assign(urlField, JExpr.dotclass(cm.ref(className)).invoke("getClassLoader").invoke("getResource").arg(wsdlLocation));
    JVar exVar = staticBlock.decl(cm.ref(WebServiceException.class), "e", JExpr._null());
    JConditional ifBlock = staticBlock._if(urlField.eq(JExpr._null()));
    ifBlock._then().assign(exVar, JExpr._new(cm.ref(WebServiceException.class)).arg(
            "Cannot find "+JExpr.quotify('\'', wsdlLocation)+" wsdl. Place the resource correctly in the classpath."));
    staticBlock.assign(exField, exVar);
}
 
Example 10
Source File: UntypedListField.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
    // [RESULT]
    // bean.getLIST().addAll($<var>);
    JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
    block.invoke($list,"addAll").arg($var);
}
 
Example 11
Source File: UntypedListField.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
    // [RESULT]
    // bean.getLIST().addAll($<var>);
    JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
    block.invoke($list,"addAll").arg($var);
}
 
Example 12
Source File: ArrayField.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void generateAccessors() {

        MethodWriter writer = outline.createMethodWriter();
        Accessor acc = create(JExpr._this());
        JVar $idx,$value; JBlock body;

        // [RESULT] T[] getX() {
        //     if( <var>==null )    return new T[0];
        //     T[] retVal = new T[this._return.length] ;
        //     System.arraycopy(this._return, 0, "retVal", 0, this._return.length);
        //     return (retVal);
        // }
        $getAll = writer.declareMethod( exposedType.array(),"get"+prop.getName(true));
        writer.javadoc().append(prop.javadoc);
        body = $getAll.body();

        body._if( acc.ref(true).eq(JExpr._null()) )._then()
            ._return(JExpr.newArray(exposedType,0));
        JVar var = body.decl(exposedType.array(), "retVal", JExpr.newArray(implType,acc.ref(true).ref("length")));
        body.add(codeModel.ref(System.class).staticInvoke("arraycopy")
                        .arg(acc.ref(true)).arg(JExpr.lit(0))
                        .arg(var)
                        .arg(JExpr.lit(0)).arg(acc.ref(true).ref("length")));
        body._return(JExpr.direct("retVal"));

        List<Object> returnTypes = listPossibleTypes(prop);
        writer.javadoc().addReturn().append("array of\n").append(returnTypes);

        // [RESULT]
        // ET getX(int idx) {
        //     if( <var>==null )    throw new IndexOutOfBoundsException();
        //     return unbox(<var>.get(idx));
        // }
        JMethod $get = writer.declareMethod(exposedType,"get"+prop.getName(true));
        $idx = writer.addParameter(codeModel.INT,"idx");

        $get.body()._if(acc.ref(true).eq(JExpr._null()))._then()
            ._throw(JExpr._new(codeModel.ref(IndexOutOfBoundsException.class)));

        writer.javadoc().append(prop.javadoc);
        $get.body()._return(acc.ref(true).component($idx));

        writer.javadoc().addReturn().append("one of\n").append(returnTypes);

        // [RESULT] int getXLength() {
        //     if( <var>==null )    throw new IndexOutOfBoundsException();
        //     return <ref>.length;
        // }
        JMethod $getLength = writer.declareMethod(codeModel.INT,"get"+prop.getName(true)+"Length");
        $getLength.body()._if(acc.ref(true).eq(JExpr._null()))._then()
                ._return(JExpr.lit(0));
        $getLength.body()._return(acc.ref(true).ref("length"));

        // [RESULT] void setX(ET[] values) {
        //     int len = values.length;
        //     for( int i=0; i<len; i++ )
        //         <ref>[i] = values[i];
        // }
        $setAll = writer.declareMethod(
            codeModel.VOID,
            "set"+prop.getName(true));

        writer.javadoc().append(prop.javadoc);
        $value = writer.addParameter(exposedType.array(),"values");
        JVar $len = $setAll.body().decl(codeModel.INT,"len", $value.ref("length"));

        $setAll.body().assign(
                (JAssignmentTarget) acc.ref(true),
                castToImplTypeArray(JExpr.newArray(
                    codeModel.ref(exposedType.erasure().fullName()),
                    $len)));

        JForLoop _for = $setAll.body()._for();
        JVar $i = _for.init( codeModel.INT, "i", JExpr.lit(0) );
        _for.test( JOp.lt($i,$len) );
        _for.update( $i.incr() );
        _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i))));

        writer.javadoc().addParam($value)
            .append("allowed objects are\n")
            .append(returnTypes);

        // [RESULT] ET setX(int idx, ET value)
        // <ref>[idx] = value
        JMethod $set = writer.declareMethod(
            exposedType,
            "set"+prop.getName(true));
        $idx = writer.addParameter( codeModel.INT, "idx" );
        $value = writer.addParameter( exposedType, "value" );

        writer.javadoc().append(prop.javadoc);

        body = $set.body();
        body._return( JExpr.assign(acc.ref(true).component($idx),
                                   castToImplType(acc.box($value))));

        writer.javadoc().addParam($value)
            .append("allowed object is\n")
            .append(returnTypes);

    }
 
Example 13
Source File: ArrayField.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void generateAccessors() {

        MethodWriter writer = outline.createMethodWriter();
        Accessor acc = create(JExpr._this());
        JVar $idx,$value; JBlock body;

        // [RESULT] T[] getX() {
        //     if( <var>==null )    return new T[0];
        //     T[] retVal = new T[this._return.length] ;
        //     System.arraycopy(this._return, 0, "retVal", 0, this._return.length);
        //     return (retVal);
        // }
        $getAll = writer.declareMethod( exposedType.array(),"get"+prop.getName(true));
        writer.javadoc().append(prop.javadoc);
        body = $getAll.body();

        body._if( acc.ref(true).eq(JExpr._null()) )._then()
            ._return(JExpr.newArray(exposedType,0));
        JVar var = body.decl(exposedType.array(), "retVal", JExpr.newArray(implType,acc.ref(true).ref("length")));
        body.add(codeModel.ref(System.class).staticInvoke("arraycopy")
                        .arg(acc.ref(true)).arg(JExpr.lit(0))
                        .arg(var)
                        .arg(JExpr.lit(0)).arg(acc.ref(true).ref("length")));
        body._return(JExpr.direct("retVal"));

        List<Object> returnTypes = listPossibleTypes(prop);
        writer.javadoc().addReturn().append("array of\n").append(returnTypes);

        // [RESULT]
        // ET getX(int idx) {
        //     if( <var>==null )    throw new IndexOutOfBoundsException();
        //     return unbox(<var>.get(idx));
        // }
        JMethod $get = writer.declareMethod(exposedType,"get"+prop.getName(true));
        $idx = writer.addParameter(codeModel.INT,"idx");

        $get.body()._if(acc.ref(true).eq(JExpr._null()))._then()
            ._throw(JExpr._new(codeModel.ref(IndexOutOfBoundsException.class)));

        writer.javadoc().append(prop.javadoc);
        $get.body()._return(acc.ref(true).component($idx));

        writer.javadoc().addReturn().append("one of\n").append(returnTypes);

        // [RESULT] int getXLength() {
        //     if( <var>==null )    throw new IndexOutOfBoundsException();
        //     return <ref>.length;
        // }
        JMethod $getLength = writer.declareMethod(codeModel.INT,"get"+prop.getName(true)+"Length");
        $getLength.body()._if(acc.ref(true).eq(JExpr._null()))._then()
                ._return(JExpr.lit(0));
        $getLength.body()._return(acc.ref(true).ref("length"));

        // [RESULT] void setX(ET[] values) {
        //     int len = values.length;
        //     for( int i=0; i<len; i++ )
        //         <ref>[i] = values[i];
        // }
        $setAll = writer.declareMethod(
            codeModel.VOID,
            "set"+prop.getName(true));

        writer.javadoc().append(prop.javadoc);
        $value = writer.addParameter(exposedType.array(),"values");
        JVar $len = $setAll.body().decl(codeModel.INT,"len", $value.ref("length"));

        $setAll.body().assign(
                (JAssignmentTarget) acc.ref(true),
                castToImplTypeArray(JExpr.newArray(
                    codeModel.ref(exposedType.erasure().fullName()),
                    $len)));

        JForLoop _for = $setAll.body()._for();
        JVar $i = _for.init( codeModel.INT, "i", JExpr.lit(0) );
        _for.test( JOp.lt($i,$len) );
        _for.update( $i.incr() );
        _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i))));

        writer.javadoc().addParam($value)
            .append("allowed objects are\n")
            .append(returnTypes);

        // [RESULT] ET setX(int idx, ET value)
        // <ref>[idx] = value
        JMethod $set = writer.declareMethod(
            exposedType,
            "set"+prop.getName(true));
        $idx = writer.addParameter( codeModel.INT, "idx" );
        $value = writer.addParameter( exposedType, "value" );

        writer.javadoc().append(prop.javadoc);

        body = $set.body();
        body._return( JExpr.assign(acc.ref(true).component($idx),
                                   castToImplType(acc.box($value))));

        writer.javadoc().addParam($value)
            .append("allowed object is\n")
            .append(returnTypes);

    }
 
Example 14
Source File: NoExtendedContentField.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
    // [RESULT]
    // bean.getLIST().addAll($<var>);
    JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
    block.invoke($list,"addAll").arg($var);
}
 
Example 15
Source File: ArrayField.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void generateAccessors() {

        MethodWriter writer = outline.createMethodWriter();
        Accessor acc = create(JExpr._this());
        JVar $idx,$value; JBlock body;

        // [RESULT] T[] getX() {
        //     if( <var>==null )    return new T[0];
        //     T[] retVal = new T[this._return.length] ;
        //     System.arraycopy(this._return, 0, "retVal", 0, this._return.length);
        //     return (retVal);
        // }
        $getAll = writer.declareMethod( exposedType.array(),"get"+prop.getName(true));
        writer.javadoc().append(prop.javadoc);
        body = $getAll.body();

        body._if( acc.ref(true).eq(JExpr._null()) )._then()
            ._return(JExpr.newArray(exposedType,0));
        JVar var = body.decl(exposedType.array(), "retVal", JExpr.newArray(implType,acc.ref(true).ref("length")));
        body.add(codeModel.ref(System.class).staticInvoke("arraycopy")
                        .arg(acc.ref(true)).arg(JExpr.lit(0))
                        .arg(var)
                        .arg(JExpr.lit(0)).arg(acc.ref(true).ref("length")));
        body._return(JExpr.direct("retVal"));

        List<Object> returnTypes = listPossibleTypes(prop);
        writer.javadoc().addReturn().append("array of\n").append(returnTypes);

        // [RESULT]
        // ET getX(int idx) {
        //     if( <var>==null )    throw new IndexOutOfBoundsException();
        //     return unbox(<var>.get(idx));
        // }
        JMethod $get = writer.declareMethod(exposedType,"get"+prop.getName(true));
        $idx = writer.addParameter(codeModel.INT,"idx");

        $get.body()._if(acc.ref(true).eq(JExpr._null()))._then()
            ._throw(JExpr._new(codeModel.ref(IndexOutOfBoundsException.class)));

        writer.javadoc().append(prop.javadoc);
        $get.body()._return(acc.ref(true).component($idx));

        writer.javadoc().addReturn().append("one of\n").append(returnTypes);

        // [RESULT] int getXLength() {
        //     if( <var>==null )    throw new IndexOutOfBoundsException();
        //     return <ref>.length;
        // }
        JMethod $getLength = writer.declareMethod(codeModel.INT,"get"+prop.getName(true)+"Length");
        $getLength.body()._if(acc.ref(true).eq(JExpr._null()))._then()
                ._return(JExpr.lit(0));
        $getLength.body()._return(acc.ref(true).ref("length"));

        // [RESULT] void setX(ET[] values) {
        //     int len = values.length;
        //     for( int i=0; i<len; i++ )
        //         <ref>[i] = values[i];
        // }
        $setAll = writer.declareMethod(
            codeModel.VOID,
            "set"+prop.getName(true));

        writer.javadoc().append(prop.javadoc);
        $value = writer.addParameter(exposedType.array(),"values");
        JVar $len = $setAll.body().decl(codeModel.INT,"len", $value.ref("length"));

        $setAll.body().assign(
                (JAssignmentTarget) acc.ref(true),
                castToImplTypeArray(JExpr.newArray(
                    codeModel.ref(exposedType.erasure().fullName()),
                    $len)));

        JForLoop _for = $setAll.body()._for();
        JVar $i = _for.init( codeModel.INT, "i", JExpr.lit(0) );
        _for.test( JOp.lt($i,$len) );
        _for.update( $i.incr() );
        _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i))));

        writer.javadoc().addParam($value)
            .append("allowed objects are\n")
            .append(returnTypes);

        // [RESULT] ET setX(int idx, ET value)
        // <ref>[idx] = value
        JMethod $set = writer.declareMethod(
            exposedType,
            "set"+prop.getName(true));
        $idx = writer.addParameter( codeModel.INT, "idx" );
        $value = writer.addParameter( exposedType, "value" );

        writer.javadoc().append(prop.javadoc);

        body = $set.body();
        body._return( JExpr.assign(acc.ref(true).component($idx),
                                   castToImplType(acc.box($value))));

        writer.javadoc().addParam($value)
            .append("allowed object is\n")
            .append(returnTypes);

    }
 
Example 16
Source File: DummyListField.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
    // [RESULT]
    // bean.getLIST().addAll($<var>);
    JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
    block.invoke($list,"addAll").arg($var);
}
 
Example 17
Source File: DummyListField.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
    // [RESULT]
    // bean.getLIST().addAll($<var>);
    JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
    block.invoke($list,"addAll").arg($var);
}
 
Example 18
Source File: DummyListField.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
    // [RESULT]
    // bean.getLIST().addAll($<var>);
    JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
    block.invoke($list,"addAll").arg($var);
}
 
Example 19
Source File: ContentListField.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
    // [RESULT]
    // bean.getLIST().addAll($<var>);
    JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
    block.invoke($list,"addAll").arg($var);
}
 
Example 20
Source File: DummyListField.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
    // [RESULT]
    // bean.getLIST().addAll($<var>);
    JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
    block.invoke($list,"addAll").arg($var);
}