private boolean visitFields(final Object object) throws IllegalAccessException {
        boolean isObservableObject = false;
        for (final Field field : getInheritedFields(object.getClass())) {
            field.setAccessible(true);
            currentField = field;
            final Class<?> fieldClass = field.getType();

            if (!isObservableObject && classImplementsOrExtends(fieldClass, Property.class)) {
                startVisiting(object);
                isObservableObject = true;
            }

            if (classImplementsOrExtends(fieldClass, ListProperty.class)) {
                handle((ListProperty<?>) field.get(object));
            } else if (classImplementsOrExtends(fieldClass, SetProperty.class)) {
                handle((SetProperty<?>) field.get(object));
            } else if (classImplementsOrExtends(fieldClass, MapProperty.class)) {
                handle((MapProperty<?, ?>) field.get(object));
            } else if (classImplementsOrExtends(fieldClass, Property.class)) {
                handle((Property<?>) field.get(object));
            }
        }
        return isObservableObject;
    }
private boolean visitFields ( final Object object ) throws IllegalAccessException { boolean isObservableObject = false ; for ( final Field field : getInheritedFields ( object . getClass ( ) ) ) { field . setAccessible ( true ) ; currentField = field ; final Class < ? > fieldClass = field . getType ( ) ; if ( ! isObservableObject && classImplementsOrExtends ( fieldClass , Property . class ) ) { startVisiting ( object ) ; isObservableObject = true ; } if ( classImplementsOrExtends ( fieldClass , ListProperty . class ) ) { handle ( ( ListProperty < ? > ) field . get ( object ) ) ; } else if ( classImplementsOrExtends ( fieldClass , SetProperty . class ) ) { handle ( ( SetProperty < ? > ) field . get ( object ) ) ; } else if ( classImplementsOrExtends ( fieldClass , MapProperty . class ) ) { handle ( ( MapProperty < ? , ? > ) field . get ( object ) ) ; } else if ( classImplementsOrExtends ( fieldClass , Property . class ) ) { handle ( ( Property < ? > ) field . get ( object ) ) ; } } return isObservableObject ; }
@param object
The object which fields should be visited.
@return {@code true} when the object was a observable object, {@code false} when it was a simple object.
@throws SecurityException
If a {@link SecurityManager} is active and denies access to fields via reflection.
@throws IllegalAccessException
If access modifiers like {@code private} are enforced even when the model is accessed via reflection.