Examples of IVariableBinding


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

     * @return The 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 {
            // handling of unresolved variable bindings is not supported, yet
            lFieldID =
                    AbstractASTNodeHandler.UNDEFINED_BINDING + AbstractFamixEntity.NAME_DELIMITER
View Full Code Here

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

        lMethodID.append(AbstractFamixEntity.METHOD_START_BRACE);

        List<SingleVariableDeclaration> parameters = getASTNode().parameters();
        for (int i = 0; i < parameters.size(); i++) {
            SingleVariableDeclaration parameter = parameters.get(i);
            IVariableBinding lVariableBinding = parameter.resolveBinding();
            if (lVariableBinding != null) {
                lMethodID.append(convertParameterTypeBindingForMethodSignature(lVariableBinding.getType()));
            } else {
                lMethodID.append(convertParameterTypeForMethodSignature(parameter));
            }
            if (i < parameters.size() - 1) {
                lMethodID.append(AbstractFamixEntity.METHOD_PARAMETER_SEPARATOR);
View Full Code Here

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

  }

  private void createAccessFrom(Name node, SourceCodeLocationHelper location) {
    IBinding binding = node.resolveBinding();
    if(binding instanceof IVariableBinding) {
      IVariableBinding varBinding = (IVariableBinding) binding;
     
      if(varBinding.isField()) {
        createAccessFrom(varBinding, location);
      }
    }
  }
View Full Code Here

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

      // VariableDeclarationFragment: is the plain variable declaration
      // part. Example:
      // "int x=0, y=0;" contains two VariableDeclarationFragments, "x=0"
      // and "y=0"

      IVariableBinding binding = fragment.resolveBinding();
      VariableBindingManager manager = new VariableBindingManager(
          fragment); // create the manager fro the fragment
      localVariableManagers.put(binding, manager);
      manager.variableInitialized(fragment.getInitializer());
      // first assignment is the initalizer
View Full Code Here

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

      // VariableDeclarationFragment: is the plain variable declaration
      // part. Example:
      // "int x=0, y=0;" contains two VariableDeclarationFragments, "x=0"
      // and "y=0"

      IVariableBinding binding = fragment.resolveBinding();
      VariableBindingManager manager = new VariableBindingManager(
          fragment); // create the manager fro the fragment
      localVariableManagers.put(binding, manager);
      manager.variableInitialized(fragment.getInitializer());
      // first assignment is the initalizer
View Full Code Here

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

  /**
   * method checks if class variable is "public" and not "public static final"
   * and puts it into publicClassVariables if true.
   */
  public boolean visit(VariableDeclarationFragment node) {
    IVariableBinding binding = node.resolveBinding();
    if (node.getParent().getNodeType() == 23) { // public class variables
      String call = node.getParent().toString();
      boolean isPublic = call.startsWith("public") && !call.startsWith("public static final") && !call.startsWith("public final static");
      if (binding != null && isPublic) {
        String key = binding.getDeclaringClass().getName() + "." + binding.getName();
        List<String> value = new ArrayList<String>();
        value.add(iCompUnit.getHandleIdentifier());
        value.add(binding.getType().getName());
        publicClassVariables.put(key, value);
      }
    }
    return true;
  }
View Full Code Here

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

      PointsToAliasContext value) {
    if (instr.getTarget().resolveType().isPrimitive())
      return LabeledSingleResult.createResult(putFresh(instr.getNode(), instr.getTarget(), value), labels);
   
    PointsToAliasContext newValue = value.clone();
    IVariableBinding binding = instr.resolveFieldBinding();
    Variable var = receiverFields.get(binding);
    if (var == null) {
      var = new FieldVariable(binding);
      receiverFields.put(binding, var);
    }
View Full Code Here

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

  }

  @Override
  public IResult<PointsToAliasContext> transfer(StoreFieldInstruction instr,
      List<ILabel> labels, PointsToAliasContext value) {
    IVariableBinding binding = instr.resolveFieldBinding();
    Variable fieldVar = receiverFields.get(binding);
    if (fieldVar == null) {
      fieldVar = new FieldVariable(binding);
      receiverFields.put(binding, fieldVar);   
    }
View Full Code Here

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

  private List<DelegateEntry> getDelegatableMethods(
      CompilationUnit cu, ITypeBinding typeBinding)
    throws Exception
  {
    IVariableBinding variable = ASTNodeSearchUtil
      .getFieldDeclarationFragmentNode(field.get(), cu).resolveBinding();
    DelegateEntry[] entries =
      StubUtility2.getDelegatableMethods(typeBinding);
    ArrayList<DelegateEntry> delegatable = new ArrayList<DelegateEntry>();
    for (DelegateEntry entry : entries) {
View Full Code Here

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

    Object v = expr.resolveConstantExpressionValue();
    if (v == null) {
      return null;
    }

    IVariableBinding vb = node.resolveBinding();
    if (!vb.getType().isPrimitive() && !(v instanceof String)) {
      return null;
    }

    if (!isFinal(vb)) {
      return null;
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.