private String getNativeNameForJavaType ( TypeMirror typeMirror ) { TypeName typeName = TypeName . get ( typeMirror ) ; if ( typeName . equals ( TypeName . INT ) || typeName . equals ( TypeName . BYTE ) || typeName . equals ( TypeName . SHORT ) || typeName . equals ( TypeName . LONG ) || typeName . equals ( TypeName . FLOAT ) || typeName . equals ( TypeName . DOUBLE ) ) { return "Number" ; } else if ( typeName . equals ( TypeName . BOOLEAN ) ) { return "Boolean" ; } else if ( typeName . equals ( TypeName . get ( String . class ) ) || typeName . equals ( TypeName . CHAR ) ) { return "String" ; } else if ( typeMirror . toString ( ) . startsWith ( JsArray . class . getCanonicalName ( ) ) ) { return "Array" ; } else { return "Object" ; } }
Transform a Java type name into a JavaScript type name . Takes care of primitive types .