fedora.client.objecteditor.types
Class DatastreamBindingRule

java.lang.Object
  extended by fedora.client.objecteditor.types.DatastreamBindingRule

public class DatastreamBindingRule
extends java.lang.Object

A single rule of a behavior mechanism's datastream binding specification. For a certain binding key (the "key" of the rule), a rule specifies a range indicating the number of datastreams to be bound, whether order is important, and the types of datastreams that may be bound.


Constructor Summary
DatastreamBindingRule(java.lang.String key, java.lang.String inputLabel, java.lang.String inputInstruction, int min, int max, boolean orderMatters, java.lang.String[] types)
          Initialize a DatastreamBindingRule with all values.
 
Method Summary
 boolean accepts(java.lang.String type)
          Does this rule allow the given type?
 java.lang.String getInputInstruction()
          Get the input instruction.
 java.lang.String getInputLabel()
          Get the input label.
 java.lang.String getKey()
          Get the key of the rule.
 int getMax()
          Get the maximum number of datastreams that can be bound.
 int getMin()
          Get the minimum number of datastreams that can be bound.
 java.lang.String[] getTypes()
          Get the type list.
 boolean orderMatters()
          Does order matter?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatastreamBindingRule

public DatastreamBindingRule(java.lang.String key,
                             java.lang.String inputLabel,
                             java.lang.String inputInstruction,
                             int min,
                             int max,
                             boolean orderMatters,
                             java.lang.String[] types)
Initialize a DatastreamBindingRule with all values. If maximum is -1, that means there is no maximum. If the array of types is null or empty, getTypes() will return a single-valued array with the "any type" pattern.

Method Detail

accepts

public boolean accepts(java.lang.String type)
Does this rule allow the given type?


getKey

public java.lang.String getKey()
Get the key of the rule.


getInputLabel

public java.lang.String getInputLabel()
Get the input label. This may be null.


getInputInstruction

public java.lang.String getInputInstruction()
Get the input instruction. This may be null.


getMax

public int getMax()
Get the maximum number of datastreams that can be bound. -1 means there is no maximum.


getMin

public int getMin()
Get the minimum number of datastreams that can be bound.


orderMatters

public boolean orderMatters()
Does order matter?


getTypes

public java.lang.String[] getTypes()
Get the type list. This will always have at least one element.