Package gw.internal.gosu.parser
Class GosuClass
java.lang.Object
gw.lang.reflect.AbstractType
gw.lang.reflect.InnerClassCapableType
gw.internal.gosu.parser.GosuClass
- All Implemented Interfaces:
ICompilableTypeInternal
,IGosuClassInternal
,IParameterizableType
,IFileRepositoryBasedType
,IHasInnerClass
,ICompilableType
,IGosuClass
,ICanBeAnnotation
,IEnhanceableType
,IEnumData
,IEnumType
,IHasJavaClass
,IType
,Serializable
,Comparable
- Direct Known Subclasses:
GosuClassFragment
,GosuEnhancement
,GosuProgram
,SyntheticClass
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface gw.lang.reflect.gs.IGosuClass
IGosuClass.ProxyUtil
Nested classes/interfaces inherited from interface gw.internal.gosu.parser.IGosuClassInternal
IGosuClassInternal.Util
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private boolean
private boolean
private boolean
private boolean
private Boolean
private boolean
private boolean
private List<IGosuClass>
private Boolean
private boolean
private boolean
private CompilationState
private String
private String
private IType
private LocklessLazyVar<IFunctionType>
private IGosuClassInternal
private GenericTypeVariable[]
private IType
private Boolean
private int
private IType[]
private int
private SoftReference<Class<?>>
private Map<CharSequence,
IGosuClassInternal> private ModifierInfo
private Map<String,
IGosuClassInternal> protected GosuClassParseInfo
private GosuParser
private IJavaType
private ISourceFileHandle
private String
private String
private String
private List<IGosuClassInternal>
private IType
private GosuClassTypeInfo
private GosuClassTypeLoader
private IType[]
private ITypeRef
private ITypeUsesMap
private List<ITypeVariableDefinition>
private LockingLazyVar<Boolean>
private static final long
Fields inherited from interface gw.lang.reflect.gs.IGosuClass
ANONYMOUS_PREFIX, PROXY_PREFIX, SUPER_PROXY_CLASS_PREFIX
Fields inherited from interface gw.lang.reflect.IType
EMPTY_ARRAY, EMPTY_TYPE_ARRAY, EMPTY_TYPE_LIST
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GosuClass
(IGosuClass genericClass, IType[] typeParams) protected
GosuClass
(IGosuClass genericClass, IType[] typeParams, boolean bCopyState) GosuClass
(String strNamespace, String strRelativeName, GosuClassTypeLoader classTypeLoader, ISourceFileHandle sourceFile, ITypeUsesMap typeUsesMap) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBlock
(IBlockClass block) void
void
addDelegateImpls
(ISymbolTable symTable, GosuClassParser parser) void
addInnerClass
(IGosuClassInternal innerGsClass) void
addInterface
(IType type) private void
addJavaEnhancements
(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic, IJavaType type) private boolean
areSymbolsFromSameDeclaration
(IVarStatement varStmt, ISymbol existingSymbol) private void
private void
private void
void
assignTypeUsesMap
(GosuParser parser) void
assignTypeVarsFromTypeParams
(IType[] typeParams) Note a gosu class can be BOTH parameterzied AND generic.int
byte[]
compile()
void
void
void
compileDefinitionsIfNeeded
(boolean bForce) void
void
copyGenericState
(boolean bCopyHierarchy) void
When changing the places from which this method is called run pc's gw.smoketest.pc.job.common.effectivetime.VisibleEffectiveTimeTest cause it will break!private GosuParser
createParser
(CompiledGosuClassSymbolTable symbolTable) boolean
ensureDefaultConstructor
(ISymbolTable symbolTable, GosuParser parser) private boolean
equalArgs
(IParameterInfo[] parameters, List<ISymbol> args) private static void
filterJavaDocAnnotations
(List<IGosuAnnotation> annotations) private static DynamicFunctionSymbol
findVarPropertyAccessorDfs
(String signature, IGosuClassInternal implClass) void
Returns a Set of all IIntrinsicTypes that this class is assignable from, including this class.int
getArrayComponent
(Object array, int iIndex) Returns the value of the indexed component in the specified array object.int
getArrayLength
(Object array) Returns the length of the specified array object.Make an array type from this type.Class<?>
getBlock
(int i) int
getCapturedSymbol
(String strName) If this is an array type, a type representing the component type of the array.getConstructorFunction
(String name) int
getDepth()
The display name of this intrinsic type.Returns the type immediately enclosing this type.getEnumValue
(String strName) getExternalSymbol
(String strName) getFunctionStatement
(IMethodInfo method) If this is a parameterized type, returns the generic type this type parameterizes.Returns an array of GenericTypeVariables declared with this Generic Type.List<? extends IGosuAnnotation>
getId()
private static DynamicFunctionSymbol
getImplDfs
(IGosuClassInternal implClass, IFunctionType ifaceFuncType, boolean bAcceptAbstract) getInnerClass
(CharSequence relativeName) returns the appropriate inner classIType[]
Map<CharSequence,
? extends IGosuClass> IType[]
getMemberField
(String charSequence) getMemberFunction
(IFunctionType funcType, boolean bContravariant) getMemberFunction
(IFunctionType funcType, String signature, boolean bContravariant) getMemberFunctions
(String names) getMemberProperty
(String name) int
Returns the modifiers for this type, encoded in an integer.getName()
The fully qualified name of this intrinsic type.The namespace for this class.protected GosuParser
getOrCreateParser
(CompiledGosuClassSymbolTable symbolTable) protected ITypeRef
protected ITypeRef
private IType
getOuterMostEnclosingClass
(IType innerClass) getParameterizedType
(IType... paramTypes) Assuming this intrinsic type is a Generic type, return the parameterized type associated with the given list of type parameters.!! The parser is only set when this class is parsed in an editor in an IDE !!getPropertyDeclaration
(String name) private IGosuClassInternal
The relative or unqualified name.IFile[]
getStaticField
(String name) getStaticProperty
(String name) WARNING: This method is slow the first time it is called.Returns the type representing the supertype of this type.Get the type information for this intrinsic type.int
Returns the type loader responsible for loading this intrinsic type.IType[]
If this is a parameterized type, returns the specific types used to create this type, null otherwies.private TypeVariableDefinitionImpl
getTypeVarDefImpl
(ITypeVariableDefinition typeVarDef) static List<IFunctionType>
getUnimplementedMethods
(IGosuClass gsIface, IGosuClass implClass, List<IFunctionType> unimpled, boolean ensurePublic, boolean bAcceptAbstract) getUnimplementedMethods
(List<IFunctionType> unimpled, IGosuClassInternal implClass, boolean bAcceptAbstract) private List
getUnmodifiableValues
(Map functionSymbolMap) private static boolean
handleParameterizedDfs
(IGosuClass implClass, IMethodInfo mi, IFunctionType ifaceFuncType, boolean bAcceptAbstract) boolean
boolean
boolean
private boolean
hasBeenUpdated
(IGosuClassInternal type, int tiChecksum) boolean
hasError()
private boolean
boolean
private boolean
haveAncestorsBeenUpdated
(IGosuClassInternal type, int tiCheckSum) private void
boolean
boolean
isAccessible
(IGosuClassInternal compilingClass, AbstractDynamicSymbol ads) private boolean
isAccessible
(IGosuClassInternal compilingClass, IVarStatement varStmt) boolean
boolean
boolean
isArray()
True if this is an array.private static boolean
isAssignable
(DynamicFunctionSymbol implDfs, IFunctionType ifaceFuncType) private boolean
isAssignable
(IFunctionType funcType, IDynamicFunctionSymbol dfs, boolean bContravariant) boolean
isAssignableFrom
(IType type) Determines if the type represented by this intrinsic type is either the same as, or is a super-type of the type represented by the specified type parameter.boolean
boolean
boolean
boolean
private boolean
isCompilingDeclarationsFor
(IScriptPartId scriptPart) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
True if this type has been replaced with a newer version of the same name in the type system.boolean
isEnum()
Returns true if this type is an enumeration.boolean
isFinal()
True if this type cannot be extended.boolean
Returns true if this ia a Generic Type.boolean
private boolean
private boolean
private boolean
isHidden
(IVarStatement varStmt) boolean
boolean
Returns true if this type is an interface.boolean
Are intances of this type mutable? Note sometimes it's difficult to determine.(package private) static boolean
boolean
Returns true if this ia a Parameterized Type.boolean
True if this type represents a primitive type e.g., Java int, char, etc.boolean
isProxy()
boolean
isStale()
boolean
isStatic()
boolean
boolean
boolean
isSubClass
(IType gsSubType) boolean
private boolean
boolean
isValid()
Defines this type if it is not yet fully defined.makeArrayInstance
(int iLength) Construct an array instance of specified length.protected IGosuClassInternal
private GosuParser
private GosuParser
makeParserForPhase
(boolean header) void
private void
private IGosuClassInternal
maybeLoadBlockToInterfaceProxy
(String relativeName) private void
void
putClassMembers
(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic) void
putClassMembers
(GosuClassTypeLoader loader, GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic) void
putClassMembers
(GosuClassTypeLoader loader, GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic, boolean bStaticImport) private void
putConstructors
(GosuParser owner, ISymbolTable table, boolean bSuperClass) private void
putEnhancements
(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic, IModule module, IType type) private void
putFields
(ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass) private void
putFunctions
(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass) private void
putProperties
(ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass) private void
putStaticFields
(ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass, boolean bStaticImport) private void
putStaticFunctions
(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass, boolean bStaticImport) private void
putStaticProperties
(ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass, boolean bStaticImport) IType requires this method be implemented to ensure IType instances can be centrally defined and cached.void
removeBlock
(IBlockClass block) void
removeInnerClass
(IGosuClassInternal innerGsClass) resolveRelativeInnerClass
(String strRelativeInnerClassName, boolean bForce) void
setAnnotations
(List<IGosuAnnotation> annotations) void
setArrayComponent
(Object array, int iIndex, Object value) Sets the value of the indexed component in the specified array object.void
setCannotCaptureSymbols
(boolean bCannotCaptureSymbols) void
setCompilingDeclarations
(boolean bCompilingDeclarations) void
setCompilingDefinitions
(boolean bCompilingDefinitions) void
setCompilingHeader
(boolean bCompilingHeader) void
setCreateEditorParser
(boolean bEditorParser) void
void
void
void
setDiscarded
(boolean bDiscarded) void
setEditorParser
(GosuParser parser) !! Used only when compiling from an edtior !!void
setEnclosingType
(IType enclosingType) Only for use during type loading e.g., from GosuClassTypeLoadervoid
setEnum()
void
setFullDescription
(String description) void
setGenericTypeVariables
(List<ITypeVariableDefinition> typeVarExprList) void
setHasAssertions
(boolean bHasAssertions) void
void
void
setInterface
(boolean bInterface) void
setJavaType
(IJavaType javaType) void
setModifierInfo
(ModifierInfo modifierInfo) void
setNamespace
(String namespace) void
void
setStructure
(boolean bStructure) void
setSuperType
(IType superType) void
setTypeUsesMap
(ITypeUsesMap usesMap) private boolean
boolean
boolean
boolean
void
toString()
void
void
Unload or nullify any references to this IType's ITypeInfo.private void
Methods inherited from class gw.lang.reflect.AbstractType
getLiteralMetaType, getMetaType, getTheRef
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface gw.lang.parser.IFileRepositoryBasedType
getJavaName
Methods inherited from interface gw.lang.reflect.IType
getLiteralMetaType, getMetaType, isDynamic
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
_strFullName
-
_typeParams
-
_parseInfo
-
_strNamespace
-
_strRelativeName
-
_typeLoader
-
_bInterface
private transient boolean _bInterface -
_bStructure
private transient boolean _bStructure -
_bEnum
private transient boolean _bEnum -
_mapInnerClasses
-
_setTypes
-
_interfaces
-
_superType
-
_enclosingType
-
_proxiedJavaClassInGosuProxy
-
_javaClass
-
_genericClass
-
_parameterizationByParamsName
-
_functionalInterface
-
_typeInfo
-
_gsArrayClass
-
_bHasSessionVarStatements
-
_iMdChecksum
private transient int _iMdChecksum -
_iTiChecksum
private transient int _iTiChecksum -
_compilationState
-
_bEditorParser
private transient boolean _bEditorParser -
_sourceFileHandle
-
_subtypes
-
_description
-
_defaultConstructorName
-
_bCannotCaptureSymbols
private transient boolean _bCannotCaptureSymbols -
_hasError
-
_bDiscarded
private transient boolean _bDiscarded -
_bInitializing
private transient boolean _bInitializing -
_blocks
-
_valid
-
_typeRef
-
_typeVarDefs
-
_genTypeVar
-
_parser
-
_typeUsesMap
-
_bStrictGenerics
-
_modifierInfo
-
_bHasAssertions
private transient boolean _bHasAssertions -
_bUsesQueryUsageSiteValidation
private transient boolean _bUsesQueryUsageSiteValidation
-
-
Constructor Details
-
GosuClass
public GosuClass(String strNamespace, String strRelativeName, GosuClassTypeLoader classTypeLoader, ISourceFileHandle sourceFile, ITypeUsesMap typeUsesMap) -
GosuClass
-
GosuClass
-
-
Method Details
-
getParseInfo
- Specified by:
getParseInfo
in interfaceICompilableTypeInternal
- Specified by:
getParseInfo
in interfaceIGosuClassInternal
-
hasAssertions
public boolean hasAssertions()- Specified by:
hasAssertions
in interfaceICompilableTypeInternal
-
setHasAssertions
public void setHasAssertions(boolean bHasAssertions) - Specified by:
setHasAssertions
in interfaceIGosuClassInternal
-
dontEverCallThis
- Specified by:
dontEverCallThis
in interfaceIGosuClassInternal
-
copyGenericState
public void copyGenericState(boolean bCopyHierarchy) - Specified by:
copyGenericState
in interfaceIGosuClassInternal
-
copyHierarchyInfo
public void copyHierarchyInfo()- Specified by:
copyHierarchyInfo
in interfaceIGosuClassInternal
-
assignParameterizedJavaTypeIfProxy
private void assignParameterizedJavaTypeIfProxy() -
assignParameterizedSuperType
private void assignParameterizedSuperType() -
assignParameterizedInterfaces
private void assignParameterizedInterfaces() -
getName
Description copied from interface:IType
The fully qualified name of this intrinsic type. -
getDisplayName
Description copied from interface:IType
The display name of this intrinsic type. Often this is simply the same asIType.getName()
, but in some cases a type may want to modify it's name for presentation to the user.- Specified by:
getDisplayName
in interfaceIType
-
getRelativeName
Description copied from interface:IType
The relative or unqualified name. For a class this should be just the class name without the package name.- Specified by:
getRelativeName
in interfaceIType
-
getNamespace
Description copied from interface:IType
The namespace for this class. For a java class this will be the package, while for other types of intrinsic types it could be another logical name.- Specified by:
getNamespace
in interfaceIType
-
setNamespace
- Specified by:
setNamespace
in interfaceIGosuClass
-
getTypeLoader
Description copied from interface:IType
Returns the type loader responsible for loading this intrinsic type.- Specified by:
getTypeLoader
in interfaceICompilableType
- Specified by:
getTypeLoader
in interfaceIGosuClassInternal
- Specified by:
getTypeLoader
in interfaceIType
-
getSupertype
Description copied from interface:IType
Returns the type representing the supertype of this type. Returns null if this type has no supertype.- Specified by:
getSupertype
in interfaceIType
-
getGenericType
Description copied from interface:IType
If this is a parameterized type, returns the generic type this type parameterizes. Otherwise, returns null.- Specified by:
getGenericType
in interfaceIType
-
isFinal
public boolean isFinal()Description copied from interface:IType
True if this type cannot be extended. -
isInterface
public boolean isInterface()Description copied from interface:IType
Returns true if this type is an interface.- Specified by:
isInterface
in interfaceIType
-
setInterface
public void setInterface(boolean bInterface) - Specified by:
setInterface
in interfaceIGosuClassInternal
-
isStructure
public boolean isStructure()- Specified by:
isStructure
in interfaceIGosuClass
-
setStructure
public void setStructure(boolean bStructure) - Specified by:
setStructure
in interfaceIGosuClassInternal
-
isEnum
public boolean isEnum()Description copied from interface:IType
Returns true if this type is an enumeration. -
setEnum
public void setEnum()- Specified by:
setEnum
in interfaceIGosuClassInternal
-
getEnumConstants
- Specified by:
getEnumConstants
in interfaceIEnumData
-
getEnumValues
- Specified by:
getEnumValues
in interfaceIEnumData
-
getEnumValue
- Specified by:
getEnumValue
in interfaceIEnumData
-
getInterfaces
- Specified by:
getInterfaces
in interfaceIType
- Returns:
- If this is a class, returns a list of all the interfaces this type implements. Similarly, if this is an interface, returns a list of all the interfaces this type extends. In any case, returns an empty list if this type neither implements nor extends interfaces.
-
maybeAssignInterfacesForParameterizedClass
private void maybeAssignInterfacesForParameterizedClass() -
addInterface
- Specified by:
addInterface
in interfaceIGosuClassInternal
-
getJavaType
- Specified by:
getJavaType
in interfaceIGosuClass
-
setJavaType
- Specified by:
setJavaType
in interfaceIGosuClassInternal
-
findProxiedClassInHierarchy
- Specified by:
findProxiedClassInHierarchy
in interfaceIGosuClass
-
isParameterizedType
public boolean isParameterizedType()Description copied from interface:IType
Returns true if this ia a Parameterized Type. Note a Parameterzied Type is not the same as a Generic Type. The difference is that a Parameterized Type is a concrete version of a Generic Type. For instance, the class ArrayListis a Generic Type, while the class ArrayList is a Parameterized Type of the the Generic Type ArrayList . - Specified by:
isParameterizedType
in interfaceIType
-
isGenericType
public boolean isGenericType()Description copied from interface:IType
Returns true if this ia a Generic Type.- Specified by:
isGenericType
in interfaceIType
- See Also:
-
getGenericTypeVariables
Description copied from interface:IType
Returns an array of GenericTypeVariables declared with this Generic Type. Otherwise, returns null if this is not a Generic Type.- Specified by:
getGenericTypeVariables
in interfaceIType
-
getParameterizedType
Description copied from interface:IType
Assuming this intrinsic type is a Generic type, return the parameterized type associated with the given list of type parameters. If the type has not been created yet, creates the parameterized type. Successive calls to this method having identical parameter types must return the identical parameterized type.- Specified by:
getParameterizedType
in interfaceIType
- Parameters:
paramTypes
- The type parameters.- Returns:
- The concrete type associated with the type parameters.
-
makeCopy
-
getTypeParameters
Description copied from interface:IType
If this is a parameterized type, returns the specific types used to create this type, null otherwies.- Specified by:
getTypeParameters
in interfaceIType
-
getAllTypesInHierarchy
Description copied from interface:IType
Returns a Set of all IIntrinsicTypes that this class is assignable from, including this class. This includes implemented interfaces and superclasses, recursively up the hieararchy. For array types, this will be a Set of all types that its component type is assignable from.- Specified by:
getAllTypesInHierarchy
in interfaceIType
-
createAllTypesInHierarchy
-
isArray
public boolean isArray()Description copied from interface:IType
True if this is an array. -
isPrimitive
public boolean isPrimitive()Description copied from interface:IType
True if this type represents a primitive type e.g., Java int, char, etc.- Specified by:
isPrimitive
in interfaceIType
-
getArrayType
Description copied from interface:IType
Make an array type from this type. E.g., String -> String[]- Specified by:
getArrayType
in interfaceIType
-
makeArrayInstance
Description copied from interface:IType
Construct an array instance of specified length.- Specified by:
makeArrayInstance
in interfaceIType
-
getArrayComponent
public Object getArrayComponent(Object array, int iIndex) throws IllegalArgumentException, ArrayIndexOutOfBoundsException Description copied from interface:IType
Returns the value of the indexed component in the specified array object.- Specified by:
getArrayComponent
in interfaceIType
- Parameters:
array
- An array instance of this intrinsic type.iIndex
- The index of the component to get.- Returns:
- The value of the indexed component in the specified array.
- Throws:
IllegalArgumentException
- If the specified object is not an array.ArrayIndexOutOfBoundsException
- If the specified index argument is negative, or if it is greater than or equal to the length of the specified array
-
setArrayComponent
public void setArrayComponent(Object array, int iIndex, Object value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException Description copied from interface:IType
Sets the value of the indexed component in the specified array object.- Specified by:
setArrayComponent
in interfaceIType
- Parameters:
array
- An array instance of this intrinsic type.iIndex
- The index of the component to set.value
- The new value of the indexed component.- Throws:
IllegalArgumentException
- If the specified object is not an array.ArrayIndexOutOfBoundsException
- If the specified index argument is negative, or if it is greater than or equal to the length of the specified array
-
getArrayLength
Description copied from interface:IType
Returns the length of the specified array object.- Specified by:
getArrayLength
in interfaceIType
- Parameters:
array
- An array instance of this intrinsic type.- Returns:
- The length of the array.
- Throws:
IllegalArgumentException
- If the object argument is not an array.
-
getComponentType
Description copied from interface:IType
If this is an array type, a type representing the component type of the array. Otherwise null.- Specified by:
getComponentType
in interfaceIType
-
isAssignableFrom
Description copied from interface:IType
Determines if the type represented by this intrinsic type is either the same as, or is a super-type of the type represented by the specified type parameter.- Specified by:
isAssignableFrom
in interfaceIType
-
isStrictGenerics
public boolean isStrictGenerics()- Specified by:
isStrictGenerics
in interfaceIParameterizableType
-
isMutable
public boolean isMutable()Description copied from interface:IType
Are intances of this type mutable? Note sometimes it's difficult to determine. For instance, java classes don't contain any information about mutability. In which case we always assume mutable, even when the underlying type may in fact be immutable. E.g., even though java.lang.String is not mutable, its corresponding JavaIntrinsicType will say it is. -
isValid
public boolean isValid()Description copied from interface:IType
Defines this type if it is not yet fully defined. For instance, if this type has source code associated with it, it must fully compile the source for it to be fully defined. -
isStatic
public boolean isStatic()- Specified by:
isStatic
in interfaceICompilableType
-
getModifierInfo
- Specified by:
getModifierInfo
in interfaceIGosuClass
-
setModifierInfo
- Specified by:
setModifierInfo
in interfaceIGosuClassInternal
-
getModifiers
public int getModifiers()Description copied from interface:IType
Returns the modifiers for this type, encoded in an integer. The modifiers consist of the constants forpublic
,protected
,private
,final
,static
,abstract
they should be decoded using the methods of classModifier
.- Specified by:
getModifiers
in interfaceIType
- See Also:
-
markStatic
public void markStatic()- Specified by:
markStatic
in interfaceIGosuClassInternal
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstract
in interfaceIType
-
getTypeInfo
Description copied from interface:IType
Get the type information for this intrinsic type.- Specified by:
getTypeInfo
in interfaceICompilableType
- Specified by:
getTypeInfo
in interfaceIGosuClass
- Specified by:
getTypeInfo
in interfaceIType
- See Also:
-
hasAncestorBeenUpdated
public boolean hasAncestorBeenUpdated() -
haveAncestorsBeenUpdated
-
hasBeenUpdated
-
unloadTypeInfo
public void unloadTypeInfo()Description copied from interface:IType
Unload or nullify any references to this IType's ITypeInfo.- Specified by:
unloadTypeInfo
in interfaceIType
-
readResolve
Description copied from interface:IType
IType requires this method be implemented to ensure IType instances can be centrally defined and cached.- Specified by:
readResolve
in interfaceIType
- Throws:
ObjectStreamException
-
getId
-
getSource
- Specified by:
getSource
in interfaceICompilableTypeInternal
- Specified by:
getSource
in interfaceIGosuClass
-
isStale
public boolean isStale()- Specified by:
isStale
in interfaceIGosuClassInternal
- Returns:
- True if this type is no longer current or has been unloaded.
-
getTypeInfoChecksum
public int getTypeInfoChecksum()- Specified by:
getTypeInfoChecksum
in interfaceIGosuClassInternal
-
isProxy
public boolean isProxy()- Specified by:
isProxy
in interfaceIGosuClassInternal
-
getFunctionalInterface
- Specified by:
getFunctionalInterface
in interfaceIType
-
getOrCreateTypeReference
-
getOrCreateTypeReference
-
isSubClass
- Specified by:
isSubClass
in interfaceIGosuClass
-
isCompiled
public boolean isCompiled()- Specified by:
isCompiled
in interfaceIGosuClass
-
getConstructorFunctions
- Specified by:
getConstructorFunctions
in interfaceIGosuClassInternal
-
getUnmodifiableValues
-
getConstructorFunction
- Specified by:
getConstructorFunction
in interfaceIGosuClassInternal
-
getDefaultConstructor
- Specified by:
getDefaultConstructor
in interfaceIGosuClassInternal
-
getStaticFunctions
- Specified by:
getStaticFunctions
in interfaceIGosuClassInternal
-
getInnerClassesMap
- Specified by:
getInnerClassesMap
in interfaceIGosuClass
-
getInnerClasses
- Specified by:
getInnerClasses
in interfaceIGosuClass
- Specified by:
getInnerClasses
in interfaceIHasInnerClass
-
getKnownInnerClassesWithoutCompiling
- Specified by:
getKnownInnerClassesWithoutCompiling
in interfaceIGosuClass
-
getBlock
- Specified by:
getBlock
in interfaceICompilableType
-
addInnerClass
- Specified by:
addInnerClass
in interfaceIGosuClassInternal
-
removeInnerClass
- Specified by:
removeInnerClass
in interfaceIGosuClassInternal
-
resolveRelativeInnerClass
- Specified by:
resolveRelativeInnerClass
in interfaceIHasInnerClass
- Overrides:
resolveRelativeInnerClass
in classInnerClassCapableType
-
getMemberFunctions
- Specified by:
getMemberFunctions
in interfaceIGosuClass
-
getMemberFunction
public DynamicFunctionSymbol getMemberFunction(IFunctionType funcType, String signature, boolean bContravariant) - Specified by:
getMemberFunction
in interfaceIGosuClassInternal
-
getMemberFunctions
- Specified by:
getMemberFunctions
in interfaceICompilableTypeInternal
- Specified by:
getMemberFunctions
in interfaceIGosuClassInternal
-
getMemberFunction
- Specified by:
getMemberFunction
in interfaceIGosuClassInternal
-
isAssignable
private boolean isAssignable(IFunctionType funcType, IDynamicFunctionSymbol dfs, boolean bContravariant) -
getStaticProperty
- Specified by:
getStaticProperty
in interfaceICompilableTypeInternal
- Specified by:
getStaticProperty
in interfaceIGosuClassInternal
-
getStaticProperties
- Specified by:
getStaticProperties
in interfaceIGosuClassInternal
-
getMemberProperties
- Specified by:
getMemberProperties
in interfaceIGosuClassInternal
-
getMemberProperty
- Specified by:
getMemberProperty
in interfaceICompilableTypeInternal
- Specified by:
getMemberProperty
in interfaceIGosuClass
- Specified by:
getMemberProperty
in interfaceIGosuClassInternal
-
getStaticFields
- Specified by:
getStaticFields
in interfaceICompilableTypeInternal
- Specified by:
getStaticFields
in interfaceIGosuClassInternal
-
getStaticField
- Specified by:
getStaticField
in interfaceIGosuClassInternal
-
getMemberFieldIndexByName
- Specified by:
getMemberFieldIndexByName
in interfaceIGosuClassInternal
-
getMemberFields
- Specified by:
getMemberFields
in interfaceICompilableTypeInternal
- Specified by:
getMemberFields
in interfaceIGosuClass
-
getMemberFieldsMap
- Specified by:
getMemberFieldsMap
in interfaceIGosuClass
-
getStaticThisSymbol
- Specified by:
getStaticThisSymbol
in interfaceIGosuClassInternal
-
getCapturedSymbols
- Specified by:
getCapturedSymbols
in interfaceICompilableTypeInternal
- Specified by:
getCapturedSymbols
in interfaceIGosuClassInternal
-
getCapturedSymbol
- Specified by:
getCapturedSymbol
in interfaceICompilableTypeInternal
- Specified by:
getCapturedSymbol
in interfaceIGosuClassInternal
-
addCapturedSymbol
- Specified by:
addCapturedSymbol
in interfaceICompilableTypeInternal
- Specified by:
addCapturedSymbol
in interfaceIGosuClassInternal
-
ensureDefaultConstructor
- Specified by:
ensureDefaultConstructor
in interfaceIGosuClassInternal
-
getClassStatement
- Specified by:
getClassStatement
in interfaceICompilableType
- Returns:
- The ClassStatement (root ParsedElement) for this GosuClass
NOTE: Because GosuClass is lazily compiled, the ClassStatement returned is NOT guaranteed to be fully compiled by this method, and may return only the declarations of the class. If you wish to access the fully compiled ClassStatement you must call
compileDefinitionsIfNeeded()
.
-
getClassStatementWithoutCompile
- Specified by:
getClassStatementWithoutCompile
in interfaceIGosuClass
-
toString
-
setSuperType
- Specified by:
setSuperType
in interfaceIGosuClassInternal
-
setEnclosingType
Description copied from interface:IGosuClass
Only for use during type loading e.g., from GosuClassTypeLoader- Specified by:
setEnclosingType
in interfaceIGosuClass
- Parameters:
enclosingType
- the enclosing type
-
getEnclosingTypeReference
- Specified by:
getEnclosingTypeReference
in interfaceIGosuClass
-
isAnonymous
public boolean isAnonymous()- Specified by:
isAnonymous
in interfaceICompilableType
-
getDepth
public int getDepth()- Specified by:
getDepth
in interfaceICompilableTypeInternal
- Specified by:
getDepth
in interfaceIGosuClassInternal
-
compileDefinitionsIfNeeded
public void compileDefinitionsIfNeeded()- Specified by:
compileDefinitionsIfNeeded
in interfaceIGosuClassInternal
-
compileDefinitionsIfNeeded
public void compileDefinitionsIfNeeded(boolean bForce) - Specified by:
compileDefinitionsIfNeeded
in interfaceICompilableTypeInternal
- Specified by:
compileDefinitionsIfNeeded
in interfaceIGosuClassInternal
-
isTypeRefreshedOutsideOfLock
private boolean isTypeRefreshedOutsideOfLock() -
postAnalyze
private void postAnalyze() -
hasParseIssuesInUsesStatements
private boolean hasParseIssuesInUsesStatements() -
updateParseResultsException
private void updateParseResultsException() -
compileDeclarationsIfNeeded
public void compileDeclarationsIfNeeded()- Specified by:
compileDeclarationsIfNeeded
in interfaceICompilableTypeInternal
- Specified by:
compileDeclarationsIfNeeded
in interfaceIGosuClassInternal
-
forceTypeInfoInitialization
public void forceTypeInfoInitialization()- Specified by:
forceTypeInfoInitialization
in interfaceIGosuClassInternal
-
syncGenericAndParameterizedClasses
public void syncGenericAndParameterizedClasses()- Specified by:
syncGenericAndParameterizedClasses
in interfaceIGosuClassInternal
-
getParameterizedTypes
- Specified by:
getParameterizedTypes
in interfaceIGosuClassInternal
-
setAnnotations
- Specified by:
setAnnotations
in interfaceIGosuClassInternal
-
filterJavaDocAnnotations
-
getEnclosingNonBlockType
- Specified by:
getEnclosingNonBlockType
in interfaceICompilableTypeInternal
- Specified by:
getEnclosingNonBlockType
in interfaceIGosuClassInternal
-
compileHeaderIfNeeded
public void compileHeaderIfNeeded()- Specified by:
compileHeaderIfNeeded
in interfaceICompilableTypeInternal
- Specified by:
compileHeaderIfNeeded
in interfaceIGosuClassInternal
-
shouldCompileDeclarations
private boolean shouldCompileDeclarations() -
getCompilationState
- Specified by:
getCompilationState
in interfaceIGosuClass
-
isCompilingHeader
public boolean isCompilingHeader()- Specified by:
isCompilingHeader
in interfaceIGosuClass
-
setCompilingHeader
public void setCompilingHeader(boolean bCompilingHeader) - Specified by:
setCompilingHeader
in interfaceIGosuClassInternal
-
isHeaderCompiled
public boolean isHeaderCompiled()- Specified by:
isHeaderCompiled
in interfaceIGosuClass
-
setHeaderCompiled
public void setHeaderCompiled()- Specified by:
setHeaderCompiled
in interfaceIGosuClassInternal
-
isCompilingDeclarations
public boolean isCompilingDeclarations()- Specified by:
isCompilingDeclarations
in interfaceIGosuClass
-
setCompilingDeclarations
public void setCompilingDeclarations(boolean bCompilingDeclarations) - Specified by:
setCompilingDeclarations
in interfaceIGosuClassInternal
-
isDeclarationsCompiled
public boolean isDeclarationsCompiled()- Specified by:
isDeclarationsCompiled
in interfaceIGosuClass
-
isDeclarationsBypassed
public boolean isDeclarationsBypassed()- Specified by:
isDeclarationsBypassed
in interfaceIGosuClass
-
setDeclarationsBypassed
public void setDeclarationsBypassed()- Specified by:
setDeclarationsBypassed
in interfaceIGosuClassInternal
-
isInnerDeclarationsCompiled
public boolean isInnerDeclarationsCompiled()- Specified by:
isInnerDeclarationsCompiled
in interfaceIGosuClass
-
setDeclarationsCompiled
public void setDeclarationsCompiled()- Specified by:
setDeclarationsCompiled
in interfaceIGosuClassInternal
-
setInnerDeclarationsCompiled
public void setInnerDeclarationsCompiled()- Specified by:
setInnerDeclarationsCompiled
in interfaceIGosuClassInternal
-
isCompilingDefinitions
public boolean isCompilingDefinitions()- Specified by:
isCompilingDefinitions
in interfaceIGosuClass
-
shouldFullyCompileAnnotations
public boolean shouldFullyCompileAnnotations()- Specified by:
shouldFullyCompileAnnotations
in interfaceICompilableTypeInternal
-
setCompilingDefinitions
public void setCompilingDefinitions(boolean bCompilingDefinitions) - Specified by:
setCompilingDefinitions
in interfaceIGosuClassInternal
-
isDefinitionsCompiled
public boolean isDefinitionsCompiled()- Specified by:
isDefinitionsCompiled
in interfaceIGosuClass
-
setDefinitionsCompiled
public void setDefinitionsCompiled()- Specified by:
setDefinitionsCompiled
in interfaceIGosuClassInternal
-
getSourceFileHandle
- Specified by:
getSourceFileHandle
in interfaceIFileRepositoryBasedType
-
getLoadedInnerClasses
- Specified by:
getLoadedInnerClasses
in interfaceIHasInnerClass
-
getClassType
- Specified by:
getClassType
in interfaceIFileRepositoryBasedType
-
getGosuAnnotations
- Specified by:
getGosuAnnotations
in interfaceICompilableTypeInternal
- Specified by:
getGosuAnnotations
in interfaceIGosuClassInternal
-
createNewParseInfo
When changing the places from which this method is called run pc's gw.smoketest.pc.job.common.effectivetime.VisibleEffectiveTimeTest cause it will break!- Specified by:
createNewParseInfo
in interfaceIGosuClassInternal
-
isTestClass
public boolean isTestClass()- Specified by:
isTestClass
in interfaceIGosuClass
-
getInnerClass
Description copied from interface:IHasInnerClass
returns the appropriate inner class- Specified by:
getInnerClass
in interfaceIGosuClass
- Specified by:
getInnerClass
in interfaceIHasInnerClass
- Returns:
-
maybeLoadBlockToInterfaceProxy
-
getMemberField
- Specified by:
getMemberField
in interfaceICompilableTypeInternal
- Specified by:
getMemberField
in interfaceIGosuClassInternal
-
shouldKeepDebugInfo
public boolean shouldKeepDebugInfo()- Specified by:
shouldKeepDebugInfo
in interfaceIGosuClass
-
getSuperClass
- Specified by:
getSuperClass
in interfaceIGosuClassInternal
-
getEnclosingType
Description copied from interface:IType
Returns the type immediately enclosing this type. If this type is not enclosed, returns null.- Specified by:
getEnclosingType
in interfaceICompilableType
- Specified by:
getEnclosingType
in interfaceICompilableTypeInternal
- Specified by:
getEnclosingType
in interfaceIType
-
hasBackingClass
public boolean hasBackingClass()- Specified by:
hasBackingClass
in interfaceIGosuClass
-
unloadBackingClass
public void unloadBackingClass()- Specified by:
unloadBackingClass
in interfaceIGosuClass
-
getBackingClass
- Specified by:
getBackingClass
in interfaceIHasJavaClass
-
isCompilable
public boolean isCompilable()- Specified by:
isCompilable
in interfaceIType
-
compile
public byte[] compile() -
getExternalSymbol
- Specified by:
getExternalSymbol
in interfaceICompilableType
-
putClassMembers
public void putClassMembers(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic) - Specified by:
putClassMembers
in interfaceICompilableTypeInternal
- Specified by:
putClassMembers
in interfaceIGosuClassInternal
-
putClassMembers
public void putClassMembers(GosuClassTypeLoader loader, GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic) - Specified by:
putClassMembers
in interfaceICompilableTypeInternal
- Specified by:
putClassMembers
in interfaceIGosuClassInternal
-
putClassMembers
public void putClassMembers(GosuClassTypeLoader loader, GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic, boolean bStaticImport) - Specified by:
putClassMembers
in interfaceIGosuClassInternal
-
addJavaEnhancements
private void addJavaEnhancements(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic, IJavaType type) -
putEnhancements
private void putEnhancements(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bStatic, IModule module, IType type) -
putFunctions
private void putFunctions(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass) -
isHidden
-
isHidden
-
isHidden
-
isCompilingDeclarationsFor
-
putProperties
private void putProperties(ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass) -
putConstructors
-
putStaticFunctions
private void putStaticFunctions(GosuParser owner, ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass, boolean bStaticImport) -
putStaticProperties
private void putStaticProperties(ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass, boolean bStaticImport) -
putStaticFields
private void putStaticFields(ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass, boolean bStaticImport) -
areSymbolsFromSameDeclaration
-
putFields
-
isAccessible
- Specified by:
isAccessible
in interfaceIGosuClassInternal
-
isAccessible
-
getOuterMostEnclosingClass
-
setParseResultsException
- Specified by:
setParseResultsException
in interfaceIGosuClassInternal
-
hasError
public boolean hasError()- Specified by:
hasError
in interfaceIGosuClass
-
hasWarnings
public boolean hasWarnings()- Specified by:
hasWarnings
in interfaceIGosuClass
-
getPureGenericClass
-
getParseResultsException
- Specified by:
getParseResultsException
in interfaceIGosuClass
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-
shouldResolve
public boolean shouldResolve()- Specified by:
shouldResolve
in interfaceIGosuClassInternal
-
makeParserForPhase
-
makeParserForPhase
-
getTypeUsesMap
- Specified by:
getTypeUsesMap
in interfaceICompilableType
-
setTypeUsesMap
- Specified by:
setTypeUsesMap
in interfaceIGosuClassInternal
-
assignTypeUsesMap
- Specified by:
assignTypeUsesMap
in interfaceICompilableTypeInternal
- Specified by:
assignTypeUsesMap
in interfaceIGosuClassInternal
-
setEditorParser
!! Used only when compiling from an edtior !!- Specified by:
setEditorParser
in interfaceIGosuClassInternal
-
setCreateEditorParser
public void setCreateEditorParser(boolean bEditorParser) - Specified by:
setCreateEditorParser
in interfaceIGosuClass
-
isCreateEditorParser
public boolean isCreateEditorParser()- Specified by:
isCreateEditorParser
in interfaceICompilableTypeInternal
- Specified by:
isCreateEditorParser
in interfaceIGosuClassInternal
-
getAnonymousInnerClassCount
public int getAnonymousInnerClassCount()- Specified by:
getAnonymousInnerClassCount
in interfaceICompilableTypeInternal
-
getParser
!! The parser is only set when this class is parsed in an editor in an IDE !!- Specified by:
getParser
in interfaceICompilableType
-
getOrCreateParser
-
createParser
-
addDelegateImpls
- Specified by:
addDelegateImpls
in interfaceIGosuClassInternal
-
getUnimplementedMethods
- Specified by:
getUnimplementedMethods
in interfaceIGosuClassInternal
-
getUnimplementedMethods
public List<IFunctionType> getUnimplementedMethods(List<IFunctionType> unimpled, IGosuClassInternal implClass, boolean bAcceptAbstract) - Specified by:
getUnimplementedMethods
in interfaceIGosuClassInternal
-
getUnimplementedMethods
public static List<IFunctionType> getUnimplementedMethods(IGosuClass gsIface, IGosuClass implClass, List<IFunctionType> unimpled, boolean ensurePublic, boolean bAcceptAbstract) -
handleParameterizedDfs
private static boolean handleParameterizedDfs(IGosuClass implClass, IMethodInfo mi, IFunctionType ifaceFuncType, boolean bAcceptAbstract) -
isAssignable
-
isObjectMethod
-
getImplDfs
private static DynamicFunctionSymbol getImplDfs(IGosuClassInternal implClass, IFunctionType ifaceFuncType, boolean bAcceptAbstract) -
findVarPropertyAccessorDfs
private static DynamicFunctionSymbol findVarPropertyAccessorDfs(String signature, IGosuClassInternal implClass) -
setFullDescription
- Specified by:
setFullDescription
in interfaceIGosuClassInternal
-
getFullDescription
- Specified by:
getFullDescription
in interfaceIGosuClassInternal
-
getSubtypes
Description copied from interface:IGosuClass
WARNING: This method is slow the first time it is called. It will iterate over all types in the system and find all matching subtypes- Specified by:
getSubtypes
in interfaceIGosuClass
- Returns:
- all subtypes of this type
-
isDiscarded
public boolean isDiscarded()Description copied from interface:IType
True if this type has been replaced with a newer version of the same name in the type system.- Specified by:
isDiscarded
in interfaceIType
-
setDiscarded
public void setDiscarded(boolean bDiscarded) - Specified by:
setDiscarded
in interfaceIType
-
isCompoundType
public boolean isCompoundType()- Specified by:
isCompoundType
in interfaceIType
-
getCompoundTypeComponents
- Specified by:
getCompoundTypeComponents
in interfaceIType
-
isCannotCaptureSymbols
public boolean isCannotCaptureSymbols()- Specified by:
isCannotCaptureSymbols
in interfaceIGosuClassInternal
-
setCannotCaptureSymbols
public void setCannotCaptureSymbols(boolean bCannotCaptureSymbols) - Specified by:
setCannotCaptureSymbols
in interfaceIGosuClassInternal
-
getBlocks
- Specified by:
getBlocks
in interfaceIGosuClass
- Specified by:
getBlocks
in interfaceIGosuClassInternal
-
getBlockCount
public int getBlockCount()- Specified by:
getBlockCount
in interfaceICompilableTypeInternal
- Specified by:
getBlockCount
in interfaceIGosuClassInternal
-
addBlock
- Specified by:
addBlock
in interfaceICompilableTypeInternal
- Specified by:
addBlock
in interfaceIGosuClassInternal
-
removeBlock
- Specified by:
removeBlock
in interfaceICompilableTypeInternal
- Specified by:
removeBlock
in interfaceIGosuClassInternal
-
initLazyVars
private void initLazyVars() -
assignTypeVarsFromTypeParams
Note a gosu class can be BOTH parameterzied AND generic. For example, class Bar{ function blah() : T {...} } class Foo extends Bar {} The class Bar here is parameterized by the type var from Foo, yet it is still a generic class. The blah() method in Foo's typeinfo must have a return type consistent with Foo's type var upper bound, CharSequence. //## todo: maybe we don't need this concept any longer? i.e., parameterization should work correctly regardless. -
getTypeVarDefs
-
setGenericTypeVariables
- Specified by:
setGenericTypeVariables
in interfaceIGosuClassInternal
-
getTypeVarDefImpl
-
getFunctionStatement
- Specified by:
getFunctionStatement
in interfaceIGosuClass
-
getPropertyDeclaration
- Specified by:
getPropertyDeclaration
in interfaceIGosuClass
-
getConstructorStatement
- Specified by:
getConstructorStatement
in interfaceIGosuClass
-
equalArgs
-
getLoaderParameterizedTypes
- Specified by:
getLoaderParameterizedTypes
in interfaceIParameterizableType
-
getSourceFiles
- Specified by:
getSourceFiles
in interfaceIType
-
isAnnotation
public boolean isAnnotation()- Specified by:
isAnnotation
in interfaceICanBeAnnotation
-