Java Javascript Mozilla Library isName(AstNode node, String value)

Here you can find the source of isName(AstNode node, String value)

Description

Returns whether an AST node is a Name with the specified value.

License

BSD License

Parameter

Parameter Description
node The AST node.
value The expected value.

Return

Whether the AST node is a Name with the specified value.

Declaration

private static final boolean isName(AstNode node, String value) 

Method Source Code

//package com.java2s;
/*/*from   w  w  w  .  jav  a  2  s .c om*/
 * 06/05/2014
 *
 * Copyright (C) 2014 Robert Futrell
 * robert_futrell at users.sourceforge.net
 * http://fifesoft.com/rsyntaxtextarea
 *
 * This library is distributed under a modified BSD license.  See the included
 * RSTALanguageSupport.License.txt file for details.
 */

import org.mozilla.javascript.ast.AstNode;

import org.mozilla.javascript.ast.Name;

public class Main {
    /**
     * Returns whether an AST node is a <code>Name</code> with the specified
     * value.
     *
     * @param node The AST node.
     * @param value The expected value.
     * @return Whether the AST node is a <code>Name</code> with the specified
     *         value.
     */
    private static final boolean isName(AstNode node, String value) {
        return node instanceof Name && value.equals(((Name) node).getIdentifier());
    }
}

Related

  1. getStringValue(AstNode element)
  2. getXhtmlLinks(Object xhtml)
  3. grabContextFactoryGlobalSetter()
  4. isContained(AstNode mayAncestor, AstNode filial)
  5. isDefined(final Object object)
  6. isNullNativeObject(Object val)
  7. isPrototypeNameNode(AstNode node)
  8. isPrototypePropertyGet(PropertyGet pg)
  9. isSimplePropertyGet(PropertyGet pg, String expectedObj, String expectedField)