codesimian
Class Reflect

java.lang.Object
  extended by codesimian.Reflect

public class Reflect
extends java.lang.Object


Field Summary
static java.lang.String[] actions
          in function names, most common text that represents what the function does.
static byte DELETE
          1 of 4 types of ACTION
static byte DOUBLE
          1 of 3 types of QUANTITY.
static byte GET
          1 of 4 types of ACTION
static byte INSERT
          1 of 4 types of ACTION
static byte INTMANY
          1 of 3 types of QUANTITY
static byte INTONE
          1 of 3 types of QUANTITY
static byte SET
          1 of 4 types of ACTION
 
Constructor Summary
Reflect()
           
 
Method Summary
static java.lang.String javaCodeForZeroOfPrimitiveType(java.lang.Class primType)
          examples: returns "0." for double.class and "false" for boolean.class
static java.lang.String pathNameOfJavaCodeForClass(java.lang.String javaCodeForClass)
          example: returns "codesimian/DefaultCS.java" if code contains "package codesimian; ...
static java.lang.String simpleName(java.lang.Class type)
          Name of a Class or primitive type with no array brackets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actions

public static final java.lang.String[] actions
in function names, most common text that represents what the function does. The first String is empty because some functions, like P(int) have the implied action: get, but no "get" in the name.


GET

public static final byte GET
1 of 4 types of ACTION

See Also:
Constant Field Values

SET

public static final byte SET
1 of 4 types of ACTION

See Also:
Constant Field Values

INSERT

public static final byte INSERT
1 of 4 types of ACTION

See Also:
Constant Field Values

DELETE

public static final byte DELETE
1 of 4 types of ACTION

See Also:
Constant Field Values

INTMANY

public static final byte INTMANY
1 of 3 types of QUANTITY

See Also:
Constant Field Values

INTONE

public static final byte INTONE
1 of 3 types of QUANTITY

See Also:
Constant Field Values

DOUBLE

public static final byte DOUBLE
1 of 3 types of QUANTITY. There is only 1 type of QUANTITY that uses DOUBLE

See Also:
Constant Field Values
Constructor Detail

Reflect

public Reflect()
Method Detail

simpleName

public static java.lang.String simpleName(java.lang.Class type)
Name of a Class or primitive type with no array brackets. boolean[][].class --> "boolean". Integer.class --> "java.lang.Integer".


pathNameOfJavaCodeForClass

public static java.lang.String pathNameOfJavaCodeForClass(java.lang.String javaCodeForClass)
example: returns "codesimian/DefaultCS.java" if code contains "package codesimian; ... class DefaultCS extends CS{" etc

WARNING: this algorithm usually works, but does not detect things like "package" in a comment or string.


javaCodeForZeroOfPrimitiveType

public static java.lang.String javaCodeForZeroOfPrimitiveType(java.lang.Class primType)
examples: returns "0." for double.class and "false" for boolean.class