/** * Test if a value is decodable to the same type. * Works for basic (final) types only and checks if the * two types are of same class. */ protected boolean isDecodableToSameType(Object property, Object value, IContext context) { boolean ret = true; if(value!=null) { OAVAttributeType attr = (OAVAttributeType)property; ret = value.getClass().equals(((OAVJavaType)attr.getType()).getClazz()); } return ret; } }
/** * Test if a value is decodable to the same type. * Works for basic (final) types only and checks if the * two types are of same class. */ protected boolean isDecodableToSameType(Object property, Object value, IContext context) { boolean ret = true; if(value!=null) { OAVAttributeType attr = (OAVAttributeType)property; ret = value.getClass().equals(((OAVJavaType)attr.getType()).getClazz()); } return ret; } }
/** * Test if this object is same type or subtype of this type. * @param object The object to test. * @return True, if object is same type or subtype. */ public boolean isSubtype(OAVObjectType type) { return type instanceof OAVJavaType ? SReflect.isSupertype(((OAVJavaType)type).getClazz(), clazz) : super.isSubtype(type); }
/** * Test if a value is a basic type. */ protected boolean isBasicType(Object property, Object value) { OAVObjectType atype = ((OAVAttributeType)property).getType(); return atype instanceof OAVJavaType && BasicTypeConverter.isBuiltInType(((OAVJavaType)atype).getClazz()); }
/** * Test if a value is a basic type. */ protected boolean isBasicType(Object property, Object value) { OAVObjectType atype = ((OAVAttributeType)property).getType(); return atype instanceof OAVJavaType && BasicTypeConverter.isBuiltInType(((OAVJavaType)atype).getClazz()); }
/** * Test if this object is same type or subtype of this type. * @param object The object to test. * @return True, if object is same type or subtype. */ public boolean isSubtype(OAVObjectType type) { return type instanceof OAVJavaType ? SReflect.isSupertype(((OAVJavaType)type).getClazz(), clazz) : super.isSubtype(type); }
/** * Test for equality. * @return True, if equal. */ public boolean equals(Object obj) { boolean ret = this==obj; if(!ret && obj!=null && obj.getClass().equals(this.getClass())) { OAVJavaAttributeType attr = (OAVJavaAttributeType)obj; if(SUtil.equals(name, attr.getName())) { Class clazz1 = ((OAVJavaType)otype).getClazz(); Class clazz2 = ((OAVJavaType)attr.getObjectType()).getClazz(); ret = SReflect.isSupertype(clazz1, clazz2) || SReflect.isSupertype(clazz2, clazz1); } } return ret; }
/** * Test for equality. * @return True, if equal. */ public boolean equals(Object obj) { boolean ret = this==obj; if(!ret && obj!=null && obj.getClass().equals(this.getClass())) { OAVJavaAttributeType attr = (OAVJavaAttributeType)obj; if(SUtil.equals(name, attr.getName())) { Class clazz1 = ((OAVJavaType)otype).getClazz(); Class clazz2 = ((OAVJavaType)attr.getObjectType()).getClazz(); ret = SReflect.isSupertype(clazz1, clazz2) || SReflect.isSupertype(clazz2, clazz1); } } return ret; }
Class clazz = ((OAVJavaType)ret).getClazz(); for(int j=1; j<i; j++) clazz = clazz.getComponentType();
Class clazz = ((OAVJavaType)ret).getClazz(); for(int j=1; j<i; j++) clazz = clazz.getComponentType();
Class clazz = ((OAVJavaType)otype).getClazz(); Field f = clazz.getField(field.getText()); exp = new LiteralExpression(f.get(null));
Class clazz = ((OAVJavaType)otype).getClazz(); Field f = clazz.getField(field.getText()); exp = new LiteralExpression(f.get(null));
&& BasicTypeConverter.isBuiltInType(((OAVJavaType)state.getType(elem)).getClazz())))
&& BasicTypeConverter.isBuiltInType(((OAVJavaType)state.getType(elem)).getClazz())))