Examples of ParamModel


Examples of net.jangaroo.jooc.model.ParamModel

    eventNameConstant.setStatic(true);
    eventNameConstant.setAsdoc(MessageFormat.format("This constant defines the value of the <code>type</code> property of the event object\nfor a <code>{0}</code> event.\n   * @eventType {0}", event.name));
    extAsClass.addMember(eventNameConstant);

    MethodModel constructorModel = extAsClass.createConstructor();
    constructorModel.addParam(new ParamModel("arguments", "Array"));
    StringBuilder propertyAssignments = new StringBuilder();
    for (int i = 0; i < event.params.size(); i++) {
      Param param = event.params.get(i);

      // add assignment to constructor body:
View Full Code Here

Examples of net.jangaroo.jooc.model.ParamModel

                : new MethodModel(convertName(method.name), convertType(method.return_.type));
        methodModel.setAsdoc(toAsDoc(method.doc));
        methodModel.getReturnModel().setAsdoc(toAsDoc(method.return_.doc));
        setStatic(methodModel, method);
        for (Param param : method.params) {
          ParamModel paramModel = new ParamModel(convertName(param.name), convertType(param.type));
          paramModel.setAsdoc(toAsDoc(param.doc));
          setDefaultValue(paramModel, param);
          paramModel.setRest(param == method.params.get(method.params.size() - 1) && param.type.endsWith("..."));
          methodModel.addParam(paramModel);
        }
        classModel.addMember(methodModel);
      }
    }
View Full Code Here

Examples of net.jangaroo.jooc.model.ParamModel

    }
  }

  @Override
  public void visitParameter(Parameter parameter) throws IOException {
    ParamModel paramModel = new ParamModel();
    paramModel.setRest(parameter.isRest());
    modelStack.push(paramModel);
    parameter.getIde().visit(this);
    visitIfNotNull(parameter.getOptTypeRelation());
    visitIfNotNull(parameter.getOptInitializer());
    modelStack.pop();
View Full Code Here

Examples of net.jangaroo.jooc.model.ParamModel

    MethodModel method = new MethodModel();
    method.setName("doFoo");
    method.setAsdoc("Some method.");
    method.setBody("trace('foo');");
    ParamModel param = new ParamModel();
    param.setName("foo");
    param.setType("com.acme.sub.Bar");
    param.setValue("null");
    method.setParams(Collections.singletonList(param));
    method.setType("int");
    classModel.addMember(method);

    PropertyModel propertyModel = new PropertyModel();
View Full Code Here

Examples of org.glassfish.api.admin.CommandModel.ParamModel

     * based on the --interactive option.
     */
    protected Collection<ParamModel> usageOptions() {
        Collection<ParamModel> opts = commandModel.getParameters();
        Set<ParamModel> uopts = new LinkedHashSet<ParamModel>();
        ParamModel p = new CommandModelData.ParamModelData("printprompt",
                boolean.class, true, Boolean.toString(programOpts.isInteractive()));
        for (ParamModel pm : opts) {
            if (pm.getName().equals("printprompt"))
                uopts.add(p);
            else
View Full Code Here

Examples of org.glassfish.api.admin.CommandModel.ParamModel

     * @param req   is option required?
     * @param def   default value for option
     */
    private static void addMetaOption(Set<ParamModel> opts, String name,
            char sname, Class type, boolean req, String def) {
        ParamModel opt = new ParamModelData(name, type, !req, def,
                                                Character.toString(sname));
        opts.add(opt);
    }
View Full Code Here

Examples of org.glassfish.api.admin.CommandModel.ParamModel

    @Override
    protected void prevalidate() throws CommandException {
        try {
            //Copy date from interactive part of
            if (reExecutedOperands != null && !reExecutedOperands.isEmpty()) {
                ParamModel operandModel = getOperandModel();
                if (operandModel != null && !operandModel.getParam().optional()) {
                    if (operands == null) {
                        operands = new ArrayList<String>(reExecutedOperands.size());
                    }
                    if (reExecutedOperands.size() > operands.size()) {
                        if (operandModel.getParam().multiple()) {
                            for (String str : reExecutedOperands) {
                                if (!operands.contains(str)) {
                                    operands.add(str);
                                }
                            }
View Full Code Here

Examples of org.glassfish.api.admin.CommandModel.ParamModel

    @Override
    protected void prevalidate() throws CommandException {
        try {
            //Copy date from interactive part of
            if (reExecutedOperands != null && !reExecutedOperands.isEmpty()) {
                ParamModel operandModel = getOperandModel();
                if (operandModel != null && !operandModel.getParam().optional()) {
                    if (operands == null) {
                        operands = new ArrayList<String>(reExecutedOperands.size());
                    }
                    if (reExecutedOperands.size() > operands.size()) {
                        if (operandModel.getParam().multiple()) {
                            for (String str : reExecutedOperands) {
                                if (!operands.contains(str)) {
                                    operands.add(str);
                                }
                            }
View Full Code Here

Examples of org.glassfish.api.admin.CommandModel.ParamModel

        }
        usageText.append(helpText);
        len += helpText.length();

        optText.setLength(0);
        ParamModel operandParam = getOperandModel();
        String opname = operandParam != null ?
        lc(operandParam.getName()) : null;
        if (!ok(opname))
            opname = "operand";

        int operandMin = 0;
        int operandMax = 0;
        if (operandParam != null) {
            operandMin = operandParam.getParam().optional() ? 0 : 1;
            operandMax = operandParam.getParam().multiple() ?
                                                        Integer.MAX_VALUE : 1;
        }
        if (operandMax > 0) {
            if (operandMin == 0) {
                optText.append("[").append(opname);
View Full Code Here

Examples of org.glassfish.api.admin.CommandModel.ParamModel

                        ProgramOptions.getValidOptions();
                StringBuilder sb = new StringBuilder();
                sb.append(programOpts.getCommandName());
                for (Map.Entry<String,List<String>> p : params.entrySet()) {
                    // find the corresponding ParamModel
                    ParamModel opt = null;
                    for (ParamModel vo : programOptions) {
                        if (vo.getName().equalsIgnoreCase(p.getKey())) {
                            opt = vo;
                            break;
                        }
                    }
                    if (opt == null) {
                        continue;
                    }

                    // format the option appropriately
                    sb.append(" --").append(p.getKey());
                    List<String> pl = p.getValue();
                    // XXX - won't handle multi-values
                    if (opt.getType() == Boolean.class ||
                        opt.getType() == boolean.class) {
                        if (!pl.get(0).equalsIgnoreCase("true")) {
                            sb.append("=false");
                        }
                    } else if (pl != null && pl.size() > 0) {
                        sb.append(" ").append(pl.get(0));
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.