|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.parser.util.ArrayListHeap
oracle.javatools.parser.java.v2.util.Conversions
oracle.javatools.parser.java.v2.common.CommonUtilities
public class CommonUtilities
Various utilities shared by the parser internals and parser externals.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface oracle.javatools.parser.java.v2.JavaPreferences |
---|
JavaPreferences.MemberOrder |
Field Summary |
---|
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 |
Constructor Summary | |
---|---|
CommonUtilities() |
Method Summary | |
---|---|
protected static TextBuffer |
acquireTextBuffer() |
protected static byte |
asg_op(int token) |
protected static boolean |
classProcessed(java.util.ArrayList processed, JavaType javaClass) After this function, the input class will be added to the processed list. |
static boolean |
containsClassThisSuper(java.lang.String qualifiedName) |
static JavaType |
createArrayType(JavaProvider provider, JavaType component, int dimensions) |
static JavaType |
createDiamondParameterizedType(JavaProvider provider, JavaType type) Create a parameterized type (a type with type arguments) with an empty type argument list, useful for the 'new Type<>()' syntax |
static JavaMethod |
createParameterizedMethod(JavaProvider provider, JavaMethod generic, JavaType[] arguments) |
static JavaType |
createParameterizedType(JavaProvider provider, JavaType generic, JavaType[] arguments) |
static JavaType |
createParameterizedType(JavaType generic, JavaType[] arguments) Deprecated. Please use the other createParameterizedType() method. |
static JavaType |
createTypeErasedClass(JavaType type) |
static JavaType |
createWildcardType(byte bound, JavaType t, JavaProvider provider) Creates a wildcard type. |
static boolean |
equals(JavaMember one, JavaMember two) |
static boolean |
equals(JavaPackage one, JavaPackage two) |
static java.lang.String |
format(java.lang.String input, java.lang.String arg0) |
static java.lang.String |
format(java.lang.String input, java.lang.String arg0, java.lang.String arg1) |
static JavaAnnotation |
getAnnotation(JavaType target, JavaType annotationType) |
static java.util.Collection |
getAnnotations(JavaType target) |
static JavaClass |
getClass(JavaFile target, java.lang.String name) |
static JavaClass |
getClass(JavaType target, java.lang.String name) |
static java.util.Collection |
getClasses(JavaType target) |
static JavaAnnotation |
getDeclaredAnnotation(JavaHasAnnotations target, JavaType annotationType) |
static JavaClass |
getDeclaredClass(JavaType target, java.lang.String name) |
static JavaMethod |
getDeclaredConstructor(JavaType target, JavaType[] targetTypes) |
static JavaField |
getDeclaredField(JavaType target, java.lang.String name) |
static JavaMethod |
getDeclaredMethod(JavaType target, java.lang.String name, JavaType[] targetTypes) |
static java.util.Collection |
getDeclaredMethods(JavaType target, java.lang.String name) |
static java.lang.String |
getDescriptor(JavaClass input) |
static java.lang.String |
getDescriptor(JavaField input) |
static java.lang.String |
getDescriptor(JavaMethod input) |
static java.lang.String |
getDescriptor(JavaTypeVariable input) |
static JavaField |
getField(JavaType target, java.lang.String name) |
static java.util.Collection |
getFields(JavaType target) |
static java.lang.String |
getInstantiatedTypeToString(JavaType type) Create a printable String representation of an instantiated type. |
static JavaMethod |
getMethod(JavaType target, java.lang.String name, JavaType[] targetTypes) |
static java.util.Collection |
getMethods(JavaType target) |
static java.util.Collection |
getMethods(JavaType target, java.lang.String name) |
static JavaType[] |
getParameterTypes(JavaMethod target) |
static PrimitiveType |
getPrimitiveType(java.lang.String name) |
static java.lang.String |
getSignature(JavaClass input) |
static java.lang.String |
getSignature(JavaField input) |
static java.lang.String |
getSignature(JavaMethod input) |
static java.lang.String |
getSignature(JavaTypeVariable input) |
static SourceAnnotation |
getSourceElement(JavaAnnotation target, SourceHasModifiers searchSpace) |
static SourceClass |
getSourceElement(JavaClass target, SourceClass searchSpace) Searches for the target type as a member of the search class. |
static SourceClass |
getSourceElement(JavaClass target, SourceFile searchSpace) Searches for the target type as a member of the search class. |
static SourceElement |
getSourceElement(JavaElement target, SourceFile searchSpace) |
static SourceMemberVariable |
getSourceElement(JavaField target, SourceClass searchSpace) Searches for the target field as a member of the search class. |
static SourceMethod |
getSourceElement(JavaMethod target, SourceClass searchSpace) Searches for the target method as a member of the search class. |
static JavaClass |
getTypeErasure(JavaTypeVariable thing) |
static JavaTypeVariable |
getTypeParameter(JavaIsGeneric target, java.lang.String name) |
static java.lang.String |
getTypeSignature(JavaClass input) |
static java.lang.String |
getTypeSignature(JavaMethod input) |
static java.lang.String |
getTypeSignature(JavaTypeVariable input) |
static java.lang.String |
getUniqueIdentifier(JavaClass thing) |
static java.lang.String |
getUniqueIdentifier(JavaField thing) |
static java.lang.String |
getUniqueIdentifier(JavaMethod thing) |
static java.lang.String |
getUniqueIdentifier(JavaPackage thing) |
static java.lang.String |
getUniqueIdentifier(JavaTypeVariable thing) |
static java.lang.String |
getUniqueIdentifier(JavaWildcardType thing) |
static int |
hashCode(JavaMember thing) |
static int |
hashCode(JavaPackage thing) |
static java.util.List |
immutableCopy(java.util.Collection src) |
protected static byte |
infix_op(int token) |
protected static boolean |
isInheritedAnnotation(JavaAnnotation annotation) |
protected static boolean |
isInheritedAnnotation(JavaType annotationType) |
static boolean |
isParameterizedMethod(JavaMethod method) Find out if the incoming method has bound type arguments, either from explicit type arguments, or from inferred type arguments. |
static boolean |
isValidImportName(java.lang.String name) Identifiers and keywords are allowed. |
static boolean |
isValidQualifiedName(java.lang.String name) Identifiers and keywords are allowed. |
static boolean |
isValidSimpleName(java.lang.String name) Identifiers and keywords are allowed. |
static JavaElement |
locateByUniqueIdentifier(java.lang.String uniqueIdentifier, JavaProvider provider) This will work for packages, classes, methods, and fields. |
static boolean |
matchMethod(JavaMethod method, JavaType[] targetTypes) |
static java.util.ArrayList |
mutableCopy(java.util.Collection src) |
static void |
notImplementedYet() |
static void |
panic() |
static void |
panic(java.lang.String msg) |
protected static byte |
postfix_op(int token) |
protected static byte |
prefix_op(int token) |
static byte |
provider2jdkVersion(JavaProvider provider) Returns the JDK version of the provider by looking for certain class names in that provider. |
protected static byte |
rel_op(int token) |
protected static void |
releaseTextBuffer(TextBuffer textBuffer) The caller is responsible for ensuring that there are no more text buffer listeners attached to this buffer. |
protected static byte |
shift_op(int token) |
static void |
unsupported() |
static void |
unsupported(java.lang.String msg) |
Methods inherited from class oracle.javatools.parser.java.v2.util.Conversions |
---|
applyAssignmentConversion, applyBinaryPromotion, applyBoxingConversion, applyCastingConversion, applyMethodConversion, applyNarrowingConversion, applyUnaryPromotion, applyUnboxingConversion, applyWideningConversion, hasSubsignatureOf, inheritsFrom, isSubtypeOf, isSubtypeOfImpl |
Methods inherited from class oracle.javatools.parser.util.ArrayListHeap |
---|
allocArrayList, freeArrayList |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommonUtilities()
Method Detail |
---|
public static byte provider2jdkVersion(JavaProvider provider)
provider
- The provider to test the jdk version of.protected static TextBuffer acquireTextBuffer()
protected static void releaseTextBuffer(TextBuffer textBuffer)
public static PrimitiveType getPrimitiveType(java.lang.String name)
public static JavaType createArrayType(JavaProvider provider, JavaType component, int dimensions)
java.lang.IllegalArgumentException
- if dimension is negative.
@Deprecated
public static JavaType createParameterizedType(JavaType generic,
JavaType[] arguments)
public static JavaType createTypeErasedClass(JavaType type)
public static JavaType createParameterizedType(JavaProvider provider, JavaType generic, JavaType[] arguments)
arguments
- Collection of JavaType's.java.lang.IllegalArgumentException
- if input type is not a generic type, if the input type is already bound, or if the arguments are not legal arguments to this generic type.public static JavaType createDiamondParameterizedType(JavaProvider provider, JavaType type)
provider
- The java providertype
- The type to use for the parameterized typejava.lang.IllegalArgumentException
- if input type is not a generic type, meaning it doesn't have typeParameters.public static JavaMethod createParameterizedMethod(JavaProvider provider, JavaMethod generic, JavaType[] arguments)
arguments
- Collection of JavaType's.java.lang.IllegalArgumentException
- if input type is not a generic type.public static JavaType createWildcardType(byte bound, JavaType t, JavaProvider provider)
BOUND_NARROW: "T" T is returned, this is not a wildcard type. BOUND_EXTENDS: "? extends T" If T is null, then this will be treated just like BOUND_NONE. BOUND_SUPER: "? super T" If T is null, an exception is thrown. BOUND_NONE: "?" T is ignored.
bound
- Valid values are JavaConstants.BOUND_*.t
- The bounding type.provider
- A provider that can fetch java/lang/Object.java.lang.IllegalArgumentException
- for an invalid bound parameter or an invalid type parameter.public static boolean matchMethod(JavaMethod method, JavaType[] targetTypes)
protected static boolean isInheritedAnnotation(JavaAnnotation annotation)
protected static boolean isInheritedAnnotation(JavaType annotationType)
public static boolean isParameterizedMethod(JavaMethod method)
method
- The incoming methodprotected static boolean classProcessed(java.util.ArrayList processed, JavaType javaClass)
processed
- An initially empty list for use with this function ONLY.protected static byte asg_op(int token)
token
- a token listed in JavaTokensprotected static byte rel_op(int token)
token
- a token listed in JavaTokensprotected static byte shift_op(int token)
token
- a token listed in JavaTokensprotected static byte infix_op(int token)
token
- a token listed in JavaTokensprotected static byte prefix_op(int token)
token
- a token listed in JavaTokensprotected static byte postfix_op(int token)
token
- a token listed in JavaTokenspublic static java.lang.String getDescriptor(JavaMethod input)
public static java.lang.String getTypeSignature(JavaMethod input)
public static java.lang.String getSignature(JavaMethod input)
public static java.lang.String getDescriptor(JavaField input)
public static java.lang.String getSignature(JavaField input)
public static java.lang.String getDescriptor(JavaClass input)
public static java.lang.String getTypeSignature(JavaClass input)
public static java.lang.String getSignature(JavaClass input)
public static java.lang.String getDescriptor(JavaTypeVariable input)
public static java.lang.String getTypeSignature(JavaTypeVariable input)
public static java.lang.String getSignature(JavaTypeVariable input)
public static java.lang.String getUniqueIdentifier(JavaPackage thing)
public static java.lang.String getUniqueIdentifier(JavaClass thing)
public static java.lang.String getUniqueIdentifier(JavaTypeVariable thing)
public static java.lang.String getUniqueIdentifier(JavaWildcardType thing)
public static java.lang.String getUniqueIdentifier(JavaField thing)
public static java.lang.String getUniqueIdentifier(JavaMethod thing)
public static boolean equals(JavaPackage one, JavaPackage two)
public static boolean equals(JavaMember one, JavaMember two)
public static int hashCode(JavaPackage thing)
public static int hashCode(JavaMember thing)
public static JavaField getDeclaredField(JavaType target, java.lang.String name)
public static java.util.Collection getDeclaredMethods(JavaType target, java.lang.String name)
public static JavaMethod getDeclaredMethod(JavaType target, java.lang.String name, JavaType[] targetTypes)
public static JavaMethod getDeclaredConstructor(JavaType target, JavaType[] targetTypes)
public static JavaClass getDeclaredClass(JavaType target, java.lang.String name)
public static JavaTypeVariable getTypeParameter(JavaIsGeneric target, java.lang.String name)
public static JavaAnnotation getDeclaredAnnotation(JavaHasAnnotations target, JavaType annotationType)
public static java.util.Collection getFields(JavaType target)
public static JavaField getField(JavaType target, java.lang.String name)
public static java.util.Collection getMethods(JavaType target)
public static java.util.Collection getMethods(JavaType target, java.lang.String name)
public static JavaMethod getMethod(JavaType target, java.lang.String name, JavaType[] targetTypes)
public static java.util.Collection getClasses(JavaType target)
public static JavaClass getClass(JavaType target, java.lang.String name)
public static JavaClass getClass(JavaFile target, java.lang.String name)
public static java.util.Collection getAnnotations(JavaType target)
public static JavaAnnotation getAnnotation(JavaType target, JavaType annotationType)
public static JavaType[] getParameterTypes(JavaMethod target)
public static JavaElement locateByUniqueIdentifier(java.lang.String uniqueIdentifier, JavaProvider provider)
public static SourceElement getSourceElement(JavaElement target, SourceFile searchSpace)
target
- Valid targets are root-level constructs (e.g. package, import) and class constructs (e.g. methods).searchSpace
- The SourceFile to search through. The search will only go as deep as member-depth.public static SourceClass getSourceElement(JavaClass target, SourceFile searchSpace)
public static SourceClass getSourceElement(JavaClass target, SourceClass searchSpace)
public static SourceMemberVariable getSourceElement(JavaField target, SourceClass searchSpace)
public static SourceMethod getSourceElement(JavaMethod target, SourceClass searchSpace)
public static SourceAnnotation getSourceElement(JavaAnnotation target, SourceHasModifiers searchSpace)
public static boolean isValidImportName(java.lang.String name)
public static boolean isValidQualifiedName(java.lang.String name)
public static boolean isValidSimpleName(java.lang.String name)
public static boolean containsClassThisSuper(java.lang.String qualifiedName)
qualifiedName
- Assumed to be a valid qualified name.public static JavaClass getTypeErasure(JavaTypeVariable thing)
public static java.lang.String getInstantiatedTypeToString(JavaType type)
type
- A resolved type which should NOT be nullpublic static java.util.List immutableCopy(java.util.Collection src)
public static java.util.ArrayList mutableCopy(java.util.Collection src)
public static java.lang.String format(java.lang.String input, java.lang.String arg0)
public static java.lang.String format(java.lang.String input, java.lang.String arg0, java.lang.String arg1)
public static void panic(java.lang.String msg)
public static void panic()
public static void unsupported(java.lang.String msg)
public static void unsupported()
public static void notImplementedYet()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |