Examples of VariableModel


Examples of com.google.java.contract.core.model.VariableModel

    }

    append("(");
    Iterator<? extends VariableModel> it = method.getParameters().iterator();
    if (it.hasNext()) {
      VariableModel param = it.next();
      while (it.hasNext()) {
        appendVariableDeclaration(param);
        append(", ");
        param = it.next();
      }
      if (!method.isVariadic()) {
        appendVariableDeclaration(param);
      } else {
        String variadicTypeName =
            VARIADIC_REGEX.matcher(param.getType().getDeclaredName())
            .replaceFirst("...");
        appendVariableDeclaration(param, variadicTypeName);
      }
    }
    append(")");
View Full Code Here

Examples of com.google.java.contract.core.model.VariableModel

        if (oldBuffer != null) {
          if (newLevel == oldContext) {
            /* End of old expression. */
            String oldExpr = oldBuffer.toString();
            oldParameters.add(
                new VariableModel(ElementKind.PARAMETER, oldName,
                                  new ClassName("java/lang/Object")));
            oldParametersCode.add(oldExpr);
            oldParametersLineNumbers.add(lineNumber);

            /* Pad buffer (for error reporting purposes). */
 
View Full Code Here

Examples of com.google.java.contract.core.model.VariableModel

  })
  public static void copyParameters(MethodModel method,
                                    List<? extends VariableModel> parameters) {
    ArrayList<VariableModel> list = new ArrayList<VariableModel>(parameters);
    for (VariableModel param : list) {
      method.addParameter(new VariableModel(param));
    }
  }
View Full Code Here

Examples of com.google.java.contract.core.model.VariableModel

      }
    }

    if (!annotation.isVirtual()) {
      method.addParameter(
          new VariableModel(ElementKind.PARAMETER,
                            JavaUtils.THAT_VARIABLE, annotation.getOwner()));
    }

    if (!annotation.isVirtual()) {
      method.addModifier(ElementModifier.PUBLIC);
View Full Code Here

Examples of com.google.java.contract.core.model.VariableModel

                     : "void");
    method.setReturnType(returnType);

    if (kind.getVariance() == ContractVariance.CONTRAVARIANT) {
      method.addParameter(
          new VariableModel(ElementKind.PARAMETER,
                            JavaUtils.ERROR_VARIABLE, returnType));
    }

    if (annotation.isPrimary()) {
      method.setSourceInfo(annotation.getSourceInfo());
View Full Code Here

Examples of com.google.java.contract.core.model.VariableModel

  }

  @Requires("type != null")
  @Ensures("result != null")
  private static VariableModel getResultVariable(TypeName type) {
    VariableModel var =
        new VariableModel(ElementKind.PARAMETER, JavaUtils.RESULT_VARIABLE,
                          type);
    var.addModifier(ElementModifier.FINAL);
    return var;
  }
View Full Code Here

Examples of com.google.java.contract.core.model.VariableModel

    return var;
  }

  @Ensures("result != null")
  private static VariableModel getSignalVariable() {
    VariableModel var =
        new VariableModel(ElementKind.PARAMETER, JavaUtils.SIGNAL_VARIABLE,
                          new ClassName("java/lang/Exception"));
    var.addModifier(ElementModifier.FINAL);
    return var;
  }
View Full Code Here

Examples of com.google.java.contract.core.model.VariableModel

          kind = ElementKind.FIELD;
        } else {
          kind = ElementKind.PARAMETER;
        }
    }
    VariableModel variable =
        new VariableModel(kind, e.getSimpleName().toString(),
                          utils.getTypeNameForType(e.asType()));
    utils.copyModifiers(e, variable);

    scanAnnotations(e, true, type.getName(), variable);
View Full Code Here

Examples of com.subgraph.vega.internal.model.variables.VariableModel

      final boolean exists = databaseFile.exists(); // possible race condition 
      final ObjectContainer db = configurationFactory.openContainer(databasePath);
      loadModelVersion(db, !exists);
      tagModel = new TagModel(db);
      webModel = new WebModel(db);
      variableModel = new VariableModel(db);
      httpMacroModel = new HttpMacroModel(db);
      identityModel = new IdentityModel(db);
      requestLog = new RequestLog(db);
      scanAlerts = new ScanAlertRepository(db, xmlRepository);
      conditionManager = new HttpConditionManager(db, conditionChangeManager);
