|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.samskivert.util.GenUtil
com.threerings.presents.tools.GenUtil
public class GenUtil
Utility methods used by our various source code generating tasks.
| Field Summary | |
|---|---|
static Pattern |
NAME_PATTERN
A regular expression for matching the class or interface declaration. |
static Pattern |
PACKAGE_PATTERN
A regular expression for matching the package declaration. |
| Constructor Summary | |
|---|---|
GenUtil()
|
|
| Method Summary | |
|---|---|
static String |
boxArgument(Class<?> clazz,
String name)
"Boxes" the supplied argument, ie. |
static String |
boxASArgument(Class<?> clazz,
String name)
"Boxes" the supplied argument, ie. |
static String |
cloneArgument(Class<?> dsclazz,
Field field,
String name)
Potentially clones the supplied argument if it is the type that needs such treatment. |
static String |
getGeneratedAnnotation(Class<?> clazz,
int indent,
boolean includeDate,
String... comments)
Return an "@Generated" annotation. |
static String |
readClassName(File source)
Reads in the supplied source file and locates the package and class or interface name and returns a fully qualified class name. |
static String |
simpleASName(Class<?> clazz)
Returns the name of the supplied class as it would appear in ActionScript code using the class (no package prefix, arrays specified as Array Array). |
static String |
unboxArgument(Type type,
String name)
"Unboxes" the supplied argument, ie. |
static String |
unboxASArgument(Class<?> clazz,
String name)
"Unboxes" the supplied argument, ie. |
| Methods inherited from class com.samskivert.util.GenUtil |
|---|
simpleName, simpleName |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Pattern PACKAGE_PATTERN
public static final Pattern NAME_PATTERN
| Constructor Detail |
|---|
public GenUtil()
| Method Detail |
|---|
public static String simpleASName(Class<?> clazz)
Array).
public static String boxArgument(Class<?> clazz,
String name)
int into an Integer
object.
public static String unboxArgument(Type type,
String name)
Integer object into an
int.
public static String boxASArgument(Class<?> clazz,
String name)
int into an Integer
object.
public static String unboxASArgument(Class<?> clazz,
String name)
Integer object into an
int.
public static String cloneArgument(Class<?> dsclazz,
Field field,
String name)
public static String readClassName(File source)
throws IOException
IOException
public static String getGeneratedAnnotation(Class<?> clazz,
int indent,
boolean includeDate,
String... comments)
clazz - the class doing the code generation, NOT the generation target.indent - the number of spaces that the annotation is indented.includeDate - include the date?comments - joined by a space and used as explanatory comments.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||