mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
implements getCanonicalName()
This commit is contained in:
parent
bb96fdcea6
commit
5d7f0773da
@ -318,6 +318,35 @@ class ReplacementForClass<T> {
|
||||
return simpleName.substring( index );
|
||||
}
|
||||
|
||||
/**
|
||||
* Replacement of the Java method getCanonicalName()
|
||||
*
|
||||
* @return the canonical name of the underlying class
|
||||
*/
|
||||
public String getCanonicalName() {
|
||||
String canonicalName;
|
||||
if( isArray() ) {
|
||||
canonicalName = getComponentType().getCanonicalName();
|
||||
if( canonicalName != null )
|
||||
return canonicalName + "[]";
|
||||
else
|
||||
return null;
|
||||
}
|
||||
canonicalName = getName();
|
||||
int idx = canonicalName.indexOf( '$' );
|
||||
if( idx >= 0 ) {
|
||||
idx++;
|
||||
if( idx < canonicalName.length() ) {
|
||||
char ch = canonicalName.charAt( idx );
|
||||
if( '0' <= ch && ch <= '9' ) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return canonicalName.replace( '$', '.' );
|
||||
}
|
||||
return canonicalName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replacement of the Java method getMethod()
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user