Implemented StringUtil.fieldsToString() using flash's introspection.
Use it in SimpleStreamableObject's toString(), with some new formatting. Unfortunately, the order of public variables seems random. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4746 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -21,7 +21,9 @@
|
||||
|
||||
package com.threerings.io {
|
||||
|
||||
import com.threerings.util.ClassUtil;
|
||||
import com.threerings.util.StringBuilder;
|
||||
import com.threerings.util.StringUtil;
|
||||
|
||||
/**
|
||||
* A simple serializable object implements the {@link Streamable}
|
||||
@@ -48,8 +50,9 @@ public class SimpleStreamableObject implements Streamable
|
||||
public function toString () :String
|
||||
{
|
||||
var buf :StringBuilder = new StringBuilder("[");
|
||||
buf.append(ClassUtil.tinyClassName(this)).append("(");
|
||||
toStringBuilder(buf);
|
||||
return buf.append("]").toString();
|
||||
return buf.append(")]").toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +61,7 @@ public class SimpleStreamableObject implements Streamable
|
||||
*/
|
||||
protected function toStringBuilder (buf :StringBuilder): void
|
||||
{
|
||||
// TODO: StringUtil.fieldsToString(buf, this);
|
||||
StringUtil.fieldsToString(buf, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user