|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jdeveloper.java.legacy.JotNames
public class JotNames
This class contains the legacy routines from
oracle.jdeveloper.jot.JotNames
for manipulating Java names
and identifiers.
From JotNames
:
Provides utility methods for manipulating Java names and identifiers.
Java class names are expressed in three forms: Java names, as used in Java source code; signature descriptors; and modified signature descriptors. The relationship between the three forms is shown in this table.
Java source | Signature Descriptor | Modified Signature Descriptor |
byte | B | B |
char | C | C |
double | D | D |
float | F | F |
int | I | I |
long | J | J |
short | S | S |
boolean | Z | Z |
package.Class | Lpackage/Class; | Lpackage.Class; |
type[] | [type | [type |
Field Summary | |
---|---|
static java.lang.Class[] |
PRIMITIVE_CLASSES
An array of the Java class objects that represent primitive types. |
static java.lang.String |
SIGS
The string of type descriptors: "L[BCDFIJSVZ" . |
static java.lang.String[] |
TYPES
An array of Java type names. |
Constructor Summary | |
---|---|
JotNames()
|
Method Summary | |
---|---|
static java.lang.Class |
classForName(java.lang.String type)
Loads the named class using the default loader. |
static java.lang.String |
dotSignatureToType(java.lang.String signature)
Converts a modified signature descriptor into a Java type name. |
static java.lang.String |
getClassName(java.lang.String pkg,
java.lang.String name)
Concatenates a package name and a class name to produce a class name. |
static java.lang.String |
getPackageFromFullClassName(java.lang.String fullName)
Extracts the package name from a qualified name. |
static java.lang.String |
getShortClassName(java.lang.String fullName)
Extracts a class name from a qualified name. |
static int |
getSignatureItemCount(java.lang.String signature)
Retrieves the number of field descriptors in a signature. |
static boolean |
isKeyword(java.lang.String name)
Returns true if name is a Java keyword. |
static boolean |
isValidClassName(java.lang.String name)
Returns true if name is a valid Java class name. |
static boolean |
isValidIdentifier(java.lang.String name)
Returns true if name is a valid Java identifier. |
static java.lang.Class |
primitiveClassForName(java.lang.String dotSignature)
Retrieves the class object representing a primitive type. |
static java.lang.String |
signatureToType(java.lang.String signature)
Converts a signature descriptor into a Java type name. |
static java.lang.String[] |
signatureToTypes(java.lang.String signature)
Converts a string of signature descriptors into an array of Java type names. |
static java.lang.String |
typeToDotSignature(java.lang.String type)
Converts a Java type name into a modified signature descriptor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SIGS
"L[BCDFIJSVZ"
. Each character is a
code for a type.
This list is arranged to be parallel to TYPES
.
TYPES
,
Constant Field Valuespublic static final java.lang.String[] TYPES
"<class>"
and "<array>"
public static final java.lang.Class[] PRIMITIVE_CLASSES
TYPES
.
TYPES
Constructor Detail |
---|
public JotNames()
Method Detail |
---|
public static final java.lang.String getClassName(java.lang.String pkg, java.lang.String name)
pkg
- a package name or null
.name
- an identifier.
pkg + "." + name
, or name
alone if
pkg
is null
or empty.public static final java.lang.String getShortClassName(java.lang.String fullName)
fullName
- a Java name; a sequence of identifiers with interspersed '.' tokens.
fullName
if it contains no '.' tokens.public static final java.lang.String getPackageFromFullClassName(java.lang.String fullName)
fullName
- a Java name; a sequence of identifiers with interspersed '.' tokens.
fullName
that precedes the last '.' token,
or the empty string if fullName
contains no '.' tokens.public static boolean isKeyword(java.lang.String name)
true
if name
is a Java keyword.
name
- a string.public static boolean isValidIdentifier(java.lang.String name)
true
if name
is a valid Java identifier.
name
- a string.public static boolean isValidClassName(java.lang.String name)
true
if name
is a valid Java class name.
A class name is a sequence of identifiers with interspersed '.' tokens.
name
- a string.public static final java.lang.String typeToDotSignature(java.lang.String type)
type
- a qualified name of a Java primitive, class, or array type.
public static java.lang.String dotSignatureToType(java.lang.String signature)
signature
- a descriptor string in which '.' tokens are substituted for '/' tokens.
signature
unchanged if signature
is not a descriptor.public static java.lang.String signatureToType(java.lang.String signature)
signature
- a descriptor string.
null
if signature
is not a descriptor.public static int getSignatureItemCount(java.lang.String signature)
ILjava/lang/String;[Ljava/lang/String;
has three descriptors, I
, Ljava/lang/String;
,
and [Ljava/lang/String;
. These would correspond to the
types int
, java.lang.String
, and
java.lang.String[]
.
signature
- the signature, expressed as a String composed
of field descriptors.
public static java.lang.String[] signatureToTypes(java.lang.String signature)
signature
- a descriptor string.
public static final java.lang.Class classForName(java.lang.String type) throws java.lang.ClassNotFoundException
type
- a qualified Java primitive, class, or array type name.
java.lang.ClassNotFoundException
- if the class could not be found.public static final java.lang.Class primitiveClassForName(java.lang.String dotSignature)
dotSignature
- a one-character string containing a type descriptor
character for a primitive type.
null
if dotSignature
does not contain a descriptor for a primitive
type.SIGS
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |