SimpleProperty withCovariant = property.addCovariantType(type); if (withCovariant == null) { if (property.getReadMethod() != null) { continue; if (type != property.getType() && property.getReadMethod() != null) { property = new SimpleProperty(name, type); properties.put(name, property); property.setReadMethod(method); if (type != property.getType() || property.getReadMethod() != null) { continue; property = new SimpleProperty(name, type); properties.put(name, property); property.setReadMethod(method); if (properties.containsKey(name)) { property = (SimpleProperty) properties.get(name); SimpleProperty withCovariant = property.addCovariantType(type); if (withCovariant == null) { if (property.getWriteMethod() != null) { continue; if (type != property.getType() && property.getWriteMethod() != null) {
public String toString() { String str = "BeanProperty{name=" + getName() + ", type=" + getType().getName(); Class[] covariantTypes = getCovariantTypes(); if (covariantTypes.length > 0) { str = str + ", covariantTypes=" + Arrays.toString(covariantTypes); } return str + '}'; }
SimpleProperty withCovariant = property.addCovariantType(type); if (withCovariant == null) { if (property.getReadMethod() != null) { continue; if (type != property.getType() && property.getReadMethod() != null) { property = new SimpleProperty(name, type); properties.put(name, property); property.setReadMethod(method); if (type != property.getType() || property.getReadMethod() != null) { continue; property = new SimpleProperty(name, type); properties.put(name, property); property.setReadMethod(method); if (properties.containsKey(name)) { property = (SimpleProperty) properties.get(name); SimpleProperty withCovariant = property.addCovariantType(type); if (withCovariant == null) { if (property.getWriteMethod() != null) { continue; if (type != property.getType() && property.getWriteMethod() != null) {
/** * @return null if no change */ SimpleProperty addCovariantType(Class type) { if (mType == type) { return null; } for (Class covariant : mCovariantTypes) { if (covariant == type) { return null; } } // Find most specialized type. Class newType = mType; if (mType.isAssignableFrom(type)) { newType = type; } for (Class covariant : mCovariantTypes) { if (covariant.isAssignableFrom(type)) { newType = type; } } Class[] newCovariant = new Class[1 + mCovariantTypes.length]; System.arraycopy(mCovariantTypes, 0, newCovariant, 1, mCovariantTypes.length); newCovariant[0] = newType == mType ? type : mType; SimpleProperty property = new SimpleProperty(mName, newType, newCovariant); property.mReadMethod = mReadMethod; property.mWriteMethod = mWriteMethod; return property; }
public String toString() { String str = "BeanProperty{name=" + getName() + ", type=" + getType().getName(); Class[] covariantTypes = getCovariantTypes(); if (covariantTypes.length > 0) { str = str + ", covariantTypes=" + Arrays.toString(covariantTypes); } return str + '}'; }
IndexedProperty addCovariantType(Class type) { SimpleProperty property = super.addCovariantType(type); if (property == null) { return null; } IndexedProperty ix = new IndexedProperty(property); ix.mIndexedReadMethods = mIndexedReadMethods; ix.mIndexedWriteMethods = mIndexedWriteMethods; return ix; }
/** * @return null if no change */ SimpleProperty addCovariantType(Class type) { if (mType == type) { return null; } for (Class covariant : mCovariantTypes) { if (covariant == type) { return null; } } // Find most specialized type. Class newType = mType; if (mType.isAssignableFrom(type)) { newType = type; } for (Class covariant : mCovariantTypes) { if (covariant.isAssignableFrom(type)) { newType = type; } } Class[] newCovariant = new Class[1 + mCovariantTypes.length]; System.arraycopy(mCovariantTypes, 0, newCovariant, 1, mCovariantTypes.length); newCovariant[0] = newType == mType ? type : mType; SimpleProperty property = new SimpleProperty(mName, newType, newCovariant); property.mReadMethod = mReadMethod; property.mWriteMethod = mWriteMethod; return property; }
IndexedProperty addCovariantType(Class type) { SimpleProperty property = super.addCovariantType(type); if (property == null) { return null; } IndexedProperty ix = new IndexedProperty(property); ix.mIndexedReadMethods = mIndexedReadMethods; ix.mIndexedWriteMethods = mIndexedWriteMethods; return ix; }