Package org.biopax.paxtools.controller
Class ObjectPropertyEditor<D extends BioPAXElement,R extends BioPAXElement>
java.lang.Object
org.biopax.paxtools.controller.PropertyAccessorAdapter<D,R>
org.biopax.paxtools.controller.SimplePropertyAccessor<D,R>
org.biopax.paxtools.controller.AbstractPropertyEditor<D,R>
org.biopax.paxtools.controller.ObjectPropertyEditor<D,R>
- 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.
-
Field Summary
Fields inherited from class org.biopax.paxtools.controller.AbstractPropertyEditor
addMethod, checkRestrictions, log, property, removeMethod, setMethodFields inherited from class org.biopax.paxtools.controller.SimplePropertyAccessor
getMethodFields inherited from class org.biopax.paxtools.controller.PropertyAccessorAdapter
domain, multipleCardinality, range -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRangeRestriction(Class<? extends BioPAXElement> domain, Set<Class<? extends BioPAXElement>> ranges) This method adds a range restriction to the property editor.protected voidcheckRestrictions(R value, D bean) Checks if the bean and the value are consistent with the cardinality rules of the model.protected MethodPropertyAccessor<R,? super D> Map<Class<? extends BioPAXElement>,Set<Class<? extends BioPAXElement>>> Set<Class<? extends BioPAXElement>>getRestrictedRangesFor(Class<? extends D> restrictedDomain) booleanbooleanbooleanbooleanvoidsetRangeRestriction(Map<Class<? extends BioPAXElement>, Set<Class<? extends BioPAXElement>>> restrictedRanges) This method sets all range restrictions.toString()Methods inherited from class org.biopax.paxtools.controller.AbstractPropertyEditor
addMaxCardinalityRestriction, createPropertyEditor, detectRange, getAddMethod, getGetMethod, getMaxCardinality, getPrimarySetMethod, getProperty, getRemoveMethod, getSetMethod, getUnknown, invokeMethod, isInstanceOfAtLeastOne, parseValueFromString, removeValueFromBean, removeValueFromBean, setValueToBean, setValueToBeanMethods inherited from class org.biopax.paxtools.controller.SimplePropertyAccessor
getValueFromBean, isMultipleCardinality, isUnknownMethods inherited from class org.biopax.paxtools.controller.PropertyAccessorAdapter
getDomain, getRange, getValueFromBeans, isMultipleCardinalityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biopax.paxtools.controller.PropertyAccessor
getDomain, getRange, getValueFromBean, getValueFromBeans, isMultipleCardinality, isUnknown
-
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. PhysicalEntityrange- 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
-
getInverseAccessor
-
toString
- Specified by:
toStringin interfacePropertyEditor<D extends BioPAXElement,R extends BioPAXElement> - Overrides:
toStringin classAbstractPropertyEditor<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 theEditorMapduring 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 restrictedranges- 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 theEditorMapduring 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
Description copied from class:AbstractPropertyEditorChecks if the bean and the value are consistent with the cardinality rules of the model. This method is important for validations.- Overrides:
checkRestrictionsin classAbstractPropertyEditor<D extends BioPAXElement,R extends BioPAXElement> - Parameters:
value- Value that is related to the objectbean- 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
- 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().
-