/** * Return the offset that the first meaningful accessor parameter is at. */ private int getAccessorParameterOffset() { return (_meta.getAccessType() == ClassMetaData.ACCESS_FIELD) ? 1 : 0; }
/** * If using property access, see if there is a different backing field * name for the persistent attribute <code>name</code>. */ private String toBackingFieldName(String name) { if (_meta.getAccessType() == ClassMetaData.ACCESS_PROPERTY && _attrsToFields != null && _attrsToFields.containsKey(name)) name = (String) _attrsToFields.get(name); return name; }
public static boolean isProperty(ClassMetaData meta) { return isProperty(meta.getAccessType()); }
public static boolean isProperty(ClassMetaData meta) { return isProperty(meta.getAccessType()); }
public static boolean isField(ClassMetaData meta) { return isField(meta.getAccessType()); }
public static boolean isEmpty(ClassMetaData meta) { return isEmpty(meta.getAccessType()); }
/** * Affirms if the given class is using field-based access. */ boolean isPropertyAccess(ClassMetaData meta) { return meta != null && (meta.isMixedAccess() || AccessCode.isProperty(meta.getAccessType())); }
/** * Affirms if the given class is using field-based access. */ boolean isPropertyAccess(ClassMetaData meta) { return meta != null && (meta.isMixedAccess() || AccessCode.isProperty(meta.getAccessType())); }
/** * Affirms if the given class is using field-based access. */ boolean isPropertyAccess(ClassMetaData meta) { return meta != null && (meta.isMixedAccess() || AccessCode.isProperty(meta.getAccessType())); }
/** * Affirms if the given class is using field-based access. */ boolean isPropertyAccess(ClassMetaData meta) { return meta != null && (meta.isMixedAccess() || AccessCode.isProperty(meta.getAccessType())); }
/** * Gets the access type used by this field. If no access type is set for * this field then return the access type used by the declaring class. */ public int getAccessType() { if (AccessCode.isUnknown(_access)) { int fCode = AccessCode.toFieldCode(getDeclaringMetaData() .getAccessType()); return fCode; } return _access; }
/** * Gets the access type used by this field. If no access type is set for * this field then return the access type used by the declaring class. */ public int getAccessType() { if (AccessCode.isUnknown(_access)) { int fCode = AccessCode.toFieldCode(getDeclaringMetaData() .getAccessType()); return fCode; } return _access; }
/** * Gets the access type used by this field. If no access type is set for * this field then return the access type used by the declaring class. */ public int getAccessType() { if (AccessCode.isUnknown(_access)) { int fCode = AccessCode.toFieldCode(getDeclaringMetaData() .getAccessType()); return fCode; } return _access; }
/** * Gets the access type used by this field. If no access type is set for * this field then return the access type used by the declaring class. */ public int getAccessType() { if (AccessCode.isUnknown(_access)) { int fCode = AccessCode.toFieldCode(getDeclaringMetaData() .getAccessType()); return fCode; } return _access; }
/** * Add the {@link Instruction}s to load the instance to modify onto the * stack, and return it. If <code>forStatic</code> is set, then * <code>code</code> is in an accessor method or another static method; * otherwise, it is in one of the PC-specified methods. * * @return the first instruction added to <code>code</code>. */ private Instruction loadManagedInstance(Code code, boolean forStatic) { if (_meta.getAccessType() == ClassMetaData.ACCESS_FIELD && forStatic) return code.aload().setParam(0); return code.aload().setThis(); }
public static int mergeFieldCode(ClassMetaData meta, FieldMetaData fmd, int fCode) { int cCode = meta.getAccessType(); try { return mergeFieldCode(cCode, fCode); } catch (IllegalStateException e) { throw new UserException(_loc.get("access-illegal-merge", fmd.getFullName(false), toFieldString(fCode), toClassString(cCode))); } }
public static int mergeFieldCode(ClassMetaData meta, FieldMetaData fmd, int fCode) { int cCode = meta.getAccessType(); try { return mergeFieldCode(cCode, fCode); } catch (IllegalStateException e) { throw new UserException(_loc.get("access-illegal-merge", fmd.getFullName(false), toFieldString(fCode), toClassString(cCode))); } }
public static int mergeFieldCode(ClassMetaData meta, FieldMetaData fmd, int fCode) { int cCode = meta.getAccessType(); try { return mergeFieldCode(cCode, fCode); } catch (IllegalStateException e) { throw new UserException(_loc.get("access-illegal-merge", fmd.getFullName(false), toFieldString(fCode), toClassString(cCode))); } }
public static int mergeFieldCode(ClassMetaData meta, FieldMetaData fmd, int fCode) { int cCode = meta.getAccessType(); try { return mergeFieldCode(cCode, fCode); } catch (IllegalStateException e) { throw new UserException(_loc.get("access-illegal-merge", fmd.getFullName(false), toFieldString(fCode), toClassString(cCode))); } }
private Object getValue(int i, Object o) { if (meta.getAccessType() == ClassMetaData.ACCESS_PROPERTY) { Field field = Reflection.findField(meta.getDescribedType(), toFieldName(i), true); return Reflection.get(o, field); } else { Field field = (Field) meta.getField(i).getBackingMember(); return Reflection.get(o, field); } }