Package com.adobe.xmp.schema.model.rules
Class LogicalRule
java.lang.Object
com.adobe.xmp.schema.model.rules.LogicalRule
- All Implemented Interfaces:
TypeRule,Serializable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.adobe.xmp.schema.model.TypeRule
TypeRule.ComparisonOperator, TypeRule.LogicalOperator -
Constructor Summary
ConstructorsConstructorDescriptionLogicalRule(TypeRule.LogicalOperator operator) Constructs a new LogicalRule. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(SchemaVisitor schemaVisitor) voidaddOperand(TypeRule rule) Adds a new operand, for the operator NOT, only one operand is allowed.Returns a list of rules that is combined by the logical operator.
-
Constructor Details
-
LogicalRule
Constructs a new LogicalRule.- Parameters:
operator- the logical operator (AND, OR, NOT).
-
-
Method Details
-
getOperator
- Returns:
- Returns the operator.
-
addOperand
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
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
- Specified by:
acceptin interfaceTypeRule- Parameters:
schemaVisitor- a visitor that implements theSchemaVisitor-interface- Throws:
XMPSchemaException- See Also:
-