Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.align.model.condition.impl
Class BindingCondition

java.lang.Object
  extended by eu.esdihumboldt.hale.common.align.model.condition.impl.BindingCondition
All Implemented Interfaces:
EntityCondition<Type>, TypeCondition

@Immutable
public class BindingCondition
extends Object
implements TypeCondition

Type condition that checks its binding and element type

Author:
Simon Templer

Constructor Summary
BindingCondition(Class<?> compatibleClass, boolean allowConversion, boolean allowCollection)
          Create a binding condition
 
Method Summary
 boolean accept(Type entity)
          Determines if the given entity matches the constraint
protected  boolean isCompatibleClass(Class<?> binding, boolean to)
          Check if the given binding is compatible to the configured compatible class
static boolean isCompatibleClass(Class<?> binding, boolean to, Class<?> compatibleClass, boolean allowConversion)
          Check if the given binding is compatible to the given compatible class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindingCondition

public BindingCondition(Class<?> compatibleClass,
                        boolean allowConversion,
                        boolean allowCollection)
Create a binding condition

Parameters:
compatibleClass - the class the binding should be compatible to
allowConversion - specifies if a binding is classified as compatible if conversion to the compatible class is possible
allowCollection - specifies if a binding is classified as compatible if it is a collection of the compatible class
Method Detail

accept

public boolean accept(Type entity)
Description copied from interface: EntityCondition
Determines if the given entity matches the constraint

Specified by:
accept in interface EntityCondition<Type>
Parameters:
entity - the entity
Returns:
if the entity matches the constraint
See Also:
EntityCondition.accept(Entity)

isCompatibleClass

protected boolean isCompatibleClass(Class<?> binding,
                                    boolean to)
Check if the given binding is compatible to the configured compatible class

Parameters:
binding - the binding
to - if a value of compatibleClass shall be assigned to the binding or vice versa
Returns:
if the binding is compatible

isCompatibleClass

public static boolean isCompatibleClass(Class<?> binding,
                                        boolean to,
                                        Class<?> compatibleClass,
                                        boolean allowConversion)
Check if the given binding is compatible to the given compatible class

Parameters:
binding - the binding
to - if a value of the compatible class shall be assigned to the binding or vice versa
compatibleClass - the compatible class
allowConversion - if conversion is allowed
Returns:
if the binding is compatible

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d