com.threerings.presents.tools
Class ActionScriptUtils

java.lang.Object
  extended by com.threerings.presents.tools.ActionScriptUtils

public class ActionScriptUtils
extends Object


Field Summary
protected static Pattern AS_IMPORT
           
protected static Pattern AS_PUBLIC_CLASS_DECL
           
protected static Splitter DOT_SPLITTER
           
 
Constructor Summary
ActionScriptUtils()
           
 
Method Summary
static void addExistingImports(String asFile, ImportSet imports)
          Adds an existing ActionScript file's imports to the given ImportSet.
static String addImportAndGetShortType(Class<?> type, boolean isField, ImportSet imports)
           
static void convertBaseClasses(ImportSet imports)
          Converts java types to their actionscript equivalents for ooo-style streaming.
static File createActionScriptPath(File actionScriptRoot, Class<?> sclass)
           
static boolean hasOmitAnnotation(Class<?> cclass)
           
protected static boolean isNaiveList(Class<?> type)
          Returns if the given class is an implementation of List that doesn't know about Streaming
protected static boolean isNaiveMap(Class<?> type)
          Returns if the given class is an implementation of Map that doesn't know about Streaming
protected static boolean isNaiveSet(Class<?> type)
           
protected static boolean needsActionScriptImport(Class<?> type, boolean isField)
           
static String toActionScriptType(Class<?> type, boolean isField)
           
static String toReadObject(Class<?> type)
           
static String toSimpleName(Class<?> type)
           
static String toWriteObject(Class<?> type, String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOT_SPLITTER

protected static final Splitter DOT_SPLITTER

AS_PUBLIC_CLASS_DECL

protected static final Pattern AS_PUBLIC_CLASS_DECL

AS_IMPORT

protected static final Pattern AS_IMPORT
Constructor Detail

ActionScriptUtils

public ActionScriptUtils()
Method Detail

addExistingImports

public static void addExistingImports(String asFile,
                                      ImportSet imports)
Adds an existing ActionScript file's imports to the given ImportSet.

Parameters:
asFile - a String containing the contents of an ActionScript file

addImportAndGetShortType

public static String addImportAndGetShortType(Class<?> type,
                                              boolean isField,
                                              ImportSet imports)

toSimpleName

public static String toSimpleName(Class<?> type)

toReadObject

public static String toReadObject(Class<?> type)

toWriteObject

public static String toWriteObject(Class<?> type,
                                   String name)

toActionScriptType

public static String toActionScriptType(Class<?> type,
                                        boolean isField)

convertBaseClasses

public static void convertBaseClasses(ImportSet imports)
Converts java types to their actionscript equivalents for ooo-style streaming.


createActionScriptPath

public static File createActionScriptPath(File actionScriptRoot,
                                          Class<?> sclass)

hasOmitAnnotation

public static boolean hasOmitAnnotation(Class<?> cclass)

isNaiveMap

protected static boolean isNaiveMap(Class<?> type)
Returns if the given class is an implementation of Map that doesn't know about Streaming


isNaiveSet

protected static boolean isNaiveSet(Class<?> type)

isNaiveList

protected static boolean isNaiveList(Class<?> type)
Returns if the given class is an implementation of List that doesn't know about Streaming


needsActionScriptImport

protected static boolean needsActionScriptImport(Class<?> type,
                                                 boolean isField)