Package sc.dyn

Class DynUtil


  • public class DynUtil
    extends java.lang.Object
    Static utility methods used by runtime sc applications. This class serves as a bridge from the runtime world to the dynamic/interpreted world. When the interpreter is enabled, dynamicSystem is set and that is used for managing operations on dynamic objects. When that is null, only the compile time features are available. Compiled classes can link against this class and then run either with or without the interpreter.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addChild​(int ix, java.lang.Object parent, java.lang.Object child)  
      static void addChild​(java.lang.Object parent, java.lang.Object child)  
      static void addDynInnerInstance​(java.lang.String typeName, java.lang.Object innerObj, java.lang.Object outerObj)  
      static void addDynInnerObject​(java.lang.String typeName, java.lang.Object innerObj, java.lang.Object outerObj)  
      static void addDynInstance​(java.lang.String typeName, java.lang.Object instObj)
      Used to associate object instances with their type in order to support the liveDynamicTypes feature.
      static void addDynListener​(IDynListener listener)  
      static void addDynObject​(java.lang.String typeName, java.lang.Object instObj)  
      static void addPropertyCache​(java.lang.Class newClass, DynType cache)
      Used in code generation cases where we register this programmatically.
      static void addSystemExitListener​(ISystemExitListener sys)  
      static boolean applySyncLayer​(java.lang.String lang, java.lang.String destName, java.lang.String scopeName, java.lang.String code, boolean applyRemoteReset, boolean allowCodeEval, BindingContext ctx)  
      static java.lang.String arrayToInstanceName​(java.lang.Object[] list)  
      static boolean booleanValue​(java.lang.Object o)  
      static char charValue​(java.lang.Object o)  
      static java.lang.String cleanClassName​(java.lang.Class cl)  
      static java.lang.String cleanTypeName​(java.lang.String typeName)  
      static boolean clearInvokeLater​(ScheduledJob job)  
      static void clearObjectIds()  
      static boolean closeEquals​(java.lang.Number v1, java.lang.Number v2)  
      static int compare​(java.lang.Object o1, java.lang.Object o2)  
      static java.lang.Object createInnerInstance​(java.lang.Object typeObj, java.lang.Object outerObj, java.lang.String constrSig, java.lang.Object... params)  
      static java.lang.Object createInstance​(java.lang.Object typeObj, java.lang.String constrSig, java.lang.Object... params)  
      static void dispose​(java.lang.Object obj)  
      static void dispose​(java.lang.Object obj, boolean disposeChildren)
      Called to remove the object from the dynamic type system.
      static void disposeLater​(java.lang.Object component, boolean disposeChildren)  
      static double doublePropertyValue​(IDynObject p, java.lang.String propName)  
      static double doubleValue​(java.lang.Object o)  
      static boolean equalArrays​(java.lang.Object[] arr1, java.lang.Object[] arr2)  
      static boolean equalObjects​(java.lang.Object obj1, java.lang.Object obj2)  
      static java.lang.Object evalArithmeticExpression​(java.lang.String operator, java.lang.Class expectedType, java.lang.Object lhsVal, java.lang.Object rhsVal)  
      static java.lang.Object evalCast​(java.lang.Class theClass, java.lang.Object value)  
      static java.lang.Object evalCast​(java.lang.Object o, java.lang.Object value)  
      static java.lang.Object evalConditionalExpression​(java.lang.String operator, java.lang.Object lhsVal, java.lang.Object rhsVal)  
      static java.lang.Object evalInverseUnaryExpression​(java.lang.String operator, java.lang.Class expectedType, java.lang.Object val)  
      static java.lang.Object evalPreConditionalExpression​(java.lang.String operator, java.lang.Object lhsVal)  
      static java.lang.Number evalPropertyIncr​(java.lang.Object thisObj, java.lang.String prop, int incr)  
      static java.lang.Number evalPropertyIncr​(java.lang.Object thisObj, IBeanMapper mapper, int incr)  
      static java.lang.Number evalPropertyIncrOrig​(java.lang.Object thisObj, java.lang.String prop, int incr)  
      static java.lang.Number evalPropertyIncrOrig​(java.lang.Object thisObj, IBeanMapper mapper, int incr)  
      static java.lang.Number evalPropertyIncrOrigStatic​(java.lang.Class thisObj, java.lang.String prop, int incr)  
      static java.lang.Number evalPropertyIncrOrigStatic​(java.lang.Class thisObj, IBeanMapper mapper, int incr)  
      static java.lang.Number evalPropertyIncrStatic​(java.lang.Class thisObj, java.lang.String prop, int incr)  
      static java.lang.Number evalPropertyIncrStatic​(java.lang.Class thisObj, IBeanMapper mapper, int incr)  
      static java.lang.Object evalRemoteScript​(ScopeContext ctx, java.lang.String script)
      Executes the supplied java script by making an RPC call targeted towards all clients with the lifecycle identified by ScopeContext
      static java.lang.Object evalScript​(java.lang.String script)  
      static java.lang.Object evalUnaryExpression​(java.lang.String operator, java.lang.Class expectedType, java.lang.Object val)  
      static void execLaterJobs()  
      static void execLaterJobs​(int minPriority, int maxPriority)  
      static java.lang.Object findCommonSuperType​(java.lang.Object c1, java.lang.Object c2)  
      static java.lang.Object findType​(java.lang.String typeName)  
      static float floatPropertyValue​(IDynObject p, java.lang.String propName)  
      static float floatValue​(java.lang.Object o)  
      static void flushCaches()  
      static java.lang.String formatDate​(java.util.Date date)
      Format dates in 8601 format (there's a JS version of this method too)
      static java.lang.Object getAnnotation​(java.lang.Object typeObj, java.lang.String annotName)  
      static java.lang.Object getAnnotationValue​(java.lang.Object typeObj, java.lang.String annotName, java.lang.String attName)  
      static java.lang.Object getArrayElement​(java.lang.Object arrVal, int dim)  
      static int getArrayLength​(java.lang.Object arrVal)  
      static IBeanMapper getArrayLengthPropertyMapping​(java.lang.Object type, java.lang.String dstPropName)  
      static java.lang.Class getCompiledClass​(java.lang.Object type)  
      static java.lang.Object getComponentType​(java.lang.Object type)  
      static IBeanMapper getConstantPropertyMapping​(java.lang.Object type, java.lang.String dstPropName)  
      static java.lang.String getCurrentThreadString()
      Don't put the ugly thread ids into the logs - normalize them with an incremending integer
      static java.lang.String getDisplayName​(java.lang.Object obj)  
      static IDynChildManager getDynChildManager​(java.lang.Object type)  
      static java.lang.String[] getDynSrcDirs()  
      static java.lang.String[] getDynSrcPrefixes()  
      static java.lang.Object getEnclosingType​(java.lang.Object typeObj, boolean instOnly)  
      static java.lang.Object getEnumConstant​(java.lang.Object typeObj, java.lang.String enumConstName)  
      static java.lang.Object[] getEnumConstants​(java.lang.Object enumType)  
      static java.lang.String getEnumName​(java.lang.Object enumObj)  
      static java.lang.Object getExtendsType​(java.lang.Object type)  
      static java.lang.Object getIndexedProperty​(java.lang.Object obj, IBeanMapper prop, int ix)  
      static java.lang.Object getInheritedAnnotationValue​(java.lang.Object typeObj, java.lang.String annotName, java.lang.String attName)  
      static java.lang.String getInnerTypeName​(java.lang.Object type)  
      static java.lang.String getInstanceId​(java.lang.Object obj)  
      static java.lang.String getInstanceId​(java.util.Map<java.lang.Object,​java.lang.String> idMap, java.util.Map<java.lang.String,​java.lang.Integer> typeIdCounts, java.lang.Object obj)
      Returns a unique id for the given object.
      static java.lang.String getInstanceName​(java.lang.Object obj)
      Returns a nice short String to display for this object instance for debugging and logging purposes primarily.
      static java.lang.Object[] getInstancesOfTypeAndSubTypes​(java.lang.String typeName)  
      static java.lang.String getInstanceTraceName​(java.lang.Object obj)  
      static int getLayerPosition​(java.lang.Object type)  
      static java.lang.String getMethodName​(java.lang.Object method)  
      static java.lang.Object getMethodType​(java.lang.Object method)  
      static int getNumInnerObjectLevels​(java.lang.Object obj)
      Walks up the object hierarchy until we hit a class or go off the top.
      static int getNumInnerTypeLevels​(java.lang.Object obj)  
      static java.lang.Object[] getObjChildren​(java.lang.Object inst, java.lang.String scopeName, boolean create)
      Returns the dynamic children objects for the given instance
      static java.lang.Object[] getObjChildrenArray2DRange​(java.lang.Object[] srcArr, java.lang.String scopeName, int startIx, int endIx)  
      static java.lang.String[] getObjChildrenNames​(java.lang.Object typeObj, java.lang.String scopeName)
      Returns tne property names of the object children for the given type object
      static java.lang.Object[] getObjChildrenTypes​(java.lang.Object typeObj, java.lang.String scopeName)
      Returns the type objects for child objects.
      static java.lang.String getObjectId​(java.lang.Object obj, java.lang.Object type, java.lang.String typeName)  
      static java.lang.String getObjectId​(java.lang.Object obj, java.lang.Object type, java.lang.String typeName, java.util.Map<java.lang.Object,​java.lang.String> idMap, java.util.Map<java.lang.String,​java.lang.Integer> typeIdCount)  
      static java.lang.String getObjectName​(java.lang.Object obj)  
      static java.lang.String getObjectName​(java.lang.Object obj, java.util.Map<java.lang.Object,​java.lang.String> idMap, java.util.Map<java.lang.String,​java.lang.Integer> typeIdCounts)  
      static java.lang.Object getOuterObject​(java.lang.Object srcObj)  
      static java.lang.String getPackageName​(java.lang.Object type)  
      static java.lang.Object[] getParameterTypes​(java.lang.Object dynMethod)  
      static IBeanMapper[] getProperties​(java.lang.Object typeObj)  
      static java.lang.Object getProperty​(java.lang.Object object, java.lang.String propertyName)  
      static java.lang.Object getProperty​(java.lang.Object object, java.lang.String propertyName, boolean getField)
      Like getPropertyValue this works for static properties, but breaks if the TypeDeclaration object is used as an object instance.
      static java.lang.Object getPropertyAnnotationValue​(java.lang.Object typeObj, java.lang.String propName, java.lang.String annotName, java.lang.String attName)  
      static DynType getPropertyCache​(java.lang.Class beanClass)  
      static int getPropertyCount​(java.lang.Object obj)  
      static IBeanMapper getPropertyMapping​(java.lang.Object type, java.lang.String dstPropName)  
      static java.lang.String getPropertyName​(java.lang.Object prop)  
      static java.lang.String[] getPropertyNames​(java.lang.Object typeObj)  
      static java.lang.Object getPropertyPath​(java.lang.Object origObj, java.lang.String origProperty)  
      static java.lang.Object getPropertyType​(java.lang.Object prop)  
      static java.lang.Object getPropertyType​(java.lang.Object objType, java.lang.String propName)  
      static java.lang.Object getPropertyValue​(java.lang.Object object, java.lang.String propertyName)  
      static java.lang.Object getPropertyValue​(java.lang.Object object, java.lang.String propertyName, boolean ignoreError)  
      static java.lang.Object getReturnType​(java.lang.Object dynMethod)  
      static java.lang.Object getReverseBindingMethod​(java.lang.Object method)  
      static IReverseMethodMapper getReverseMethodMapper​(MethodBinding binding)  
      static java.lang.Object getRootType​(java.lang.Object typeObj)  
      static ScopeDefinition getScopeByName​(java.lang.String scopeName)  
      static java.lang.String getScopeName​(java.lang.Object obj)  
      static java.lang.String getScopeNameForType​(java.lang.Object typeObj)  
      static IBeanMapper[] getStaticProperties​(java.lang.Object typeObj)  
      static java.lang.Object getStaticProperty​(java.lang.Object typeObj, java.lang.String propertyName)  
      static int getStaticPropertyCount​(java.lang.Object cl)  
      static java.lang.Object getSType​(java.lang.Object obj)
      Like the above but does not check if obj is itself a class.
      static java.lang.ClassLoader getSysClassLoader()
      Returns the layered system class loader if there is one - null otherwise.
      static java.lang.String getTraceId​(java.lang.Object obj)
      Returns a small but consistent id for each object - using the objectId if it's set just for consistency and ease of debugging
      static java.lang.String getTraceObjId​(java.lang.Object obj)
      Gets the trace id without the identity wrapper, for things like session ids which should use 'equals' rather than object identity to match the same trace id
      static java.lang.Object getType​(java.lang.Object obj)  
      static java.lang.Integer getTypeIdCount​(java.lang.String typeName, java.util.Map<java.lang.String,​java.lang.Integer> typeIdCounts)  
      static java.lang.String getTypeName​(java.lang.Object type, boolean includeDims)  
      static java.lang.Object getTypeOfObj​(java.lang.Object changedObj)  
      static java.lang.String getTypeSignature​(java.lang.Object method)  
      static boolean hasAnnotation​(java.lang.Object typeObj, java.lang.String annotName)  
      static boolean hasModifier​(java.lang.Object def, java.lang.String modifier)  
      static boolean hasPendingJobs()  
      static boolean hasProperty​(java.lang.Object obj, java.lang.String propName)  
      static void initComponent​(java.lang.Object comp)  
      static boolean instanceOf​(java.lang.Object obj, java.lang.Object type)  
      static int intPropertyValue​(IDynObject p, java.lang.String propName)  
      static int intValue​(java.lang.Object o)  
      static ScheduledJob invokeLater​(java.lang.Runnable r, int priority)
      Runs at the next opportunity as determined by the ThreadScheduler or the framework scheduler.
      static java.lang.Object invokeMethod​(java.lang.Object obj, java.lang.Object method, java.lang.Object... paramValues)  
      static RemoteResult invokeRemote​(ScopeDefinition def, ScopeContext ctx, java.lang.String destName, java.lang.Object obj, java.lang.Object method, java.lang.Object... paramValues)
      Here we are are invoking a generic remote method call.
      static java.lang.Object invokeRemoteSync​(ScopeDefinition def, ScopeContext ctx, java.lang.String destName, long timeout, java.lang.Object obj, java.lang.Object method, java.lang.Object... paramValues)  
      static boolean isArray​(java.lang.Object type)  
      static boolean isAssignableFrom​(java.lang.Object type1, java.lang.Object type2)  
      static boolean isComponentType​(java.lang.Object type)  
      static boolean isEnumConstant​(java.lang.Object obj)  
      static boolean isEnumType​(java.lang.Object type)  
      static boolean isEvalSupported()  
      static boolean isImmutableObject​(java.lang.Object obj)  
      static boolean isNonCompiledType​(java.lang.Object obj)
      Returns true if this is a TypeDeclaration, not a Class
      static boolean isObject​(java.lang.Object obj)  
      static boolean isObjectType​(java.lang.Object type)  
      static boolean isRemoteMethod​(java.lang.Object method)  
      static boolean isRootedObject​(java.lang.Object obj)  
      static boolean isSingletonType​(java.lang.Object type)  
      static boolean isStaticMethod​(java.lang.Object meth)  
      static boolean isSType​(java.lang.Object obj)
      Unlike isType, treats TypeDeclaration's as non-types so they can be serialized across the wire as objects in the dynamic runtime in some cases
      static boolean isType​(java.lang.Object obj)
      StrataCode uses some objects to implement dynamic types.
      static long longPropertyValue​(IDynObject p, java.lang.String propName)  
      static long longValue​(java.lang.Object o)  
      static boolean needsSync​(java.lang.Object type)  
      static java.lang.Object newInnerComponent​(java.lang.Object typeObj, java.lang.Object outerObj, java.lang.String constrSig, java.lang.Object... params)
      Use this method to create an instance that might be an @Component class - so that we call the init and start methods
      static java.lang.Object newInnerInstance​(java.lang.Object typeObj, java.lang.Object outerObj, java.lang.String constrSig, java.lang.Object... params)  
      static java.util.Date parseDate​(java.lang.String dateStr)
      Parse dates in 8601 format (there's a Javascript version of this method for client/server code)
      static void refreshType​(java.lang.String typeName)  
      static void registerTypeChangeListener​(ITypeChangeListener listener)
      Call this method to be notified when dynamic types change
      static void removeChild​(java.lang.Object parent, java.lang.Object child)  
      static java.lang.Object resolveMethod​(java.lang.Object type, java.lang.String methodName, java.lang.Object returnType, java.lang.String paramSig)  
      static java.lang.Object resolveName​(java.lang.String name, boolean create)  
      static java.lang.Object resolveName​(java.lang.String name, boolean create, boolean returnTypes)  
      static IBeanMapper resolvePropertyMapping​(java.lang.Object type, java.lang.String dstPropName)
      Like getPropertyMapping but prints an error if the property is not found.
      static java.lang.Object resolveRemoteMethod​(java.lang.Object type, java.lang.String methodName, java.lang.Object retType, java.lang.String paramSig)  
      static java.lang.Object resolveRemoteStaticMethod​(java.lang.Object type, java.lang.String methodName, java.lang.Object retType, java.lang.String paramSig)  
      static java.lang.Object resolveStaticMethod​(java.lang.Object type, java.lang.String methodName, java.lang.Object returnType, java.lang.String paramSig)
      In Java this is the same method but in Javascript they are different
      static java.lang.Object[] resolveTypeGroupMembers​(java.lang.String typeGroupName)  
      static java.lang.Object setAndReturn​(java.lang.Object thisObj, java.lang.String prop, java.lang.Object value)  
      static java.lang.Object setAndReturn​(java.lang.Object thisObj, IBeanMapper mapper, java.lang.Object value)  
      static java.lang.Object setAndReturnOrig​(java.lang.Object thisObj, java.lang.String prop, java.lang.Object value)  
      static java.lang.Object setAndReturnOrig​(java.lang.Object thisObj, IBeanMapper mapper, java.lang.Object value)  
      static java.lang.Object setAndReturnOrigStatic​(java.lang.Class thisObj, java.lang.String prop, java.lang.Object value)  
      static java.lang.Object setAndReturnOrigStatic​(java.lang.Class thisObj, IBeanMapper mapper, java.lang.Object value)  
      static java.lang.Object setAndReturnStatic​(java.lang.Class thisObj, java.lang.String prop, java.lang.Object value)  
      static java.lang.Object setAndReturnStatic​(java.lang.Class thisObj, IBeanMapper mapper, java.lang.Object value)  
      static void setArrayElement​(java.lang.Object arrVal, int dim, java.lang.Object value)  
      static void setIndexedProperty​(java.lang.Object obj, java.lang.Object prop, int ix, java.lang.Object value)  
      static void setObjectId​(java.lang.Object obj, java.lang.String name)  
      static void setProperty​(java.lang.Object object, java.lang.String propertyName, java.lang.Object valueToSet)  
      static void setProperty​(java.lang.Object object, java.lang.String propertyName, java.lang.Object valueToSet, boolean setField)  
      static void setPropertyValue​(java.lang.Object object, java.lang.String propertyName, java.lang.Object valueToSet)  
      static void setStaticProperty​(java.lang.Object typeObj, java.lang.String propertyName, java.lang.Object valueToSet)  
      static void setThreadScheduler​(IScheduler sched)  
      static void startComponent​(java.lang.Object comp)  
      static java.lang.String toString​(java.lang.Object obj)  
      static void updateTypeIdCount​(java.lang.String typeName, int val)  
      static java.util.Map<java.lang.String,​java.lang.String> validateProperties​(java.lang.Object obj, java.util.List<java.lang.String> propNames)  
      static java.lang.String validateProperty​(IPropValidator obj, java.lang.String propName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • frameworkScheduler

        public static IScheduler frameworkScheduler
      • threadScheduler

        public static java.lang.ThreadLocal<IScheduler> threadScheduler
    • Method Detail

      • clearObjectIds

        public static void clearObjectIds()
      • flushCaches

        public static void flushCaches()
      • getPropertyCache

        public static DynType getPropertyCache​(java.lang.Class beanClass)
      • getTypeName

        public static java.lang.String getTypeName​(java.lang.Object type,
                                                   boolean includeDims)
      • getNumInnerTypeLevels

        public static int getNumInnerTypeLevels​(java.lang.Object obj)
      • getNumInnerObjectLevels

        public static int getNumInnerObjectLevels​(java.lang.Object obj)
        Walks up the object hierarchy until we hit a class or go off the top.
      • getInnerTypeName

        public static java.lang.String getInnerTypeName​(java.lang.Object type)
      • getPropertyType

        public static java.lang.Object getPropertyType​(java.lang.Object objType,
                                                       java.lang.String propName)
      • getPropertyMapping

        public static IBeanMapper getPropertyMapping​(java.lang.Object type,
                                                     java.lang.String dstPropName)
      • getConstantPropertyMapping

        public static IBeanMapper getConstantPropertyMapping​(java.lang.Object type,
                                                             java.lang.String dstPropName)
      • getArrayLengthPropertyMapping

        public static IBeanMapper getArrayLengthPropertyMapping​(java.lang.Object type,
                                                                java.lang.String dstPropName)
      • resolvePropertyMapping

        public static IBeanMapper resolvePropertyMapping​(java.lang.Object type,
                                                         java.lang.String dstPropName)
        Like getPropertyMapping but prints an error if the property is not found.
      • getReturnType

        public static java.lang.Object getReturnType​(java.lang.Object dynMethod)
      • getParameterTypes

        public static java.lang.Object[] getParameterTypes​(java.lang.Object dynMethod)
      • instanceOf

        public static boolean instanceOf​(java.lang.Object obj,
                                         java.lang.Object type)
      • isAssignableFrom

        public static boolean isAssignableFrom​(java.lang.Object type1,
                                               java.lang.Object type2)
      • getCompiledClass

        public static java.lang.Class getCompiledClass​(java.lang.Object type)
      • invokeMethod

        public static java.lang.Object invokeMethod​(java.lang.Object obj,
                                                    java.lang.Object method,
                                                    java.lang.Object... paramValues)
      • invokeRemote

        public static RemoteResult invokeRemote​(ScopeDefinition def,
                                                ScopeContext ctx,
                                                java.lang.String destName,
                                                java.lang.Object obj,
                                                java.lang.Object method,
                                                java.lang.Object... paramValues)
        Here we are are invoking a generic remote method call. The ScopeDefinition and ScopeContext can be null for defaults, but if specified select a specific remote context in a specific remote process. For example, a server running a method on a specific session or window that's connected.
      • invokeRemoteSync

        public static java.lang.Object invokeRemoteSync​(ScopeDefinition def,
                                                        ScopeContext ctx,
                                                        java.lang.String destName,
                                                        long timeout,
                                                        java.lang.Object obj,
                                                        java.lang.Object method,
                                                        java.lang.Object... paramValues)
      • resolveStaticMethod

        public static java.lang.Object resolveStaticMethod​(java.lang.Object type,
                                                           java.lang.String methodName,
                                                           java.lang.Object returnType,
                                                           java.lang.String paramSig)
        In Java this is the same method but in Javascript they are different
      • resolveRemoteMethod

        public static java.lang.Object resolveRemoteMethod​(java.lang.Object type,
                                                           java.lang.String methodName,
                                                           java.lang.Object retType,
                                                           java.lang.String paramSig)
      • resolveRemoteStaticMethod

        public static java.lang.Object resolveRemoteStaticMethod​(java.lang.Object type,
                                                                 java.lang.String methodName,
                                                                 java.lang.Object retType,
                                                                 java.lang.String paramSig)
      • resolveMethod

        public static java.lang.Object resolveMethod​(java.lang.Object type,
                                                     java.lang.String methodName,
                                                     java.lang.Object returnType,
                                                     java.lang.String paramSig)
      • getMethodName

        public static java.lang.String getMethodName​(java.lang.Object method)
      • getMethodType

        public static java.lang.Object getMethodType​(java.lang.Object method)
      • getPropertyName

        public static java.lang.String getPropertyName​(java.lang.Object prop)
      • getPropertyType

        public static java.lang.Object getPropertyType​(java.lang.Object prop)
      • getTypeSignature

        public static java.lang.String getTypeSignature​(java.lang.Object method)
      • evalCast

        public static java.lang.Object evalCast​(java.lang.Object o,
                                                java.lang.Object value)
      • isType

        public static boolean isType​(java.lang.Object obj)
        StrataCode uses some objects to implement dynamic types. This method returns true if the given object is either a plain old Class type or a dynamic type.
      • isSType

        public static boolean isSType​(java.lang.Object obj)
        Unlike isType, treats TypeDeclaration's as non-types so they can be serialized across the wire as objects in the dynamic runtime in some cases
      • isNonCompiledType

        public static boolean isNonCompiledType​(java.lang.Object obj)
        Returns true if this is a TypeDeclaration, not a Class
      • getSType

        public static java.lang.Object getSType​(java.lang.Object obj)
        Like the above but does not check if obj is itself a class. That breaks when we try to use ITypeDeclaration as an object instance.
      • getType

        public static java.lang.Object getType​(java.lang.Object obj)
      • hasModifier

        public static boolean hasModifier​(java.lang.Object def,
                                          java.lang.String modifier)
      • getStaticPropertyCount

        public static int getStaticPropertyCount​(java.lang.Object cl)
      • getPropertyCount

        public static int getPropertyCount​(java.lang.Object obj)
      • intPropertyValue

        public static int intPropertyValue​(IDynObject p,
                                           java.lang.String propName)
      • floatPropertyValue

        public static float floatPropertyValue​(IDynObject p,
                                               java.lang.String propName)
      • doublePropertyValue

        public static double doublePropertyValue​(IDynObject p,
                                                 java.lang.String propName)
      • longPropertyValue

        public static long longPropertyValue​(IDynObject p,
                                             java.lang.String propName)
      • getProperties

        public static IBeanMapper[] getProperties​(java.lang.Object typeObj)
      • getPropertyNames

        public static java.lang.String[] getPropertyNames​(java.lang.Object typeObj)
      • getStaticProperties

        public static IBeanMapper[] getStaticProperties​(java.lang.Object typeObj)
      • getPropertyPath

        public static java.lang.Object getPropertyPath​(java.lang.Object origObj,
                                                       java.lang.String origProperty)
      • getPropertyValue

        public static java.lang.Object getPropertyValue​(java.lang.Object object,
                                                        java.lang.String propertyName,
                                                        boolean ignoreError)
      • getPropertyValue

        public static java.lang.Object getPropertyValue​(java.lang.Object object,
                                                        java.lang.String propertyName)
      • getProperty

        public static java.lang.Object getProperty​(java.lang.Object object,
                                                   java.lang.String propertyName)
      • getProperty

        public static java.lang.Object getProperty​(java.lang.Object object,
                                                   java.lang.String propertyName,
                                                   boolean getField)
        Like getPropertyValue this works for static properties, but breaks if the TypeDeclaration object is used as an object instance. That case is where the type declaration represents the class for a static property.
      • getStaticProperty

        public static java.lang.Object getStaticProperty​(java.lang.Object typeObj,
                                                         java.lang.String propertyName)
      • setStaticProperty

        public static void setStaticProperty​(java.lang.Object typeObj,
                                             java.lang.String propertyName,
                                             java.lang.Object valueToSet)
      • setPropertyValue

        public static void setPropertyValue​(java.lang.Object object,
                                            java.lang.String propertyName,
                                            java.lang.Object valueToSet)
      • setProperty

        public static void setProperty​(java.lang.Object object,
                                       java.lang.String propertyName,
                                       java.lang.Object valueToSet)
      • setProperty

        public static void setProperty​(java.lang.Object object,
                                       java.lang.String propertyName,
                                       java.lang.Object valueToSet,
                                       boolean setField)
      • createInstance

        public static java.lang.Object createInstance​(java.lang.Object typeObj,
                                                      java.lang.String constrSig,
                                                      java.lang.Object... params)
      • createInnerInstance

        public static java.lang.Object createInnerInstance​(java.lang.Object typeObj,
                                                           java.lang.Object outerObj,
                                                           java.lang.String constrSig,
                                                           java.lang.Object... params)
      • newInnerInstance

        public static java.lang.Object newInnerInstance​(java.lang.Object typeObj,
                                                        java.lang.Object outerObj,
                                                        java.lang.String constrSig,
                                                        java.lang.Object... params)
      • newInnerComponent

        public static java.lang.Object newInnerComponent​(java.lang.Object typeObj,
                                                         java.lang.Object outerObj,
                                                         java.lang.String constrSig,
                                                         java.lang.Object... params)
        Use this method to create an instance that might be an @Component class - so that we call the init and start methods
      • addDynObject

        public static void addDynObject​(java.lang.String typeName,
                                        java.lang.Object instObj)
      • addDynInnerObject

        public static void addDynInnerObject​(java.lang.String typeName,
                                             java.lang.Object innerObj,
                                             java.lang.Object outerObj)
      • getObjectName

        public static java.lang.String getObjectName​(java.lang.Object obj)
      • getObjectName

        public static java.lang.String getObjectName​(java.lang.Object obj,
                                                     java.util.Map<java.lang.Object,​java.lang.String> idMap,
                                                     java.util.Map<java.lang.String,​java.lang.Integer> typeIdCounts)
      • addDynInstance

        public static void addDynInstance​(java.lang.String typeName,
                                          java.lang.Object instObj)
        Used to associate object instances with their type in order to support the liveDynamicTypes feature. You turn this on both globally and for compiled layers, as an option in the layer. When enabled, a call to register each instance with its type is put into the object creation template. When you later modify the object's type definition (such as through a PropertyAssignment), we can apply those changes to all instances. This gets turned on automatically for all types in dynamic layers.
      • addDynListener

        public static void addDynListener​(IDynListener listener)
      • addDynInnerInstance

        public static void addDynInnerInstance​(java.lang.String typeName,
                                               java.lang.Object innerObj,
                                               java.lang.Object outerObj)
      • resolveTypeGroupMembers

        public static java.lang.Object[] resolveTypeGroupMembers​(java.lang.String typeGroupName)
      • getDynSrcDirs

        public static java.lang.String[] getDynSrcDirs()
      • getDynSrcPrefixes

        public static java.lang.String[] getDynSrcPrefixes()
      • refreshType

        public static void refreshType​(java.lang.String typeName)
      • getObjChildren

        public static java.lang.Object[] getObjChildren​(java.lang.Object inst,
                                                        java.lang.String scopeName,
                                                        boolean create)
        Returns the dynamic children objects for the given instance
      • getObjChildrenArray2DRange

        public static java.lang.Object[] getObjChildrenArray2DRange​(java.lang.Object[] srcArr,
                                                                    java.lang.String scopeName,
                                                                    int startIx,
                                                                    int endIx)
      • getObjChildrenNames

        public static java.lang.String[] getObjChildrenNames​(java.lang.Object typeObj,
                                                             java.lang.String scopeName)
        Returns tne property names of the object children for the given type object
      • getObjChildrenTypes

        public static java.lang.Object[] getObjChildrenTypes​(java.lang.Object typeObj,
                                                             java.lang.String scopeName)
        Returns the type objects for child objects. If scopeName is not null, only types with the given scope are returned.
      • getReverseBindingMethod

        public static java.lang.Object getReverseBindingMethod​(java.lang.Object method)
      • equalObjects

        public static boolean equalObjects​(java.lang.Object obj1,
                                           java.lang.Object obj2)
      • closeEquals

        public static boolean closeEquals​(java.lang.Number v1,
                                          java.lang.Number v2)
      • equalArrays

        public static boolean equalArrays​(java.lang.Object[] arr1,
                                          java.lang.Object[] arr2)
      • evalCast

        public static java.lang.Object evalCast​(java.lang.Class theClass,
                                                java.lang.Object value)
      • getTraceId

        public static java.lang.String getTraceId​(java.lang.Object obj)
        Returns a small but consistent id for each object - using the objectId if it's set just for consistency and ease of debugging
      • getTraceObjId

        public static java.lang.String getTraceObjId​(java.lang.Object obj)
        Gets the trace id without the identity wrapper, for things like session ids which should use 'equals' rather than object identity to match the same trace id
      • cleanClassName

        public static java.lang.String cleanClassName​(java.lang.Class cl)
      • cleanTypeName

        public static java.lang.String cleanTypeName​(java.lang.String typeName)
      • arrayToInstanceName

        public static java.lang.String arrayToInstanceName​(java.lang.Object[] list)
      • getInstanceId

        public static java.lang.String getInstanceId​(java.lang.Object obj)
      • getInstanceId

        public static java.lang.String getInstanceId​(java.util.Map<java.lang.Object,​java.lang.String> idMap,
                                                     java.util.Map<java.lang.String,​java.lang.Integer> typeIdCounts,
                                                     java.lang.Object obj)
        Returns a unique id for the given object. Types return the type name. The id will otherwise by type-id__integer
      • getObjectId

        public static java.lang.String getObjectId​(java.lang.Object obj,
                                                   java.lang.Object type,
                                                   java.lang.String typeName)
      • getObjectId

        public static java.lang.String getObjectId​(java.lang.Object obj,
                                                   java.lang.Object type,
                                                   java.lang.String typeName,
                                                   java.util.Map<java.lang.Object,​java.lang.String> idMap,
                                                   java.util.Map<java.lang.String,​java.lang.Integer> typeIdCount)
      • setObjectId

        public static void setObjectId​(java.lang.Object obj,
                                       java.lang.String name)
      • getTypeIdCount

        public static java.lang.Integer getTypeIdCount​(java.lang.String typeName,
                                                       java.util.Map<java.lang.String,​java.lang.Integer> typeIdCounts)
      • updateTypeIdCount

        public static void updateTypeIdCount​(java.lang.String typeName,
                                             int val)
      • getInstanceName

        public static java.lang.String getInstanceName​(java.lang.Object obj)
        Returns a nice short String to display for this object instance for debugging and logging purposes primarily. The toString is inspected and if it makes a nice looking debug String it is used. If it's too long or has new lines it is not used and the name__integer is used.
      • getInstanceTraceName

        public static java.lang.String getInstanceTraceName​(java.lang.Object obj)
      • getDisplayName

        public static java.lang.String getDisplayName​(java.lang.Object obj)
      • toString

        public static java.lang.String toString​(java.lang.Object obj)
      • getArrayLength

        public static int getArrayLength​(java.lang.Object arrVal)
      • getArrayElement

        public static java.lang.Object getArrayElement​(java.lang.Object arrVal,
                                                       int dim)
      • setArrayElement

        public static void setArrayElement​(java.lang.Object arrVal,
                                           int dim,
                                           java.lang.Object value)
      • getIndexedProperty

        public static java.lang.Object getIndexedProperty​(java.lang.Object obj,
                                                          IBeanMapper prop,
                                                          int ix)
      • setIndexedProperty

        public static void setIndexedProperty​(java.lang.Object obj,
                                              java.lang.Object prop,
                                              int ix,
                                              java.lang.Object value)
      • evalArithmeticExpression

        public static java.lang.Object evalArithmeticExpression​(java.lang.String operator,
                                                                java.lang.Class expectedType,
                                                                java.lang.Object lhsVal,
                                                                java.lang.Object rhsVal)
      • evalPreConditionalExpression

        public static java.lang.Object evalPreConditionalExpression​(java.lang.String operator,
                                                                    java.lang.Object lhsVal)
      • evalConditionalExpression

        public static java.lang.Object evalConditionalExpression​(java.lang.String operator,
                                                                 java.lang.Object lhsVal,
                                                                 java.lang.Object rhsVal)
      • evalUnaryExpression

        public static java.lang.Object evalUnaryExpression​(java.lang.String operator,
                                                           java.lang.Class expectedType,
                                                           java.lang.Object val)
      • evalInverseUnaryExpression

        public static java.lang.Object evalInverseUnaryExpression​(java.lang.String operator,
                                                                  java.lang.Class expectedType,
                                                                  java.lang.Object val)
      • addPropertyCache

        public static void addPropertyCache​(java.lang.Class newClass,
                                            DynType cache)
        Used in code generation cases where we register this programmatically.
      • intValue

        public static int intValue​(java.lang.Object o)
      • floatValue

        public static float floatValue​(java.lang.Object o)
      • doubleValue

        public static double doubleValue​(java.lang.Object o)
      • longValue

        public static long longValue​(java.lang.Object o)
      • booleanValue

        public static boolean booleanValue​(java.lang.Object o)
      • charValue

        public static char charValue​(java.lang.Object o)
      • setAndReturn

        public static java.lang.Object setAndReturn​(java.lang.Object thisObj,
                                                    java.lang.String prop,
                                                    java.lang.Object value)
      • setAndReturnOrig

        public static java.lang.Object setAndReturnOrig​(java.lang.Object thisObj,
                                                        java.lang.String prop,
                                                        java.lang.Object value)
      • setAndReturnStatic

        public static java.lang.Object setAndReturnStatic​(java.lang.Class thisObj,
                                                          java.lang.String prop,
                                                          java.lang.Object value)
      • setAndReturnOrigStatic

        public static java.lang.Object setAndReturnOrigStatic​(java.lang.Class thisObj,
                                                              java.lang.String prop,
                                                              java.lang.Object value)
      • setAndReturn

        public static java.lang.Object setAndReturn​(java.lang.Object thisObj,
                                                    IBeanMapper mapper,
                                                    java.lang.Object value)
      • setAndReturnOrig

        public static java.lang.Object setAndReturnOrig​(java.lang.Object thisObj,
                                                        IBeanMapper mapper,
                                                        java.lang.Object value)
      • setAndReturnStatic

        public static java.lang.Object setAndReturnStatic​(java.lang.Class thisObj,
                                                          IBeanMapper mapper,
                                                          java.lang.Object value)
      • setAndReturnOrigStatic

        public static java.lang.Object setAndReturnOrigStatic​(java.lang.Class thisObj,
                                                              IBeanMapper mapper,
                                                              java.lang.Object value)
      • evalPropertyIncr

        public static java.lang.Number evalPropertyIncr​(java.lang.Object thisObj,
                                                        java.lang.String prop,
                                                        int incr)
      • evalPropertyIncrOrig

        public static java.lang.Number evalPropertyIncrOrig​(java.lang.Object thisObj,
                                                            java.lang.String prop,
                                                            int incr)
      • evalPropertyIncrStatic

        public static java.lang.Number evalPropertyIncrStatic​(java.lang.Class thisObj,
                                                              java.lang.String prop,
                                                              int incr)
      • evalPropertyIncrOrigStatic

        public static java.lang.Number evalPropertyIncrOrigStatic​(java.lang.Class thisObj,
                                                                  java.lang.String prop,
                                                                  int incr)
      • evalPropertyIncr

        public static java.lang.Number evalPropertyIncr​(java.lang.Object thisObj,
                                                        IBeanMapper mapper,
                                                        int incr)
      • evalPropertyIncrOrig

        public static java.lang.Number evalPropertyIncrOrig​(java.lang.Object thisObj,
                                                            IBeanMapper mapper,
                                                            int incr)
      • evalPropertyIncrStatic

        public static java.lang.Number evalPropertyIncrStatic​(java.lang.Class thisObj,
                                                              IBeanMapper mapper,
                                                              int incr)
      • evalPropertyIncrOrigStatic

        public static java.lang.Number evalPropertyIncrOrigStatic​(java.lang.Class thisObj,
                                                                  IBeanMapper mapper,
                                                                  int incr)
      • dispose

        public static void dispose​(java.lang.Object obj)
      • dispose

        public static void dispose​(java.lang.Object obj,
                                   boolean disposeChildren)
        Called to remove the object from the dynamic type system. Though we use weak storage for these instances, it's faster to get rid of them when you are done. Also removes the bindings. Used the system dispose method to just remove the instance from the instancesByType table.
      • disposeLater

        public static void disposeLater​(java.lang.Object component,
                                        boolean disposeChildren)
      • initComponent

        public static void initComponent​(java.lang.Object comp)
      • startComponent

        public static void startComponent​(java.lang.Object comp)
      • resolveName

        public static java.lang.Object resolveName​(java.lang.String name,
                                                   boolean create)
      • resolveName

        public static java.lang.Object resolveName​(java.lang.String name,
                                                   boolean create,
                                                   boolean returnTypes)
      • findType

        public static java.lang.Object findType​(java.lang.String typeName)
      • isEvalSupported

        public static boolean isEvalSupported()
      • evalRemoteScript

        public static java.lang.Object evalRemoteScript​(ScopeContext ctx,
                                                        java.lang.String script)
        Executes the supplied java script by making an RPC call targeted towards all clients with the lifecycle identified by ScopeContext
      • evalScript

        public static java.lang.Object evalScript​(java.lang.String script)
      • applySyncLayer

        public static boolean applySyncLayer​(java.lang.String lang,
                                             java.lang.String destName,
                                             java.lang.String scopeName,
                                             java.lang.String code,
                                             boolean applyRemoteReset,
                                             boolean allowCodeEval,
                                             BindingContext ctx)
      • isObjectType

        public static boolean isObjectType​(java.lang.Object type)
      • isSingletonType

        public static boolean isSingletonType​(java.lang.Object type)
      • isObject

        public static boolean isObject​(java.lang.Object obj)
      • isRootedObject

        public static boolean isRootedObject​(java.lang.Object obj)
      • getOuterObject

        public static java.lang.Object getOuterObject​(java.lang.Object srcObj)
      • getRootType

        public static java.lang.Object getRootType​(java.lang.Object typeObj)
      • getEnclosingType

        public static java.lang.Object getEnclosingType​(java.lang.Object typeObj,
                                                        boolean instOnly)
      • isEnumConstant

        public static boolean isEnumConstant​(java.lang.Object obj)
      • isEnumType

        public static boolean isEnumType​(java.lang.Object type)
      • getEnumConstants

        public static java.lang.Object[] getEnumConstants​(java.lang.Object enumType)
      • getEnumConstant

        public static java.lang.Object getEnumConstant​(java.lang.Object typeObj,
                                                       java.lang.String enumConstName)
      • getEnumName

        public static java.lang.String getEnumName​(java.lang.Object enumObj)
      • setThreadScheduler

        public static void setThreadScheduler​(IScheduler sched)
      • invokeLater

        public static ScheduledJob invokeLater​(java.lang.Runnable r,
                                               int priority)
        Runs at the next opportunity as determined by the ThreadScheduler or the framework scheduler. Higher priority jobs run before lower priority ones
      • clearInvokeLater

        public static boolean clearInvokeLater​(ScheduledJob job)
      • execLaterJobs

        public static void execLaterJobs()
      • execLaterJobs

        public static void execLaterJobs​(int minPriority,
                                         int maxPriority)
      • hasPendingJobs

        public static boolean hasPendingJobs()
      • getPackageName

        public static java.lang.String getPackageName​(java.lang.Object type)
      • hasAnnotation

        public static boolean hasAnnotation​(java.lang.Object typeObj,
                                            java.lang.String annotName)
      • getAnnotation

        public static java.lang.Object getAnnotation​(java.lang.Object typeObj,
                                                     java.lang.String annotName)
      • getAnnotationValue

        public static java.lang.Object getAnnotationValue​(java.lang.Object typeObj,
                                                          java.lang.String annotName,
                                                          java.lang.String attName)
      • getPropertyAnnotationValue

        public static java.lang.Object getPropertyAnnotationValue​(java.lang.Object typeObj,
                                                                  java.lang.String propName,
                                                                  java.lang.String annotName,
                                                                  java.lang.String attName)
      • getInheritedAnnotationValue

        public static java.lang.Object getInheritedAnnotationValue​(java.lang.Object typeObj,
                                                                   java.lang.String annotName,
                                                                   java.lang.String attName)
      • getScopeName

        public static java.lang.String getScopeName​(java.lang.Object obj)
      • getScopeNameForType

        public static java.lang.String getScopeNameForType​(java.lang.Object typeObj)
      • getScopeByName

        public static ScopeDefinition getScopeByName​(java.lang.String scopeName)
      • getSysClassLoader

        public static java.lang.ClassLoader getSysClassLoader()
        Returns the layered system class loader if there is one - null otherwise.
      • getExtendsType

        public static java.lang.Object getExtendsType​(java.lang.Object type)
      • isRemoteMethod

        public static boolean isRemoteMethod​(java.lang.Object method)
      • getInstancesOfTypeAndSubTypes

        public static java.lang.Object[] getInstancesOfTypeAndSubTypes​(java.lang.String typeName)
      • getDynChildManager

        public static IDynChildManager getDynChildManager​(java.lang.Object type)
      • removeChild

        public static void removeChild​(java.lang.Object parent,
                                       java.lang.Object child)
      • addChild

        public static void addChild​(java.lang.Object parent,
                                    java.lang.Object child)
      • addChild

        public static void addChild​(int ix,
                                    java.lang.Object parent,
                                    java.lang.Object child)
      • getLayerPosition

        public static int getLayerPosition​(java.lang.Object type)
      • registerTypeChangeListener

        public static void registerTypeChangeListener​(ITypeChangeListener listener)
        Call this method to be notified when dynamic types change
      • isComponentType

        public static boolean isComponentType​(java.lang.Object type)
      • isArray

        public static boolean isArray​(java.lang.Object type)
      • getComponentType

        public static java.lang.Object getComponentType​(java.lang.Object type)
      • hasProperty

        public static boolean hasProperty​(java.lang.Object obj,
                                          java.lang.String propName)
      • getTypeOfObj

        public static java.lang.Object getTypeOfObj​(java.lang.Object changedObj)
      • getCurrentThreadString

        public static java.lang.String getCurrentThreadString()
        Don't put the ugly thread ids into the logs - normalize them with an incremending integer
      • needsSync

        public static boolean needsSync​(java.lang.Object type)
      • findCommonSuperType

        public static java.lang.Object findCommonSuperType​(java.lang.Object c1,
                                                           java.lang.Object c2)
      • compare

        public static int compare​(java.lang.Object o1,
                                  java.lang.Object o2)
      • addSystemExitListener

        public static void addSystemExitListener​(ISystemExitListener sys)
      • parseDate

        public static java.util.Date parseDate​(java.lang.String dateStr)
        Parse dates in 8601 format (there's a Javascript version of this method for client/server code)
      • formatDate

        public static java.lang.String formatDate​(java.util.Date date)
        Format dates in 8601 format (there's a JS version of this method too)
      • isImmutableObject

        public static boolean isImmutableObject​(java.lang.Object obj)
      • validateProperties

        public static java.util.Map<java.lang.String,​java.lang.String> validateProperties​(java.lang.Object obj,
                                                                                                java.util.List<java.lang.String> propNames)
      • validateProperty

        public static java.lang.String validateProperty​(IPropValidator obj,
                                                        java.lang.String propName)
      • isStaticMethod

        public static boolean isStaticMethod​(java.lang.Object meth)