de.interactive_instruments.ShapeChange.TargetHelper
Class XpathConstraintNode.Logic

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.TargetHelper.XpathConstraintNode
      extended by de.interactive_instruments.ShapeChange.TargetHelper.XpathConstraintNode.Logic
Enclosing class:
XpathConstraintNode

public static class XpathConstraintNode.Logic
extends XpathConstraintNode

This class stands for logical operations AND, OR, XOR and EQV. Which of these is is coded in the state member logic.


Nested Class Summary
protected static class XpathConstraintNode.Logic.LogicType
           
 
Nested classes/interfaces inherited from class de.interactive_instruments.ShapeChange.TargetHelper.XpathConstraintNode
XpathConstraintNode.AllInstances, XpathConstraintNode.Arithmetic, XpathConstraintNode.Attribute, XpathConstraintNode.BindingContext, XpathConstraintNode.Cast, XpathConstraintNode.ChangeCase, XpathConstraintNode.Comparison, XpathConstraintNode.Concatenate, XpathConstraintNode.Empty, XpathConstraintNode.Error, XpathConstraintNode.Exists, XpathConstraintNode.IfThenElse, XpathConstraintNode.KindOf, XpathConstraintNode.Literal, XpathConstraintNode.Logic, XpathConstraintNode.Matches, XpathConstraintNode.MessageComment, XpathConstraintNode.Select, XpathConstraintNode.Size, XpathConstraintNode.Substring, XpathConstraintNode.Unique, XpathConstraintNode.Variable, XpathConstraintNode.XpathFragment, XpathConstraintNode.XpathType
 
Field Summary
protected  XpathConstraintNode.Logic.LogicType logic
           
 
Fields inherited from class de.interactive_instruments.ShapeChange.TargetHelper.XpathConstraintNode
children, negated, parent, xpathHelper
 
Constructor Summary
XpathConstraintNode.Logic(XpathHelper xpathHelper, XpathConstraintNode.Logic.LogicType logic)
          Ctor
 
Method Summary
 boolean isAndOrLogic(boolean isAnd)
          Method to inquire whether the node inquired is a Logic node and this logic node has the same isAnd polarity as specified in the parameter.
 XpathConstraintNode.XpathFragment translate(XpathConstraintNode.BindingContext ctx)
          This compiles the node and its children to an Xpath predicate, which can be inserted into a <rule>.
 
Methods inherited from class de.interactive_instruments.ShapeChange.TargetHelper.XpathConstraintNode
addChild, bindsVariable, containsError, generatingAttribute, hasIdentity, hasSimpleType, isDependentOn, isMultiple, isVarOrAttribBased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logic

protected XpathConstraintNode.Logic.LogicType logic
Constructor Detail

XpathConstraintNode.Logic

public XpathConstraintNode.Logic(XpathHelper xpathHelper,
                                 XpathConstraintNode.Logic.LogicType logic)
Ctor

Parameters:
xpathHelper - The schema object
isAnd - Flag to make this an AND (true) or an OR (false)
Method Detail

isAndOrLogic

public boolean isAndOrLogic(boolean isAnd)

Method to inquire whether the node inquired is a Logic node and this logic node has the same isAnd polarity as specified in the parameter. XORs and EQVs are ignored and yield false.

Overrides:
isAndOrLogic in class XpathConstraintNode
Parameters:
isAnd - Flag: Are we an AND? (not an OR)?
Returns:
True if this is Logic with the same AND/OR polarity

translate

public XpathConstraintNode.XpathFragment translate(XpathConstraintNode.BindingContext ctx)

This compiles the node and its children to an Xpath predicate, which can be inserted into a <rule>.

AND and OR are translated into their Xpath counterparts and and or. XOR will be realized as a != operator, EQV by an = operator.

Specified by:
translate in class XpathConstraintNode
Parameters:
ctx - BindingContext this node shall be compiled in
Returns:
Object containing the Xpath fragment and its operator priority


Copyright © 2015. All rights reserved.