Package gw.internal.gosu.parser
Class BeanAccess
java.lang.Object
gw.internal.gosu.parser.BeanAccess
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
areBeansEqual
(Object bean1, Object bean2) Test for equality between two BeanType values.private static boolean
areObjectsLogicallyEqual
(IType lhsType, IType rhsType, Object lhsValue, Object rhsValue) static boolean
areValuesEqual
(Object lhsValue, Object rhsValue) Returns true if the values are logically equal, false otherwise.static MethodList
getMethods
(ITypeInfo beanInfo, IType whosaskin) static List<? extends IPropertyInfo>
getProperties
(ITypeInfo beanInfo, IType classBean) static IPropertyInfo
getProperty
(ITypeInfo beanInfo, IType classBean, String strMember) static IPropertyInfo
getPropertyInfo
(IType classBean, IType whosAskin, String strProperty, IFeatureFilter filter, ParserBase parser, IScriptabilityModifier scriptabilityConstraint) static IPropertyInfo
getPropertyInfo
(IType classBean, String strProperty, IFeatureFilter filter, ParserBase parser, IScriptabilityModifier scriptabilityConstraint) private static IPropertyInfo
getPropertyInfo_NoException
(IType classBean, IType whosAskin, String strProperty, IFeatureFilter filter, ParserBase parser, IScriptabilityModifier scriptabilityConstraint) static IPropertyInfo
getPropertyInfo_NoException
(IType classBean, String strProperty, IFeatureFilter filter, ParserBase parser, IScriptabilityModifier scriptabilityConstraint) static IPropertyInfo
getPropertyInfoDirectly
(IType classBean, String strProperty) Resolves the property directly, as if the type were requesting it, giving access to all propertiesstatic IPropertyInfo
getPropertyInfoDirectly_NoException
(IType classBean, String strProperty) Resolves the property directly, as if the type were requesting it, giving access to all propertiesstatic boolean
isBeanType
(IType typeSource) static boolean
isBoxedTypeFor
(IType primitiveType, IType boxedType) static boolean
isDescriptorHidden
(IAttributedFeatureInfo descriptor) Returns true if the method or property is hidden or otherwise not scriptable.private static boolean
isDimension
(IType intrType) static boolean
isNumericType
(IType intrType)
-
Constructor Details
-
BeanAccess
private BeanAccess()private to enforce singleton access.
-
-
Method Details
-
isDescriptorHidden
Returns true if the method or property is hidden or otherwise not scriptable. -
isBeanType
-
isNumericType
-
isDimension
-
isBoxedTypeFor
-
areValuesEqual
Returns true if the values are logically equal, false otherwise. Perform an equality comparison. Heuristics for evaluation follow:- If the LHS is a Number, coerce the RHS to a Number value and compare.
- If the LHS is a String, coerce the RHS to a String value and String compare.
- (Ditto for Boolean and DateTime).
- If the LHS is a Bean,
- If the RHS is a Bean, compare with equals().
- Otherwise, attempt to determine which operand is coercible to the other, coerce, and compare with equals().
- Otherwise, compare with equals().
-
areObjectsLogicallyEqual
-
areBeansEqual
Test for equality between two BeanType values. Note this method is not entirely appropriate for non-BeanType value i.e., it's not as intelligent as EqualityExpression comparing primitive types, TypeKeys, etc. Msotly this method is for handling conversion of KeyableBean and Key for comparison.- Parameters:
bean1
- A value having an IType of BeanTypebean2
- A value having an IType of BeanType- Returns:
- True if the beans are equal
-
getProperties
-
getMethods
-
getPropertyInfoDirectly
public static IPropertyInfo getPropertyInfoDirectly(IType classBean, String strProperty) throws ParseException Resolves the property directly, as if the type were requesting it, giving access to all properties- Throws:
ParseException
-
getPropertyInfo
public static IPropertyInfo getPropertyInfo(IType classBean, String strProperty, IFeatureFilter filter, ParserBase parser, IScriptabilityModifier scriptabilityConstraint) throws ParseException - Throws:
ParseException
-
getPropertyInfo
public static IPropertyInfo getPropertyInfo(IType classBean, IType whosAskin, String strProperty, IFeatureFilter filter, ParserBase parser, IScriptabilityModifier scriptabilityConstraint) throws ParseException - Throws:
ParseException
-
getPropertyInfoDirectly_NoException
public static IPropertyInfo getPropertyInfoDirectly_NoException(IType classBean, String strProperty) Resolves the property directly, as if the type were requesting it, giving access to all properties -
getPropertyInfo_NoException
public static IPropertyInfo getPropertyInfo_NoException(IType classBean, String strProperty, IFeatureFilter filter, ParserBase parser, IScriptabilityModifier scriptabilityConstraint) -
getPropertyInfo_NoException
private static IPropertyInfo getPropertyInfo_NoException(IType classBean, IType whosAskin, String strProperty, IFeatureFilter filter, ParserBase parser, IScriptabilityModifier scriptabilityConstraint) -
getProperty
-