com.dlsc.flexgantt.policy
Class AbstractPolicy

java.lang.Object
  extended by com.dlsc.flexgantt.policy.AbstractPolicy
All Implemented Interfaces:
IPolicy
Direct Known Subclasses:
AbstractGridPolicy, AbstractStatusBarPolicy, AbstractZoomPolicy, DefaultCrosshairPolicy, DefaultDragAndDropPolicy, DefaultDragInfoPolicy, DefaultEditActivityObjectPolicy, DefaultEditCapacityObjectPolicy, DefaultEditEventlineObjectPolicy, DefaultEditLayerPolicy, DefaultEditTimelineObjectPolicy, DefaultEventlineLabelPolicy, DefaultGridLinePolicy, DefaultLabelPolicy, DefaultLinePolicy, DefaultNodeDragAndDropPolicy, DefaultNodeEditPolicy, DefaultOverviewPolicy, DefaultPopupPolicy, DefaultRelationshipPolicy, DefaultRowPolicy, DefaultSelectionPolicy

public abstract class AbstractPolicy
extends java.lang.Object
implements IPolicy

All policies are subclasses of this abstract policy implementation.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
IPolicyProvider

Constructor Summary
AbstractPolicy()
           
 
Method Summary
 void assertClass(java.lang.String methodName, java.lang.String argName, java.lang.Class<?> cl, java.lang.Object obj)
          Utility method for detailed problem reporting when an object that gets passed to a policy method does not have the correct type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPolicy

public AbstractPolicy()
Method Detail

assertClass

public void assertClass(java.lang.String methodName,
                        java.lang.String argName,
                        java.lang.Class<?> cl,
                        java.lang.Object obj)
Utility method for detailed problem reporting when an object that gets passed to a policy method does not have the correct type. Policies intentionally do not use Generics as their usage would have increased the policy complexity too much.

Parameters:
methodName - the method that wants to assert / make sure that the given object does have the correct type
argName - the name of the method argument that requires a certain object type
cl - the required object type
obj - the object that got passed to the method and that gets checked for whether it has the right type or not
Since:
1.0