de.interactive_instruments.ShapeChange.Target.XmlSchema
Class SchematronConstraintNode.Logic

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode
      extended by de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode.Logic
Enclosing class:
SchematronConstraintNode

public static class SchematronConstraintNode.Logic
extends SchematronConstraintNode

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 SchematronConstraintNode.Logic.LogicType
           
 
Nested classes/interfaces inherited from class de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode
SchematronConstraintNode.AllInstances, SchematronConstraintNode.Arithmetic, SchematronConstraintNode.Attribute, SchematronConstraintNode.BindingContext, SchematronConstraintNode.Cast, SchematronConstraintNode.ChangeCase, SchematronConstraintNode.Comparison, SchematronConstraintNode.Concatenate, SchematronConstraintNode.Empty, SchematronConstraintNode.Error, SchematronConstraintNode.Exists, SchematronConstraintNode.IfThenElse, SchematronConstraintNode.KindOf, SchematronConstraintNode.Let, SchematronConstraintNode.Literal, SchematronConstraintNode.Logic, SchematronConstraintNode.Matches, SchematronConstraintNode.MessageComment, SchematronConstraintNode.Select, SchematronConstraintNode.Size, SchematronConstraintNode.Substring, SchematronConstraintNode.Unique, SchematronConstraintNode.Variable, SchematronConstraintNode.XpathFragment, SchematronConstraintNode.XpathType
 
Field Summary
protected  SchematronConstraintNode.Logic.LogicType logic
           
 
Fields inherited from class de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode
children, negated, parent, schemaObject
 
Constructor Summary
SchematronConstraintNode.Logic(SchematronSchema schemaObject, SchematronConstraintNode.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.
 SchematronConstraintNode.XpathFragment translate(SchematronConstraintNode.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.Target.XmlSchema.SchematronConstraintNode
addChild, containsError, generatingAttribute, hasIdentity, hasSimpleType, isDependentOn, isMultiple, isVarOrAttribBased, nodeVariableIsBoundTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logic

protected SchematronConstraintNode.Logic.LogicType logic
Constructor Detail

SchematronConstraintNode.Logic

public SchematronConstraintNode.Logic(SchematronSchema schemaObject,
                                      SchematronConstraintNode.Logic.LogicType logic)
Ctor

Parameters:
schemaObject - 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 SchematronConstraintNode
Parameters:
isAnd - Flag: Are we an AND? (not an OR)?
Returns:
True if this is Logic with the same AND/OR polarity

translate

public SchematronConstraintNode.XpathFragment translate(SchematronConstraintNode.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 SchematronConstraintNode
Parameters:
ctx - BindingContext this node shall be compiled in
Returns:
Object containing the Xpath fragment and its operator priority


Copyright © 2015. All rights reserved.