Package gw.internal.gosu.parser
Class GosuVarPropertyInfo
- java.lang.Object
-
- gw.lang.reflect.BaseFeatureInfo
-
- gw.internal.gosu.parser.GosuBaseAttributedFeatureInfo
-
- gw.internal.gosu.parser.GosuVarPropertyInfo
-
- All Implemented Interfaces:
IGosuVarPropertyInfo
,IAnnotatedFeatureInfo
,IAttributedFeatureInfo
,IFeatureInfo
,IGenericMethodInfo
,IIntrinsicTypeReference
,IPropertyInfo
,ICompileTimeConstantValue
public class GosuVarPropertyInfo extends GosuBaseAttributedFeatureInfo implements IGosuVarPropertyInfo
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gw.lang.reflect.IAnnotatedFeatureInfo
IAnnotatedFeatureInfo.IAnnotationInfoHelper
-
Nested classes/interfaces inherited from interface gw.lang.reflect.IAttributedFeatureInfo
IAttributedFeatureInfo.MODIFIER
-
-
Field Summary
-
Fields inherited from interface gw.lang.reflect.IAnnotatedFeatureInfo
ANNOTATION_HELPER
-
-
Constructor Summary
Constructors Constructor Description GosuVarPropertyInfo(GosuClassTypeInfo container, GosuVarPropertyInfo pi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IType
assignActualType(IType type)
void
assignSymbolType(IType type)
Object
doCompileTimeEvaluation()
IPropertyAccessor
getAccessor()
String
getDescription()
A full description of this feature.IType
getFeatureType()
The type of this feature e.g., for a property this is the property's type.protected List<IGosuAnnotation>
getGosuAnnotations()
String
getName()
Gets the programmatic name or identifier of this feature.int
getOffset()
IType[]
getParameterizedParameterTypes(IType... typeParams)
IType[]
getParameterizedParameterTypes2(IType ownersType, IType... typeParams)
IType
getParameterizedReturnType(IType... typeParams)
IPresentationInfo
getPresentationInfo()
IType
getScopedSymbolType()
String
getSymbolAttributeName()
String
getSymbolScopeString()
GenericTypeVariable[]
getTypeVariables()
boolean
hasDeclaredProperty()
TypeVarToTypeMap
inferTypeParametersFromArgumentTypes(IType... argTypes)
TypeVarToTypeMap
inferTypeParametersFromArgumentTypes2(IType owningParameterizedType, IType... argTypes)
boolean
isCompileTimeConstantValue()
boolean
isFinal()
boolean
isInternal()
True if this feature is internal.boolean
isPrivate()
True if this feature is private.boolean
isProtected()
True if this feature is protected.boolean
isPublic()
True if this feature is public.boolean
isReadable()
boolean
isReified()
boolean
isScopedField()
boolean
isStatic()
True if this feature is static, meaning the feature is not specific to a particular instance of the feature's containing type.boolean
isWritable()
boolean
isWritable(IType whosAskin)
-
Methods inherited from class gw.internal.gosu.parser.GosuBaseAttributedFeatureInfo
getActualTypeInContainer, getDeclaredAnnotations, getDeprecatedReason, getOwnersType, isDeprecated, isHidden, isVisible
-
Methods inherited from class gw.lang.reflect.BaseFeatureInfo
getAnnotation, getAnnotations, getAnnotationsOfType, getContainer, getDisplayName, getParamTypes, getSuperAnnotatedElements, hasAnnotation, hasDeclaredAnnotation, isAbstract, isDefaultImpl, isInternalAPI, isScriptable, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.reflect.IAnnotatedFeatureInfo
getAnnotation, getAnnotations, getAnnotationsOfType, getDeclaredAnnotations, getDeprecatedReason, hasAnnotation, hasDeclaredAnnotation, isDefaultImpl, isDeprecated
-
Methods inherited from interface gw.lang.reflect.IAttributedFeatureInfo
isAbstract, isHidden, isScriptable, isVisible
-
Methods inherited from interface gw.lang.reflect.IFeatureInfo
getContainer, getDisplayName, getLocationInfo, getOwnersType
-
Methods inherited from interface gw.lang.reflect.IIntrinsicTypeReference
getAssignableFeatureType
-
Methods inherited from interface gw.lang.reflect.IPropertyInfo
isReadable
-
-
-
-
Constructor Detail
-
GosuVarPropertyInfo
public GosuVarPropertyInfo(GosuClassTypeInfo container, GosuVarPropertyInfo pi)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:IFeatureInfo
Gets the programmatic name or identifier of this feature. Note this name should follow Java identifier naming conventions (alpha-num and underscores, but can't start with a digit).- Specified by:
getName
in interfaceIFeatureInfo
-
getFeatureType
public IType getFeatureType()
Description copied from interface:IIntrinsicTypeReference
The type of this feature e.g., for a property this is the property's type.- Specified by:
getFeatureType
in interfaceIIntrinsicTypeReference
-
isStatic
public boolean isStatic()
Description copied from interface:IAttributedFeatureInfo
True if this feature is static, meaning the feature is not specific to a particular instance of the feature's containing type.- Specified by:
isStatic
in interfaceIAttributedFeatureInfo
-
isPrivate
public boolean isPrivate()
Description copied from interface:IAttributedFeatureInfo
True if this feature is private. Private features are only accessible from within the type that owns them.- Specified by:
isPrivate
in interfaceIAttributedFeatureInfo
- Overrides:
isPrivate
in classBaseFeatureInfo
-
isInternal
public boolean isInternal()
Description copied from interface:IAttributedFeatureInfo
True if this feature is internal. Internal features are accessible from within the type that owns them and from other types in the same namespace.- Specified by:
isInternal
in interfaceIAttributedFeatureInfo
- Overrides:
isInternal
in classBaseFeatureInfo
-
isProtected
public boolean isProtected()
Description copied from interface:IAttributedFeatureInfo
True if this feature is protected. Protected features are accessible from within the type that owns them and from derived containers.- Specified by:
isProtected
in interfaceIAttributedFeatureInfo
- Overrides:
isProtected
in classBaseFeatureInfo
-
isFinal
public boolean isFinal()
- Specified by:
isFinal
in interfaceIAttributedFeatureInfo
- Overrides:
isFinal
in classBaseFeatureInfo
-
isReified
public boolean isReified()
- Specified by:
isReified
in interfaceIAttributedFeatureInfo
- Overrides:
isReified
in classBaseFeatureInfo
-
isPublic
public boolean isPublic()
Description copied from interface:IAttributedFeatureInfo
True if this feature is public. Public features are not restricted.- Specified by:
isPublic
in interfaceIAttributedFeatureInfo
- Overrides:
isPublic
in classBaseFeatureInfo
-
getGosuAnnotations
protected List<IGosuAnnotation> getGosuAnnotations()
- Specified by:
getGosuAnnotations
in classGosuBaseAttributedFeatureInfo
-
isReadable
public boolean isReadable()
- Specified by:
isReadable
in interfaceIPropertyInfo
- Returns:
- true if the property is readable given the visibility constraint passed in, false otherwise.
-
isWritable
public boolean isWritable(IType whosAskin)
- Specified by:
isWritable
in interfaceIPropertyInfo
- Parameters:
whosAskin
- The type querying the property writability. For example, passing in the type the property is on will allow properties that have private access in the setter to be written to. Passing in an unrelated type will only allow properties that are to be written to.- Returns:
- True if the property is writable given the visibility constraint passed in, false otherwise.
-
isWritable
public boolean isWritable()
- Specified by:
isWritable
in interfaceIPropertyInfo
- Returns:
- True if the property is writable given the visibility constraint passed in, false otherwise.
-
getOffset
public int getOffset()
- Specified by:
getOffset
in interfaceIGosuVarPropertyInfo
-
getAccessor
public IPropertyAccessor getAccessor()
- Specified by:
getAccessor
in interfaceIPropertyInfo
- Returns:
- the PropertyAccessor (for getting and setting) this property.
-
getPresentationInfo
public IPresentationInfo getPresentationInfo()
- Specified by:
getPresentationInfo
in interfaceIPropertyInfo
-
assignActualType
public IType assignActualType(IType type)
- Specified by:
assignActualType
in interfaceIGosuVarPropertyInfo
-
assignSymbolType
public void assignSymbolType(IType type)
- Specified by:
assignSymbolType
in interfaceIGosuVarPropertyInfo
-
hasDeclaredProperty
public boolean hasDeclaredProperty()
- Specified by:
hasDeclaredProperty
in interfaceIGosuVarPropertyInfo
-
isScopedField
public boolean isScopedField()
- Specified by:
isScopedField
in interfaceIGosuVarPropertyInfo
-
getScopedSymbolType
public IType getScopedSymbolType()
- Specified by:
getScopedSymbolType
in interfaceIGosuVarPropertyInfo
-
getSymbolScopeString
public String getSymbolScopeString()
- Specified by:
getSymbolScopeString
in interfaceIGosuVarPropertyInfo
-
getSymbolAttributeName
public String getSymbolAttributeName()
- Specified by:
getSymbolAttributeName
in interfaceIGosuVarPropertyInfo
-
getTypeVariables
public GenericTypeVariable[] getTypeVariables()
- Specified by:
getTypeVariables
in interfaceIGenericMethodInfo
- Returns:
- An array of generic type variables if this feature corresponds with a generic type.
-
getParameterizedReturnType
public IType getParameterizedReturnType(IType... typeParams)
- Specified by:
getParameterizedReturnType
in interfaceIGenericMethodInfo
-
getParameterizedParameterTypes
public IType[] getParameterizedParameterTypes(IType... typeParams)
- Specified by:
getParameterizedParameterTypes
in interfaceIGenericMethodInfo
-
getParameterizedParameterTypes2
public IType[] getParameterizedParameterTypes2(IType ownersType, IType... typeParams)
- Specified by:
getParameterizedParameterTypes2
in interfaceIGenericMethodInfo
-
inferTypeParametersFromArgumentTypes
public TypeVarToTypeMap inferTypeParametersFromArgumentTypes(IType... argTypes)
- Specified by:
inferTypeParametersFromArgumentTypes
in interfaceIGenericMethodInfo
- Parameters:
argTypes
- The argument types from a generic method call.- Returns:
- A map of inferred type parameters based on the argTypes. The map
contains only the types that could be inferred -- the map may be empty.
E.g.,
given generic method:
T[] toArray( T[] ) and call: list.toArray( new String[list.size()] ); => the toArray() method call should be automatically parameterized with based on the new String[0].
-
inferTypeParametersFromArgumentTypes2
public TypeVarToTypeMap inferTypeParametersFromArgumentTypes2(IType owningParameterizedType, IType... argTypes)
- Specified by:
inferTypeParametersFromArgumentTypes2
in interfaceIGenericMethodInfo
-
isCompileTimeConstantValue
public boolean isCompileTimeConstantValue()
- Specified by:
isCompileTimeConstantValue
in interfaceICompileTimeConstantValue
-
doCompileTimeEvaluation
public Object doCompileTimeEvaluation()
- Specified by:
doCompileTimeEvaluation
in interfaceICompileTimeConstantValue
-
getDescription
public String getDescription()
Description copied from interface:IFeatureInfo
A full description of this feature.- Specified by:
getDescription
in interfaceIFeatureInfo
- Overrides:
getDescription
in classBaseFeatureInfo
-
-