org.objectweb.proactive.core.mop
Class Utils

java.lang.Object
  |
  +--org.objectweb.proactive.core.mop.Utils

public abstract class Utils
extends java.lang.Object

This class contains static convenience and utility methods


Field Summary
static java.lang.Class JAVA_LANG_BOOLEAN
           
static java.lang.Class JAVA_LANG_CHARACTER
           
static java.lang.Class JAVA_LANG_EXCEPTION
           
static java.lang.Class JAVA_LANG_NUMBER
          Static variables
static java.lang.Class JAVA_LANG_RUNTIMEEXCEPTION
           
static java.lang.Class JAVA_LANG_THROWABLE
           
static java.lang.Class JAVA_LANG_VOID
           
static java.lang.String STUB_DEFAULT_PACKAGE
           
static java.lang.String STUB_DEFAULT_PREFIX
           
 
Constructor Summary
Utils()
           
 
Method Summary
static boolean checkMethod(java.lang.reflect.Method met)
          Checks if the given method can be reified.
static java.lang.String convertClassNameToStubClassName(java.lang.String classname)
           
static java.lang.String convertStubClassNameToClassName(java.lang.String stubclassname)
           
static java.lang.Class decipherPrimitiveType(java.lang.String str)
           
static java.lang.String getPackageName(java.lang.String fqnameofclass)
           
static java.lang.Class getPrimitiveType(java.lang.Class cl)
          Performs the opposite operation as getWrapperClass
static java.lang.String getRelativePath(java.lang.String className)
           
static java.lang.String getRidOfAbstract(java.lang.String in)
           
static java.lang.String getRidOfNative(java.lang.String in)
          Removes the keyword 'native' from the String given as argument.
static java.lang.String getRidOfNativeAndAbstract(java.lang.String in)
           
static java.lang.String getSimpleName(java.lang.String fullyQualifiedNameOfClass)
          Extracts the simple name of the class from its fully qualified name
static java.lang.Class getWrapperClass(java.lang.Class cl)
          Returns the Class object that is a wrapper for the given cl class.
static boolean isNormalException(java.lang.Class exc)
           
static boolean isStubClassName(java.lang.String classname)
           
static boolean isSuperTypeInArray(java.lang.Class c, java.lang.Class[] types)
           
static boolean isSuperTypeInArray(java.lang.String className, java.lang.Class[] types)
           
static boolean isWrapperClass(java.lang.Class cl)
          Tests if the class given as an argument is a wrapper class How can we be sure that all subclasses of java.lang.Number are wrappers ??
static java.lang.Object makeDeepCopy(java.lang.Object source)
           
static java.lang.String nameOfWrapper(java.lang.Class cl)
           
static java.lang.String sourceLikeForm(java.lang.Class cl)
          Returns a String representing the'source code style' declaration of the Class object representing an array type given as argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_LANG_NUMBER

public static final java.lang.Class JAVA_LANG_NUMBER
Static variables


JAVA_LANG_CHARACTER

public static final java.lang.Class JAVA_LANG_CHARACTER

JAVA_LANG_BOOLEAN

public static final java.lang.Class JAVA_LANG_BOOLEAN

JAVA_LANG_VOID

public static final java.lang.Class JAVA_LANG_VOID

JAVA_LANG_RUNTIMEEXCEPTION

public static final java.lang.Class JAVA_LANG_RUNTIMEEXCEPTION

JAVA_LANG_EXCEPTION

public static final java.lang.Class JAVA_LANG_EXCEPTION

JAVA_LANG_THROWABLE

public static final java.lang.Class JAVA_LANG_THROWABLE

STUB_DEFAULT_PREFIX

public static final java.lang.String STUB_DEFAULT_PREFIX
See Also:
Constant Field Values

STUB_DEFAULT_PACKAGE

public static final java.lang.String STUB_DEFAULT_PACKAGE
See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

getRidOfNative

public static java.lang.String getRidOfNative(java.lang.String in)
Removes the keyword 'native' from the String given as argument. We assume there is only one occurence of 'native' in the string.

Parameters:
in - The String the keyword 'native' is to be removed from.
Returns:
the input String minus the first occurence of 'native'.

getRidOfAbstract

public static java.lang.String getRidOfAbstract(java.lang.String in)

getRidOfNativeAndAbstract

public static java.lang.String getRidOfNativeAndAbstract(java.lang.String in)

checkMethod

public static boolean checkMethod(java.lang.reflect.Method met)
Checks if the given method can be reified. Criteria for NOT being reifiable are :

Parameters:
met - The method to be checked
Returns:
True if the method is reifiable

sourceLikeForm

public static java.lang.String sourceLikeForm(java.lang.Class cl)
Returns a String representing the'source code style' declaration of the Class object representing an array type given as argument. The problem is that the toString() method of class Class does not return what we are expecting, i-e the type definition that appears in the source code (like char[][]).

Returns:
A String with the'source code representation' of that array type

nameOfWrapper

public static java.lang.String nameOfWrapper(java.lang.Class cl)

getPackageName

public static java.lang.String getPackageName(java.lang.String fqnameofclass)

getSimpleName

public static java.lang.String getSimpleName(java.lang.String fullyQualifiedNameOfClass)
Extracts the simple name of the class from its fully qualified name


getWrapperClass

public static java.lang.Class getWrapperClass(java.lang.Class cl)
Returns the Class object that is a wrapper for the given cl class.


getPrimitiveType

public static java.lang.Class getPrimitiveType(java.lang.Class cl)
Performs the opposite operation as getWrapperClass


isWrapperClass

public static boolean isWrapperClass(java.lang.Class cl)
Tests if the class given as an argument is a wrapper class How can we be sure that all subclasses of java.lang.Number are wrappers ??


getRelativePath

public static java.lang.String getRelativePath(java.lang.String className)

isNormalException

public static boolean isNormalException(java.lang.Class exc)

decipherPrimitiveType

public static java.lang.Class decipherPrimitiveType(java.lang.String str)

isSuperTypeInArray

public static boolean isSuperTypeInArray(java.lang.String className,
                                         java.lang.Class[] types)

isSuperTypeInArray

public static boolean isSuperTypeInArray(java.lang.Class c,
                                         java.lang.Class[] types)

makeDeepCopy

public static java.lang.Object makeDeepCopy(java.lang.Object source)
                                     throws java.io.IOException
java.io.IOException

convertClassNameToStubClassName

public static java.lang.String convertClassNameToStubClassName(java.lang.String classname)

isStubClassName

public static boolean isStubClassName(java.lang.String classname)

convertStubClassNameToClassName

public static java.lang.String convertStubClassNameToClassName(java.lang.String stubclassname)


Copyright © April 2004 INRIA All Rights Reserved.