|
org.openide.src 1.8.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.src.Type
public final class Type
Java types.
Field Summary | |
---|---|
static Type |
BOOLEAN
boolean primitive type. |
static Type |
BYTE
byte primitive type. |
static Type |
CHAR
char primitive type. |
static Type |
DOUBLE
double primitive type. |
static Type |
FLOAT
float primitive type. |
static Type |
INT
int primitive type. |
static Type |
LONG
long primitive type. |
static Type |
SHORT
short primitive type. |
static Type |
VOID
void primitive type. |
Method Summary | |
---|---|
boolean |
compareTo(Type type,
boolean source)
Compare the specified Type with this Type for equality. |
static Type |
createArray(Type elementType)
Create an array type. |
static Type |
createClass(Identifier id)
Create a class type by name. |
static Type |
createFromClass(Class cl)
Create a type from an existing class. |
boolean |
equals(Object o)
Compare the specified object with this Type for equality. |
Identifier |
getClassName()
Get the (fully-qualified) name of this class type. |
Type |
getElementType()
Get the element type of this array type. |
String |
getFullString()
Get a form of this type usable in Java source. |
String |
getSignature()
Deprecated. Use Type.getSignature (FileObject projectArtefact) method. |
String |
getSignature(FileObject projectArtefact)
Returns a JVM-signature of the type. |
String |
getSourceString()
Get a form of this type usable in Java source. |
Identifier |
getTypeIdentifier()
Returns the identifier of a class for a class-type. |
static String[] |
getTypesNames()
Get the Java names of the primitive types. |
String |
getVMClassName()
Deprecated. Use the Test.getVMClassName(final FileObject projectArtefact) method. |
String |
getVMClassName(FileObject projectArtefact)
Constructs and returns name of a reference type that can be used for Class.forName(). |
int |
hashCode()
|
boolean |
isArray()
Test if the type is an array. |
boolean |
isClass()
Test if the type is a class or interface. |
boolean |
isPrimitive()
Test if the type is primitive. |
static Type |
parse(String text)
Create a type from its string representation. |
Class |
toClass()
Attempt to get the real class corresponding to this type, using the default class loader. |
Class |
toClass(ClassLoader loader)
Attempt to get the real class corresponding to this type. |
String |
toString()
Get a form of this type usable in Java source. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Type VOID
void
primitive type.
public static final Type BOOLEAN
boolean
primitive type.
public static final Type INT
int
primitive type.
public static final Type CHAR
char
primitive type.
public static final Type BYTE
byte
primitive type.
public static final Type SHORT
short
primitive type.
public static final Type LONG
long
primitive type.
public static final Type FLOAT
float
primitive type.
public static final Type DOUBLE
double
primitive type.
Method Detail |
---|
public static String[] getTypesNames()
public static Type createArray(Type elementType)
elementType
- the element type
public static Type createClass(Identifier id)
id
- the class name
public static Type createFromClass(Class cl)
cl
- the class
public static Type parse(String text) throws IllegalArgumentException
text
- the string representation, e.g. "int[][]"
,
"java.awt.Button"
, etc.
InvalidArgumentException
- if the text cannot be parsed
IllegalArgumentException
public boolean isPrimitive()
true
if sopublic boolean isArray()
true
if sopublic boolean isClass()
true
if so, false
if an array or primitive typepublic Type getElementType() throws IllegalStateException
IllegalStateException
- if this type is not an array typepublic Identifier getClassName() throws IllegalStateException
IllegalStateException
- if this type is not a simple class or interface typepublic Class toClass() throws ClassNotFoundException
ClassNotFoundException
- if the class cannot be foundpublic Class toClass(ClassLoader loader) throws ClassNotFoundException
loader
- class loader to use for loading classes
ClassNotFoundException
- if the class cannot be foundpublic String getSourceString()
public String getFullString()
public String toString()
public final String getVMClassName() throws UnsupportedOperationException
UnsupportedOperationException
public final String getVMClassName(FileObject projectArtefact) throws UnsupportedOperationException
projectArtefact
- the FileObject which implies the project classpath to resolve the Type into ClassElement
UnsupportedOperationException
- if the type is primitive.public final Identifier getTypeIdentifier() throws UnsupportedOperationException
UnsupportedOperationException
public final String getSignature()
public final String getSignature(FileObject projectArtefact)
projectArtefact
- the FileObject which implies the project ClassPath
public boolean compareTo(Type type, boolean source)
type
- Type to be compared with thissource
- Determine if the source name (for class types)
should be also compared.
If false
only fully qualified name is compared.
true
if the specified object equals to
specified Identifier otherwise false
.public boolean equals(Object o)
o
- Object to be compared with this
true
if the specified object represents the same type
otherwise false
.public int hashCode()
|
org.openide.src 1.8.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |