Examples of IVariableBinding


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

      //array containing all the fields
      IVariableBinding[] vb = b.getDeclaredFields();
     
      //add all the global proposals within the array into the list.
      for(int i = 0; i<vb.length; i++){
        IVariableBinding temp = vb[i];
        int modifier = temp.getModifiers();
        //find out if the current type has been declared in the same package
        //as the class where code completion has been called
        boolean isSamePackage = false;
        if(temp.getDeclaringClass().getPackage().equals(packageBinding)){
          isSamePackage=true;
        }
        if(Modifier.isPublic(modifier)||(Modifier.isProtected(modifier)&&inherited)||(isSamePackage && !Modifier.isPrivate(modifier) && !Modifier.isProtected(modifier))){
          VarProposal entry = new VarProposal(temp, name);
         
View Full Code Here

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

    //array containing all the fields
    IVariableBinding[] vb = b.getDeclaredFields();
   
    //add all the private proposals within the array into the list.
    for(int i = 0; i<vb.length; i++){
      IVariableBinding temp = vb[i];
      if(Modifier.isPrivate(temp.getModifiers())){
        fields.add(new VarProposal(temp, name));
      }
    }
    return fields;
  }
View Full Code Here

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

  /** (non-Javadoc)
   * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.VariableDeclarationFragment)
   */
  public boolean visit(VariableDeclarationFragment node) {
    VariableDeclarationFragment vdf = (VariableDeclarationFragment) node;
    IVariableBinding binding = vdf.resolveBinding();
    localVariables.add(new VarProposal(binding, "Local"));
    return true;
  }
View Full Code Here

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

    else{ // if action is a Variable
      //search for the semantic action within the variable proposal list
      for(int i=0; i<fields.size(); i++){
        if(fields.get(i).getName().equals(action.getName())){
          //proposal has been found
          IVariableBinding b = fields.get(i).getBinding();
          ITypeBinding type = b.getType();
          if(arrayLevel > type.getDimensions()){
            //the number of array parameters written at the operation has exceeded the actual array dimension of this type
            return null;
          }
          while (arrayLevel > 0){
View Full Code Here

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

    debugFiles.clear();
  }
 
 
  private void generateConservativeConstraints(ITypeBinding type) {
    IVariableBinding f[] = type.getDeclaredFields();
    IMethodBinding m[] = type.getDeclaredMethods();
   
   
    /*
    for(int i=0; i<f.length; i++){
View Full Code Here

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

                } else if (expression instanceof Name) {
                    // manually resolving the type of the argument
                    Name castedName = (Name) expression;
                    IBinding binding = castedName.resolveBinding();
                    if ((binding != null) && (binding.getKind() == IBinding.VARIABLE)) {
                        IVariableBinding varBinding = (IVariableBinding) binding;
                        ITypeBinding varTypeBinding = varBinding.getType();
                        argumentType = getInvocationHandler().convert(varTypeBinding);
                    }
                    if (argumentType.equals(AbstractASTNodeHandler.UNDEFINED_BINDING)) {
                        argumentType = resolveTypeBinding(expression);
                    }
View Full Code Here

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

        IBinding binding = getASTNode().resolveBinding();
        if (binding != null) {
            if (binding.getKind() == IBinding.VARIABLE) {
                if (((IVariableBinding) binding).isField()) {
                    IVariableBinding lVariableBinding = (IVariableBinding) binding;
                    if (lVariableBinding.getDeclaringClass() == null) {
                        // This is most likely an access to the length
                        // field of an array.
                        return null;
                    }

                    org.evolizer.famix.model.entities.FamixClass lDeclClass = getClass(lVariableBinding.getDeclaringClass(), null, false);
                    lFieldID = lDeclClass.getUniqueName() + AbstractFamixEntity.NAME_DELIMITER + lVariableBinding.getName();
                }
            }
        }

        return lFieldID;
View Full Code Here

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

     * @see org.evolizer.famix.importer.nodehandler.VariableDeclarationFragmentHandler#initDataType()
     */
    @Override
    protected void initDataType() {
        if (getDataType() == null) {
            IVariableBinding lVariableBinding = getASTNode().resolveBinding();
            ITypeBinding lTypeBinding = null;
            if (lVariableBinding != null) {
                lTypeBinding = lVariableBinding.getType();
            }
            FamixClass lDataType = getClass(lTypeBinding, getASTNode().getType(), false);
            lDataType = (FamixClass) getModel().addElement(lDataType);
            setDataType(lDataType);
        }
View Full Code Here

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

     * @return The FAMIX conform unique name.
     */
    @Override
    protected String convertFieldID() {
        String lFieldID = null;
        IVariableBinding lBinding = (IVariableBinding) getASTNode().getName().resolveBinding();
        if (lBinding != null) {
            if (lBinding.getDeclaringClass() != null) {
                lFieldID =
                        lBinding.getDeclaringClass().getBinaryName() + AbstractFamixEntity.NAME_DELIMITER + lBinding.getName();
            } else {
                lFieldID = lBinding.getName();
            }
        } else {
            lFieldID =
                    AbstractASTNodeHandler.UNDEFINED_BINDING + AbstractFamixEntity.NAME_DELIMITER
                            + getASTNode().getName().getFullyQualifiedName();
View Full Code Here

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

    }

    private void createAttributes() {
        FamixAttribute lField = null;
       
        IVariableBinding lVariableBinding = getASTNode().resolveVariable();
        if (lVariableBinding != null) {
            String lFieldID = null;
            int lModifiers = lVariableBinding.getModifiers();
            String lSimpleName = lVariableBinding.getName();
            lFieldID = getCurrType().getUniqueName() + AbstractFamixEntity.NAME_DELIMITER + lSimpleName;
           
            lField = getFactory().createAttribute(lFieldID, null);
            lField = (FamixAttribute) getModel().addElement(lField);
            lField.setModifiers(lModifiers);
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.