mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
improve the constructor of FunctionName
This commit is contained in:
parent
51b58e2a79
commit
c2683f4576
@ -28,6 +28,12 @@ import de.inetsoftware.classparser.Member;
|
|||||||
*/
|
*/
|
||||||
public class FunctionName {
|
public class FunctionName {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Java class name.
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
public final String className;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name in the WebAssembly.
|
* The name in the WebAssembly.
|
||||||
*/
|
*/
|
||||||
@ -40,6 +46,12 @@ public class FunctionName {
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
public final String signatureName;
|
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.
|
* Create a new instance from the given reference in the ConstantPool or parsed method.
|
||||||
*
|
*
|
||||||
@ -47,10 +59,36 @@ public class FunctionName {
|
|||||||
* the Java method
|
* the Java method
|
||||||
*/
|
*/
|
||||||
FunctionName( @Nonnull Member methodOrField ) {
|
FunctionName( @Nonnull Member methodOrField ) {
|
||||||
String methodName = methodOrField.getName();
|
this( methodOrField, methodOrField.getType() );
|
||||||
String className = methodOrField.getClassName();
|
}
|
||||||
fullName = className + '.' + methodName;
|
|
||||||
signatureName = fullName + 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user