Class ModelUtil

  • public class ModelUtil
    extends java.lang.Object
    This interface contains a wide range of operations on Java objects defined in either java.lang.Class, or ITypeDeclaration as the primary types. For ITypeDeclaration there are two primary implementations: CFClass - the .class file parser, or, a main type for source files parsed in Java or StrataCode. We use Object here as the core type to avoid the need to create wrapper types for java.lang.Class to implement ITypeDeclaration. From a performance perspective, lots of wrapper classes is not efficient but it means we do more casting. If it were only classes, it would not be a good tradeoff but this same decision affects all meta-data: java.lang.reflect.Field etc. which are more numerous. Casting and Object provides some flexibility for such a core API from an integration perspective, especially if we use it with layers down the road to add new languages to this base API. TODO: this class has gotten too big. Are there any feature chunks we can break off to improve modularization?
    • Field Detail


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

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

        public static int REFRESH_CLASSES
        Flags to refreshBoundTypes

        public static int REFRESH_TYPEDEFS

        public static int REFRESH_TRANSFORMED_ONLY
    • Method Detail

      • getVariableTypeDeclaration

        public static java.lang.Object getVariableTypeDeclaration​(java.lang.Object varObj,
                                                                  JavaModel model)
      • getVariableTypeDeclaration

        public static java.lang.Object getVariableTypeDeclaration​(java.lang.Object varObj)
      • getVariableGenericTypeDeclaration

        public static java.lang.Object getVariableGenericTypeDeclaration​(java.lang.Object varObj,
                                                                         JavaModel model)
      • getVariableClass

        public static java.lang.Class getVariableClass​(java.lang.Object varObj)
      • initMethodTypeParameters

        public static java.util.Map<TypeParamKey,​java.lang.Object> initMethodTypeParameters​(java.lang.Object[] typeParameters,
                                                                                                  java.lang.Object[] genericParamTypes,
                                                                                                  java.lang.Object[] resolvedParamTypes,
                                                                                                  java.util.List<Expression> arguments,
                                                                                                  java.lang.Object retType,
                                                                                                  java.lang.Object retInferredType)
      • isGenericArray

        public static boolean isGenericArray​(java.lang.Object genArray)
      • getGenericComponentType

        public static java.lang.Object getGenericComponentType​(java.lang.Object genParam)
      • getMethodTypeDeclaration

        public static java.lang.Object getMethodTypeDeclaration​(java.lang.Object typeContext,
                                                                java.lang.Object varObj,
                                                                java.util.List<Expression> arguments,
                                                                LayeredSystem sys,
                                                                JavaModel model,
                                                                java.lang.Object inferredType,
                                                                java.lang.Object definedInType)
      • getTypeDeclFromType

        public static java.lang.Object getTypeDeclFromType​(java.lang.Object typeContext,
                                                           java.lang.Object type,
                                                           boolean classOnly,
                                                           LayeredSystem sys,
                                                           boolean bindUnboundParams,
                                                           java.lang.Object definedInType,
                                                           java.lang.Object parentType,
                                                           int parentParamIx)
      • getTypeParameterDeclaration

        public static java.lang.Object getTypeParameterDeclaration​(java.lang.Object type)
      • getAllMethods

        public static java.lang.Object[] getAllMethods​(java.lang.Object type,
                                                       java.lang.String modifier,
                                                       boolean hasModifier,
                                                       boolean isDyn,
                                                       boolean overridesComp)
      • getMethods

        public static java.lang.Object[] getMethods​(java.lang.Object type,
                                                    java.lang.String methodName,
                                                    java.lang.String modifier)
      • getMethods

        public static java.lang.Object[] getMethods​(java.lang.Object type,
                                                    java.lang.String methodName,
                                                    java.lang.String modifier,
                                                    boolean includeExtends)
      • overridesMethod

        public static boolean overridesMethod​(java.lang.Object subTypeMethod,
                                              java.lang.Object superTypeMethod)
      • getTypeDeclarationFromJavaType

        public static java.lang.Object getTypeDeclarationFromJavaType​(java.lang.Object javaType)
      • typeToClassArray

        public static java.lang.Class[] typeToClassArray​(JavaType[] types)
      • getSetMethodPropertyType

        public static java.lang.Object getSetMethodPropertyType​(java.lang.Object setMethod,
                                                                JavaModel model)
      • getSetMethodPropertyType

        public static java.lang.Object getSetMethodPropertyType​(java.lang.Object setMethod)
      • getSetMethodJavaType

        public static JavaType getSetMethodJavaType​(LayeredSystem sys,
                                                    java.lang.Object setMethod,
                                                    java.lang.Object definedInType)
      • getMethodDeclaringClass

        public static java.lang.Object getMethodDeclaringClass​(java.lang.Object methodObj)
      • checkAccess

        public static boolean checkAccess​(java.lang.Object refType,
                                          java.lang.Object member)
      • checkAccessList

        public static boolean checkAccessList​(java.lang.Object refType,
                                              java.lang.Object member,
                                              java.util.EnumSet<JavaSemanticNode.MemberType> mtypes)
      • checkAccess

        public static boolean checkAccess​(java.lang.Object refType,
                                          java.lang.Object member,
                                          JavaSemanticNode.MemberType mtype)
      • samePackage

        public static boolean samePackage​(java.lang.Object type1,
                                          java.lang.Object type2)
      • getPackageName

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

        public static boolean sameModel​(java.lang.Object type1,
                                        java.lang.Object type2)
      • isVarArgs

        public static boolean isVarArgs​(java.lang.Object method)
      • getMethod

        public static java.lang.Object getMethod​(LayeredSystem sys,
                                                 java.lang.Object resultClass,
                                                 java.lang.String methodName,
                                                 java.lang.Object refType,
                                                 ITypeParamContext ctx,
                                                 java.lang.Object inferredType,
                                                 boolean staticOnly,
                                                 java.util.List<JavaType> methodTypeArgs,
                                                 java.util.List<?> parametersOrExpressions,
                                                 java.lang.Object[] typesToMatch)
        Returns the method specified on resultClass with the given name which matches either the paraemetersOrExpressions, or a specific list of parameter types. TODO: we should consolidate this logic - this version is used for Class types, CFClass has a defineMethod and AbstractMethodDefinition.definesMethod also has similar logic
      • parameterTypesMatch

        public static boolean parameterTypesMatch​(java.lang.Object[] parameterTypes,
                                                  java.lang.Object[] types,
                                                  java.lang.Object toCheck,
                                                  java.lang.Object refType,
                                                  ITypeParamContext ctx)
      • getConstructorFromSignature

        public static java.lang.Object getConstructorFromSignature​(java.lang.Object type,
                                                                   java.lang.String sig,
                                                                   boolean includeHidden)
      • getMethodFromSignature

        public static java.lang.Object getMethodFromSignature​(java.lang.Object type,
                                                              java.lang.String methodName,
                                                              java.lang.String paramSig,
                                                              boolean resolveLayer)
      • methodNamesMatch

        public static boolean methodNamesMatch​(java.lang.Object c1,
                                               java.lang.Object c2)
      • methodsMatch

        public static boolean methodsMatch​(java.lang.Object m1,
                                           java.lang.Object m2)
      • sameMethodParameters

        public static boolean sameMethodParameters​(java.lang.Object m1,
                                                   java.lang.Object m2)
      • sameMethods

        public static boolean sameMethods​(java.lang.Object m1,
                                          java.lang.Object m2)
        Returns true for two methods which match in name and parameter signature. Beware that it will return true for the same method in different layers (use sameMethodInLayer).
      • anyUnresolvedParamTypes

        public static boolean anyUnresolvedParamTypes​(java.lang.Object m)
      • sameMethodInLayer

        public static boolean sameMethodInLayer​(LayeredSystem sys,
                                                java.lang.Object m1,
                                                java.lang.Object m2)
        Returns true for two methods which are not only the same name, signature but also defined in the same layer. Will consider two methods in different runtimes but the same layer the same method.
      • sameParameters

        public static boolean sameParameters​(java.lang.Object[] c1Types,
                                             java.lang.Object[] c2Types,
                                             boolean allowUnbound,
                                             LayeredSystem sys)
      • parametersMatch

        public static boolean parametersMatch​(java.lang.Object[] c1Types,
                                              java.lang.Object[] c2Types,
                                              boolean allowUnbound,
                                              LayeredSystem sys)
      • chooseImplMethod

        public static java.lang.Object chooseImplMethod​(java.lang.Object c1,
                                                        java.lang.Object c2,
                                                        boolean includeAbstract)
      • pickMoreSpecificMethod

        public static java.lang.Object pickMoreSpecificMethod​(java.lang.Object c1,
                                                              java.lang.Object c2,
                                                              java.lang.Object[] c1ArgTypes,
                                                              java.lang.Object[] c2ArgTypes,
                                                              java.util.List<? extends java.lang.Object> exprs)
        Chooses the method with the more specific return type - as per the searchMethods method in java.lang.Class
      • sameTypesOrVariables

        public static boolean sameTypesOrVariables​(java.lang.Object typeObj1,
                                                   java.lang.Object typeObj2)
      • sameTypes

        public static boolean sameTypes​(java.lang.Object typeObj1,
                                        java.lang.Object typeObj2)
        isSameType might be a better name?
      • sameTypesAndParams

        public static boolean sameTypesAndParams​(java.lang.Object t1,
                                                 java.lang.Object t2)
      • sameTypesAndLayers

        public static boolean sameTypesAndLayers​(LayeredSystem sys,
                                                 java.lang.Object type1,
                                                 java.lang.Object type2)
      • sameTypeParameters

        public static boolean sameTypeParameters​(java.lang.Object tp1,
                                                 java.lang.Object tp2)
      • isBoolean

        public static boolean isBoolean​(java.lang.Object type)
      • isCharacter

        public static boolean isCharacter​(java.lang.Object type)
      • isPrimitive

        public static boolean isPrimitive​(java.lang.Object type)
      • isPrimitiveNumberType

        public static boolean isPrimitiveNumberType​(java.lang.Object type)
      • isANumber

        public static boolean isANumber​(java.lang.Object type)
      • isNumber

        public static boolean isNumber​(java.lang.Object type)
      • coerceTypes

        public static java.lang.Object coerceTypes​(LayeredSystem sys,
                                                   java.lang.Object lhsType,
                                                   java.lang.Object rhsType)
      • blendTypes

        public static java.lang.Object blendTypes​(java.lang.Object lhsType,
                                                  java.lang.Object rhsType)
        This is used to combine the inferredType with the type extracted from the parameters in determining "the" type. Originally it also called coerceTypes but ran into some problems with that.
      • refineType

        public static java.lang.Object refineType​(LayeredSystem sys,
                                                  java.lang.Object definedInType,
                                                  java.lang.Object origType,
                                                  java.lang.Object newType)
      • implementsInterfaces

        public static boolean implementsInterfaces​(java.lang.Object type,
                                                   java.lang.Object[] ifaces)
      • getAllImplementsTypeDeclarations

        public static java.lang.Object[] getAllImplementsTypeDeclarations​(java.lang.Object c1)
      • getImplementsTypeDeclarations

        public static java.lang.Object[] getImplementsTypeDeclarations​(java.lang.Object c1)
      • getOverlappingInterfaces

        public static java.lang.Object[] getOverlappingInterfaces​(java.lang.Object c1,
                                                                  java.lang.Object c2)
      • findCommonSuperClass

        public static java.lang.Object findCommonSuperClass​(LayeredSystem sys,
                                                            java.lang.Object c1,
                                                            java.lang.Object c2)
      • findBestMatchingInterface

        public static java.lang.Object findBestMatchingInterface​(java.lang.Object src,
                                                                 java.lang.Object target,
                                                                 java.lang.Object curRes)
      • typeToClass

        public static java.lang.Class typeToClass​(java.lang.Object type)
      • getClassName

        public static java.lang.String getClassName​(java.lang.Object type)
        Returns just the base part of the name, i.e. "List" for java.util.List.)
      • getTypeName

        public static java.lang.String getTypeName​(java.lang.Object type)
        Returns the complete type name of the type with array dimensions, without type parameters
      • getTypeName

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

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

        public static java.lang.String getJavaFullTypeName​(java.lang.Object type)
      • coerceNumberTypes

        public static java.lang.Object coerceNumberTypes​(java.lang.Object lhsType,
                                                         java.lang.Object rhsType)
      • isArray

        public static boolean isArray​(java.lang.Object arrayType)
      • getArrayComponentType

        public static java.lang.Object getArrayComponentType​(java.lang.Object arrayType)
      • hasTypeParameters

        public static boolean hasTypeParameters​(java.lang.Object paramType)
      • hasDefinedTypeParameters

        public static boolean hasDefinedTypeParameters​(java.lang.Object paramType)
      • getNumTypeParameters

        public static int getNumTypeParameters​(java.lang.Object paramType)
      • getTypeVariable

        public static java.lang.Object getTypeVariable​(java.lang.Object paramType,
                                                       int ix)
      • getTypeParameter

        public static java.lang.Object getTypeParameter​(java.lang.Object paramType,
                                                        int ix)
      • getArrayOrListComponentType

        public static java.lang.Object getArrayOrListComponentType​(java.lang.Object arrayType)
      • isAssignableFrom

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

        public static boolean isAssignableFrom​(java.lang.Object type1,
                                               java.lang.Object type2,
                                               LayeredSystem sys)
      • isAssignableTypesFromOverride

        public static boolean isAssignableTypesFromOverride​(java.lang.Object from,
                                                            java.lang.Object to)
        Use for comparing parameter types in methods to decide when one overrides the other
      • isAssignableFrom

        public static boolean isAssignableFrom​(java.lang.Object type1,
                                               java.lang.Object type2,
                                               boolean assignmentSemantics,
                                               ITypeParamContext ctx)
      • isAssignableFrom

        public static boolean isAssignableFrom​(java.lang.Object type1,
                                               java.lang.Object type2,
                                               boolean assignmentSemantics,
                                               ITypeParamContext ctx,
                                               LayeredSystem sys)
      • isAssignableFrom

        public static boolean isAssignableFrom​(java.lang.Object type1,
                                               java.lang.Object type2,
                                               boolean assignmentSemantics,
                                               ITypeParamContext ctx,
                                               boolean allowUnbound,
                                               LayeredSystem sys)
        Note: the LayeredSystem is an optional parameter here for an edge case that allows us to detect mismatching Classes after we've reset the class loader and reload them rather than compare by name.
      • isAssignableByName

        public static boolean isAssignableByName​(java.lang.Object cl1,
                                                 java.lang.Object cl2)
      • isString

        public static boolean isString​(java.lang.Object type)
      • isDouble

        public static boolean isDouble​(java.lang.Object type)
      • isFloat

        public static boolean isFloat​(java.lang.Object type)
      • isLong

        public static boolean isLong​(java.lang.Object type)
      • isInteger

        public static boolean isInteger​(java.lang.Object type)
      • isShort

        public static boolean isShort​(java.lang.Object type)
      • isByte

        public static boolean isByte​(java.lang.Object type)
      • isAnInteger

        public static boolean isAnInteger​(java.lang.Object type)
      • implementsType

        public static boolean implementsType​(java.lang.Object implType,
                                             java.lang.String fullTypeName,
                                             boolean assignment,
                                             boolean allowUnbound)
      • mergeAnnotations

        public static java.lang.Object mergeAnnotations​(java.lang.Object mainAnnot,
                                                        java.lang.Object overAnnot,
                                                        boolean replace)
        As we are inheriting definitions we may find both src/dst types have the same annotation. This method merges the definitions. When we are merging up to a more specific layer, we only copy definitions not found in the destination layer (replace=false). When we are merging from a more specific to a more general definition (the modify declaration), we replace conflicting definitions in the dest.
      • mergeAnnotationLists

        public static java.util.List<java.lang.Object> mergeAnnotationLists​(java.util.List<java.lang.Object> mainAnnot,
                                                                            java.util.List<java.lang.Object> overAnnot,
                                                                            boolean replace)
        For repeating annotations, it seems like we merge the definitions unless we add smarts for a specific annotation. For now, we just append the lists and return all of them.
      • getPropertyAnnotation

        public static java.lang.Object getPropertyAnnotation​(java.lang.Object property,
                                                             java.lang.String annotationName)
      • getPropertyAnnotations

        public static java.util.Map<java.lang.String,​java.lang.Object> getPropertyAnnotations​(java.lang.Object property)
      • getPropertiesWithAnnotation

        public static java.util.List<java.lang.Object> getPropertiesWithAnnotation​(java.lang.Object type,
                                                                                   java.lang.String annotationName)
      • hasAnnotation

        public static boolean hasAnnotation​(java.lang.Object definition,
                                            java.lang.String annotationName)
        This method is available in the Javascript runtime so we have it here so the APIs stay in sync
      • getAnnotation

        public static java.lang.Object getAnnotation​(java.lang.Object definition,
                                                     java.lang.String annotationName)
      • getRepeatingAnnotation

        public static java.util.List<java.lang.Object> getRepeatingAnnotation​(java.lang.Object definition,
                                                                              java.lang.String annotationName)
      • getAnnotationTargets

        public static java.util.EnumSet<java.lang.annotation.ElementType> getAnnotationTargets​(java.lang.Object annot)
      • getAnnotationValueFromList

        public static java.lang.Object getAnnotationValueFromList​(java.util.List<java.lang.Object> annotations,
                                                                  java.lang.String s)
      • getAnnotationValue

        public static java.lang.Object getAnnotationValue​(java.lang.Object annotation,
                                                          java.lang.String s)
      • isComplexAnnotation

        public static boolean isComplexAnnotation​(java.lang.Object annotation)
      • parametersToTypeArray

        public static java.lang.Object[] parametersToTypeArray​(java.util.List<? extends java.lang.Object> parameters,
                                                               ITypeParamContext ctx)
      • parametersToJavaTypeArray

        public static JavaType[] parametersToJavaTypeArray​(LayeredSystem sys,
                                                           java.lang.Object method,
                                                           java.util.List<? extends java.lang.Object> parameters,
                                                           ParamTypedMethod ctx)
      • definesMethod

        public static java.lang.Object definesMethod​(java.lang.Object td,
                                                     java.lang.String name,
                                                     java.util.List<? extends java.lang.Object> parameters,
                                                     ITypeParamContext ctx,
                                                     java.lang.Object refType,
                                                     boolean isTransformed,
                                                     boolean staticOnly,
                                                     java.lang.Object inferredType,
                                                     java.util.List<JavaType> methodTypeArgs)
      • definesMethod

        public static java.lang.Object definesMethod​(java.lang.Object td,
                                                     java.lang.String name,
                                                     java.util.List<? extends java.lang.Object> parameters,
                                                     ITypeParamContext ctx,
                                                     java.lang.Object refType,
                                                     boolean isTransformed,
                                                     boolean staticOnly,
                                                     java.lang.Object inferredType,
                                                     java.util.List<JavaType> methodTypeArgs,
                                                     LayeredSystem sys)
      • declaresConstructor

        public static java.lang.Object declaresConstructor​(LayeredSystem sys,
                                                           java.lang.Object td,
                                                           java.util.List<?> parameters,
                                                           ITypeParamContext ctx)
      • declaresConstructor

        public static java.lang.Object declaresConstructor​(LayeredSystem sys,
                                                           java.lang.Object td,
                                                           java.util.List<?> args,
                                                           ITypeParamContext ctx,
                                                           java.lang.Object refType)
      • definesConstructor

        public static java.lang.Object definesConstructor​(LayeredSystem sys,
                                                          java.lang.Object td,
                                                          java.util.List<?> parameters,
                                                          ITypeParamContext ctx)
        NOTE: it's rare that you want to use this method - use declaresConstructor instead. This one searches for a matching constructor in the type hierarchy but Java does not inherit constructors automatically from one type to it's sub-types.
      • definesConstructorFromList

        public static java.lang.Object definesConstructorFromList​(LayeredSystem sys,
                                                                  java.lang.Object td,
                                                                  java.util.List<?> parameters,
                                                                  ITypeParamContext ctx,
                                                                  java.lang.Object refType,
                                                                  boolean isTransformed)
      • definesConstructor

        public static java.lang.Object definesConstructor​(LayeredSystem sys,
                                                          java.lang.Object td,
                                                          java.util.List<?> parameters,
                                                          ITypeParamContext ctx,
                                                          java.lang.Object refType,
                                                          boolean isTransformed)
      • getConstructors

        public static java.lang.Object[] getConstructors​(java.lang.Object td,
                                                         java.lang.Object refType)
      • getConstructors

        public static java.lang.Object[] getConstructors​(java.lang.Object td,
                                                         java.lang.Object refType,
                                                         boolean includeHidden)
      • hasDefaultConstructor

        public static boolean hasDefaultConstructor​(LayeredSystem sys,
                                                    java.lang.Object td,
                                                    java.lang.Object refType,
                                                    JavaSemanticNode refNode,
                                                    Layer refLayer)
      • transformNewExpression

        public static boolean transformNewExpression​(LayeredSystem sys,
                                                     java.lang.Object boundType)
      • isObjectType

        public static boolean isObjectType​(java.lang.Object boundType)
      • isObjectProperty

        public static boolean isObjectProperty​(java.lang.Object boundType)
      • isObjectSetProperty

        public static boolean isObjectSetProperty​(java.lang.Object boundType)
        Is this an object type which overrides a previous getX/setX method
      • hasObjectTypeAnnotation

        public static boolean hasObjectTypeAnnotation​(java.lang.Object boundType)
      • getObjectInstance

        public static java.lang.Object getObjectInstance​(java.lang.Object typeObj)
        If given a top-level object type, returns the object instance. If given a class, creates an instance of that class using the zero arg constructor.
      • getAndRegisterGlobalObjectInstance

        public static java.lang.Object getAndRegisterGlobalObjectInstance​(java.lang.Object typeObj)
      • isField

        public static boolean isField​(java.lang.Object varObj)
      • hasField

        public static boolean hasField​(java.lang.Object varObj)
      • isProperty

        public static boolean isProperty​(java.lang.Object member)
      • isReadableProperty

        public static boolean isReadableProperty​(java.lang.Object member)
      • isWritableProperty

        public static boolean isWritableProperty​(java.lang.Object member)
      • isGetSetMethod

        public static boolean isGetSetMethod​(java.lang.Object member)
      • isPropertyGetSet

        public static boolean isPropertyGetSet​(java.lang.Object member)
      • hasGetMethod

        public static boolean hasGetMethod​(java.lang.Object member)
      • hasSetMethod

        public static boolean hasSetMethod​(java.lang.Object member)
      • getGetMethodFromSet

        public static java.lang.Object getGetMethodFromSet​(java.lang.Object member)
      • getSetMethodFromGet

        public static java.lang.Object getSetMethodFromGet​(java.lang.Object member)
      • getFieldFromGetSetMethod

        public static java.lang.Object getFieldFromGetSetMethod​(java.lang.Object member)
      • isPropertyIs

        public static boolean isPropertyIs​(java.lang.Object propObj)
      • getPropertyType

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

        public static java.lang.Object getPropertyType​(java.lang.Object prop,
                                                       LayeredSystem sys)
        For compiled properties, if you pass in a layered system, you will get the annotated version of the type, not the compiled type
      • getFieldType

        public static java.lang.Object getFieldType​(java.lang.Object field)
      • getFieldJavaType

        public static JavaType getFieldJavaType​(LayeredSystem sys,
                                                java.lang.Object field,
                                                java.lang.Object definedInType)
      • isMethod

        public static boolean isMethod​(java.lang.Object member)
      • computeFrameSize

        public static int computeFrameSize​(java.util.List<Statement> statements)
      • wrapRuntimeException

        public static java.lang.Throwable wrapRuntimeException​(Statement statement,
                                                               java.lang.Throwable exc)
      • getMethod

        public static java.lang.Object getMethod​(java.lang.Object currentObject,
                                                 java.lang.String methName)
      • createInstance

        public static java.lang.Object createInstance​(java.lang.Object boundType,
                                                      java.lang.String sig,
                                                      java.util.List<Expression> arguments,
                                                      ExecutionContext ctx)
      • execTemplateDeclarations

        public static void execTemplateDeclarations​(java.lang.StringBuilder sb,
                                                    ExecutionContext ctx,
                                                    java.util.List<java.lang.Object> declarations)
      • getAccessLevel

        public static AccessLevel getAccessLevel​(java.lang.Object def,
                                                 boolean explicitOnly)
      • getAccessLevelString

        public static java.lang.String getAccessLevelString​(java.lang.Object def,
                                                            boolean explicitOnly,
                                                            JavaSemanticNode.MemberType type)
      • hasModifier

        public static boolean hasModifier​(java.lang.Object def,
                                          java.lang.String s)
      • getAnnotationSingleValue

        public static java.lang.Object getAnnotationSingleValue​(java.lang.Object annotObj)
      • initBindingDirection

        public static BindingDirection initBindingDirection​(java.lang.String operator)
      • getEnclosingInstType

        public static java.lang.Object getEnclosingInstType​(java.lang.Object compClass)
      • getEnclosingType

        public static java.lang.Object getEnclosingType​(java.lang.Object srcMember)
      • getEnclosingType

        public static java.lang.Object getEnclosingType​(java.lang.Object prop,
                                                        LayeredSystem sys)
      • getOuterObject

        public static java.lang.Object getOuterObject​(java.lang.Object toConstructType,
                                                      ExecutionContext ctx)
      • needsTypeDeclarationParam

        public static boolean needsTypeDeclarationParam​(java.lang.Class compClass,
                                                        boolean innerClass)
        Returns true for classes which have a constructor that takes a BodyTypeDeclaration
      • constructorArgListToValues

        public static java.lang.Object[] constructorArgListToValues​(java.lang.Object toConstructType,
                                                                    java.util.List<Expression> arguments,
                                                                    ExecutionContext ctx,
                                                                    java.lang.Object outerObj)
      • expressionListToValues

        public static java.lang.Object[] expressionListToValues​(java.util.List<Expression> arguments,
                                                                ExecutionContext ctx)
      • callMethod

        public static java.lang.Object callMethod​(java.lang.Object thisObj,
                                                  java.lang.Object method,
                                                  java.lang.Object... argValues)
      • convertVarargValues

        public static java.lang.Object[] convertVarargValues​(java.lang.Object method,
                                                             java.lang.Object[] argValues)
      • invokeMethod

        public static java.lang.Object invokeMethod​(java.lang.Object thisObject,
                                                    java.lang.Object method,
                                                    java.lang.Object[] argValues,
                                                    ExecutionContext ctx)
        A simple direct invoke of either an interpreted or compiled method once values are bound to parameters
      • invokeMethod

        public static java.lang.Object invokeMethod​(java.lang.Object thisObject,
                                                    java.lang.Object method,
                                                    java.util.List<Expression> arguments,
                                                    java.lang.Class expectedType,
                                                    ExecutionContext ctx,
                                                    boolean repeatArgs,
                                                    boolean findMethodOnThis,
                                                    ParamTypedMethod pmeth)
        Invokes a method given a list of arguments, the Method object and args to eval. Handles repeated arguments
      • isComponentType

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

        public static boolean needsGetSet​(java.lang.Object boundType)
        Fields in the original model might get converted to get/set
      • needsSet

        public static boolean needsSet​(java.lang.Object boundType)
      • isBindable

        public static boolean isBindable​(LayeredSystem system,
                                         java.lang.Object parentType,
                                         java.lang.String propName)
        Returns true if this property is marked as bindable as a type-level annotation. Use isBindable(Object propObj) to check for annotations on the property object itself.
      • isBindable

        public static boolean isBindable​(java.lang.Object assignedProperty)
      • isManualBindable

        public static boolean isManualBindable​(java.lang.Object assignedProperty)
      • isAutomaticBindable

        public static boolean isAutomaticBindable​(java.lang.Object assignedProperty)
      • isArrayLength

        public static boolean isArrayLength​(java.lang.Object assignedProperty)
      • isConstant

        public static boolean isConstant​(java.lang.Object assignedProperty)
      • getCompiledClass

        public static java.lang.Class getCompiledClass​(java.lang.Object fieldType)
      • getInnerType

        public static java.lang.Object getInnerType​(java.lang.Object type,
                                                    java.lang.String innerTypeName,
                                                    TypeContext ctx)
      • getAllInnerTypes

        public static java.lang.Object[] getAllInnerTypes​(java.lang.Object type,
                                                          java.lang.String modifier,
                                                          boolean thisClassOnly,
                                                          boolean includeInherited)
      • getCompiledClassName

        public static java.lang.String getCompiledClassName​(java.lang.Object type)
      • getCompiledTypeName

        public static java.lang.String getCompiledTypeName​(java.lang.Object type)
      • getRuntimeTypeName

        public static java.lang.String getRuntimeTypeName​(java.lang.Object type)
      • modifiersToString

        public static java.lang.String modifiersToString​(java.lang.Object definition,
                                                         boolean includeAnnotations,
                                                         boolean includeAccess,
                                                         boolean includeFinal,
                                                         boolean includeScopes,
                                                         boolean abs,
                                                         JavaSemanticNode.MemberType type)
      • isGetMethodImpl

        public static java.lang.String isGetMethodImpl​(java.lang.Object meth)
      • isGetMethod

        public static java.lang.String isGetMethod​(java.lang.String name,
                                                   java.lang.Object[] parameterTypes,
                                                   java.lang.Object returnType)
        These next three functions take info from a method and turn it into a property name if it is a property of this type. Note that we can't use getTypeDeclaration here since we need this info before we start the component so all determinations must be done using the type name.
      • convertGetMethodName

        public static java.lang.String convertGetMethodName​(java.lang.String name)
      • isSetMethodImpl

        public static java.lang.String isSetMethodImpl​(java.lang.Object meth)
      • isSetMethod

        public static java.lang.String isSetMethod​(java.lang.String name,
                                                   java.lang.Object[] paramJavaTypes,
                                                   java.lang.Object returnType)
        For set methods, we allow both void setX(int) and "? setX(int)". Some folks may need int setX(int) and others do this setX(y) to chain methods. Note: including indexed setters here - i.e. setX(ix, val). Not sure that's right and corresponds to logic calling this in MethodDefinition.
      • isSetMethod

        public static boolean isSetMethod​(java.lang.Object method)
      • isGetMethod

        public static boolean isGetMethod​(java.lang.Object method)
      • isGetIndexMethod

        public static boolean isGetIndexMethod​(java.lang.Object method)
      • isSetIndexMethod

        public static boolean isSetIndexMethod​(java.lang.Object method)
      • hasSetIndexMethod

        public static boolean hasSetIndexMethod​(java.lang.Object method)
      • isSetIndexMethodImpl

        public static java.lang.String isSetIndexMethodImpl​(java.lang.Object meth)
      • isSetIndexMethod

        public static java.lang.String isSetIndexMethod​(java.lang.String name,
                                                        java.lang.Object[] paramJavaTypes,
                                                        java.lang.Object returnType)
      • isGetIndexMethodImpl

        public static java.lang.String isGetIndexMethodImpl​(java.lang.Object meth)
      • isGetIndexMethod

        public static java.lang.String isGetIndexMethod​(java.lang.String name,
                                                        java.lang.Object[] paramJavaTypes,
                                                        java.lang.Object returnType)
      • typeIsVoid

        public static boolean typeIsVoid​(java.lang.Object type)
      • typeIsInteger

        public static boolean typeIsInteger​(java.lang.Object type)
      • typeIsBoolean

        public static boolean typeIsBoolean​(java.lang.Object type)
      • typeIsString

        public static boolean typeIsString​(java.lang.Object type)
      • typeIsStringArray

        public static boolean typeIsStringArray​(java.lang.Object type)
      • toDefinitionString

        public static java.lang.String toDefinitionString​(java.lang.Object typeObj)
      • toDeclarationString

        public static java.lang.String toDeclarationString​(java.lang.Object typeObj)
      • argumentsToString

        public static java.lang.String argumentsToString​(java.util.List<? extends ITypedObject> arguments)
      • listToTypes

        public static java.lang.Object[] listToTypes​(java.util.List<?> list)
      • varListToTypes

        public static java.lang.Object[] varListToTypes​(java.util.List<?> list)
      • isParameterizedMethod

        public static boolean isParameterizedMethod​(java.lang.Object method)
      • hasParameterizedReturnType

        public static boolean hasParameterizedReturnType​(java.lang.Object method)
      • hasParameterizedArguments

        public static boolean hasParameterizedArguments​(java.lang.Object method)
      • getParameterizedType

        public static java.lang.Object getParameterizedType​(java.lang.Object member,
                                                            JavaSemanticNode.MemberType type)
        If we are looking for a type with information about type parameters, we need to use a different method for the native Class/Method etc. as they do not store the type param stuff in the same place.
      • getParameterizedReturnType

        public static java.lang.Object getParameterizedReturnType​(java.lang.Object method,
                                                                  java.util.List<? extends ITypedObject> arguments,
                                                                  boolean resolve)
      • isParameterizedType

        public static boolean isParameterizedType​(java.lang.Object type)
      • isTypeVariable

        public static boolean isTypeVariable​(java.lang.Object type)
      • isWildcardType

        public static boolean isWildcardType​(java.lang.Object type)
      • isUnboundedWildcardType

        public static boolean isUnboundedWildcardType​(java.lang.Object type)
      • isSuperWildcard

        public static boolean isSuperWildcard​(java.lang.Object type)
      • getWildcardBounds

        public static java.lang.Object getWildcardBounds​(java.lang.Object type)
      • getWildcardLowerBounds

        public static java.lang.Object getWildcardLowerBounds​(java.lang.Object type)
      • getWildcardUpperBounds

        public static java.lang.Object getWildcardUpperBounds​(java.lang.Object type)
      • hasTypeVariables

        public static boolean hasTypeVariables​(java.lang.Object type)
      • getTypeParameterString

        public static java.lang.String getTypeParameterString​(java.lang.Object type)
      • getTypeParameters

        public static java.util.List<?> getTypeParameters​(java.lang.Object type)
        Returns TypeParameter or TypeVariable
      • getTypeParameterName

        public static java.lang.String getTypeParameterName​(java.lang.Object typeParam)
      • getTypeParameterDefault

        public static java.lang.Object getTypeParameterDefault​(java.lang.Object typeParam)
      • getTypeParameterPosition

        public static int getTypeParameterPosition​(java.lang.Object typeParam)
      • getTypeParameterPosition

        public static int getTypeParameterPosition​(java.lang.Object rootType,
                                                   java.lang.String typeParamName)
      • getGenericTypeName

        public static java.lang.String getGenericTypeName​(java.lang.Object resultType,
                                                          java.lang.Object member,
                                                          boolean includeDims)
      • resolveGenericTypeName

        public static java.lang.String resolveGenericTypeName​(java.lang.Object srcType,
                                                              java.lang.Object resultType,
                                                              java.lang.Object genType,
                                                              boolean includeDims)
      • getExtendsJavaTypePath

        public static java.util.List<java.lang.Object> getExtendsJavaTypePath​(java.lang.Object srcType,
                                                                              java.lang.Object resultType)
        Computes the list of classes which map the base type 'srcType' to the sub type resultType. For interfaces we check the implements types.
      • resolveTypeParameterName

        public static java.lang.Object resolveTypeParameterName​(java.lang.Object srcType,
                                                                java.lang.Object resultType,
                                                                java.lang.String typeParamName)
        TODO - replace this with resolveTypeParameter
      • resolveBaseTypeParameters

        public static java.lang.Object resolveBaseTypeParameters​(LayeredSystem sys,
                                                                 java.lang.Object subType,
                                                                 java.lang.Object baseType)
      • resolveBaseTypeParameter

        public static java.lang.Object resolveBaseTypeParameter​(java.lang.Object subType,
                                                                java.lang.Object baseType,
                                                                java.lang.Object typeParam)
        TODO: this seems like the same thing as resolveTypeParameter - can we eliminate one implementation? Given a subType and baseType and the typeParameter in the base-type, returns the type or type parameter in the sub type. For example, given List<E> and MyList implements List<Integer> you provide subType = MyList, baseType = List and typeParam = E and get back Integer.
      • resolveSubTypeParameters

        public static java.util.List<java.lang.Object> resolveSubTypeParameters​(java.lang.Object subType,
                                                                                java.lang.Object baseType)
      • resolveTypeParameter

        public static java.lang.Object resolveTypeParameter​(java.lang.Object srcType,
                                                            java.lang.Object resultType,
                                                            java.lang.Object typeParam)
        Computes the type parameter in type 'resultType' that corresponds to "typeParam" you provide for the base type srcType. In other words, it lets you determine the value of a base type's type parameter when evaluated in the context of the sub-type. So List<E> - you provide List.class, E, and the resultType of MySubType implements List<Integer> and it will return Integer.class This "typeParam" should be one of the type variables srcType was defined with, and srcType should be a baseType of resultType.
      • resolveTypeParameter

        public static java.lang.Object resolveTypeParameter​(java.lang.Object srcType,
                                                            ITypeParamContext resultType,
                                                            java.lang.String typeParamName)
      • getNumTypeArguments

        public static int getNumTypeArguments​(java.lang.Object extJavaType)
      • getTypeArguments

        public static java.util.List<?> getTypeArguments​(java.lang.Object extJavaType)
      • hasTypeArguments

        public static boolean hasTypeArguments​(java.lang.Object extJavaType)
      • getAbsoluteGenericTypeName

        public static java.lang.String getAbsoluteGenericTypeName​(java.lang.Object resultType,
                                                                  java.lang.Object member,
                                                                  boolean includeDims)
      • definesMember

        public static java.lang.Object definesMember​(java.lang.Object type,
                                                     java.lang.String name,
                                                     java.util.EnumSet<JavaSemanticNode.MemberType> mtypes,
                                                     java.lang.Object refType,
                                                     TypeContext ctx,
                                                     LayeredSystem sys)
        Looks for a member - field, method, enum with the given name on the given type. The refType specifies a type used for access control checks - if you're not allowed, null is returned. Pass in a LayeredSystem if you want to find a src reference for an annotation layer that's applied to a compiled type. For example, you might have a compiled type Foo that extends Bar which has an annotation layer. If we find a member in 'Bar', we need to check if the 'Bar' src type has a version of that member. If so we return that instead since it's more specific. This is the one of the ways we can attach meta-data onto types that are delivered in a compiled format. If you don't care about that, pass in null for the sys and that check is not performed.
      • definesMember

        public static java.lang.Object definesMember​(java.lang.Object type,
                                                     java.lang.String name,
                                                     java.util.EnumSet<JavaSemanticNode.MemberType> mtypes,
                                                     java.lang.Object refType,
                                                     TypeContext ctx,
                                                     boolean skipIfaces,
                                                     boolean isTransformed,
                                                     LayeredSystem sys)
      • isTypeInLayer

        public static boolean isTypeInLayer​(java.lang.Object type,
                                            Layer layer)
      • getInheritedAnnotation

        public static java.lang.Object getInheritedAnnotation​(LayeredSystem system,
                                                              java.lang.Object superType,
                                                              java.lang.String annotationName)
      • getInheritedAnnotationValue

        public static java.lang.Object getInheritedAnnotationValue​(LayeredSystem system,
                                                                   java.lang.Object type,
                                                                   java.lang.String annotName,
                                                                   java.lang.String attributeName)
      • getInheritedAnnotation

        public static java.lang.Object getInheritedAnnotation​(LayeredSystem system,
                                                              java.lang.Object superType,
                                                              java.lang.String annotationName,
                                                              boolean skipCompiled)
      • getAllInheritedAnnotations

        public static java.util.ArrayList<java.lang.Object> getAllInheritedAnnotations​(LayeredSystem system,
                                                                                       java.lang.Object superType,
                                                                                       java.lang.String annotationName,
                                                                                       boolean skipCompiled,
                                                                                       Layer refLayer,
                                                                                       boolean layerResolve)
      • appendLists

        public static java.util.ArrayList<java.lang.Object> appendLists​(java.util.ArrayList<java.lang.Object> origList,
                                                                        java.util.ArrayList<java.lang.Object> newList)
      • getInheritedAnnotation

        public static java.lang.Object getInheritedAnnotation​(LayeredSystem system,
                                                              java.lang.Object superType,
                                                              java.lang.String annotationName,
                                                              boolean skipCompiled,
                                                              Layer refLayer,
                                                              boolean layerResolve)
      • findType

        public static java.lang.Object findType​(LayeredSystem sys,
                                                java.lang.String typeName)
        Similar to DynUtil.findType, but if there are any source type declarations availble, that is returned first
      • findTypeDeclaration

        public static java.lang.Object findTypeDeclaration​(LayeredSystem sys,
                                                           java.lang.String typeName,
                                                           Layer refLayer,
                                                           boolean layerResolve)
      • findTypeDeclaration

        public static java.lang.Object findTypeDeclaration​(LayeredSystem sys,
                                                           java.lang.Object baseType,
                                                           java.lang.String typeName,
                                                           Layer refLayer,
                                                           boolean addExternalReference)
      • resolveSrcTypeDeclaration

        public static java.lang.Object resolveSrcTypeDeclaration​(LayeredSystem sys,
                                                                 java.lang.Object type)
      • resolveSrcTypeDeclaration

        public static java.lang.Object resolveSrcTypeDeclaration​(LayeredSystem sys,
                                                                 java.lang.Object type,
                                                                 boolean cachedOnly,
                                                                 boolean srcOnly,
                                                                 Layer refLayer)
        In some cases, you might have a class which corresponds to an annotation layer or something. Use this method to ensure you get the most specific src type for that class name. If cachedOnly is true, we do not load the src file just to retrieve the src description. If you are using the runtime descriptions of the type this can be a lot faster. But if you have loaded the src, it's best to use the most accurate type.
      • getSuperclass

        public static java.lang.Object getSuperclass​(java.lang.Object type)
        For modify operations, returns the modified type declaration, i.e. with the same type name
      • getExtendsClass

        public static java.lang.Object getExtendsClass​(java.lang.Object type)
        For modify operations, returns the actual super class or extends class of the current type, i.e. never the same type name
      • getCompiledExtendsTypeDeclaration

        public static java.lang.Object getCompiledExtendsTypeDeclaration​(java.lang.Object type)
        For modify types, if it's modify inherited it returns the modified type, since that's really a new type in the compiled world.
      • getExtendsTypeName

        public static java.lang.String getExtendsTypeName​(java.lang.Object type)
      • getExtendsJavaType

        public static java.lang.Object getExtendsJavaType​(java.lang.Object type)
      • getImplementsJavaTypes

        public static java.lang.Object[] getImplementsJavaTypes​(java.lang.Object type)
      • getCompiledImplTypes

        public static java.lang.Object[] getCompiledImplTypes​(java.lang.Object type)
      • getCompiledImplJavaTypes

        public static java.lang.Object[] getCompiledImplJavaTypes​(java.lang.Object type)
      • getOperator

        public static java.lang.String getOperator​(java.lang.Object fieldDef)
      • getPropertyName

        public static java.lang.String getPropertyName​(java.lang.Object fieldDef)
      • isFieldShadowedByMethod

        public static boolean isFieldShadowedByMethod​(java.lang.Object obj)
        Returns true for a Java field which has the same name as one of its methods - used for JS. Only works for source types currently.
      • getLayerForMember

        public static Layer getLayerForMember​(LayeredSystem sys,
                                              java.lang.Object member)
      • getLayerForType

        public static Layer getLayerForType​(LayeredSystem sys,
                                            java.lang.Object type)
      • getPropertyLayer

        public static Layer getPropertyLayer​(java.lang.Object propDef)
      • isStringOrChar

        public static boolean isStringOrChar​(java.lang.Object typeDeclaration)
      • isCompiledClass

        public static boolean isCompiledClass​(java.lang.Object type)
      • isEnum

        public static boolean isEnum​(java.lang.Object varObj)
        Returns true for EnumConstants
      • getEnumConstantName

        public static java.lang.String getEnumConstantName​(java.lang.Object enumConst)
      • isInterface

        public static boolean isInterface​(java.lang.Object obj)
      • isAnnotation

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

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

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

        public static java.lang.Object getEnumTypeFromEnum​(java.lang.Object enumObj)
      • getMethodName

        public static java.lang.String getMethodName​(java.lang.Object methObj)
      • getNumParameters

        public static int getNumParameters​(java.lang.Object methObj)
      • getThrowsClause

        public static java.lang.String getThrowsClause​(java.lang.Object methObj)
      • getPropertyMappers

        public static IBeanMapper[] getPropertyMappers​(java.lang.Object typeObj)
      • getStaticPropertyMappers

        public static IBeanMapper[] getStaticPropertyMappers​(java.lang.Object typeObj)
      • getDeclaredMergedPropertiesAndTypes

        public static java.lang.Object[] getDeclaredMergedPropertiesAndTypes​(java.lang.Object type,
                                                                             java.lang.String modifier,
                                                                             boolean includeModified)
      • getMergedPropertiesAndTypes

        public static java.lang.Object[] getMergedPropertiesAndTypes​(java.lang.Object type,
                                                                     java.lang.String modifier,
                                                                     LayeredSystem sys)
      • mergeTypesAndProperties

        public static java.lang.Object[] mergeTypesAndProperties​(java.lang.Object type,
                                                                 java.lang.Object[] types,
                                                                 java.lang.Object[] props)
        Note: This merges the types but does not merge the properties. Assumes that's been done in getMerged/DeclaredProperties
      • getDeclaredMergedProperties

        public static java.lang.Object[] getDeclaredMergedProperties​(java.lang.Object type,
                                                                     java.lang.String modifier,
                                                                     boolean includeModified)
      • isReverseBinding

        public static boolean isReverseBinding​(java.lang.Object def)
      • getMergedProperties

        public static java.lang.Object[] getMergedProperties​(java.lang.Object type,
                                                             java.lang.String modifier)
      • getProperties

        public static java.lang.Object[] getProperties​(java.lang.Object typeObj,
                                                       java.lang.String modifier)
      • getProperties

        public static java.lang.Object[] getProperties​(java.lang.Object typeObj,
                                                       java.lang.String modifier,
                                                       boolean includeAssigns)
      • getDeclaredProperties

        public static java.lang.Object[] getDeclaredProperties​(java.lang.Object typeObj,
                                                               java.lang.String modifier,
                                                               boolean includeAssigns,
                                                               boolean includeModified,
                                                               boolean editorProperties)
      • getDeclaredPropertiesAndTypes

        public static java.lang.Object[] getDeclaredPropertiesAndTypes​(java.lang.Object typeObj,
                                                                       java.lang.String modifier,
                                                                       LayeredSystem sys)
      • getPropertiesAndTypes

        public static java.lang.Object[] getPropertiesAndTypes​(java.lang.Object typeObj,
                                                               java.lang.String modifier)
      • getFields

        public static java.lang.Object[] getFields​(java.lang.Object typeObj,
                                                   java.lang.String modifier,
                                                   boolean hasModifier,
                                                   boolean dynamicOnly,
                                                   boolean includeObjs,
                                                   boolean includeAssigns,
                                                   boolean includeModified)
      • removePropertiesInList

        public static java.util.List removePropertiesInList​(java.util.List declProps,
                                                            java.util.List remProps,
                                                            boolean byName)
      • mergeProperties

        public static java.util.List mergeProperties​(java.util.List modProps,
                                                     java.util.List declProps,
                                                     boolean replace)
      • mergeProperties

        public static java.util.List mergeProperties​(java.util.List modProps,
                                                     java.util.List declProps,
                                                     boolean replace,
                                                     boolean includeAssigns)
        Merges property lists, modifying the first argument, adding any new entries, replacing entries in declProps
      • propertyIndexOf

        public static int propertyIndexOf​(java.util.List props,
                                          java.lang.Object prop,
                                          boolean byName)
      • mergeMethods

        public static java.util.List<java.lang.Object> mergeMethods​(java.util.List modMeths,
                                                                    java.util.List declMeths)
      • appendInheritedMethods

        public static java.util.List<java.lang.Object> appendInheritedMethods​(java.lang.Object[] implResult,
                                                                              java.util.List<java.lang.Object> result)
      • mergeInnerTypes

        public static java.util.List mergeInnerTypes​(java.util.List modProps,
                                                     java.util.List declProps)
      • arrayToString

        public static java.lang.String arrayToString​(java.lang.Object[] list)
        Takes an array of methods, fields etc. and dumps it to standard out for debugging purposes. Semantic nodes use their language representation. Fields, Methods, etc. are ok as they are in Java with toString.
      • elementWithTypeToString

        public static java.lang.String elementWithTypeToString​(java.lang.Object elem,
                                                               boolean baseNameOnly)
      • elementToString

        public static java.lang.String elementToString​(java.lang.Object elem,
                                                       boolean baseNameOnly)
      • elementName

        public static java.lang.String elementName​(java.lang.Object elem)
      • getClientTypeDeclaration

        public static ClientTypeDeclaration getClientTypeDeclaration​(java.lang.Object type)
      • setElementValue

        public static java.lang.Object setElementValue​(java.lang.Object type,
                                                       java.lang.Object instance,
                                                       java.lang.Object elem,
                                                       java.lang.String text,
                                                       boolean updateType,
                                                       boolean updateInstances,
                                                       boolean valueIsExpr)
        Modifies the code for the current program model, setting the specified property called 'elem' to a text value specified. This operation is invoked when you update the initialization expression for a property, field, etc. in a program editor.
      • getPreviousDefinition

        public static java.lang.Object getPreviousDefinition​(java.lang.Object def)
      • parseCommandString

        public static java.lang.Object parseCommandString​(Language cmdLang,
                                                          java.lang.String command,
                                                          Parselet start)
      • elementValueString

        public static java.lang.String elementValueString​(java.lang.Object elem)
      • instanceValueString

        public static java.lang.String instanceValueString​(java.lang.Object inst,
                                                           java.lang.Object value,
                                                           ExecutionContext ctx)
      • getPropertyInitializer

        public static Expression getPropertyInitializer​(java.lang.Object extType,
                                                        java.lang.String name)
      • getRuntimeMethod

        public static java.lang.Object getRuntimeMethod​(java.lang.Object method)
      • getRuntimePropertyMapping

        public static java.lang.Object getRuntimePropertyMapping​(java.lang.Object propType)
      • typeNamesEqual

        public static boolean typeNamesEqual​(java.lang.String fte,
                                             java.lang.String fullTypeName)
        Allows $ to match . in type names
      • addCompletionCandidate

        public static boolean addCompletionCandidate​(java.util.Set<java.lang.String> candidates,
                                                     java.lang.String prospect,
                                                     int max)
      • suggestMembers

        public static boolean suggestMembers​(JavaModel model,
                                             java.lang.Object type,
                                             java.lang.String prefix,
                                             java.util.Set<java.lang.String> candidates,
                                             boolean includeGlobals,
                                             boolean includeProps,
                                             boolean includeMethods,
                                             boolean includeClassBodyKeywords,
                                             int max)
      • suggestTypes

        public static boolean suggestTypes​(JavaModel model,
                                           java.lang.String prefix,
                                           java.lang.String lastIdent,
                                           java.util.Set<java.lang.String> candidates,
                                           boolean includeGlobals)
      • suggestTypes

        public static boolean suggestTypes​(JavaModel model,
                                           java.lang.String prefix,
                                           java.lang.String lastIdent,
                                           java.util.Set<java.lang.String> candidates,
                                           boolean includeGlobals,
                                           boolean annotTypes,
                                           int max)
      • suggestVariables

        public static void suggestVariables​(IBlockStatement enclBlock,
                                            java.lang.String prefix,
                                            java.util.Set<java.lang.String> candidates,
                                            int max)
      • getReturnType

        public static java.lang.Object getReturnType​(java.lang.Object method,
                                                     boolean boundParams)
      • getReturnJavaType

        public static java.lang.Object getReturnJavaType​(java.lang.Object method)
      • getParameterTypes

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

        public static java.lang.Object[] getParameterTypes​(java.lang.Object method,
                                                           boolean bound)
      • convertParamSigToTypes

        public static java.lang.Object[] convertParamSigToTypes​(java.lang.String paramSig)
        Given a signature string in the format used for remote methods, return the list of parameter types to that method
      • getGenericParameterTypes

        public static java.lang.Object[] getGenericParameterTypes​(java.lang.Object method,
                                                                  boolean bound)
      • getActualParameterTypes

        public static java.lang.Object[] getActualParameterTypes​(java.lang.Object method,
                                                                 boolean bound)
        Just like the above but removes the outer-instance parameter which is present in java.lang.reflect.Constructor's getParameterTypes.
      • getParameterJavaTypes

        public static java.lang.Object[] getParameterJavaTypes​(java.lang.Object method,
                                                               boolean convertRepeating)
      • getDeclarationType

        public static DeclarationType getDeclarationType​(java.lang.Object type)
      • getMethodCache

        public static CoalescedHashMap getMethodCache​(java.lang.Object type)
      • getBindableAnnotation

        public static java.lang.Object getBindableAnnotation​(java.lang.Object def)
      • isAutomaticBindingAnnotation

        public static boolean isAutomaticBindingAnnotation​(java.lang.Object annotationObj)
      • resolveAnnotationReference

        public static java.lang.Object resolveAnnotationReference​(JavaModel model,
                                                                  java.lang.Object def)
      • getFullBaseTypeName

        public static java.lang.String getFullBaseTypeName​(java.lang.Object typeDeclaration)
      • getParameterNames

        public static java.lang.String[] getParameterNames​(java.lang.Object meth)
      • getParameterDecl

        public static java.lang.String getParameterDecl​(java.lang.Object meth)
      • getModifiers

        public static int getModifiers​(java.lang.Object def)
      • getRootType

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

        public static java.lang.Object[] getExceptionTypes​(java.lang.Object meth)
      • isComponentInterface

        public static boolean isComponentInterface​(LayeredSystem sys,
                                                   java.lang.Object typeDecl)
      • getAnnotationValue

        public static java.lang.Object getAnnotationValue​(java.lang.Object type,
                                                          java.lang.String annotationName,
                                                          java.lang.String valueName)
      • getPropertyAnnotationValue

        public static java.lang.Object getPropertyAnnotationValue​(java.lang.Object type,
                                                                  java.lang.String annotationName,
                                                                  java.lang.String valueName)
      • getScopeName

        public static java.lang.String getScopeName​(java.lang.Object def)
        Returns any scope name set on this type or field. Note that scopes can only be set on source descriptions. If you need scope info for other than code generation, i.e. at runtime, you set the annotationName for the scope process and then check for the annotation at runtime.
      • getInheritedScopeName

        public static java.lang.String getInheritedScopeName​(LayeredSystem sys,
                                                             java.lang.Object def,
                                                             Layer refLayer)
        Returns any scope name set on this type or field. Note that scopes can only be set on source descriptions. If you need scope info for other than code generation, i.e. at runtime, you set the annotationName for the scope process and then check for the annotation at runtime.
      • getTypeFromTypeOrParamName

        public static java.lang.Object getTypeFromTypeOrParamName​(BodyTypeDeclaration srcType,
                                                                  java.lang.String fieldTypeName)
        Takes name of the form: typeName<paramType> and returns just the type object for "typeName", ignoring the parameters
      • getJavaTypeFromTypeOrParamName

        public static JavaType getJavaTypeFromTypeOrParamName​(BodyTypeDeclaration srcType,
                                                              java.lang.String fieldTypeName)
        Takes name of the form: typeName<paramType> and returns the JavaType which represents that expression
      • getStaticPropertyValue

        public static java.lang.Object getStaticPropertyValue​(java.lang.Object staticType,
                                                              java.lang.String firstIdentifier)
      • isChainedReferenceInitializer

        public static boolean isChainedReferenceInitializer​(MethodDefinition mdef)
      • isDynamicProperty

        public static boolean isDynamicProperty​(java.lang.Object propType)
      • isDynamicType

        public static boolean isDynamicType​(java.lang.Object encType)
      • isDynamicNew

        public static boolean isDynamicNew​(java.lang.Object boundType)
      • getTypeFromInstance

        public static java.lang.Object getTypeFromInstance​(java.lang.Object arg)
      • getRuntimeClassName

        public static java.lang.String getRuntimeClassName​(java.lang.Object extendsType)
      • getSignature

        public static java.lang.String getSignature​(java.lang.Object type)
      • getTypeSignature

        public static java.lang.String getTypeSignature​(java.lang.Object obj)
        Returns the type signature for the parameters for a method - NOTE: does not include the return type like the Java method signature that's in the class file.
      • getPropertyCache

        public static DynType getPropertyCache​(java.lang.Object extType)
      • getPropertyMapping

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

        public static IBeanMapper getConstantPropertyMapping​(java.lang.Object type,
                                                             java.lang.String propName)
      • evalCast

        public static java.lang.Object evalCast​(java.lang.Object propertyType,
                                                java.lang.Object val)
      • getObjectsType

        public static java.lang.Object getObjectsType​(java.lang.Object obj)
        Unlike DynUtil.getType which conditionally strips the type off, here we do it explicitly so that when the runtime gets a java.lang.Class instance we still call getClass
      • evalInstanceOf

        public static boolean evalInstanceOf​(java.lang.Object lhsObj,
                                             java.lang.Object rhs,
                                             ITypeParamContext ctx)
      • getRuntimeType

        public static java.lang.Object getRuntimeType​(java.lang.Object rootType)
      • isInstance

        public static boolean isInstance​(java.lang.Object srcTypeObj,
                                         java.lang.Object obj)
      • isCompiledMethod

        public static boolean isCompiledMethod​(java.lang.Object override)
      • getCompileLiveDynamicTypes

        public static boolean getCompileLiveDynamicTypes​(java.lang.Object typeObj)
      • getLiveDynamicTypes

        public static boolean getLiveDynamicTypes​(java.lang.Object typeObj)
      • isDynamicStub

        public static boolean isDynamicStub​(java.lang.Object extendsType,
                                            boolean includeExtends)
      • resolve

        public static java.lang.Object resolve​(java.lang.Object typeObj,
                                               boolean modified)
      • getNumberPrefixFromType

        public static java.lang.String getNumberPrefixFromType​(java.lang.Object type)
        Prefix for the intValue and intPropertyValue methods in TypeUtil and DynUtil
      • typesToThrowsClause

        public static java.lang.String typesToThrowsClause​(java.lang.Object[] throwsTypes)
      • refreshBoundProperty

        public static java.lang.Object refreshBoundProperty​(LayeredSystem sys,
                                                            java.lang.Object type,
                                                            int flags)
      • refreshBoundMethod

        public static java.lang.Object refreshBoundMethod​(LayeredSystem sys,
                                                          java.lang.Object meth,
                                                          int flags)
      • refreshBoundField

        public static java.lang.Object refreshBoundField​(LayeredSystem sys,
                                                         java.lang.reflect.Field field)
      • refreshBoundIdentifierType

        public static java.lang.Object refreshBoundIdentifierType​(LayeredSystem sys,
                                                                  java.lang.Object boundType,
                                                                  int flags)
      • refreshBoundType

        public static java.lang.Object refreshBoundType​(LayeredSystem sys,
                                                        java.lang.Object boundType,
                                                        int flags)
      • refreshBoundClass

        public static java.lang.Object refreshBoundClass​(LayeredSystem sys,
                                                         java.lang.Object boundClass)
      • getEnum

        public static java.lang.Object getEnum​(java.lang.Object currentType,
                                               java.lang.String nextName)
      • getRuntimeEnum

        public static java.lang.Object getRuntimeEnum​(java.lang.Object boundType)
      • convertToCommaSeparatedStrings

        public static java.lang.StringBuilder convertToCommaSeparatedStrings​(java.util.Set<java.lang.String> names)
      • isAbstractType

        public static boolean isAbstractType​(java.lang.Object type)
      • isAbstractElement

        public static boolean isAbstractElement​(java.lang.Object type)
      • isAbstractMethod

        public static boolean isAbstractMethod​(java.lang.Object meth)
      • getReverseBindingMethod

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

        public static boolean needsCompMethod​(java.lang.Object meth)
      • markNeedsDynAccess

        public static void markNeedsDynAccess​(java.lang.Object boundType)
      • needsDynType

        public static boolean needsDynType​(java.lang.Object type)
      • isConstructor

        public static boolean isConstructor​(java.lang.Object method)
      • isLHSTypedMethod

        public static boolean isLHSTypedMethod​(java.lang.Object boundType)
        Weird rule in java. When you have a parameterized return type and no arguments, the type comes from the LHS of the assignment expression (only for assignment expressions apparently)
      • getAccessClass

        public static java.lang.Object getAccessClass​(java.lang.Object base)
        Returns the class which will hold the newX method for a component type that is transformed
      • getRuntimeTypeDeclaration

        public static java.lang.Object getRuntimeTypeDeclaration​(java.lang.Object type)
      • isCompiledProperty

        public static boolean isCompiledProperty​(java.lang.Object impl,
                                                 java.lang.String name,
                                                 boolean fieldMode,
                                                 boolean interfaceMode)
      • needsOwnClass

        public static boolean needsOwnClass​(java.lang.Object type,
                                            boolean checkComponents)
        Returns false if this type is optimized away. i.e. an object instance which contains no methods or fields, just initializations which we can apply at runtime on the base class
      • definesCurrentObject

        public static boolean definesCurrentObject​(java.lang.Object type)
      • getInnerTypeName

        public static java.lang.String getInnerTypeName​(java.lang.Object typeObj)
      • getTypeOffset

        public static int getTypeOffset​(java.lang.Object type)
      • getLineNumber

        public static int getLineNumber​(java.lang.Object type)
      • matchesLayerFilter

        public static boolean matchesLayerFilter​(java.lang.Object type,
                                                 java.util.Collection<CodeType> codeTypes)
        Used to filter objects in the UI. Returns true if the type provided has any definitions in a layer with the given code types and functions
      • getFiltersForType

        public static void getFiltersForType​(java.lang.Object type,
                                             java.util.Collection<CodeType> codeTypes,
                                             boolean allLayers)
      • definedInLayer

        public static boolean definedInLayer​(java.lang.Object type,
                                             Layer layer)
      • isLayerType

        public static boolean isLayerType​(java.lang.Object type)
      • isLayerComponent

        public static boolean isLayerComponent​(java.lang.Object type)
      • getJavaModel

        public static JavaModel getJavaModel​(java.lang.Object node)
      • isApplicationType

        public static boolean isApplicationType​(java.lang.Object type)
        Determines whether or not we display this type in application tree view. Should we check if the component is validated, has instances, or something? If so, we need to figure out how to revalidate the view when those things change.
      • validateElement

        public static java.lang.String validateElement​(Parselet element,
                                                       java.lang.String str,
                                                       boolean optional)
      • javaTypeToCompiledString

        public static java.lang.String javaTypeToCompiledString​(java.lang.Object refType,
                                                                java.lang.Object type,
                                                                boolean retNullForDynObj)
      • evalParameterForType

        public static java.lang.String evalParameterForType​(java.lang.Object type,
                                                            java.lang.Object memberType,
                                                            java.lang.String typeParam)
      • evalParameterPosition

        public static int evalParameterPosition​(java.lang.Object fromType,
                                                java.lang.Object memberType,
                                                java.lang.String typeParam)
      • getTypeArgument

        public static java.lang.Object getTypeArgument​(java.lang.Object javaType,
                                                       int ix)
      • getCompiledTypeArgs

        public static java.util.List<JavaType> getCompiledTypeArgs​(java.lang.Object type,
                                                                   java.util.List<JavaType> typeArgs)
        Converts the type arguments for the compiled class. Similar to getCompiledClassName but converts the type arguments along the way through the type hierarchy skipping dynamic and skipped classes
      • getGenericSetMethodPropertyTypeName

        public static java.lang.String getGenericSetMethodPropertyTypeName​(java.lang.Object resultType,
                                                                           java.lang.Object setMethod,
                                                                           boolean includeDim)
      • definesComponentMethod

        public static java.lang.Object definesComponentMethod​(java.lang.Object type,
                                                              java.lang.String name,
                                                              java.lang.Object refType)
      • getSuperInitTypeCall

        public static java.lang.String getSuperInitTypeCall​(LayeredSystem sys,
                                                            java.lang.Object objType)
      • getParamTypeBaseType

        public static java.lang.Object getParamTypeBaseType​(java.lang.Object paramType)
      • getOuterInstCount

        public static int getOuterInstCount​(java.lang.Object pType)
      • getSuperMethod

        public static java.lang.Object getSuperMethod​(java.lang.Object method)
      • needsClassInit

        public static boolean needsClassInit​(java.lang.Object srcType)
      • resolveSrcMethod

        public static java.lang.Object resolveSrcMethod​(LayeredSystem sys,
                                                        java.lang.Object meth,
                                                        boolean cachedOnly,
                                                        boolean srcOnly,
                                                        Layer refLayer)
      • isProcessableType

        public static boolean isProcessableType​(java.lang.Object existing)
      • getNumInnerTypeLevels

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

        public static int getArrayNumDims​(java.lang.Object type)
      • isGlobalScope

        public static boolean isGlobalScope​(LayeredSystem sys,
                                            java.lang.Object typeObj)
      • isChangeable

        public static boolean isChangeable​(java.lang.Object prop)
      • makeBindable

        public static void makeBindable​(TypeDeclaration type,
                                        java.lang.String propName,
                                        boolean needsBindable)
      • hasUnboundTypeParameters

        public static boolean hasUnboundTypeParameters​(java.lang.Object type)
      • hasAnyTypeVariables

        public static boolean hasAnyTypeVariables​(java.lang.Object type)
      • getTypeOrLayerAnnotation

        public static java.lang.Object getTypeOrLayerAnnotation​(LayeredSystem sys,
                                                                java.lang.Object type,
                                                                java.lang.String annotName)
        Use this method when you want to get an annotation first on this type, and if not set, use the layer's version. Note that this does not support the inherited flag. I'm not sure what that would mean... should it also search all dependent layers at the same time? First check all types, then all layers? Or should inheriting via the layer setting be different than inheriting from the type?
      • getTypeOrLayerAnnotationValue

        public static java.lang.Object getTypeOrLayerAnnotationValue​(LayeredSystem sys,
                                                                     java.lang.Object type,
                                                                     java.lang.String annotName,
                                                                     java.lang.String attName)
        Use this method when you want to get an annotation first on this type, and if not set, use the layer's version. Note that this does not support the inherited flag. I'm not sure what that would mean... should it also search all dependent layers at the same time? First check all types, then all layers? Or should inheriting via the layer setting be different than inheriting from the type?
      • getLayerAnnotation

        public static java.lang.Object getLayerAnnotation​(Layer layer,
                                                          java.lang.String annotName)
      • getLayerAnnotationValue

        public static java.lang.Object getLayerAnnotationValue​(Layer layer,
                                                               java.lang.String annotName,
                                                               java.lang.String attName)
      • initType

        public static void initType​(java.lang.Object type)
      • ensureStarted

        public static void ensureStarted​(java.lang.Object type,
                                         boolean validate)
      • isTransformedType

        public static boolean isTransformedType​(java.lang.Object refType)
      • hasDynTypeConstructor

        public static boolean hasDynTypeConstructor​(java.lang.Object extType)
      • isDefaultMethod

        public static boolean isDefaultMethod​(java.lang.Object meth)
      • getMethodTypeParameters

        public static java.lang.Object[] getMethodTypeParameters​(java.lang.Object method)
      • hasMethodTypeParameters

        public static boolean hasMethodTypeParameters​(java.lang.Object method)
      • hasMethodUnboundTypeParameters

        public static boolean hasMethodUnboundTypeParameters​(java.lang.Object method)
      • wrapPrimitiveType

        public static java.lang.Object wrapPrimitiveType​(java.lang.Object newVal)
      • isUnboundSuper

        public static boolean isUnboundSuper​(java.lang.Object type)
      • overridesMethodInType

        public static boolean overridesMethodInType​(java.lang.Object type,
                                                    java.lang.Object meth)
      • isOuterType

        public static boolean isOuterType​(java.lang.Object enclosingType,
                                          java.lang.Object currentType)
      • getPropagatedConstructor

        public static java.lang.Object getPropagatedConstructor​(LayeredSystem sys,
                                                                java.lang.Object type,
                                                                JavaSemanticNode refNode,
                                                                Layer refLayer)
      • isAnonymousClass

        public static boolean isAnonymousClass​(java.lang.Object depClass)
      • getArrayDimsStr

        public static java.lang.String getArrayDimsStr​(java.lang.Object type)
      • paramTypeToString

        public static java.lang.String paramTypeToString​(java.lang.Object type)
      • getClassFromType

        public static java.lang.Object getClassFromType​(LayeredSystem system,
                                                        java.lang.Object definedInType,
                                                        java.lang.String className,
                                                        boolean useImports,
                                                        boolean compiledOnly)
      • resolveCompiledType

        public static java.lang.Object resolveCompiledType​(LayeredSystem sys,
                                                           java.lang.Object extendsType,
                                                           java.lang.String fullTypeName)
      • getDebugName

        public static java.lang.String getDebugName​(java.lang.Object privRes)
      • getTypesFromExpressions

        public static java.lang.Object[] getTypesFromExpressions​(java.util.List<Expression> args)
      • getAnnotations

        public static java.util.Map<java.lang.String,​java.lang.Object> getAnnotations​(java.lang.Object def)
      • createAnnotationsMap

        public static java.util.Map<java.lang.String,​java.lang.Object> createAnnotationsMap​(java.lang.annotation.Annotation[] annotations)
      • getPropertyTypeFromType

        public static java.lang.Object getPropertyTypeFromType​(java.lang.Object type,
                                                               java.lang.String propName)
      • getTemplatePathName

        public static java.lang.String getTemplatePathName​(java.lang.Object objType)
      • addUniqueLayerType

        public static boolean addUniqueLayerType​(LayeredSystem sys,
                                                 java.util.List<BodyTypeDeclaration> result,
                                                 BodyTypeDeclaration res)
        The equals operator on TypeDeclaration is to compare the files so that's not a good test. This prevents the same type-name/layer-name combo from being added to the list
      • getParameterString

        public static java.lang.String getParameterString​(java.lang.Object meth)
      • isSyncEnabled

        public static boolean isSyncEnabled​(java.lang.Object type)
        For compile time access to whether or not we are dealing with a synchronize type. TODO: calls to 'addSyncType' are not reflected here which breaks the syncTypeFilter. For now, we're leaving the syncTypeFilter in as a system option to workaround this problem. But you can update globalSyncTypes to include other types as synchronized for when you need the syncTypeFilter.
      • isResetSyncEnabled

        public static boolean isResetSyncEnabled​(java.lang.Object type)
      • getJSSyncTypes

        public static java.util.Set<java.lang.String> getJSSyncTypes​(LayeredSystem sys,
                                                                     java.lang.Object type)
      • getResetSyncTypes

        public static java.util.Set<java.lang.String> getResetSyncTypes​(LayeredSystem sys,
                                                                        java.lang.Object type)
      • getEditorCreateMethod

        public static java.lang.Object getEditorCreateMethod​(LayeredSystem sys,
                                                             java.lang.Object typeObj)
      • getJavaTypeFromDefinition

        public static JavaType getJavaTypeFromDefinition​(LayeredSystem sys,
                                                         java.lang.Object def,
                                                         java.lang.Object definedInType)
      • getExportProperties

        public static boolean getExportProperties​(LayeredSystem sys,
                                                  java.lang.Object type)
      • addSyncTypeFilterTypes

        public static void addSyncTypeFilterTypes​(java.lang.Object type,
                                                  java.util.Set<java.lang.Object> types)
      • getConstructorPropSignature

        public static java.lang.String getConstructorPropSignature​(java.lang.Object type)