Package org.biopax.paxtools.controller
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
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMaxCardinalityRestriction(Class<? extends D> domain, int max) Sets a maximum cardinality for a domain.getMaxCardinality(Class<? extends D> restrictedDomain) Return the maximum cardinality that is defined for the property to which editor is belong.Returns the primary set method of the editor.Gets the unknown value.voidremoveValueFromBean(Set<R> values, D bean) Removes the values from the bean using theremoveValueFromBean(Object, org.biopax.paxtools.model.BioPAXElement)for each value in the set.voidremoveValueFromBean(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 usingsetValueToBean(Object, org.biopax.paxtools.model.BioPAXElement)(but only if )voidsetValueToBean(Set<R> values, D bean) voidsetValueToBean(R value, D bean) Sets the value to the bean using the default setMethod if value is not null.toString()Methods inherited from interface org.biopax.paxtools.controller.PropertyAccessor
getDomain, getRange, getValueFromBean, getValueFromBeans, isMultipleCardinality, isUnknown
-
Method Details
-
toString
String toString() -
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
Sets a maximum cardinality for a domain.- Parameters:
domain- domain on which restriction will be setmax- cardinality- See Also:
-
getMaxCardinality
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
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 usingsetValueToBean(Object, org.biopax.paxtools.model.BioPAXElement)(but only if )- Parameters:
value- to be removed from the beanbean- bean from which the value is going to be removed
-
removeValueFromBean
Removes the values from the bean using theremoveValueFromBean(Object, org.biopax.paxtools.model.BioPAXElement)for each value in the set.- Parameters:
values- to be removed from the beanbean- bean from which the value is going to be removed
-
setValueToBean
Sets the value to the bean using the default setMethod if value is not null.- Parameters:
value- to be set to the beanbean- to which the value is to be set
-
setValueToBean
-
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.
-