Search in sources :

Example 11 with IdentitySet

use of com.canoo.dp.impl.platform.core.IdentitySet in project dolphin-platform by canoo.

the class GarbageCollector method getAllProperties.

private IdentitySet<Property> getAllProperties(Object bean) {
    IdentitySet<Property> ret = new IdentitySet<>();
    List<Field> fields = propertyFieldCache.get(bean.getClass());
    if (fields == null) {
        fields = new ArrayList<>();
        for (Field field : ReflectionHelper.getInheritedDeclaredFields(bean.getClass())) {
            if (Property.class.isAssignableFrom(field.getType())) {
                fields.add(field);
            }
        }
        propertyFieldCache.put(bean.getClass(), fields);
    }
    for (Field field : fields) {
        ret.add((Property) ReflectionHelper.getPrivileged(field, bean));
    }
    return ret;
}
Also used : Field(java.lang.reflect.Field) IdentitySet(com.canoo.dp.impl.platform.core.IdentitySet) Property(com.canoo.platform.remoting.Property)

Aggregations

IdentitySet (com.canoo.dp.impl.platform.core.IdentitySet)11 Date (java.util.Date)9 Test (org.testng.annotations.Test)9 Field (java.lang.reflect.Field)2 ObservableList (com.canoo.platform.remoting.ObservableList)1 Property (com.canoo.platform.remoting.Property)1 ArrayList (java.util.ArrayList)1