Class ObjectPropertyEditor<D extends BioPAXElement,R extends BioPAXElement>

All Implemented Interfaces:
PropertyAccessor<D,R>, PropertyEditor<D,R>

public class ObjectPropertyEditor<D extends BioPAXElement,R extends BioPAXElement> extends AbstractPropertyEditor<D,R>
Provides an editor for all object value types, e.g. everything other than Primitive, ENUM, and String.
  • Constructor Details

    • ObjectPropertyEditor

      public ObjectPropertyEditor(String property, Method getMethod, Class<D> domain, Class<R> range, boolean multipleCardinality)
      Full constructor.
      Parameters:
      property - Name of the property, e.g. entityReference.
      getMethod - A "Method" class that represents the getter method. e.g. getEntityReference()
      domain - name of the domain of this property. e.g. PhysicalEntity
      range - name of the range of this property. e.g. EntityReference.
      multipleCardinality - false if this property is functional, e.g. many-to-one or one-to-one.
  • Method Details

    • getRestrictedRanges

      public Map<Class<? extends BioPAXElement>,Set<Class<? extends BioPAXElement>>> getRestrictedRanges()
    • isCompleteForward

      public boolean isCompleteForward()
    • isCompleteBackward

      public boolean isCompleteBackward()
    • isInverseMultipleCardinality

      public boolean isInverseMultipleCardinality()
    • getInverseGetMethod

      public Method getInverseGetMethod()
    • getInverseAccessor

      public PropertyAccessor<R,? super D> getInverseAccessor()
    • toString

      public String toString()
      Specified by:
      toString in interface PropertyEditor<D extends BioPAXElement,R extends BioPAXElement>
      Overrides:
      toString in class AbstractPropertyEditor<D extends BioPAXElement,R extends BioPAXElement>
    • addRangeRestriction

      public void addRangeRestriction(Class<? extends BioPAXElement> domain, Set<Class<? extends BioPAXElement>> ranges)
      This method adds a range restriction to the property editor. e.g. All entityReferences of Proteins should be ProteinReferences. Note: All restrictions specified in the BioPAX specification is automatically created by the EditorMap during initialization. Use this method if you need to add restrictions that are not specified in the model.
      Parameters:
      domain - subdomain of the property to be restricted
      ranges - valid ranges for this subdomain.
    • setRangeRestriction

      public void setRangeRestriction(Map<Class<? extends BioPAXElement>,Set<Class<? extends BioPAXElement>>> restrictedRanges)
      This method sets all range restrictions. Note: All restrictions specified in the BioPAX specification is automatically created by the EditorMap during initialization. Use this method if you need to add restrictions that are not specified in the model.
      Parameters:
      restrictedRanges - a set of range restrictions specified as a map.
    • checkRestrictions

      protected void checkRestrictions(R value, D bean)
      Description copied from class: AbstractPropertyEditor
      Checks if the bean and the value are consistent with the cardinality rules of the model. This method is important for validations.
      Overrides:
      checkRestrictions in class AbstractPropertyEditor<D extends BioPAXElement,R extends BioPAXElement>
      Parameters:
      value - Value that is related to the object
      bean - Object that is related to the value
    • getRestrictedRangesFor

      public Set<Class<? extends BioPAXElement>> getRestrictedRangesFor(Class<? extends D> restrictedDomain)
      Parameters:
      restrictedDomain - a subdomain that is restricted.
      Returns:
      the range restrictions for the given subdomain for this propertyEditor.
    • hasInverseLink

      public boolean hasInverseLink()
      Returns:
      true iff this property has a defined inverse link in paxtools.
    • findInverseGetMethod

      protected Method findInverseGetMethod()
      Returns:
      the inverse get method for this property. If the property for this editor is entityReference this method will return a Method instance that represents .EntityReference#getEntityReferenceOf().