Package org.eclipse.m2m.atl.emftvm.util
Class EMFTVMUtil
- java.lang.Object
-
- org.eclipse.m2m.atl.emftvm.util.EMFTVMUtil
-
public final class EMFTVMUtil extends java.lang.ObjectEMFTVM static utility methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEMFTVMUtil.RegistryTypeSwitchReturns the registry type of the switched object.
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.PatternDELIM_PATTERNType namespace matching pattern.static java.lang.StringINIT_OP_NAMEName of the "init" static parameterless operation.static java.lang.StringMAIN_OP_NAMEName of the "main" static parameterless operation.static java.lang.StringNATIVENative type namespace.static java.lang.StringNS_DELIMType namespace delimiter.static java.lang.StringXMI_ID_FEATUREName if the XMI ID feature forEObjects contained inXMIResources.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidadd(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf, java.lang.Object value, int index)Adds thevalueofeo.sf.static FieldcreateField(java.lang.String name, boolean isStatic, java.lang.String[] context, java.lang.String[] type, CodeBlock initialiser)Creates a newField.static OperationcreateOperation(boolean isStatic, java.lang.String name, java.lang.String[] context, java.lang.String[] returnType, java.lang.String[][][] parameters, CodeBlock body)Creates a newOperation.static java.lang.Objectemf2vm(ExecEnv env, org.eclipse.emf.ecore.EObject eo, java.lang.Object value)Convertsvalueto an EMFTVM value.static LazyList<org.eclipse.emf.ecore.EObject>findAllInstances(org.eclipse.emf.ecore.EClass type, ExecEnv env)Finds all instances of type in the registered input/inout models.static LazyList<org.eclipse.emf.ecore.EObject>findAllInstIn(java.lang.Object modelname, org.eclipse.emf.ecore.EClass type, ExecEnv env)Finds all instances of type in the given model.static java.lang.reflect.Constructor<?>findConstructor(java.lang.Class<?> context, java.lang.Class<?>[] argTypes)Looks for a native Java constructor.static java.lang.reflect.MethodfindNativeMethod(java.lang.Class<?> context, java.lang.String opname, boolean isStatic)Looks for a native Java method without arguments.static java.lang.reflect.MethodfindNativeMethod(java.lang.Class<?> context, java.lang.String opname, java.lang.Class<?>[] argTypes, boolean isStatic)Looks for a native Java method.static java.lang.reflect.MethodfindNativeMethod(java.lang.Class<?> context, java.lang.String opname, java.lang.Class<?> argType, boolean isStatic)Looks for a native Java method.static java.lang.reflect.MethodfindNativeMethod(Operation op, java.lang.Object self, java.lang.String opname)Looks for a native Java method without arguments.static java.lang.reflect.MethodfindNativeMethod(Operation op, java.lang.Object self, java.lang.String opname, java.lang.Object arg)Looks for a native Java method with one argument.static java.lang.reflect.MethodfindNativeMethod(Operation op, java.lang.Object self, java.lang.String opname, java.lang.Object[] args)Looks for a native Java method with multiple arguments.static java.lang.reflect.MethodfindNativeSuperMethod(Operation op, java.lang.Class<?> context, java.lang.String opname)Looks for a native superclass Java method without arguments.static java.lang.reflect.MethodfindNativeSuperMethod(Operation op, java.lang.Class<?> context, java.lang.String opname, java.lang.Object arg)Looks for a native superclass Java method with one argument.static java.lang.reflect.MethodfindNativeSuperMethod(Operation op, java.lang.Class<?> context, java.lang.String opname, java.lang.Object[] args)Looks for a native superclass Java method with multiple arguments.static java.lang.reflect.MethodfindRootMethod(java.lang.reflect.Method method)Finds the rootClassdeclaration for the givenmethod.static java.lang.Objectget(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf)Retrieves the value ofeo.sf.static java.lang.Class<?>[]getArgumentClasses(java.lang.Object[] args)Retrieves the classes ofargs.static java.lang.ObjectgetArgumentType(java.lang.Object arg)Retrieves the type ofarg.static java.lang.Object[]getArgumentTypes(java.lang.Object[] args)Retrieves the types ofargs.static MetamodelgetEcoreMetamodel()Returns the singleton instance of the Ecore metamodel.static MetamodelgetEmfTvmMetamodel()Returns the singleton instance of the EMFTVM metamodel.static java.io.FilegetFile(java.lang.String path)Returns the file with the givenpathin the workspace, or the file in the filesystem if the workspace is not available.static java.util.LocalegetLocale(java.lang.String locale)Returns theLocalefor the givenlocalestring.static doublegetMethodCacheHitRate()Returns the hit rate of the method cache.static java.lang.ObjectgetRegistryType(java.lang.Object type)Returns the type object to use for the registry.static doublegetRootMethodCacheHitRate()Returns the hit rate of the root method cache.static MetamodelgetTraceMetamodel()Returns the singleton instance of the Trace metamodel.static LazyList<java.lang.Object>getTrans(java.lang.Object object, java.lang.reflect.Field field, LazyList<java.lang.Object> result)Retrieves the transitive closure offieldonobject.static LazyList<java.lang.Object>getTrans(java.lang.Object object, Field field, StackFrame frame, LazyList<java.lang.Object> result)Retrieves the transitive closure offieldonobject.static LazyList<java.lang.Object>getTrans(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature sf, ExecEnv env, LazyList<java.lang.Object> result)Retrieves the transitive closure ofsfonobject.static java.lang.StringgetTypeName(ExecEnv env, java.lang.Object type)Returns the name oftype, for printing.static java.lang.StringgetTypeNames(ExecEnv env, java.lang.Object[] types)Returns the names oftypes, for printing.static java.lang.ObjectinvokeNative(StackFrame frame, java.lang.Object self, java.lang.reflect.Method method)Invokes native Javamethodonselfwithout arguments.static java.lang.ObjectinvokeNative(StackFrame frame, java.lang.Object self, java.lang.reflect.Method method, java.lang.Object arg)Invokes native Javamethodonselfwith argumentarg.static java.lang.ObjectinvokeNative(StackFrame frame, java.lang.Object self, java.lang.reflect.Method method, java.lang.Object[] args)Invokes native Javamethodonselfwith argumentsargs.static java.lang.ObjectinvokeNative(StackFrame frame, java.lang.Object self, java.lang.String opname)Invokes native Java methodopnameonselfwithout arguments.static java.lang.ObjectinvokeNative(StackFrame frame, java.lang.Object self, java.lang.String opname, java.lang.Object arg)Invokes native Java methodopnameonselfwith argumentarg.static java.lang.ObjectinvokeNative(StackFrame frame, java.lang.Object self, java.lang.String opname, java.lang.Object[] args)Invokes native Java methodopnameonselfwith argumentsargs.static java.lang.ObjectinvokeNativeStatic(StackFrame frame, java.lang.Class<?> type, java.lang.String opname)Invokes static native Java methodopnamewithout arguments.static java.lang.ObjectinvokeNativeStatic(StackFrame frame, java.lang.Class<?> type, java.lang.String opname, java.lang.Object arg)Invokes static native Java methodopnamewith argumentarg.static java.lang.ObjectinvokeNativeStatic(StackFrame frame, java.lang.Class<?> type, java.lang.String opname, java.lang.Object[] args)Invokes static native Java methodopnamewith argumentsargs.static voidregisterEPackages(org.eclipse.emf.ecore.resource.ResourceSet rs)Registers allEPackagensURIs inrsin the localrsEPackage.Registry.static voidremove(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf, java.lang.Object value)Removes thevaluefromeo.sf.static voidset(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf, java.lang.Object value)Sets thevalueofeo.sf.static java.lang.StringtoPrettyString(java.lang.Object object, ExecEnv env)Offers an alternative to the defaulttoString()method.static java.lang.StringtoPrettyString(java.util.Collection<?> coll, ExecEnv env)Offers an alternative to the defaulttoString()method.static <T> java.lang.StringtoPrettyString(T[] array, ExecEnv env)Offers an alternative to the defaulttoString()method.static java.lang.ObjectuncheckedGet(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf)Retrieves the value ofeo.sf.static booleanwriteToWithCharset(java.lang.String string, java.lang.String path, java.lang.String charset)Writesstringtopathwith the givencharset.
-
-
-
Field Detail
-
NATIVE
public static final java.lang.String NATIVE
Native type namespace.- See Also:
- Constant Field Values
-
NS_DELIM
public static final java.lang.String NS_DELIM
Type namespace delimiter.- See Also:
- Constant Field Values
-
DELIM_PATTERN
public static final java.util.regex.Pattern DELIM_PATTERN
Type namespace matching pattern.- See Also:
NS_DELIM
-
MAIN_OP_NAME
public static final java.lang.String MAIN_OP_NAME
Name of the "main" static parameterless operation.- See Also:
- Constant Field Values
-
INIT_OP_NAME
public static final java.lang.String INIT_OP_NAME
Name of the "init" static parameterless operation.- See Also:
- Constant Field Values
-
XMI_ID_FEATURE
public static final java.lang.String XMI_ID_FEATURE
Name if the XMI ID feature forEObjects contained inXMIResources.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTypeName
public static java.lang.String getTypeName(ExecEnv env, java.lang.Object type)
Returns the name oftype, for printing.- Parameters:
env- the currentExecEnvtype- the type- Returns:
- the name of
type, for printing
-
getTypeNames
public static java.lang.String getTypeNames(ExecEnv env, java.lang.Object[] types)
Returns the names oftypes, for printing.- Parameters:
env- the currentExecEnv.types- the types- Returns:
- the names of
types, for printing
-
getRegistryType
public static java.lang.Object getRegistryType(java.lang.Object type) throws java.lang.IllegalArgumentExceptionReturns the type object to use for the registry.- Parameters:
type- the type object- Returns:
- the type object to use for the registry
- Throws:
java.lang.IllegalArgumentException- if type is a primitive EMF type without instance class
-
getEcoreMetamodel
public static Metamodel getEcoreMetamodel()
Returns the singleton instance of the Ecore metamodel.- Returns:
- the singleton instance of the Ecore metamodel
-
getEmfTvmMetamodel
public static Metamodel getEmfTvmMetamodel()
Returns the singleton instance of the EMFTVM metamodel.- Returns:
- the singleton instance of the EMFTVM metamodel
-
getTraceMetamodel
public static Metamodel getTraceMetamodel()
Returns the singleton instance of the Trace metamodel.- Returns:
- the singleton instance of the Trace metamodel
-
findAllInstances
public static LazyList<org.eclipse.emf.ecore.EObject> findAllInstances(org.eclipse.emf.ecore.EClass type, ExecEnv env)
Finds all instances of type in the registered input/inout models.- Parameters:
type- the typeenv- the currentExecEnv- Returns:
- all instances of type in the registered input/inout models
-
findAllInstIn
public static LazyList<org.eclipse.emf.ecore.EObject> findAllInstIn(java.lang.Object modelname, org.eclipse.emf.ecore.EClass type, ExecEnv env)
Finds all instances of type in the given model.- Parameters:
modelname- the model nametype- the typeenv- the currentExecEnv- Returns:
- all instances of type in the given model
-
toPrettyString
public static java.lang.String toPrettyString(java.lang.Object object, ExecEnv env)Offers an alternative to the defaulttoString()method. Usesenvto determine the containing model of types. Compensates forEObject's notoriously badtoString().- Parameters:
object-env-- Returns:
- the string representation of
object.
-
toPrettyString
public static java.lang.String toPrettyString(java.util.Collection<?> coll, ExecEnv env)Offers an alternative to the defaulttoString()method. Usesenvto determine the containing model of types. Compensates forEObject's notoriously badtoString().- Parameters:
coll-env-- Returns:
- the string representation of
coll.
-
toPrettyString
public static <T> java.lang.String toPrettyString(T[] array, ExecEnv env)Offers an alternative to the defaulttoString()method. Usesenvto determine the containing model of types. Compensates forEObject's notoriously badtoString().- Parameters:
array-env-- Returns:
- the string representation of
coll.
-
get
public static java.lang.Object get(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf)
Retrieves the value ofeo.sf. Checks thateois not in an output model.- Parameters:
env- the currentExecEnveo- the model element to retrieve the value fromsf- the structural feature to retrieve the value from- Returns:
- the value of
eo.sf.
-
uncheckedGet
public static java.lang.Object uncheckedGet(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf)
Retrieves the value ofeo.sf.- Parameters:
env- the currentExecEnveo- the model element to retrieve the value fromsf- the structural feature to retrieve the value from- Returns:
- the value of
eo.sf.
-
emf2vm
public static java.lang.Object emf2vm(ExecEnv env, org.eclipse.emf.ecore.EObject eo, java.lang.Object value)
Convertsvalueto an EMFTVM value.- Parameters:
env- the currentExecEnveo- theEObjectfrom which the value was obtainedvalue- the EMF value to convert- Returns:
- the EMFTVM value
-
set
public static void set(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf, java.lang.Object value)
Sets thevalueofeo.sf.- Parameters:
env- the currentExecEnveo- the model element to set the value forsf- the structural feature to set the value forvalue- the value to set
-
add
public static void add(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf, java.lang.Object value, int index)
Adds thevalueofeo.sf.- Parameters:
env-eo-sf-value-index- the insertion index (-1 for end)
-
remove
public static void remove(ExecEnv env, org.eclipse.emf.ecore.EObject eo, org.eclipse.emf.ecore.EStructuralFeature sf, java.lang.Object value)
Removes thevaluefromeo.sf.- Parameters:
env-eo-sf-value-
-
getArgumentTypes
public static java.lang.Object[] getArgumentTypes(java.lang.Object[] args)
Retrieves the types ofargs.- Parameters:
args-- Returns:
- the types of
args
-
getArgumentType
public static java.lang.Object getArgumentType(java.lang.Object arg)
Retrieves the type ofarg.- Parameters:
arg-- Returns:
- the type of
arg
-
invokeNative
public static java.lang.Object invokeNative(StackFrame frame, java.lang.Object self, java.lang.String opname, java.lang.Object[] args)
Invokes native Java methodopnameonselfwith argumentsargs.- Parameters:
frame- the current stack frameself- the object on which to invoke the methodopname- the method nameargs- the method arguments- Returns:
- the method result
-
invokeNative
public static java.lang.Object invokeNative(StackFrame frame, java.lang.Object self, java.lang.reflect.Method method, java.lang.Object[] args)
Invokes native Javamethodonselfwith argumentsargs.- Parameters:
frame- the current stack frameself- the object on which to invoke the methodmethod- the methodargs- the method arguments- Returns:
- the method result
-
invokeNative
public static java.lang.Object invokeNative(StackFrame frame, java.lang.Object self, java.lang.String opname, java.lang.Object arg)
Invokes native Java methodopnameonselfwith argumentarg.- Parameters:
frame- the current stack frameself- the object on which to invoke the methodopname- the method namearg- the method argument- Returns:
- the method result
-
invokeNative
public static java.lang.Object invokeNative(StackFrame frame, java.lang.Object self, java.lang.reflect.Method method, java.lang.Object arg)
Invokes native Javamethodonselfwith argumentarg.- Parameters:
frame- the current stack frameself- the object on which to invoke the methodmethod- the methodarg- the method argument- Returns:
- the method result
-
invokeNative
public static java.lang.Object invokeNative(StackFrame frame, java.lang.Object self, java.lang.String opname)
Invokes native Java methodopnameonselfwithout arguments.- Parameters:
frame- the current stack frameself- the object on which to invoke the methodopname- the method name- Returns:
- the method result
-
invokeNative
public static java.lang.Object invokeNative(StackFrame frame, java.lang.Object self, java.lang.reflect.Method method)
Invokes native Javamethodonselfwithout arguments.- Parameters:
frame- the current stack frameself- the object on which to invoke the methodmethod- the method- Returns:
- the method result
-
invokeNativeStatic
public static java.lang.Object invokeNativeStatic(StackFrame frame, java.lang.Class<?> type, java.lang.String opname, java.lang.Object[] args)
Invokes static native Java methodopnamewith argumentsargs.- Parameters:
frame- the current stack frametype- the class in which the static method is definedopname- the method nameargs- the method arguments- Returns:
- the method result
-
invokeNativeStatic
public static java.lang.Object invokeNativeStatic(StackFrame frame, java.lang.Class<?> type, java.lang.String opname, java.lang.Object arg)
Invokes static native Java methodopnamewith argumentarg.- Parameters:
frame- the current stack frametype- the class in which the static method is definedopname- the method namearg- the method arguments- Returns:
- the method result
-
invokeNativeStatic
public static java.lang.Object invokeNativeStatic(StackFrame frame, java.lang.Class<?> type, java.lang.String opname)
Invokes static native Java methodopnamewithout arguments.- Parameters:
frame- the current stack frametype- the class in which the static method is definedopname- the method name- Returns:
- the method result
-
findNativeMethod
public static java.lang.reflect.Method findNativeMethod(java.lang.Class<?> context, java.lang.String opname, java.lang.Class<?>[] argTypes, boolean isStatic)Looks for a native Java method.- Parameters:
context- The class of the methodopname- The method nameargTypes- The types of all argumentsisStatic- Whether to look for a static method or not- Returns:
- the method if found, null otherwise
-
findNativeMethod
public static java.lang.reflect.Method findNativeMethod(java.lang.Class<?> context, java.lang.String opname, java.lang.Class<?> argType, boolean isStatic)Looks for a native Java method.- Parameters:
context- The class of the methodopname- The method nameargumentType- The type of the argumentisStatic- Whether to look for a static method or not- Returns:
- the method if found, null otherwise
-
findNativeMethod
public static java.lang.reflect.Method findNativeMethod(java.lang.Class<?> context, java.lang.String opname, boolean isStatic)Looks for a native Java method without arguments.- Parameters:
context- The class of the methodopname- The method nameisStatic- Whether to look for a static method or not- Returns:
- the method if found, null otherwise
-
findNativeMethod
public static java.lang.reflect.Method findNativeMethod(Operation op, java.lang.Object self, java.lang.String opname)
Looks for a native Java method without arguments.- Parameters:
op- the previously found EMFTVMOperationself- the object on which to invoke the methodopname- the method name- Returns:
- the method if found and more specific than
op,nullotherwise
-
findNativeMethod
public static java.lang.reflect.Method findNativeMethod(Operation op, java.lang.Object self, java.lang.String opname, java.lang.Object arg)
Looks for a native Java method with one argument.- Parameters:
op- the previously found EMFTVMOperationself- the object on which to invoke the methodopname- the method namearg- the method argument- Returns:
- the method if found and more specific than
op,nullotherwise
-
findNativeMethod
public static java.lang.reflect.Method findNativeMethod(Operation op, java.lang.Object self, java.lang.String opname, java.lang.Object[] args)
Looks for a native Java method with multiple arguments.- Parameters:
op- the previously found EMFTVMOperationself- the object on which to invoke the methodopname- the method nameargs- the method arguments- Returns:
- the method if found and more specific than
op,nullotherwise
-
findNativeSuperMethod
public static java.lang.reflect.Method findNativeSuperMethod(Operation op, java.lang.Class<?> context, java.lang.String opname)
Looks for a native superclass Java method without arguments.- Parameters:
op- the previously found EMFTVMOperationcontext- the context for which to find the superclass methodopname- the method name- Returns:
- the method if found and more specific than
op,nullotherwise
-
findNativeSuperMethod
public static java.lang.reflect.Method findNativeSuperMethod(Operation op, java.lang.Class<?> context, java.lang.String opname, java.lang.Object arg)
Looks for a native superclass Java method with one argument.- Parameters:
op- the previously found EMFTVMOperationcontext- the context for which to find the superclass methodname- the method namearg- the method argument- Returns:
- the method if found and more specific than
op,nullotherwise
-
findNativeSuperMethod
public static java.lang.reflect.Method findNativeSuperMethod(Operation op, java.lang.Class<?> context, java.lang.String opname, java.lang.Object[] args)
Looks for a native superclass Java method with multiple arguments.- Parameters:
op- the previously found EMFTVMOperationcontext- the context for which to find the superclass methodname- the method nameargs- the method arguments- Returns:
- the method if found and more specific than
op,nullotherwise
-
findConstructor
public static java.lang.reflect.Constructor<?> findConstructor(java.lang.Class<?> context, java.lang.Class<?>[] argTypes)Looks for a native Java constructor.- Parameters:
context- The class of the methodargumentTypes- The types of all arguments- Returns:
- the constructor if found,
nullotherwise
-
getArgumentClasses
public static java.lang.Class<?>[] getArgumentClasses(java.lang.Object[] args)
Retrieves the classes ofargs.- Parameters:
args-- Returns:
- the classes of
args
-
writeToWithCharset
public static boolean writeToWithCharset(java.lang.String string, java.lang.String path, java.lang.String charset) throws java.io.IOExceptionWritesstringtopathwith the givencharset.- Parameters:
string- the string to writepath- the path of the file to write tocharset- the character set to use, or use default when null- Returns:
- true on success
- Throws:
java.io.IOException- when writing fails
-
getFile
public static java.io.File getFile(java.lang.String path)
Returns the file with the givenpathin the workspace, or the file in the filesystem if the workspace is not available.- Parameters:
path- the absolute or relative path to a file.- Returns:
- the file in the workspace, or the file in the filesystem if the workspace is not available.
-
createOperation
public static Operation createOperation(boolean isStatic, java.lang.String name, java.lang.String[] context, java.lang.String[] returnType, java.lang.String[][][] parameters, CodeBlock body)
Creates a newOperation.- Parameters:
isStatic- whether the created operation is staticname- operation namecontext- operation context [type model, type name]returnType- operation return [type model, type name]parameters- operations parameters: [[[name], [type model, type name]], ...]body- operation body- Returns:
- a new
Operation. - See Also:
Types
-
createField
public static Field createField(java.lang.String name, boolean isStatic, java.lang.String[] context, java.lang.String[] type, CodeBlock initialiser)
Creates a newField.
-
getTrans
public static LazyList<java.lang.Object> getTrans(java.lang.Object object, Field field, StackFrame frame, LazyList<java.lang.Object> result)
Retrieves the transitive closure offieldonobject.- Parameters:
object- the object on which to retrievefieldfield- the field for which to retrieve the valueframe- the currentStackFrameresult- the intermediate list of values- Returns:
- the updated result
-
getTrans
public static LazyList<java.lang.Object> getTrans(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature sf, ExecEnv env, LazyList<java.lang.Object> result)
Retrieves the transitive closure ofsfonobject.- Parameters:
object- the object on which to retrievesfsf- the structural feature for which to retrieve the valueenv- the currentExecEnvresult- the intermediate list of values- Returns:
- the updated result
-
getTrans
public static LazyList<java.lang.Object> getTrans(java.lang.Object object, java.lang.reflect.Field field, LazyList<java.lang.Object> result) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException
Retrieves the transitive closure offieldonobject.- Parameters:
object- the object on which to retrievefieldfield- the field for which to retrieve the valueresult- the intermediate list of values- Returns:
- the updated result
- Throws:
java.lang.IllegalAccessExceptionjava.lang.IllegalArgumentException
-
getLocale
public static java.util.Locale getLocale(java.lang.String locale)
Returns theLocalefor the givenlocalestring.- Parameters:
locale- the locale string (e.g. "nl_BE", "es_ES_Traditional_WIN")- Returns:
- the
Localefor the givenlocalestring
-
registerEPackages
public static void registerEPackages(org.eclipse.emf.ecore.resource.ResourceSet rs)
Registers allEPackagensURIs inrsin the localrsEPackage.Registry. Sets theEPackagensURI to theEPackagename if not set.- Parameters:
rs- theResourceSet
-
findRootMethod
public static java.lang.reflect.Method findRootMethod(java.lang.reflect.Method method)
Finds the rootClassdeclaration for the givenmethod.- Parameters:
method- the method for which to find the root declaration- Returns:
- the root
Method
-
getMethodCacheHitRate
public static double getMethodCacheHitRate()
Returns the hit rate of the method cache.- Returns:
- the hit rate of the method cache, or
-1.0if no hits were recorded yet
-
getRootMethodCacheHitRate
public static double getRootMethodCacheHitRate()
Returns the hit rate of the root method cache.- Returns:
- the hit rate of the root method cache, or
-1.0if no hits were recorded yet
-
-