jade.content.schema.facets
Class CardinalityFacet

java.lang.Object
  |
  +--jade.content.schema.facets.CardinalityFacet

public class CardinalityFacet
extends java.lang.Object
implements Facet

This facet forces the elements in an AbsAggregate to be instances of a given schema.

Author:
Giovanni Caire - TILAB
See Also:
Serialized Form

Constructor Summary
CardinalityFacet(int cardMin, int cardMax)
          Construct a CardinalityFacet that forces the number of elements in an AbsAggregate to be within a given range
 
Method Summary
 void validate(AbsObject value, Ontology onto)
          Check that the number of elements in an AbsAggregate is within a given range
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CardinalityFacet

public CardinalityFacet(int cardMin,
                        int cardMax)
Construct a CardinalityFacet that forces the number of elements in an AbsAggregate to be within a given range
Parameters:
cardMin - The range lower bound
cardMax - The range upper bound
Method Detail

validate

public void validate(AbsObject value,
                     Ontology onto)
              throws OntologyException
Check that the number of elements in an AbsAggregate is within a given range
Specified by:
validate in interface Facet
Parameters:
value - The value to be checked
Throws:
OntologyException - If the value is not valid