Package org.eclipse.jdt.core.dom

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


   * @return the binding for the implicit <code>this</code>
   * variable of the given accessed element (method or field).
   */
  private ITypeBinding implicitThisBinding(IBinding accessedElement) {
    boolean isMethod;
    IBinding genericBinding; // generic version of accessedElement to simplify comparison
    if(accessedElement instanceof IMethodBinding) {
      if(((IMethodBinding) accessedElement).isConstructor())
        // constructor is easy because statically bound
        return ((IMethodBinding) accessedElement).getDeclaringClass();
      genericBinding = ((IMethodBinding) accessedElement).getMethodDeclaration();
View Full Code Here


         *
         *  @param token The token to be tested.
         *  @return true if the token can be consumed.
         */
        public boolean consumes(SemanticToken token) {
            IBinding binding = token.getBinding();

            if ((binding == null) || (binding.getKind() != IBinding.METHOD)) {
                return false;
            }

            IMethodBinding methodBinding = (IMethodBinding) binding;

View Full Code Here

         *
         *  @param token The token to be tested.
         *  @return true if the token can be consumed.
         */
        public boolean consumes(SemanticToken token) {
            IBinding binding = token.getBinding();

            if ((binding == null) || (binding.getKind() != IBinding.VARIABLE)) {
                return false;
            }

            IVariableBinding variableBinding = (IVariableBinding) binding;
            return variableBinding.isField()
View Full Code Here

    /*
     * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken)
     */
    public boolean consumes(SemanticToken token) {
      IBinding binding= token.getBinding();
      if (binding != null && binding.getKind() == IBinding.VARIABLE && !((IVariableBinding) binding).isField()) {
        ASTNode decl= token.getRoot().findDeclaringNode(binding);
        return decl instanceof VariableDeclaration;
      }
      return false;
    }
View Full Code Here

    /*
     * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken)
     */
    public boolean consumes(SemanticToken token) {
      IBinding binding= token.getBinding();
      if (binding != null && binding.getKind() == IBinding.VARIABLE && !((IVariableBinding) binding).isField()) {
        ASTNode decl= token.getRoot().findDeclaringNode(binding);
        return decl != null && decl.getLocationInParent() == MethodDeclaration.PARAMETERS_PROPERTY;
      }
      return false;
    }
View Full Code Here

    /*
     * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken)
     */
    public boolean consumes(SemanticToken token) {
      IBinding binding= getMethodBinding(token);
      return binding != null ? binding.isDeprecated() : false;
    }
View Full Code Here

     *
     * @param token the token to extract the method binding from
     * @return the corresponding method binding, or <code>null</code>
     */
    private IBinding getMethodBinding(SemanticToken token) {
      IBinding binding= null;
      // work around: https://bugs.eclipse.org/bugs/show_bug.cgi?id=62605
      ASTNode node= token.getNode();
      ASTNode parent= node.getParent();
      while (isTypePath(node, parent)) {
        node= parent;
View Full Code Here

      ASTNode node= name.getParent();
      if (node.getNodeType() != ASTNode.SIMPLE_TYPE && node.getNodeType() != ASTNode.TYPE_PARAMETER)
        return false;

      // 2: match generic type variable references
      IBinding binding= token.getBinding();
      return binding instanceof ITypeBinding && ((ITypeBinding) binding).isTypeVariable();
    }
View Full Code Here

        if (nodeType == ASTNode.IMPORT_DECLARATION)
          return false;
      }

      // 2: match classes
      IBinding binding= token.getBinding();
      return binding instanceof ITypeBinding && ((ITypeBinding) binding).isClass();
    }
View Full Code Here

        if (nodeType == ASTNode.IMPORT_DECLARATION)
          return false;
      }

      // 2: match enums
      IBinding binding= token.getBinding();
      return binding instanceof ITypeBinding && ((ITypeBinding) binding).isEnum();
    }
View Full Code Here

TOP

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

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.