public Accessor create(JExpression targetObject) { return new Accessor(targetObject); }
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")); $get.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._throw(JExpr._new(codeModel.ref(IndexOutOfBoundsException.class))); $get.body()._return(acc.ref(true).component($idx)); $getLength.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._return(JExpr.lit(0)); $getLength.body()._return(acc.ref(true).ref("length")); (JAssignmentTarget) acc.ref(true), castToImplTypeArray(JExpr.newArray( codeModel.ref(exposedType.erasure().fullName()), _for.test( JOp.lt($i,$len) ); _for.update( $i.incr() ); _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i)))); body._return( JExpr.assign(acc.ref(true).component($idx), castToImplType(acc.box($value))));
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")); $get.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._throw(JExpr._new(codeModel.ref(IndexOutOfBoundsException.class))); $get.body()._return(acc.ref(true).component($idx)); $getLength.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._return(JExpr.lit(0)); $getLength.body()._return(acc.ref(true).ref("length")); (JAssignmentTarget) acc.ref(true), castToImplTypeArray(JExpr.newArray( codeModel.ref(exposedType.erasure().fullName()), _for.test( JOp.lt($i,$len) ); _for.update( $i.incr() ); _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i)))); body._return( JExpr.assign(acc.ref(true).component($idx), castToImplType(acc.box($value))));
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")); $get.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._throw(JExpr._new(codeModel.ref(IndexOutOfBoundsException.class))); $get.body()._return(acc.ref(true).component($idx)); $getLength.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._return(JExpr.lit(0)); $getLength.body()._return(acc.ref(true).ref("length")); (JAssignmentTarget) acc.ref(true), castToImplTypeArray(JExpr.newArray( codeModel.ref(exposedType.erasure().fullName()), _for.test( JOp.lt($i,$len) ); _for.update( $i.incr() ); _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i)))); body._return( JExpr.assign(acc.ref(true).component($idx), castToImplType(acc.box($value))));
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")); $get.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._throw(JExpr._new(codeModel.ref(IndexOutOfBoundsException.class))); $get.body()._return(acc.ref(true).component($idx)); $getLength.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._return(JExpr.lit(0)); $getLength.body()._return(acc.ref(true).ref("length")); (JAssignmentTarget) acc.ref(true), castToImplTypeArray(JExpr.newArray( codeModel.ref(exposedType.erasure().fullName()), _for.test( JOp.lt($i,$len) ); _for.update( $i.incr() ); _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i)))); body._return( JExpr.assign(acc.ref(true).component($idx), castToImplType(acc.box($value))));
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")); $get.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._throw(JExpr._new(codeModel.ref(IndexOutOfBoundsException.class))); $get.body()._return(acc.ref(true).component($idx)); $getLength.body()._if(acc.ref(true).eq(JExpr._null()))._then() ._return(JExpr.lit(0)); $getLength.body()._return(acc.ref(true).ref("length")); (JAssignmentTarget) acc.ref(true), castToImplTypeArray(JExpr.newArray( codeModel.ref(exposedType.erasure().fullName()), _for.test( JOp.lt($i,$len) ); _for.update( $i.incr() ); _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i)))); body._return( JExpr.assign(acc.ref(true).component($idx), castToImplType(acc.box($value))));
public Accessor create(JExpression targetObject) { return new Accessor(targetObject); }
public Accessor create(JExpression targetObject) { return new Accessor(targetObject); }
public Accessor create(JExpression targetObject) { return new Accessor(targetObject); }
public Accessor create(JExpression targetObject) { return new Accessor(targetObject); }