Package com.sun.codemodel

Examples of com.sun.codemodel.JInvocation.arg()


            exp.arg(scopeClass);
        }
        if(implType==exposedType)
            exp.arg($value);
        else
            exp.arg(JExpr.cast(implType,$value));

        m.body()._return( exp );

        m.javadoc()
            .append("Create an instance of ")
View Full Code Here


                FieldOutline fo = outline.getField(field);
                FieldAccessor accessor = fo.create(JExpr._this());

                // declare a parameter on this factory method and set
                // it to the field
                inv.arg(m.param( fo.getRawType(), fieldName ));

                JVar $var = c.param( fo.getRawType(), fieldName );
                accessor.fromRawValue(c.body(),'_'+fieldName,$var);
            }
        }
View Full Code Here

                    StringBuilder buf = new StringBuilder();
                    for( PackageOutlineImpl po : packageContexts.values() ) {
                        if(buf.length()>0buf.append(':');
                        buf.append(po._package().name());
                    }
                    inv.arg(buf.toString()).arg($classLoader);
                    break;
                }
            case BEAN_ONLY:
                for( ClassOutlineImpl cc : getClasses() )
                    inv.arg(cc.implRef.dotclass());
View Full Code Here

                    inv.arg(buf.toString()).arg($classLoader);
                    break;
                }
            case BEAN_ONLY:
                for( ClassOutlineImpl cc : getClasses() )
                    inv.arg(cc.implRef.dotclass());
                for( PackageOutlineImpl po : packageContexts.values() )
                    inv.arg(po.objectFactory().dotclass());
                break;
            default:
                throw new IllegalStateException();
View Full Code Here

                }
            case BEAN_ONLY:
                for( ClassOutlineImpl cc : getClasses() )
                    inv.arg(cc.implRef.dotclass());
                for( PackageOutlineImpl po : packageContexts.values() )
                    inv.arg(po.objectFactory().dotclass());
                break;
            default:
                throw new IllegalStateException();
            }
        } catch (JClassAlreadyExistsException e) {
View Full Code Here

                if(baseExposedType==codeModel.ref(String.class)){
                    strForm = $v;
                } else {
                    strForm = $v.invoke("toString");
                }
                m.body()._throw(ex.arg(strForm));
            }
        } else {
            // [RESULT]
            // public String value() { return name(); }
            type.method(JMod.PUBLIC, String.class, "value" ).body()._return(JExpr.invoke("name"));
View Full Code Here

      {
        supportedMethodsExpr = _enumSetClass.staticInvoke("of");
        for (ResourceMethod resourceMethod: supportedMethods)
        {
          validateResourceMethod(resourceSchemaClass, resourceName, resourceMethod);
          supportedMethodsExpr.arg(_resourceMethodClass.staticRef(resourceMethod.name()));
        }
      }

      JBlock staticInit = facadeClass.init();
View Full Code Here

    JInvocation invocation = derivedBuilderConstructor.body().invoke(SUPER).arg(uriParam);

    // the new BatchGetEntityRequestBuilderBase does not need the valueClass parameter in constructor
    if (!baseBuilderClass.fullName().startsWith(BatchGetEntityRequestBuilderBase.class.getName() + "<"))
    {
      invocation.arg(valueClass.dotclass());
    }
    invocation.arg(resourceSpecParam).arg(requestOptionsParam);
    if (finderName != null)
    {
      derivedBuilderConstructor.body().add(JExpr._super().invoke("name").arg(finderName));
View Full Code Here

    // the new BatchGetEntityRequestBuilderBase does not need the valueClass parameter in constructor
    if (!baseBuilderClass.fullName().startsWith(BatchGetEntityRequestBuilderBase.class.getName() + "<"))
    {
      invocation.arg(valueClass.dotclass());
    }
    invocation.arg(resourceSpecParam).arg(requestOptionsParam);
    if (finderName != null)
    {
      derivedBuilderConstructor.body().add(JExpr._super().invoke("name").arg(finderName));
    }
View Full Code Here

  public JExpression getBindingProviderExpr(GenerationContext context) {
    JType aegis = context.getCodeModel()._ref(AegisBindingProvider.class);
    JInvocation expr = JExpr._new(aegis);

    JType xbean = context.getCodeModel()._ref(JaxbTypeRegistry.class);
    expr.arg(JExpr._new(xbean));

    return expr;
  }

  /**
 
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.