View Full Code Here

Examples of org.apache.click.eclipse.preferences.ClickProjectPropertyPage.VariableModel

          new ProjectScope(file.getProject()), ClickPlugin.PLUGIN_ID);
      String vars = store.getString(ClickPlugin.PREF_VELOCITY_VARS);
      if(vars != null && vars.length() > 0){
        preferenceObjects = VariableModel.deserialize(vars);
        for(int i=0;i<preferenceObjects.size();i++){
          VariableModel model = preferenceObjects.get(i);
          if(matchString.startsWith("$" + model.name + ".") || matchString.startsWith("${" + model.name + ".")){
            IType type = findType((String)model.type);
            if(type != null){
              return processType(type, result, matchString, offset);
            }
          }
        }
      }
    }
   
    Map<String, TemplateObject> fields = extractPageFields();
    for(Iterator<Map.Entry<String, TemplateObject>> ite = fields.entrySet().iterator(); ite.hasNext();){
      Map.Entry<String, TemplateObject> entry = ite.next();
      String name = entry.getKey();
      if(matchString.startsWith("$" + name + ".") || matchString.startsWith("${" + name + ".")){
        TemplateObject obj = (TemplateObject)entry.getValue();
        if(obj.getType()!=null){
          return processType(obj.getType(), result, matchString, offset);
        }
      }
    }
   
    if(format==null){
      registerProposal(result, offset, matchString, "$format", "$format", IMAGE_VAR);
    } else {
      registerProposal(result, offset, matchString,
          "$format", "$format - " + format.getFullyQualifiedName(), IMAGE_VAR);
    }
   
    // for page class fields
    for(Iterator<Map.Entry<String, TemplateObject>> ite = fields.entrySet().iterator(); ite.hasNext();){
      Map.Entry<String, TemplateObject> entry = ite.next();
      String name = entry.getKey();
      TemplateObject obj = (TemplateObject)entry.getValue();
      registerProposal(result, offset, matchString,
        "$" + name, "$" + name + " - " + obj.getTypeName(), IMAGE_FIELD);
    }
   
    // #set($xxxx)
    String source = textViewer.getDocument().get().substring(0, offset);
    Matcher matcher = PATTERN_SET.matcher(source);
    while(matcher.find()){
      String name = matcher.group(1);
      registerProposal(result, offset, matchString, "$" + name, "$" + name, IMAGE_VAR);
    }
   
    // #macro(xxxx)
    matcher = PATTERN_MACRO.matcher(source);
    while(matcher.find()){
      String name = matcher.group(1);
      registerProposal(result, offset, matchString, "#" + name + "()", name, IMAGE_DIRECTIVE);
    }
    readMacroVM(result, offset, matchString);
   
    registerProposal(result, offset, matchString, "$imports", "$imports - PageImports", IMAGE_VAR);
    registerProposal(result, offset, matchString, "$context", "$context - String", IMAGE_VAR);
    registerProposal(result, offset, matchString, "$messages", "$messages - Map", IMAGE_VAR);
    registerProposal(result, offset, matchString, "$path", "$path - String", IMAGE_VAR);
    registerProposal(result, offset, matchString, "$request", "$request - HttpServletRequest", IMAGE_VAR);
    registerProposal(result, offset, matchString, "$response", "$response - HttpServletResponse", IMAGE_VAR);
    registerProposal(result, offset, matchString, "$session", "$session - SessionMap", IMAGE_VAR);
   
    if(preferenceObjects != null){
      for(int i=0;i<preferenceObjects.size();i++){
        VariableModel model = (VariableModel) preferenceObjects.get(i);
        registerProposal(result, offset, matchString,
            "$" + model.name, "$" + model.name + " - " + model.type, IMAGE_VAR);
      }
    }
   
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.