java.lang.Object
omix.lang.OmixApplication
public abstract class OmixApplication extends Object
The OmixApplication class contains static methods which allow:
- Internationalization
- Inter namespace access
- Author:
- Dr. Peter Droste, Omix Visualization
-
Method Summary
Modifier and Type Method Description static String
currentNamespace(OVLEnvironment env)
Returns the namespace of the current OVL program.static Accessory
getAccessory(OVLEnvironment env, String namespace, Object object, String accessoryName)
This method dynamically reads the content of the object's accessory field.static @IsVarType Object
invokeMethod(OVLEnvironment env, String namespace, @IsVarType Object object, String methodSignatur, Object @IsVarType ... params)
This method dynamically invokes the method described bymethodSignatur
.static boolean
isNamespaceAvailable(OVLEnvironment env, String namespace, Object object)
Tests if a namespace is available in the network.static OVLObject
newInstance(OVLEnvironment env, String namespace, Object object, String constructorSignature, Object... params)
This method dynamically instantiates an OVL class defined in a namespace.static @IsVarType Object
readField(OVLEnvironment env, String namespace, @IsVarType Object object, String fieldName)
This method dynamically reads the content of the object's field.static String
translate(String context, String text)
This method translates a text into the currently active language of Omix if there is a translation available.static void
writeField(OVLEnvironment env, String namespace, @IsVarType Object object, String fieldName, @IsVarType Object value)
This method dynamically changes the content of a field to the submitted value.
-
Method Details
-
translate
This method translates a text into the currently active language of Omix if there is a translation available.- Parameters:
context
- The context of the text (for instance, class name)text
- to be translated- Returns:
- translation
-
invokeMethod
public static @IsVarType Object invokeMethod(@OVLInaccessible OVLEnvironment env, String namespace, @IsVarType Object object, String methodSignatur, Object @IsVarType ... params)This method dynamically invokes the method described bymethodSignatur
. If an error occurs during the method invocation a runtime exception is thrown giving details about the error.- Parameters:
env
- The OVLEnvironment parameter is invisible in OVL and submitted automatically.namespace
- The namespace the method was defined in.object
- The object the method shall be invoked on.methodSignatur
- The method name followed by parentheses containing the parameter types of the method: e.g.:invokeMethod(OVLEnvironment,String,Object,String,Object[])
params
- The parameters submitted to the invoked method.- Returns:
- The return value of the method which is
null
in case of avoid
method.
-
readField
public static @IsVarType Object readField(@OVLInaccessible OVLEnvironment env, String namespace, @IsVarType Object object, String fieldName)This method dynamically reads the content of the object's field. If an error occurs during the method invocation a runtime exception is thrown giving details about the error.- Parameters:
env
- The OVLEnvironment parameter is invisible in OVL and submitted automatically.namespace
- The namespace the field was defined in.object
- The object owning the field.fieldName
- The name of the field.- Returns:
- The value of the field.
-
writeField
public static void writeField(@OVLInaccessible OVLEnvironment env, String namespace, @IsVarType Object object, String fieldName, @IsVarType Object value)This method dynamically changes the content of a field to the submitted value. If an error occurs during the method invocation a runtime exception is thrown giving details about the error.- Parameters:
env
- The OVLEnvironment parameter is invisible in OVL and submitted automatically.namespace
- The namespace the field was defined in.object
- The object owning the field.fieldName
- The name of the field.value
- The value to be set.
-
getAccessory
public static Accessory getAccessory(@OVLInaccessible OVLEnvironment env, String namespace, Object object, String accessoryName)This method dynamically reads the content of the object's accessory field.- Parameters:
env
- The OVLEnvironment parameter is invisible in OVL and submitted automatically.namespace
- The namespace the accessory field was defined in.object
- The object owning the accessory field.accessoryName
- The name of the accessory field.- Returns:
- A reference to the accessory.
-
newInstance
public static OVLObject newInstance(@OVLInaccessible OVLEnvironment env, String namespace, Object object, String constructorSignature, Object... params)This method dynamically instantiates an OVL class defined in a namespace.- Parameters:
env
- The OVLEnvironment parameter is invisible in OVL and submitted automatically.namespace
- The namespace the according OVL class was defined in.object
- Here, a pointer to a network item object has to be submitted, for instancethis
ornetwork()
.constructorSignature
- The class name followed by parentheses containing the parameter types of the constructor:params
- The parameters submitted to the invoked constructor.- Returns:
- the instance of the OVL class
-
isNamespaceAvailable
public static boolean isNamespaceAvailable(@OVLInaccessible OVLEnvironment env, String namespace, Object object)Tests if a namespace is available in the network. This is usually the case if the according plugin is activated in the document.- Parameters:
env
- The OVLEnvironment parameter is invisible in OVL and submitted automatically.namespace
- The namespace to be tested.object
- Here, a pointer to a network item object has to be submitted, for instancethis
ornetwork()
.- Returns:
true
if namespace is available.
-
currentNamespace
Returns the namespace of the current OVL program.- Parameters:
env
- The OVLEnvironment parameter is invisible in OVL and submitted automatically.- Returns:
- The namespace of the current OVL program.
-