From 4453cc1c8f80f92e32cd79560862c6798c2f0a89 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sun, 2 Jan 2022 21:21:01 +0100 Subject: [PATCH] more method stubs for class Class --- .../nativecode/ReplacementForClass.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/de/inetsoftware/jwebassembly/module/nativecode/ReplacementForClass.java b/src/de/inetsoftware/jwebassembly/module/nativecode/ReplacementForClass.java index 31e4eb6..15f37ae 100644 --- a/src/de/inetsoftware/jwebassembly/module/nativecode/ReplacementForClass.java +++ b/src/de/inetsoftware/jwebassembly/module/nativecode/ReplacementForClass.java @@ -1,5 +1,5 @@ /* - Copyright 2020 - 2021 Volker Berlin (i-net software) + Copyright 2020 - 2022 Volker Berlin (i-net software) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ import static de.inetsoftware.jwebassembly.module.TypeManager.VOID; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Type; +import java.util.Map; import de.inetsoftware.jwebassembly.api.annotation.Replace; import de.inetsoftware.jwebassembly.api.annotation.WasmTextCode; @@ -217,6 +218,14 @@ class ReplacementForClass { @WasmTextCode( "unreachable" ) // TODO public native boolean isAssignableFrom( Class cls ); + /** + * Replacement of the Java method isInterface() + * + * @return {@code true} if this object represents an interface; + */ + @WasmTextCode( "unreachable" ) // TODO + public native boolean isInterface(); + /** * Replacement of the Java method isArray() * @return {@code true} if this object represents an array class; @@ -405,4 +414,13 @@ class ReplacementForClass { public boolean desiredAssertionStatus() { return false; } + + /** + * Replacement of the Java method enumConstantDirectory() + * + * Returns a map from simple name to enum constant. This package-private + * method is used internally by Enum to implement + */ + @WasmTextCode( "unreachable" ) // TODO + native Map enumConstantDirectory(); }