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 Modifier and Type Class Description private classGosuVarPropertyInfo.VarPropertyAccessor-
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 Modifier and Type Field Description private IPropertyAccessor_accessorprivate IType_actualTypeprivate boolean_bInternalprivate boolean_bPrivateprivate boolean_bProtectedprivate boolean_bPublicprivate boolean_bStaticprivate java.lang.String_fullDescriptionprivate IGosuClass_gosuClassprivate boolean_hasPropertyprivate int_iOffsetprivate boolean_isFinalprivate boolean_isScopedFieldprivate int_modifiersprivate java.lang.String_strIdentiferprivate java.lang.String_symbolAttributeNameprivate java.lang.String_symbolScopeStringprivate IType_symbolType-
Fields inherited from class gw.internal.gosu.parser.GosuBaseAttributedFeatureInfo
_declaredAnnotations
-
Fields inherited from interface gw.lang.reflect.IAnnotatedFeatureInfo
ANNOTATION_HELPER
-
-
Constructor Summary
Constructors Constructor Description GosuVarPropertyInfo(GosuClassTypeInfo container, GosuVarPropertyInfo pi)GosuVarPropertyInfo(IFeatureInfo container, IVarStatement varStmt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITypeassignActualType(IType type)voidassignSymbolType(IType type)java.lang.ObjectdoCompileTimeEvaluation()IPropertyAccessorgetAccessor()private ExpressiongetCompileTimeConstantExpression()java.lang.StringgetDescription()A full description of this feature.ITypegetFeatureType()The type of this feature e.g., for a property this is the property's type.protected java.util.List<IGosuAnnotation>getGosuAnnotations()java.lang.StringgetName()Gets the programmatic name or identifier of this feature.intgetOffset()IType[]getParameterizedParameterTypes(IType... typeParams)IType[]getParameterizedParameterTypes2(IType ownersType, IType... typeParams)ITypegetParameterizedReturnType(IType... typeParams)IPresentationInfogetPresentationInfo()ITypegetScopedSymbolType()java.lang.StringgetSymbolAttributeName()java.lang.StringgetSymbolScopeString()GenericTypeVariable[]getTypeVariables()booleanhasDeclaredProperty()TypeVarToTypeMapinferTypeParametersFromArgumentTypes(IType... argTypes)TypeVarToTypeMapinferTypeParametersFromArgumentTypes2(IType owningParameterizedType, IType... argTypes)booleanisCompileTimeConstantValue()booleanisFinal()booleanisInternal()True if this feature is internal.booleanisPrivate()True if this feature is private.booleanisProtected()True if this feature is protected.booleanisPublic()True if this feature is public.booleanisReadable()booleanisReified()booleanisScopedField()booleanisStatic()True if this feature is static, meaning the feature is not specific to a particular instance of the feature's containing type.booleanisWritable()booleanisWritable(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
-
-
-
-
Field Detail
-
_strIdentifer
private java.lang.String _strIdentifer
-
_actualType
private IType _actualType
-
_bStatic
private boolean _bStatic
-
_bPublic
private boolean _bPublic
-
_bProtected
private boolean _bProtected
-
_bInternal
private boolean _bInternal
-
_bPrivate
private boolean _bPrivate
-
_iOffset
private int _iOffset
-
_accessor
private IPropertyAccessor _accessor
-
_fullDescription
private java.lang.String _fullDescription
-
_hasProperty
private boolean _hasProperty
-
_isScopedField
private boolean _isScopedField
-
_gosuClass
private IGosuClass _gosuClass
-
_isFinal
private boolean _isFinal
-
_symbolType
private IType _symbolType
-
_symbolScopeString
private java.lang.String _symbolScopeString
-
_symbolAttributeName
private java.lang.String _symbolAttributeName
-
_modifiers
private int _modifiers
-
-
Constructor Detail
-
GosuVarPropertyInfo
GosuVarPropertyInfo(IFeatureInfo container, IVarStatement varStmt)
-
GosuVarPropertyInfo
public GosuVarPropertyInfo(GosuClassTypeInfo container, GosuVarPropertyInfo pi)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:IFeatureInfoGets 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:
getNamein interfaceIFeatureInfo
-
getFeatureType
public IType getFeatureType()
Description copied from interface:IIntrinsicTypeReferenceThe type of this feature e.g., for a property this is the property's type.- Specified by:
getFeatureTypein interfaceIIntrinsicTypeReference
-
isStatic
public boolean isStatic()
Description copied from interface:IAttributedFeatureInfoTrue if this feature is static, meaning the feature is not specific to a particular instance of the feature's containing type.- Specified by:
isStaticin interfaceIAttributedFeatureInfo
-
isPrivate
public boolean isPrivate()
Description copied from interface:IAttributedFeatureInfoTrue if this feature is private. Private features are only accessible from within the type that owns them.- Specified by:
isPrivatein interfaceIAttributedFeatureInfo- Overrides:
isPrivatein classBaseFeatureInfo
-
isInternal
public boolean isInternal()
Description copied from interface:IAttributedFeatureInfoTrue 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:
isInternalin interfaceIAttributedFeatureInfo- Overrides:
isInternalin classBaseFeatureInfo
-
isProtected
public boolean isProtected()
Description copied from interface:IAttributedFeatureInfoTrue if this feature is protected. Protected features are accessible from within the type that owns them and from derived containers.- Specified by:
isProtectedin interfaceIAttributedFeatureInfo- Overrides:
isProtectedin classBaseFeatureInfo
-
isFinal
public boolean isFinal()
- Specified by:
isFinalin interfaceIAttributedFeatureInfo- Overrides:
isFinalin classBaseFeatureInfo
-
isReified
public boolean isReified()
- Specified by:
isReifiedin interfaceIAttributedFeatureInfo- Overrides:
isReifiedin classBaseFeatureInfo
-
isPublic
public boolean isPublic()
Description copied from interface:IAttributedFeatureInfoTrue if this feature is public. Public features are not restricted.- Specified by:
isPublicin interfaceIAttributedFeatureInfo- Overrides:
isPublicin classBaseFeatureInfo
-
getGosuAnnotations
protected java.util.List<IGosuAnnotation> getGosuAnnotations()
- Specified by:
getGosuAnnotationsin classGosuBaseAttributedFeatureInfo
-
isReadable
public boolean isReadable()
- Specified by:
isReadablein interfaceIPropertyInfo- Returns:
- true if the property is readable given the visibility constraint passed in, false otherwise.
-
isWritable
public boolean isWritable(IType whosAskin)
- Specified by:
isWritablein 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:
isWritablein interfaceIPropertyInfo- Returns:
- True if the property is writable given the visibility constraint passed in, false otherwise.
-
getOffset
public int getOffset()
- Specified by:
getOffsetin interfaceIGosuVarPropertyInfo
-
getAccessor
public IPropertyAccessor getAccessor()
- Specified by:
getAccessorin interfaceIPropertyInfo- Returns:
- the PropertyAccessor (for getting and setting) this property.
-
getPresentationInfo
public IPresentationInfo getPresentationInfo()
- Specified by:
getPresentationInfoin interfaceIPropertyInfo
-
assignActualType
public IType assignActualType(IType type)
- Specified by:
assignActualTypein interfaceIGosuVarPropertyInfo
-
assignSymbolType
public void assignSymbolType(IType type)
- Specified by:
assignSymbolTypein interfaceIGosuVarPropertyInfo
-
hasDeclaredProperty
public boolean hasDeclaredProperty()
- Specified by:
hasDeclaredPropertyin interfaceIGosuVarPropertyInfo
-
isScopedField
public boolean isScopedField()
- Specified by:
isScopedFieldin interfaceIGosuVarPropertyInfo
-
getScopedSymbolType
public IType getScopedSymbolType()
- Specified by:
getScopedSymbolTypein interfaceIGosuVarPropertyInfo
-
getSymbolScopeString
public java.lang.String getSymbolScopeString()
- Specified by:
getSymbolScopeStringin interfaceIGosuVarPropertyInfo
-
getSymbolAttributeName
public java.lang.String getSymbolAttributeName()
- Specified by:
getSymbolAttributeNamein interfaceIGosuVarPropertyInfo
-
getTypeVariables
public GenericTypeVariable[] getTypeVariables()
- Specified by:
getTypeVariablesin interfaceIGenericMethodInfo- Returns:
- An array of generic type variables if this feature corresponds with a generic type.
-
getParameterizedReturnType
public IType getParameterizedReturnType(IType... typeParams)
- Specified by:
getParameterizedReturnTypein interfaceIGenericMethodInfo
-
getParameterizedParameterTypes
public IType[] getParameterizedParameterTypes(IType... typeParams)
- Specified by:
getParameterizedParameterTypesin interfaceIGenericMethodInfo
-
getParameterizedParameterTypes2
public IType[] getParameterizedParameterTypes2(IType ownersType, IType... typeParams)
- Specified by:
getParameterizedParameterTypes2in interfaceIGenericMethodInfo
-
inferTypeParametersFromArgumentTypes
public TypeVarToTypeMap inferTypeParametersFromArgumentTypes(IType... argTypes)
- Specified by:
inferTypeParametersFromArgumentTypesin 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:
inferTypeParametersFromArgumentTypes2in interfaceIGenericMethodInfo
-
isCompileTimeConstantValue
public boolean isCompileTimeConstantValue()
- Specified by:
isCompileTimeConstantValuein interfaceICompileTimeConstantValue
-
doCompileTimeEvaluation
public java.lang.Object doCompileTimeEvaluation()
- Specified by:
doCompileTimeEvaluationin interfaceICompileTimeConstantValue
-
getCompileTimeConstantExpression
private Expression getCompileTimeConstantExpression()
-
getDescription
public java.lang.String getDescription()
Description copied from interface:IFeatureInfoA full description of this feature.- Specified by:
getDescriptionin interfaceIFeatureInfo- Overrides:
getDescriptionin classBaseFeatureInfo
-
-