Class LogicalRule

java.lang.Object
com.adobe.xmp.schema.model.rules.LogicalRule
All Implemented Interfaces:
TypeRule, Serializable

public class LogicalRule extends Object implements TypeRule
The logical rule describes a conjunction (AND), disjunction (OR) or negation (NOT) of the child rules. Note: The operator NOT can only take one argument.
See Also:
  • Constructor Details

    • LogicalRule

      public LogicalRule(TypeRule.LogicalOperator operator)
      Constructs a new LogicalRule.
      Parameters:
      operator - the logical operator (AND, OR, NOT).
  • Method Details

    • getOperator

      public TypeRule.LogicalOperator getOperator()
      Returns:
      Returns the operator.
    • addOperand

      public void addOperand(TypeRule rule)
      Adds a new operand, for the operator NOT, only one operand is allowed. TODO check that the NOT operator can only be used with one operand.
      Parameters:
      rule - a rule that is added as operand
    • getOperands

      public List<TypeRule> getOperands()
      Returns a list of rules that is combined by the logical operator. If NOT is used, the list has to contain exactly one entry.
      Returns:
      Returns all operands.
    • accept

      public void accept(SchemaVisitor schemaVisitor) throws XMPSchemaException
      Specified by:
      accept in interface TypeRule
      Parameters:
      schemaVisitor - a visitor that implements the SchemaVisitor-interface
      Throws:
      XMPSchemaException
      See Also: