|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.generator.JavaType
This class represents a Java data type. The primitive data types
are available as static fields available via this class name.
Also, the void return type and the commonly used
String
data type each have a static representation.
Additionally, a static method is available to find the appropriate
primitive data type via a keyword string, such as int.
Field Summary | |
static JavaType |
BOOLEAN_TYPE
The boolean primitive data type. |
static JavaType |
BYTE_TYPE
The byte primitive data type. |
static JavaType |
CHAR_TYPE
The char primitive data type. |
static JavaType |
DOUBLE_TYPE
The double primitive data type. |
static JavaType |
FLOAT_TYPE
The float primitive data type. |
static JavaType |
INT_TYPE
The int primitive data type. |
static JavaType |
LONG_TYPE
The long primitive data type. |
static JavaType |
SHORT_TYPE
The short primitive data type. |
static JavaType |
STRING_TYPE
The commonly used String data type. |
static JavaType |
VOID_TYPE
The commonly used void return type. |
Constructor Summary | |
JavaType(String typeName)
Constructs a JavaType with the specified
type name. |
|
JavaType(String packageName,
String typeName)
Constructs a JavaType with the specified
package name and type name. |
Method Summary | |
boolean |
equals(Object obj)
Returns true if this data type is equal to another object. |
String |
getPackage()
Returns the type's package name. |
String |
getType()
Returns the type's name. |
int |
hashCode()
Returns a hash code value for this JavaType. |
boolean |
hasPackage()
Returns whether the type has a package specified or not. |
String |
toString()
Returns a String object representing this JavaType. |
String |
toString(boolean includePackage)
Returns a String object representing this JavaType. |
static JavaType |
typeFor(String typeName)
Returns an appropriate JavaType for the given type name string. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final JavaType BOOLEAN_TYPE
public static final JavaType BYTE_TYPE
public static final JavaType CHAR_TYPE
public static final JavaType DOUBLE_TYPE
public static final JavaType FLOAT_TYPE
public static final JavaType INT_TYPE
public static final JavaType LONG_TYPE
public static final JavaType SHORT_TYPE
public static final JavaType STRING_TYPE
public static final JavaType VOID_TYPE
Constructor Detail |
public JavaType(String typeName)
JavaType
with the specified
type name. If the type name is a class name, it can include the
full package name.
typeName
- The type's name.public JavaType(String packageName, String typeName)
JavaType
with the specified
package name and type name.
packageName
- The type's package name.typeName
- The type's name.Method Detail |
public static JavaType typeFor(String typeName)
null
string is given,
the void return type will be returned.
If the given type name string is one of the primitive data types
or it is the string "String"
,
the appropriate static field will be returned.
If the given type name is not a primitive data type and is a class name,
it can include the full package name.
typeName
- The data type to get.public boolean hasPackage()
public String getPackage()
null
is returned.
public String getType()
public boolean equals(Object obj)
equals
in class Object
obj
- The object to compare with.
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public String toString(boolean includePackage)
includePackage
is true, include the package name.
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |