de.interactive_instruments.ShapeChange.TargetHelper
Class XpathConstraintNode.KindOf

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

public static class XpathConstraintNode.KindOf
extends XpathConstraintNode

This class represents oclIsKindOf and oclIsTypeOf nodes. The difference between the two is expressed in an exact flag. The object also carries a negation flag to express that an object is NOT kind of some type. The type is given by the first of the children.


Nested Class Summary
 
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  ClassInfo argumentClass
           
protected  boolean exact
           
 
Fields inherited from class de.interactive_instruments.ShapeChange.TargetHelper.XpathConstraintNode
children, negated, parent, xpathHelper
 
Constructor Summary
XpathConstraintNode.KindOf(XpathHelper xpathHelper, boolean exact, boolean neg)
          Ctor
 
Method Summary
 void setClass(ClassInfo ci)
          If the class to be tested against is already known (it is not an expression) this reference can be set via this method.
 XpathConstraintNode.XpathFragment translate(XpathConstraintNode.BindingContext ctx)
          This compiles the KindOf predicate (and its negation) to an equivalent Xpath expression fragment.
 
Methods inherited from class de.interactive_instruments.ShapeChange.TargetHelper.XpathConstraintNode
addChild, bindsVariable, containsError, generatingAttribute, hasIdentity, hasSimpleType, isAndOrLogic, isDependentOn, isMultiple, isVarOrAttribBased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

argumentClass

protected ClassInfo argumentClass

exact

protected boolean exact
Constructor Detail

XpathConstraintNode.KindOf

public XpathConstraintNode.KindOf(XpathHelper xpathHelper,
                                  boolean exact,
                                  boolean neg)
Ctor

Parameters:
xpathHelper - The schema object
exact - Flag: Only check the given type
neg - Flag: Negated meaning
Method Detail

setClass

public void setClass(ClassInfo ci)
If the class to be tested against is already known (it is not an expression) this reference can be set via this method.

Parameters:
ci - ClassInfo representing the type to be tested against

translate

public XpathConstraintNode.XpathFragment translate(XpathConstraintNode.BindingContext ctx)

This compiles the KindOf predicate (and its negation) to an equivalent Xpath expression fragment. KindOf is translated to a predicate which compares the element name against all concrete subtypes of the given type.

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


Copyright © 2015. All rights reserved.