Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.SimpleName


            public boolean visit(TypeDeclaration typeDecl) {
                ITypeBinding typeBinding = typeDecl.resolveBinding();
                if (typeBinding != null) {
                    if (typeBinding.getBinaryName().equals(className)) {
                        Map<String,Object> attribs = new HashMap<String,Object>();
                        SimpleName nameNode = typeDecl.getName();
                        attribs.put(IMarker.CHAR_START, nameNode.getStartPosition());
                        attribs.put(IMarker.CHAR_END, nameNode.getStartPosition() + nameNode.getLength());

                        String message = String.format("The method '%s' was removed, which requires a %s change to the package.", methodName, requiresDelta);
                        attribs.put(IMarker.MESSAGE, message);

                        markers.add(new MarkerData(ast.getJavaElement().getResource(), attribs, false));
View Full Code Here


            public boolean visit(TypeDeclaration typeDecl) {
                ITypeBinding typeBinding = typeDecl.resolveBinding();
                if (typeBinding != null) {
                    if (typeBinding.getBinaryName().equals(className)) {
                        Map<String,Object> attribs = new HashMap<String,Object>();
                        SimpleName nameNode = typeDecl.getName();
                        attribs.put(IMarker.CHAR_START, nameNode.getStartPosition());
                        attribs.put(IMarker.CHAR_END, nameNode.getStartPosition() + nameNode.getLength());

                        String message = String.format("The method '%s' was removed, which requires a %s change to the package.", methodName, requiresDelta);
                        attribs.put(IMarker.MESSAGE, message);

                        markers.add(new MarkerData(ast.getJavaElement().getResource(), attribs, false));
View Full Code Here

  // consider visit(FieldAccess )
  private void visitItFieldInvocation(final MethodInvocation node, final IMethodBinding meth)
  {
    if (node.getExpression() instanceof SimpleName)
    {
      SimpleName var = (SimpleName) node.getExpression();
      String varName = var.getIdentifier();

      IBinding exprBinding = var.resolveBinding();

      if ( "it".equals(varName) && exprBinding instanceof IVariableBinding ) // call on 'it' field
      {
        IVariableBinding varBinding = (IVariableBinding) exprBinding;
        IMethodBinding mockMethod = getSurroundingMockMethod(node);
View Full Code Here

        if (intoEL)
          addIfNotExist(elNodeName, propList);
      }

      public boolean visit(MethodDeclaration node) {
        SimpleName name = node.getName();
        String methodName = name.toString();
       
        if (node.getReturnType2() != null && node.getModifiers() == Modifier.PUBLIC && !(node.getReturnType2().isPrimitiveType() && ((PrimitiveType) node.getReturnType2()).getPrimitiveTypeCode() == PrimitiveType.VOID)) {
          if (methodName.startsWith("is") && methodName.length() > 2) {
            String propName = getPropertyName(methodName.substring(2));
            addIfNotExist(propName, propList);
            //methodList.add(methodName + "()");
          } else if (methodName.startsWith("get") && methodName.length() > 3) {
            String propName = getPropertyName(methodName.substring(3));
            addIfNotExist(propName, propList);
            //methodList.add(methodName + "()");
          }else {
            methodList.add(methodName + "()");
          }
        }
        return false;
      }

      private String getPropertyName(String name) {
        if (name.length() > 1)
          return name.substring(0, 1).toLowerCase() + name.substring(1);
        else
          return name.toLowerCase();
      }
    });
  }
View Full Code Here

    if(dot!=-1)
      eName = eName.substring(dot+1);
    System.out.println(eName);
    for(int i=0;i<types.size();i++){
      TypeDeclaration tDec = (TypeDeclaration) types.get(i);
      SimpleName sName = tDec.getName();
      String tName = sName.getIdentifier();
      System.out.println(tName);
      if(tName.equals(eName)){
        typeDec = tDec;
        break;
      }
View Full Code Here

      if(right.isQualifiedType()){
        QualifiedType leftType = (QualifiedType) left;
        QualifiedType rightType = (QualifiedType) right;
        Type leftQualifier = leftType.getQualifier();
        Type rightQualifier = rightType.getQualifier();
        SimpleName leftName = leftType.getName();
        SimpleName rightName = rightType.getName();
        boolean assignable = isAssignable(leftQualifier, rightQualifier);
        return assignable && leftName.getIdentifier().equals(rightName.getIdentifier());
      }
    } else if(left.isSimpleType()){
      if(right.isSimpleType()){
        SimpleType leftType = (SimpleType) left;
        SimpleType rightType = (SimpleType) right;
View Full Code Here

      if (adapter.isRoot()) {
        return createAddMethod(type, adapter, esd, mListener, mi);
      } else {
        Expression optionalExpression = mi.getExpression();
        if (optionalExpression instanceof SimpleName) {
          SimpleName simplename = (SimpleName) optionalExpression;
          String idName = simplename.getFullyQualifiedName();
          if (idName.equals(adapter.getID()))
            return createAddMethod(type, adapter, esd, mListener, mi);
          else
            return false;
        } else
View Full Code Here

            if (list.size() != 1) {
              return new CodeSnippet(adapter, eventSet, methodDesc, es.toString());
            }
            Expression exp = (Expression) list.get(0);
            if (exp instanceof SimpleName) {
              SimpleName sn = (SimpleName) exp;
              SimpleName varn = var.getName();
              if (sn.getFullyQualifiedName().equals(varn.getFullyQualifiedName()))
                return new EventDelegation(methodDesc, mi.getName().getFullyQualifiedName());
            }
            return new CodeSnippet(adapter, eventSet, methodDesc, es.toString());
          } else {
            return new CodeSnippet(adapter, eventSet, methodDesc, es.toString());
View Full Code Here

  }
  /**
   * Example: break;   or   break ToHere;
   */
  public boolean visit(BreakStatement node) {
    SimpleName simpleName = node.getLabel();
    String label;
    if(simpleName == null)
      label = null;
    else
      label = simpleName.getIdentifier();
   
    controlFlowNode.breaking(label, true);

    return false;
  }
View Full Code Here

  }
  /**
   * Example: continue;   or   continue ToHere;
   */
  public boolean visit(ContinueStatement node) {
    SimpleName simpleName = node.getLabel();
    String label;
    if(simpleName == null)
      label = null;
    else
      label = simpleName.getIdentifier();
   
    controlFlowNode.continuing(label, true);
   
    return false;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.SimpleName

Copyright © 2018 www.massapicom. 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.