public class FieldAccessor extends Object
|Modifier and Type||Method and Description|
public static Optional<Object> fieldFromBean(AnchorBean<?> bean, Field field) throws IllegalAccessException, BeanMisconfiguredException
bean- the bean
field- the field to retrieve a value from
Optional.empty()if it doesn't exist and the bean is marked as optional.
IllegalAccessException- if reflection tries to access a property it has no permissions for.
BeanMisconfiguredException- if no value exists for the field (and it's not marked as optional).
public static boolean isFieldAnnotatedAsOptional(Field field)
field- the field
Copyright © 2010–2021 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.