Package org.eclipse.jdt.core.dom

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


     * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken)
     */
    public boolean consumes(SemanticToken token) {

      // 1: match types
      SimpleName name= token.getNode();
      ASTNode node= name.getParent();
      int nodeType= node.getNodeType();
      if (nodeType != ASTNode.SIMPLE_TYPE && nodeType != ASTNode.QUALIFIED_TYPE && nodeType != ASTNode.QUALIFIED_NAME && nodeType != ASTNode.QUALIFIED_NAME && nodeType != ASTNode.ENUM_DECLARATION)
        return false;
      while (nodeType == ASTNode.QUALIFIED_NAME) {
        node= node.getParent();
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) {

      // 1: match types
      SimpleName name= token.getNode();
      ASTNode node= name.getParent();
      int nodeType= node.getNodeType();
      if (nodeType != ASTNode.SIMPLE_TYPE && nodeType != ASTNode.QUALIFIED_TYPE  && nodeType != ASTNode.QUALIFIED_NAME && nodeType != ASTNode.TYPE_DECLARATION)
        return false;
      while (nodeType == ASTNode.QUALIFIED_NAME) {
        node= node.getParent();
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) {

      // 1: match types
      SimpleName name= token.getNode();
      ASTNode node= name.getParent();
      int nodeType= node.getNodeType();
      if (nodeType != ASTNode.SIMPLE_TYPE && nodeType != ASTNode.QUALIFIED_TYPE  && nodeType != ASTNode.QUALIFIED_NAME && nodeType != ASTNode.ANNOTATION_TYPE_DECLARATION
          && nodeType != ASTNode.MARKER_ANNOTATION && nodeType != ASTNode.NORMAL_ANNOTATION && nodeType != ASTNode.SINGLE_MEMBER_ANNOTATION)
        return false;
      while (nodeType == ASTNode.QUALIFIED_NAME) {
View Full Code Here

    /*
     * @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#isMatched(org.eclipse.jdt.core.dom.ASTNode)
     */
    public boolean consumes(SemanticToken token) {
      SimpleName node= token.getNode();
      if (node.isDeclaration())
        return false;

      IBinding binding= token.getBinding();
      return binding != null && binding.getKind() == IBinding.METHOD && (binding.getModifiers() & Modifier.STATIC) == Modifier.STATIC;
    }
View Full Code Here

    /*
     * @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#isMatched(org.eclipse.jdt.core.dom.ASTNode)
     */
    public boolean consumes(SemanticToken token) {
      SimpleName node= token.getNode();
      if (node.getParent() instanceof MemberValuePair) {
        IBinding binding= token.getBinding();
        boolean isAnnotationElement= binding != null && binding.getKind() == IBinding.METHOD;

        return isAnnotationElement;
      }
View Full Code Here

    /*
     * @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#isMatched(org.eclipse.jdt.core.dom.ASTNode)
     */
    public boolean consumes(SemanticToken token) {
      SimpleName node= token.getNode();
      if (node.isDeclaration())
        return false;

      IBinding binding= token.getBinding();
      boolean isAbstractMethod= binding != null && binding.getKind() == IBinding.METHOD && (binding.getModifiers() & Modifier.ABSTRACT) == Modifier.ABSTRACT;
      if (!isAbstractMethod)
View Full Code Here

    /*
     * @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#isMatched(org.eclipse.jdt.core.dom.ASTNode)
     */
    public boolean consumes(SemanticToken token) {
      SimpleName node= token.getNode();
      if (node.isDeclaration())
        return false;

      IBinding binding= token.getBinding();
      if (binding == null || binding.getKind() != IBinding.METHOD)
        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) {
      SimpleName node= token.getNode();
      StructuralPropertyDescriptor location= node.getLocationInParent();
      if (location == VariableDeclarationFragment.NAME_PROPERTY || location == SingleVariableDeclaration.NAME_PROPERTY) {
        ASTNode parent= node.getParent();
        if (parent instanceof VariableDeclaration) {
          parent= parent.getParent();
          return parent == null || !(parent instanceof FieldDeclaration);
        }
      }
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) {

      // 1: match types
      SimpleName name= token.getNode();
      ASTNode node= name.getParent();
      int nodeType= node.getNodeType();
      if (nodeType != ASTNode.SIMPLE_TYPE && nodeType != ASTNode.QUALIFIED_TYPE)
        return false;

      // 2: match type arguments
View Full Code Here

    enumDecl.enumConstants().addAll(enumConstantDeclarationCollection);
    return enumDecl;
  }

  private static Type getNewType(AST ast, String typeName) {
    final SimpleName name = ast.newSimpleName(typeName);
    return ast.newSimpleType(name);
  }
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.