org.stjs.generator.writer
Class JavascriptKeywords

java.lang.Object
  extended by org.stjs.generator.writer.JavascriptKeywords

public final class JavascriptKeywords
extends Object

This class checks if a method or a variable has the name of a Javascript keyword. Even though the Java compiler lets the user use some of the keywords as variable names, the Generator should not generate code with these names.

Author:
Alexandru Craciun

Field Summary
static String CONSTRUCTOR
           
static String NULL
           
static String PROTOTYPE
           
static String THIS
           
static String VAR
           
 
Method Summary
static void checkIdentifier(com.sun.source.tree.Tree tree, String name, GenerationContext<?> context)
           
static boolean isReservedWord(String identifier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final String PROTOTYPE
See Also:
Constant Field Values

CONSTRUCTOR

public static final String CONSTRUCTOR
See Also:
Constant Field Values

VAR

public static final String VAR
See Also:
Constant Field Values

THIS

public static final String THIS
See Also:
Constant Field Values

NULL

public static final String NULL
See Also:
Constant Field Values
Method Detail

checkIdentifier

public static void checkIdentifier(com.sun.source.tree.Tree tree,
                                   String name,
                                   GenerationContext<?> context)

isReservedWord

public static boolean isReservedWord(String identifier)


Copyright © 2014. All Rights Reserved.