org.biopax.paxtools.controller
Class ObjectPropertyEditor<D extends BioPAXElement,R extends BioPAXElement>

java.lang.Object
  extended by org.biopax.paxtools.controller.SimplePropertyAccessor<D,R>
      extended by org.biopax.paxtools.controller.PropertyEditor<D,R>
          extended by org.biopax.paxtools.controller.ObjectPropertyEditor<D,R>
All Implemented Interfaces:
PropertyAccessor<D,R>

public class ObjectPropertyEditor<D extends BioPAXElement,R extends BioPAXElement>
extends PropertyEditor<D,R>

Provides an editor compatible with all value types other Primitive, ENUM, and String by extending the PropertyEditor.

See Also:
PropertyEditor

Field Summary
protected  java.lang.Class<D> domain
          This is the Class representing the domain of the property.
protected  boolean multipleCardinality
          This is false if there is a cardinality restriction of one on the property.
protected  java.lang.Class<R> range
          This is the Class representing the range of the property.
 
Fields inherited from class org.biopax.paxtools.controller.PropertyEditor
addMethod, log, property, removeMethod, setMethod
 
Fields inherited from class org.biopax.paxtools.controller.SimplePropertyAccessor
getMethod
 
Constructor Summary
ObjectPropertyEditor(java.lang.String property, java.lang.reflect.Method getMethod, java.lang.Class<D> domain, java.lang.Class<R> range, boolean multipleCardinality)
           
 
Method Summary
 void addRangeRestriction(java.lang.Class<? extends BioPAXElement> domain, java.util.Set<java.lang.Class<? extends BioPAXElement>> ranges)
           
protected  void checkRestrictions(R value, D bean)
          Checks if the bean and the value are consistent with the cardinality rules of the model.
protected  java.lang.reflect.Method findInverseGetMethod()
           
 java.lang.Class<D> getDomain()
          Returns the domain of the property.
 PropertyAccessor<R,? super D> getInverseAccessor()
           
 java.lang.reflect.Method getInverseGetMethod()
           
 java.lang.Class<R> getRange()
          Returns the range of the editor.
 java.util.Map<java.lang.Class<? extends BioPAXElement>,java.util.Set<java.lang.Class<? extends BioPAXElement>>> getRestrictedRanges()
           
 java.util.Set<java.lang.Class<? extends BioPAXElement>> getRestrictedRangesFor(java.lang.Class<? extends D> restrictedDomain)
           
 boolean hasInverseLink()
           
 boolean isCompleteBackward()
           
 boolean isCompleteForward()
           
 boolean isInverseMultipleCardinality()
           
 boolean isMultipleCardinality()
          Checks if the property to which editor is assigned has multiple cardinality.
 void setRangeRestriction(java.util.Map<java.lang.Class<? extends BioPAXElement>,java.util.Set<java.lang.Class<? extends BioPAXElement>>> restrictedRanges)
           
 java.lang.String toString()
           
 
Methods inherited from class org.biopax.paxtools.controller.PropertyEditor
addMaxCardinalityRestriction, createPropertyEditor, detectRange, getAddMethod, getGetMethod, getMaxCardinality, getPrimarySetMethod, getProperty, getRemoveMethod, getSetMethod, getUnknown, invokeMethod, isInstanceOfAtLeastOne, parseValueFromString, removeValueFromBean, removeValueFromBean, setValueToBean, setValueToBean
 
Methods inherited from class org.biopax.paxtools.controller.SimplePropertyAccessor
getValueFromBean, isMultipleCardinality, isUnknown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

domain

protected java.lang.Class<D extends BioPAXElement> domain
This is the Class representing the domain of the property.


range

protected java.lang.Class<R> range
This is the Class representing the range of the property. It is by default an object.


multipleCardinality

protected final boolean multipleCardinality
This is false if there is a cardinality restriction of one on the property.

Constructor Detail

ObjectPropertyEditor

public ObjectPropertyEditor(java.lang.String property,
                            java.lang.reflect.Method getMethod,
                            java.lang.Class<D> domain,
                            java.lang.Class<R> range,
                            boolean multipleCardinality)
Method Detail

getRestrictedRanges

public java.util.Map<java.lang.Class<? extends BioPAXElement>,java.util.Set<java.lang.Class<? extends BioPAXElement>>> getRestrictedRanges()

isCompleteForward

public boolean isCompleteForward()

isCompleteBackward

public boolean isCompleteBackward()

isInverseMultipleCardinality

public boolean isInverseMultipleCardinality()

getInverseGetMethod

public java.lang.reflect.Method getInverseGetMethod()

getInverseAccessor

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

toString

public java.lang.String toString()
Overrides:
toString in class PropertyEditor<D extends BioPAXElement,R extends BioPAXElement>

addRangeRestriction

public void addRangeRestriction(java.lang.Class<? extends BioPAXElement> domain,
                                java.util.Set<java.lang.Class<? extends BioPAXElement>> ranges)

setRangeRestriction

public void setRangeRestriction(java.util.Map<java.lang.Class<? extends BioPAXElement>,java.util.Set<java.lang.Class<? extends BioPAXElement>>> restrictedRanges)

checkRestrictions

protected void checkRestrictions(R value,
                                 D bean)
Description copied from class: PropertyEditor
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 PropertyEditor<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 java.util.Set<java.lang.Class<? extends BioPAXElement>> getRestrictedRangesFor(java.lang.Class<? extends D> restrictedDomain)

hasInverseLink

public boolean hasInverseLink()

findInverseGetMethod

protected java.lang.reflect.Method findInverseGetMethod()

getDomain

public java.lang.Class<D> getDomain()
Returns the domain of the property.

Specified by:
getDomain in interface PropertyAccessor<D extends BioPAXElement,R>
Returns:
the domain of the editor

getRange

public java.lang.Class<R> getRange()
Returns the range of the editor.

Specified by:
getRange in interface PropertyAccessor<D extends BioPAXElement,R>
Returns:
a class

isMultipleCardinality

public boolean isMultipleCardinality()
Checks if the property to which editor is assigned has multiple cardinality.

Specified by:
isMultipleCardinality in interface PropertyAccessor<D extends BioPAXElement,R>
Returns:
true if editor belongs to a multiple cardinality property.


Copyright © 2011 BioPAX. All Rights Reserved.