public class JsUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JsUtils.InvocationStyle
Invocation styles.
|
Modifier and Type | Method and Description |
---|---|
static JsExpression |
createApplyInvocation(SourceInfo sourceInfo,
com.google.gwt.dev.js.JsUtils.InvocationDescriptor invocationDescriptor) |
static JsExpression |
createAssignment(JsExpression lhs,
JsExpression rhs) |
static JsExpression |
createAssignment(SourceInfo info,
JsExpression lhs,
JsExpression rhs) |
static JsFunction |
createBridge(JMethod method,
JsName polyName,
JsScope scope) |
static JsExpression |
createCallInvocationOrSuperPropertyAccess(SourceInfo sourceInfo,
com.google.gwt.dev.js.JsUtils.InvocationDescriptor invocationDescriptor) |
static JsExpression |
createCommaExpression(JsExpression... expressions) |
static JsExpression |
createDirectInvocationOrPropertyAccess(SourceInfo sourceInfo,
com.google.gwt.dev.js.JsUtils.InvocationDescriptor invocationDescriptor) |
static JsFunction |
createEmptyFunctionLiteral(SourceInfo info,
JsScope scope,
JsName name) |
static JsExpression |
createInvocationOrPropertyAccess(JsUtils.InvocationStyle invocationStyle,
SourceInfo sourceInfo,
JMethod method,
JsExpression instance,
JsNameRef reference,
List<JsExpression> args) |
static JsExpression |
createQualifiedNameRef(SourceInfo info,
JsExpression base,
String... names) |
static JsNameRef |
createQualifiedNameRef(SourceInfo info,
JsName... names) |
static JsNameRef |
createQualifiedNameRef(String namespace,
SourceInfo sourceInfo)
Given a string qualifier such as 'foo.bar.Baz', returns a chain of JsNameRef's representing
this qualifier.
|
static JsExpression |
extractExpression(JsStatement stmt)
Attempts to extract a single expression from a given statement and returns
it.
|
static JsName |
getJsNameForField(JavaToJavaScriptMap jjsmap,
JProgram jprogram,
String indexedMethodName) |
static JsName |
getJsNameForMethod(JavaToJavaScriptMap jjsmap,
JProgram jprogram,
String indexedMethodName) |
static boolean |
isEmpty(JsStatement stmt) |
static JsFunction |
isExecuteOnce(JsInvocation invocation)
Given a JsInvocation, determine if it is invoking a JsFunction that is
specified to be executed only once during the program's lifetime.
|
static JsFunction |
isFunction(JsExpression e)
Given an expression, determine if it is a JsNameRef that refers to a
statically-defined JsFunction.
|
static JsFunction |
isFunctionDeclaration(JsStatement stmt)
If the statement is a JsExprStmt that declares a function with no other
side effects, returns that function; otherwise
null . |
static boolean |
isValidJsIdentifier(String name)
A JavaScript identifier contains only letters, numbers, _, $ and does not begin with a number.
|
static boolean |
isValidJsQualifiedName(String name) |
public static JsFunction isExecuteOnce(JsInvocation invocation)
public static JsFunction isFunction(JsExpression e)
public static JsExpression createAssignment(JsExpression lhs, JsExpression rhs)
public static JsExpression createAssignment(SourceInfo info, JsExpression lhs, JsExpression rhs)
public static JsFunction createBridge(JMethod method, JsName polyName, JsScope scope)
public static JsExpression createCommaExpression(JsExpression... expressions)
public static JsFunction createEmptyFunctionLiteral(SourceInfo info, JsScope scope, JsName name)
public static JsExpression createQualifiedNameRef(SourceInfo info, JsExpression base, String... names)
public static JsNameRef createQualifiedNameRef(String namespace, SourceInfo sourceInfo)
public static JsNameRef createQualifiedNameRef(SourceInfo info, JsName... names)
public static JsExpression createApplyInvocation(SourceInfo sourceInfo, com.google.gwt.dev.js.JsUtils.InvocationDescriptor invocationDescriptor)
public static JsExpression createDirectInvocationOrPropertyAccess(SourceInfo sourceInfo, com.google.gwt.dev.js.JsUtils.InvocationDescriptor invocationDescriptor)
public static JsExpression createCallInvocationOrSuperPropertyAccess(SourceInfo sourceInfo, com.google.gwt.dev.js.JsUtils.InvocationDescriptor invocationDescriptor)
public static JsExpression createInvocationOrPropertyAccess(JsUtils.InvocationStyle invocationStyle, SourceInfo sourceInfo, JMethod method, JsExpression instance, JsNameRef reference, List<JsExpression> args)
public static JsExpression extractExpression(JsStatement stmt)
null
.public static JsName getJsNameForMethod(JavaToJavaScriptMap jjsmap, JProgram jprogram, String indexedMethodName)
public static JsName getJsNameForField(JavaToJavaScriptMap jjsmap, JProgram jprogram, String indexedMethodName)
public static boolean isEmpty(JsStatement stmt)
public static JsFunction isFunctionDeclaration(JsStatement stmt)
null
.public static boolean isValidJsIdentifier(String name)
public static boolean isValidJsQualifiedName(String name)
Copyright © 2018. All rights reserved.