Class SimplePropertyAccessor<D extends BioPAXElement,R>

java.lang.Object
org.biopax.paxtools.controller.PropertyAccessorAdapter<D,R>
org.biopax.paxtools.controller.SimplePropertyAccessor<D,R>
All Implemented Interfaces:
PropertyAccessor<D,R>
Direct Known Subclasses:
AbstractPropertyEditor

public class SimplePropertyAccessor<D extends BioPAXElement,R> extends PropertyAccessorAdapter<D,R>
  • Field Details

    • getMethod

      protected final Method getMethod
      This variable stores the method to invoke for getting the value of the property on a given bean. In the case of multiple cardinality, this method is expected to return a Set otherwise an instance of PropertyAccessorAdapter.range
  • Constructor Details

    • SimplePropertyAccessor

      public SimplePropertyAccessor(Class<D> domain, Class<R> range, boolean multipleCardinality, Method getMethod)
  • Method Details

    • isMultipleCardinality

      protected static boolean isMultipleCardinality(Method getMethod)
    • getValueFromBean

      public Set<R> getValueFromBean(D bean) throws IllegalBioPAXArgumentException
      Returns the value of the bean using the default getMethod. If the value is unknown returns null or an empty set depending on the cardinality.
      Parameters:
      bean - the object whose property is requested
      Returns:
      an object as the value
      Throws:
      IllegalBioPAXArgumentException
    • isUnknown

      public boolean isUnknown(Object value)
      Checks if the value is unkown. In this context a value is regarded to be unknown if it is null (unset).
      Parameters:
      value - the value to be checked
      Returns:
      true if the value is unknown
    • toString

      public String toString()
      Overrides:
      toString in class Object