diff --git a/src/de/inetsoftware/jwebassembly/module/FunctionName.java b/src/de/inetsoftware/jwebassembly/module/FunctionName.java index 866d661..a552ac8 100644 --- a/src/de/inetsoftware/jwebassembly/module/FunctionName.java +++ b/src/de/inetsoftware/jwebassembly/module/FunctionName.java @@ -28,6 +28,12 @@ import de.inetsoftware.classparser.Member; */ public class FunctionName { + /** + * The Java class name. + */ + @Nonnull + public final String className; + /** * The name in the WebAssembly. */ @@ -40,6 +46,12 @@ public class FunctionName { @Nonnull public final String signatureName; + /** + * The signature + */ + @Nonnull + public final String signature; + /** * Create a new instance from the given reference in the ConstantPool or parsed method. * @@ -47,10 +59,36 @@ public class FunctionName { * the Java method */ FunctionName( @Nonnull Member methodOrField ) { - String methodName = methodOrField.getName(); - String className = methodOrField.getClassName(); - fullName = className + '.' + methodName; - signatureName = fullName + methodOrField.getType(); + this( methodOrField, methodOrField.getType() ); + } + + /** + * Create a new instance from the given reference in the ConstantPool and a special signature. + * + * @param methodOrField + * the Java method + * @param signature + * the Java signature + */ + FunctionName( @Nonnull Member methodOrField, String signature ) { + this( methodOrField.getClassName(), methodOrField.getName(), signature ); + } + + /** + * Create a new instance from the given values + * + * @param className + * the Java class name + * @param methodName + * the Java method name + * @param signature + * the Java signature + */ + FunctionName( String className, String methodName, String signature ) { + this.className = className; + this.fullName = className + '.' + methodName; + this.signatureName = fullName + signature; + this.signature = signature; } /**