Oh yeah, that too
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6346 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -55,6 +55,13 @@ public class ActionScriptUtils
|
|||||||
return Iterables.getLast(DOT_SPLITTER.split(full));
|
return Iterables.getLast(DOT_SPLITTER.split(full));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static String toSimpleName (Class<?> type)
|
||||||
|
{
|
||||||
|
String name = type.getName().substring(type.getName().lastIndexOf(".") + 1);
|
||||||
|
// inner classes are not supported by ActionScript so we _
|
||||||
|
return name.replaceAll("\\$", "_");
|
||||||
|
}
|
||||||
|
|
||||||
public static String toReadObject (Class<?> type)
|
public static String toReadObject (Class<?> type)
|
||||||
{
|
{
|
||||||
if (type.equals(String.class)) {
|
if (type.equals(String.class)) {
|
||||||
@@ -63,12 +70,10 @@ public class ActionScriptUtils
|
|||||||
} else if (type.equals(Integer.class) ||
|
} else if (type.equals(Integer.class) ||
|
||||||
type.equals(Short.class) ||
|
type.equals(Short.class) ||
|
||||||
type.equals(Byte.class)) {
|
type.equals(Byte.class)) {
|
||||||
String name = ActionScriptSource.toSimpleName(type.getName());
|
return "readField(" + toSimpleName(type) + ").value";
|
||||||
return "readField(" + name + ").value";
|
|
||||||
|
|
||||||
} else if (type.equals(Long.class)) {
|
} else if (type.equals(Long.class)) {
|
||||||
String name = ActionScriptSource.toSimpleName(type.getName());
|
return "readField(" + toSimpleName(type) + ")";
|
||||||
return "readField(" + name + ")";
|
|
||||||
|
|
||||||
} else if (type.equals(Boolean.TYPE)) {
|
} else if (type.equals(Boolean.TYPE)) {
|
||||||
return "readBoolean()";
|
return "readBoolean()";
|
||||||
|
|||||||
Reference in New Issue
Block a user