Interface PropertyEditor<D extends BioPAXElement,R>

All Superinterfaces:
PropertyAccessor<D,R>
All Known Subinterfaces:
DataPropertyEditor<D,R>
All Known Implementing Classes:
AbstractPropertyEditor, EnumeratedPropertyEditor, ObjectPropertyEditor, PrimitivePropertyEditor, StringPropertyEditor

public interface PropertyEditor<D extends BioPAXElement,R> extends PropertyAccessor<D,R>
  • Method Details

    • toString

      String toString()
      Overrides:
      toString in class Object
    • getAddMethod

      Method getAddMethod()
      Returns:
      the add method.
    • getGetMethod

      Method getGetMethod()
      Returns:
      the get method
    • getProperty

      String getProperty()
      Returns:
      the proterty name as a string
    • getRemoveMethod

      Method getRemoveMethod()
      Returns:
      the remove method
    • getSetMethod

      Method getSetMethod()
      Returns:
      the set method
    • addMaxCardinalityRestriction

      void addMaxCardinalityRestriction(Class<? extends D> domain, int max)
      Sets a maximum cardinality for a domain.
      Parameters:
      domain - domain on which restriction will be set
      max - cardinality
      See Also:
    • getMaxCardinality

      Integer getMaxCardinality(Class<? extends D> restrictedDomain)
      Return the maximum cardinality that is defined for the property to which editor is belong.
      Parameters:
      restrictedDomain - domain to be checked for the cardinality
      Returns:
      an integer indicating the maximum cardinality
    • getUnknown

      R getUnknown()
      Gets the unknown value. In an object property or enumeration context a value is regarded to be unknown if it is null (unset); in a primitive property context it depends (can be e.g., BioPAXElement.UNKNOWN_FLOAT)
      Returns:
      null or what it means that the property value is unknown
    • removeValueFromBean

      void removeValueFromBean(R value, D bean)
      Removes the value from the bean using the default removeMethod, if such method is defined (i.e., it's a multiple cardinality property), otherwise sets unknown value using setValueToBean(Object, org.biopax.paxtools.model.BioPAXElement) (but only if )
      Parameters:
      value - to be removed from the bean
      bean - bean from which the value is going to be removed
    • removeValueFromBean

      void removeValueFromBean(Set<R> values, D bean)
      Removes the values from the bean using the removeValueFromBean(Object, org.biopax.paxtools.model.BioPAXElement) for each value in the set.
      Parameters:
      values - to be removed from the bean
      bean - bean from which the value is going to be removed
    • setValueToBean

      void setValueToBean(R value, D bean)
      Sets the value to the bean using the default setMethod if value is not null.
      Parameters:
      value - to be set to the bean
      bean - to which the value is to be set
    • setValueToBean

      void setValueToBean(Set<R> values, D bean)
    • getPrimarySetMethod

      Method getPrimarySetMethod()
      Returns the primary set method of the editor. It is the setMethod for a property of single cardinality, and the addMethod method for a property of multiple cardinality.
      Returns:
      the method to be primarily used for setting a value to an object.