Package com.adobe.xmp.schema.model.rules
Class LogicalRule
- java.lang.Object
 - 
- com.adobe.xmp.schema.model.rules.LogicalRule
 
 
- 
- All Implemented Interfaces:
 TypeRule,java.io.Serializable
public class LogicalRule extends java.lang.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:
 - Serialized Form
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface com.adobe.xmp.schema.model.TypeRule
TypeRule.ComparisonOperator, TypeRule.LogicalOperator 
 - 
 
- 
Constructor Summary
Constructors Constructor Description LogicalRule(TypeRule.LogicalOperator operator)Constructs a new LogicalRule. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(SchemaVisitor schemaVisitor)voidaddOperand(TypeRule rule)Adds a new operand, for the operator NOT, only one operand is allowed.java.util.List<TypeRule>getOperands()Returns a list of rules that is combined by the logical operator.TypeRule.LogicalOperatorgetOperator() 
 - 
 
- 
- 
Constructor Detail
- 
LogicalRule
public LogicalRule(TypeRule.LogicalOperator operator)
Constructs a new LogicalRule.- Parameters:
 operator- the logical operator (AND, OR, NOT).
 
 - 
 
- 
Method Detail
- 
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 java.util.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:
 acceptin interfaceTypeRule- Parameters:
 schemaVisitor- a visitor that implements theSchemaVisitor-interface- Throws:
 XMPSchemaException- See Also:
 TypeRule.accept(com.adobe.xmp.schema.model.SchemaVisitor)
 
 - 
 
 -