本文整理匯總了Java中org.teavm.jso.JSMethod類的典型用法代碼示例。如果您正苦於以下問題:Java JSMethod類的具體用法?Java JSMethod怎麽用?Java JSMethod使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JSMethod類屬於org.teavm.jso包,在下文中一共展示了JSMethod類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addInterfaces
import org.teavm.jso.JSMethod; //導入依賴的package包/類
private boolean addInterfaces(ExposedClass exposedCls, ClassReader cls) {
boolean added = false;
for (String ifaceName : cls.getInterfaces()) {
if (exposedCls.implementedInterfaces.contains(ifaceName)) {
continue;
}
ClassReader iface = innerSource.get(ifaceName);
if (iface == null) {
continue;
}
if (addInterface(exposedCls, iface)) {
added = true;
for (MethodReader method : iface.getMethods()) {
if (method.hasModifier(ElementModifier.STATIC)
|| (method.getProgram() != null && method.getProgram().basicBlockCount() > 0)) {
continue;
}
if (!exposedCls.inheritedMethods.containsKey(method.getDescriptor())) {
String name = method.getName();
AnnotationReader methodAnnot = method.getAnnotations().get(JSMethod.class.getName());
if (methodAnnot != null) {
AnnotationValue nameVal = methodAnnot.getValue("value");
if (nameVal != null) {
String nameStr = nameVal.getString();
if (!nameStr.isEmpty()) {
name = nameStr;
}
}
}
exposedCls.methods.put(method.getDescriptor(), name);
}
}
}
}
return added;
}
示例2: processMethod
import org.teavm.jso.JSMethod; //導入依賴的package包/類
private boolean processMethod(MethodReader method, CallLocation callLocation, InvokeInstruction invoke) {
String name = method.getName();
AnnotationReader methodAnnot = method.getAnnotations().get(JSMethod.class.getName());
if (methodAnnot != null) {
AnnotationValue redefinedMethodName = methodAnnot.getValue("value");
if (redefinedMethodName != null) {
name = redefinedMethodName.getString();
}
}
boolean[] byRefParams = new boolean[method.parameterCount() + 1];
if (!validateSignature(method, callLocation, byRefParams)) {
return false;
}
Variable result = invoke.getReceiver() != null ? program.createVariable() : null;
InvokeInstruction newInvoke = new InvokeInstruction();
ValueType[] signature = new ValueType[method.parameterCount() + 3];
Arrays.fill(signature, ValueType.object(JSObject.class.getName()));
newInvoke.setMethod(new MethodReference(JS.class.getName(), "invoke", signature));
newInvoke.setType(InvocationType.SPECIAL);
newInvoke.setReceiver(result);
newInvoke.getArguments().add(invoke.getInstance());
newInvoke.getArguments().add(marshaller.addStringWrap(marshaller.addString(name, invoke.getLocation()),
invoke.getLocation()));
newInvoke.setLocation(invoke.getLocation());
for (int i = 0; i < invoke.getArguments().size(); ++i) {
Variable arg = marshaller.wrapArgument(callLocation, invoke.getArguments().get(i),
method.parameterType(i), byRefParams[i]);
newInvoke.getArguments().add(arg);
}
replacement.add(newInvoke);
if (result != null) {
result = marshaller.unwrapReturnValue(callLocation, result, method.getResultType());
copyVar(result, invoke.getReceiver(), invoke.getLocation());
}
return true;
}
示例3: bindVertexArrayOES
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod
void bindVertexArrayOES(JSObject name);
示例4: deleteVertexArrayOES
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod
void deleteVertexArrayOES(JSObject name);
示例5: createVertexArrayOES
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod
JSObject createVertexArrayOES();
示例6: onAnimation
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod
void onAnimation();
示例7: add
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod("push")
public abstract void add(Node value);
示例8: output
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod("$rt_putStdout")
void output(int b);
示例9: error
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod("$rt_putStderr")
void error(int b);
示例10: nextId
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod("$rt_nextId")
int nextId();
示例11: killSchedule
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod("clearTimeout")
void killSchedule(int scheduleId);
示例12: doContinue
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod("continue")
void doContinue();
示例13: getSupportedExtensionArray
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod("getSupportedExtensions")
String[] getSupportedExtensionArray();
示例14: getAttachedShadersArray
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod("getAttachedShaders")
WebGLShader[] getAttachedShadersArray(WebGLProgram program);
示例15: getParameteri
import org.teavm.jso.JSMethod; //導入依賴的package包/類
@JSMethod("getParameter")
int getParameteri(int pname);