|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.3.0) E17493-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.parser.java.v2.common.AbstractElement
oracle.javatools.parser.java.v2.common.AbstractType
oracle.javatools.parser.java.v2.common.AbstractClass
oracle.javatools.parser.java.v2.common.PrimitiveType
public final class PrimitiveType
Represents a primitive type JavaClass. To get one, you may either use the lookup tables provided here as static fields or CommonUtilities.getPrimitiveType(S).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface oracle.javatools.parser.java.v2.JavaPreferences |
---|
JavaPreferences.MemberOrder |
Field Summary | |
---|---|
byte |
primCode Primitive code. |
static PrimitiveType[] |
PRIMITIVE_alpha Letter-to-primitive lookup table indexed by ch - 'A' value. |
static PrimitiveType[] |
PRIMITIVE_lookup Token-to-primitive lookup table indexed by tk - KW_base value. |
static PrimitiveType[] |
PRIMITIVE_objects Array of PrimitiveObj instances. |
Fields inherited from interface oracle.javatools.parser.java.v2.JavaOperators |
---|
OPT_ADD, OPT_ADDASG, OPT_AND, OPT_ANNOTATION, OPT_ARRAYCONST, OPT_ASG, OPT_base, OPT_BITAND, OPT_BITANDASG, OPT_BITNOT, OPT_BITOR, OPT_BITORASG, OPT_BITXOR, OPT_BITXORASG, OPT_CLASS_LITERAL, OPT_COND, OPT_DEREF, OPT_DIV, OPT_DIVASG, OPT_DOT, OPT_EQ, OPT_GE, OPT_GT, OPT_INSTANCEOF, OPT_invalid, OPT_INVOKE, OPT_LE, OPT_LIST, OPT_LITERAL, OPT_LSH, OPT_LSHASG, OPT_LT, OPT_max, OPT_MINUS, OPT_MINUSASG, OPT_MOD, OPT_MODASG, OPT_MUL, OPT_MULASG, OPT_NEGATIVE, OPT_NESTEXP, OPT_NEWARRAY, OPT_NEWOBJECT, OPT_NOT, OPT_NOTEQ, OPT_OR, OPT_POSITIVE, OPT_POSTDEC, OPT_POSTINC, OPT_precedence, OPT_PREDEC, OPT_PREINC, OPT_QUALIFIED_SUPER, OPT_QUALIFIED_THIS, OPT_RSH, OPT_RSHASG, OPT_SIMPLE_NAME, OPT_tokens, OPT_TYPE, OPT_TYPECAST, OPT_URSH, OPT_URSHASG, OPT_words |
Fields inherited from interface oracle.javatools.parser.java.v2.model.JavaClass |
---|
EMPTY_ARRAY |
Constructor Summary | |
---|---|
protected |
PrimitiveType(byte code) |
Method Summary | |
---|---|
static boolean |
applyNarrowingConversion(PrimitiveType subject, PrimitiveType target) JLS 5.1.3. |
static PrimitiveType |
applyUnboxingConversion(JavaType input) Deprecated. Use applyUnboxingConversion(JavaType, int) instead |
static PrimitiveType |
applyUnboxingConversion(JavaType input, int j2se) Tries to apply unboxing conversion to the input. |
static boolean |
applyWideningConversion(PrimitiveType subject, PrimitiveType target) JLS 5.1.2. |
java.lang.String |
getDescriptor() Gets the descriptor for this type, as defined by the JVMS2. |
JavaFile |
getFile() |
int |
getModifiers() |
java.lang.String |
getName() Gets the simplest name of this type with "[]"s if present. |
static PrimitiveType |
getNullType() Return the PrimitiveType that represents the null type |
java.lang.String |
getQualifiedName() Gets the fully qualified name of this type in source format. |
java.lang.String |
getSignature() Gets the "Signature" attribute of this type, as defined by the JVMS3. |
java.lang.String |
getTypeSignature() Gets the type signature for this type, as defined by the JVMS3. |
java.lang.String |
getVMName() Gets the VM name for this type. |
boolean |
isFloatingPoint() |
boolean |
isIntegral() |
boolean |
isNumeric() |
static boolean |
isNumeric(PrimitiveType subject) |
boolean |
isPrimitive() |
static PrimitiveType |
lookupPrimitive(java.lang.String name) |
Methods inherited from class oracle.javatools.parser.java.v2.common.AbstractClass |
---|
getElementKind, getTypeErasure, getUniqueIdentifier, isAnnotation, isEnum, isExported, isInterface, isMemberClass |
Methods inherited from class oracle.javatools.parser.java.v2.common.AbstractElement |
---|
getActualTypeArguments, getDeclaredAnnotation, getDeclaredAnnotations, getSourceElement, getSourceSymbol, getTypeParameters, hasActualTypeArguments, hasTypeParameters, isAbstract, isDeprecated, isFinal, isHidden, isPackagePrivate, isPrivate, isProtected, isPublic, isSourceElement, isStatic, isSynthetic, isTransient, isVarargs |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaClass |
---|
clearCompiledInfo |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaType |
---|
equals, getArrayDimensions, getBaseComponentType, getClass, getClasses, getClinitMethod, getClosestClass, getComponentType, getDeclaredClass, getDeclaredClasses, getDeclaredConstructor, getDeclaredConstructors, getDeclaredField, getDeclaredFields, getDeclaredMethod, getDeclaredMethods, getDeclaredMethods, getField, getFields, getHierarchy, getInterfaces, getMethod, getMethods, getMethods, getPackage, getPackageName, getRawName, getSuperclass, getThisValue, getUnqualifiedName, getUnresolvedInterfaces, getUnresolvedSuperclass, getURL, isArray, isAssignableFrom, isSubtypeOf |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaIsGeneric |
---|
getActualTypeArguments, getTypeParameter, getTypeParameters, hasActualTypeArguments, hasTypeParameters |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaMember |
---|
getOwningClass, isAbstract, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaHasType |
---|
getResolvedType, getUnresolvedType |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaHasAnnotations |
---|
getAnnotation, getAnnotations, getDeclaredAnnotation, getDeclaredAnnotations |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaElement |
---|
getOwner, getSourceElement, isDeprecated, isFinal, isHidden, isSourceElement, isSynthetic, printCompiledInfo |
Field Detail |
---|
public static final PrimitiveType[] PRIMITIVE_objects
public static final PrimitiveType[] PRIMITIVE_lookup
public static final PrimitiveType[] PRIMITIVE_alpha
public final byte primCode
Constructor Detail |
---|
protected PrimitiveType(byte code)
Method Detail |
---|
public static PrimitiveType lookupPrimitive(java.lang.String name)
public static PrimitiveType getNullType()
@Deprecated
public static PrimitiveType applyUnboxingConversion(JavaType input)
input
- A JavaType which should not be nullpublic static PrimitiveType applyUnboxingConversion(JavaType input, int j2se)
input
- A JavaType which should not be nullj2se
- The JDK version to use, one of JavaConstants.J2SE_XXXpublic static boolean isNumeric(PrimitiveType subject)
public static boolean applyWideningConversion(PrimitiveType subject, PrimitiveType target)
public static boolean applyNarrowingConversion(PrimitiveType subject, PrimitiveType target)
public boolean isNumeric()
public boolean isIntegral()
public boolean isFloatingPoint()
public JavaFile getFile()
getFile
in interface JavaElement
If a SourceFile is returned, then this element is declared in or otherwise comes in a SourceFile.
A non-null JavaFile may be returned that is not a SourceFile. For example, a JavaClass that came from a .class file definition will return such a JavaFile instance.
If null, then this element was created on-the-fly.
public java.lang.String getQualifiedName()
JavaType
The source name of a non-parametrized top-level type of the form "pkg.Cls" is "pkg.Cls".
The source name of a non-parametrized member type of the form T.InnerClass (that is, a member type InnerClass that is a member of type T) is the source name of T suffixed with by ".InnerClass", e.g. "java.util.Map.Entry", "pkg.Cls<?>.InnerClass".
The source name of a parametrized type starts with the source name of the raw type and lists the source name of all of its actual type argumenths, e.g. "java.util.List<java.lang.String>". The source name of an array type T[] is the source name of T suffixed by the appropriate number of "[]"s.
The source name of a wildcard type is the string with which it would appear in a source file. The three possible forms this can take are: "?", "? extends T", "? super T".
The source name of a type parameter is just its name.
The source name of a primitive type should be pretty obvious.
The source name of a local inner class is just its name because a local inner class is referenced, in a source file, by its name.
An anonymous inner classes does not have a source name. It will return the empty string for its source name.
Open for discussion: What should be returned by an anonymous class? Technically, the concept of a source name is irrelevant because anonymous classes may not be referred to in a source compilation unit.
getQualifiedName
in interface JavaType
getQualifiedName
in class AbstractType
java.lang.Object
java.util.Map<String,String>
java.lang.String[][]
public java.lang.String getVMName()
JavaType
The VM name of a non-parametrized top-level type of the form "pkg.Cls" is "pkg/Cls".
The VM name of a non-parametrized member-level type of the form "pkg.Cls.InnerClass" is "pkg/Cls$InnerClass".
The VM name of a parametrized type is the VM name of the raw type. Because parametrization is stripped at run-time, we will omit it from the VM name.
The VM name of an array type T[] is the VM name of T suffixed by the appropriate number of "[]"s.
The VM name of a local inner class or anonymous inner class is a string that uniquely identifies it from all other types and is usually prefixed with the VM name of its directly enclosing class. For example, an anonymous inner class belonging to the type "pkg.Cls" may return "pkg/Cls$1".
The VM name of any other type is the same as its source name.
getVMName
in interface JavaType
getVMName
in class AbstractType
public java.lang.String getName()
JavaType
The name of a non-parametrized top-level type of the form "pkg.Cls" is "Cls".
The name of a non-parametrized member type of the form "pkg.Cls.InnerClass" is "InnerClass".
The name of an array type T[] is the name of T suffixed by the appropriate number of "[]"s.
The name of a parametrized type is the same as the name of its raw type. That is, the name of "pkg.Cls<String>" is simply "Cls".
The name of a wildcard type is always "?".
The name of a type parameter should be pretty obvious.
The name of a primitive type should be pretty obvious.
The name of a local inner class is just its name.
An anonymous inner classes does not have a name and will return the empty string.
getName
in interface JavaHasName
getName
in interface JavaType
getName
in class AbstractType
public java.lang.String getDescriptor()
JavaType
For jdk < 1.5, the "FieldDescriptor" is returned (JVMS2). For jdk < 1.5, descriptors and signatures are the same thing.
For jdk >= 1.5, a type signature of the type erasure is returned.
Note: Do not confuse a type's descriptor with a method's descriptor. The descriptor of the type of a method is the field descriptor describing its return type. The descriptor of a method describes parameter types.
getDescriptor
in interface JavaType
getDescriptor
in class AbstractClass
public java.lang.String getTypeSignature()
JavaType
A JavaClass returns its "ClassTypeSignature" (JVMS3). A JavaClass is uniquely identified by its type signature. Example value: Ljava/util/List<Ljava/lang/Object;>;
A JavaTypeVariable returns its "TypeVariableSignature" (JVMS3). A type variable is uniquely identified by the combination of its owning declaration AND its type signature. Example value: TE;
A WildcardType returns its "TypeArgument" value (JVMS3). A wildcard type is uniquely identified by its type signature. Example values: *
+Ljava/lang/Object;
.
getTypeSignature
in interface JavaType
getTypeSignature
in class AbstractClass
public java.lang.String getSignature()
JavaType
The "Signature" attribute for a field is the "ClassTypeSignature" for its type.
The "Signature" attribute for a method involves the "ClassSignature"s for its type parameters and the "ClassTypeSignature"s of its remaining constituent types.
A JavaClass returns its "ClassSignature" (JVMS3).
A JavaTypeVariable does not have a class signature, but will return a string for use in a class signature or a method signature.
A WildcardType does not have a class signature and may not part of a class signature. Its return value is undefined.
getSignature
in interface JavaType
getSignature
in class AbstractClass
public int getModifiers()
getModifiers
in interface JavaElement
getModifiers
in class AbstractType
public boolean isPrimitive()
isPrimitive
in interface JavaType
isPrimitive
in class AbstractType
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.3.0) E17493-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |