@Test public void testIsPushable_WithReadAndWriteNoBoundObject() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> null, TestPMO.PROPERTY_PMO_PROP, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_PMO_PROP)); assertThat(dispatcher.isPushable(Aspect.of("", "something")), is(false)); }
@Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) && hasWriteMethod(propertyAspectName)) || (!hasReadMethod(propertyAspectName) && fallbackDispatcher.isPushable(aspect)); } else { return hasInvokeMethod(propertyAspectName) || fallbackDispatcher.isPushable(aspect); } }
ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) && hasWriteMethod(propertyAspectName)) || (!hasReadMethod(propertyAspectName) && fallbackDispatcher.isPushable(aspect)); } else { return hasInvokeMethod(propertyAspectName) || fallbackDispatcher.isPushable(aspect); } } }
ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) && hasWriteMethod(propertyAspectName)) || (!hasReadMethod(propertyAspectName) && fallbackDispatcher.isPushable(aspect)); } else { return hasInvokeMethod(propertyAspectName) || fallbackDispatcher.isPushable(aspect); } } ReflectionPropertyDispatcher(Supplier<?> boundObjectSupplier, String property,
            PropertyDispatcher fallbackDispatcher); }
ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) && hasWriteMethod(propertyAspectName)) || (!hasReadMethod(propertyAspectName) && fallbackDispatcher.isPushable(aspect)); } else { return hasInvokeMethod(propertyAspectName) || fallbackDispatcher.isPushable(aspect); } } ReflectionPropertyDispatcher(Supplier<?> boundObjectSupplier, String property,
            PropertyDispatcher fallbackDispatcher); @Override String getProperty(); @CheckForNull @Override Object getBoundObject(); @Override Class<?> getValueClass(); @Override @SuppressWarnings("unchecked") V pull(Aspect<V> aspect); @Override void push(Aspect<V> aspect); @Override boolean isPushable(Aspect<V> aspect); @Override MessageList getMessages(MessageList messageList); @Override String toString(); }
ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) && hasWriteMethod(propertyAspectName)) || (!hasReadMethod(propertyAspectName) && fallbackDispatcher.isPushable(aspect)); } else { return hasInvokeMethod(propertyAspectName) || fallbackDispatcher.isPushable(aspect); } } ReflectionPropertyDispatcher(Supplier<?> boundObjectSupplier, String property,
            PropertyDispatcher fallbackDispatcher); @Override String getProperty(); @CheckForNull @Override Object getBoundObject(); @Override Class<?> getValueClass(); @Override @SuppressWarnings("unchecked") V pull(Aspect<V> aspect); @Override void push(Aspect<V> aspect); @Override boolean isPushable(Aspect<V> aspect); @Override MessageList getMessages(MessageList messageList); @Override String toString();  }