public class JavaToJavaScriptMapImpl extends Object implements JavaToJavaScriptMap
EMPTY
Constructor and Description |
---|
JavaToJavaScriptMapImpl(List<JDeclaredType> types,
Map<HasName,JsName> names,
Map<JsStatement,JDeclaredType> typeForStatement,
Map<JsStatement,JMethod> methodForStatement) |
Modifier and Type | Method and Description |
---|---|
JMethod |
methodForStatement(JsStatement statement)
If
stat is used to set up the definion for some method implementation, then
return that method. |
JsName |
nameForField(JField field)
Return the JavaScript name corresponding to a Java field.
|
JsName |
nameForMethod(JMethod method)
Return the JavaScript name corresponding to a Java method.
|
JsName |
nameForType(JDeclaredType type)
Return the JavaScript name corresponding to a Java type.
|
JField |
nameToField(JsName name)
If name is the name of a
var
|
JMethod |
nameToMethod(JsName name)
If
name is the name of a function that corresponds to a Java
method, then return that method. |
JClassType |
nameToType(JsName name)
If
name is the name of a constructor function corresponding to
a Java type, then return that type. |
JDeclaredType |
typeForStatement(JsStatement statement)
If
statement is used to set up the definition of some type, return
that class. |
public JavaToJavaScriptMapImpl(List<JDeclaredType> types, Map<HasName,JsName> names, Map<JsStatement,JDeclaredType> typeForStatement, Map<JsStatement,JMethod> methodForStatement)
public JsName nameForField(JField field)
JavaToJavaScriptMap
nameForField
in interface JavaToJavaScriptMap
public JsName nameForMethod(JMethod method)
JavaToJavaScriptMap
nameForMethod
in interface JavaToJavaScriptMap
public JsName nameForType(JDeclaredType type)
JavaToJavaScriptMap
nameForType
in interface JavaToJavaScriptMap
public JField nameToField(JsName name)
JavaToJavaScriptMap
name
is the name of a
var that corresponds to a Java
static field, then return that field. Otherwise, return null.
- Specified by:
nameToField
in interface JavaToJavaScriptMap
-
nameToMethod
public JMethod nameToMethod(JsName name)
Description copied from interface: JavaToJavaScriptMap
If name
is the name of a function that corresponds to a Java
method, then return that method. Otherwise, return null.
- Specified by:
nameToMethod
in interface JavaToJavaScriptMap
-
nameToType
public JClassType nameToType(JsName name)
Description copied from interface: JavaToJavaScriptMap
If name
is the name of a constructor function corresponding to
a Java type, then return that type. Otherwise, return null
.
- Specified by:
nameToType
in interface JavaToJavaScriptMap
-
typeForStatement
public JDeclaredType typeForStatement(JsStatement statement)
Description copied from interface: JavaToJavaScriptMap
If statement
is used to set up the definition of some type, return
that class. Otherwise, return null.
- Specified by:
typeForStatement
in interface JavaToJavaScriptMap
-
methodForStatement
public JMethod methodForStatement(JsStatement statement)
Description copied from interface: JavaToJavaScriptMap
If stat
is used to set up the definion for some method implementation, then
return that method. Otherwise return null.
- Specified by:
methodForStatement
in interface JavaToJavaScriptMap
Copyright © 2018. All rights reserved.