Package gw.internal.gosu.parser
Class BeanAccess
- java.lang.Object
-
- gw.internal.gosu.parser.BeanAccess
-
public class BeanAccess extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
areBeansEqual(Object bean1, Object bean2)
Test for equality between two BeanType values.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)
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.static boolean
isNumericType(IType intrType)
-
-
-
Method Detail
-
isDescriptorHidden
public static boolean isDescriptorHidden(IAttributedFeatureInfo descriptor)
Returns true if the method or property is hidden or otherwise not scriptable.
-
isBeanType
public static boolean isBeanType(IType typeSource)
-
isNumericType
public static boolean isNumericType(IType intrType)
-
areValuesEqual
public static boolean areValuesEqual(Object lhsValue, Object rhsValue)
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().
-
areBeansEqual
public static boolean areBeansEqual(Object bean1, Object bean2)
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
public static List<? extends IPropertyInfo> getProperties(ITypeInfo beanInfo, IType classBean)
-
getMethods
public static MethodList getMethods(ITypeInfo beanInfo, IType whosaskin)
-
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)
-
getProperty
public static IPropertyInfo getProperty(ITypeInfo beanInfo, IType classBean, String strMember)
-
-