
public class JRunAsync extends JExpression
| Constructor and Description |
|---|
JRunAsync(SourceInfo info,
int runAsyncId,
String name,
boolean explicitClassLiteral,
JExpression runAsyncCall,
JExpression onSuccessCall)
Constructs a runAsync call node; explicitClassLiteral is set if the corresponding
GWT.runAsync() call has a class literal.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Based on either explicit class literal, or the jsni name of the containing
method.
|
JExpression |
getOnSuccessCall()
Returns a call expression akin to
callback.onSuccess(). |
JExpression |
getRunAsyncCall()
Returns a call expression akin to
AsyncFragmentLoader.runAsync(7, callback). |
int |
getRunAsyncId()
Returns a unique id for each runAsync, 1-based.
|
JType |
getType()
Returns the type of this expression.
|
boolean |
hasExplicitClassLiteral()
Returns true if the corresponding GWT.runAsync call had a class literal.
|
boolean |
hasSideEffects() |
void |
traverse(JVisitor visitor,
Context ctx)
Causes this object to have the visitor visit itself and its children.
|
void |
traverseOnSuccess(JVisitor visitor)
Explcitly traverse the onSuccessCall.
|
makeStatementgetSourceInfo, setSourceInfo, toSource, toStringpublic JRunAsync(SourceInfo info, int runAsyncId, String name, boolean explicitClassLiteral, JExpression runAsyncCall, JExpression onSuccessCall)
public String getName()
public JExpression getOnSuccessCall()
callback.onSuccess().
ControlFlowAnalyzer makes a synthetic
visit to this call on the "far" side of the split point, ie, the code that
runs when the fragment is through downloading.public JExpression getRunAsyncCall()
AsyncFragmentLoader.runAsync(7, callback). This represents the
"near" side of the split point, calling into the machinery that queues up
the fragment download.public int getRunAsyncId()
ReplaceRunAsyncs embeds these ids into the Java AST as parameter for a call to RunAsync.forSplitPointNumber}
TODO(rluble): these ids used to be splitpoint/fragment ids back when there was 1-to-1 mapping from RunAsyncs to fragment id. This code and the runtime code need to be refactored so that its less coupled and cleaner.public JType getType()
HasTypepublic boolean hasSideEffects()
hasSideEffects in class JExpressionpublic void traverse(JVisitor visitor, Context ctx)
JVisitablevisitor - the visitor that should traverse this nodectx - the context of an existing traversalpublic void traverseOnSuccess(JVisitor visitor)
public boolean hasExplicitClassLiteral()
Copyright © 2018. All rights reserved.