Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.schema.model.constraint.type
Class ElementType

java.lang.Object
  extended by eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType
All Implemented Interfaces:
TypeConstraint

@Immutable
public class ElementType
extends Object
implements TypeConstraint

Specifies a Java binding and optionally a TypeDefinition for a elements of a collection. This is only relevant for a type if its Binding is a collection or array, default element binding is Object.

Author:
Simon Templer

Constructor Summary
ElementType()
          Creates a default element binding constraint with Object binding and no type definition.
 
Method Summary
static ElementType createFromType(TypeDefinition elementType)
          Create an element type constraint with the given element type.
static ElementType get(Class<?> binding)
          Get the element type constraint with the given Java binding
 Class<?> getBinding()
          Get the Java binding for collection elements of the type
 TypeDefinition getDefinition()
          Get the type definition for collection elements of the type
 boolean isInheritable()
          Determines if the constraint is inheritable, meaning it may be used for a sub-type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementType

public ElementType()
Creates a default element binding constraint with Object binding and no type definition.

See Also:
Constraint
Method Detail

get

public static ElementType get(Class<?> binding)
Get the element type constraint with the given Java binding

Parameters:
binding - the type's Java binding
Returns:
the element type constraint (which is a singleton)

createFromType

public static ElementType createFromType(TypeDefinition elementType)
Create an element type constraint with the given element type.

Parameters:
elementType - the element type definition
Returns:
the element type constraint

getBinding

public Class<?> getBinding()
Get the Java binding for collection elements of the type

Returns:
the element binding

getDefinition

public TypeDefinition getDefinition()
Get the type definition for collection elements of the type

Returns:
the type definition, may be null

isInheritable

public boolean isInheritable()
Description copied from interface: TypeConstraint
Determines if the constraint is inheritable, meaning it may be used for a sub-type. A constraint may only be inherited if it is not overriden in the sub-type.

Specified by:
isInheritable in interface TypeConstraint
Returns:
if the constraint is inheritable
See Also:
TypeConstraint.isInheritable()

Humboldt Alignment Editor 2.5.0

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