Here you can find the source of isName(AstNode node, String value)
Name
with the specified value.
Parameter | Description |
---|---|
node | The AST node. |
value | The expected value. |
Name
with the specified value.
private static final boolean isName(AstNode node, String value)
//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()); } }