de.interactive_instruments.ShapeChange.TargetHelper
Class XpathConstraintNode.AllInstances

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

public static class XpathConstraintNode.AllInstances
extends XpathConstraintNode

This class represents the OCL operation allInstances(). AllInstances is based on a class literal and represents all instances of that class.


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 objectClass
           
 
Fields inherited from class de.interactive_instruments.ShapeChange.TargetHelper.XpathConstraintNode
children, negated, parent, xpathHelper
 
Constructor Summary
XpathConstraintNode.AllInstances(XpathHelper xpathHelper, ClassInfo ci, boolean negated)
          Ctor
 
Method Summary
 boolean hasIdentity()
          This predicate finds out whether the allInstances results in a collection of instances, which conceptually have identity.
 boolean hasSimpleType()
          allInstances() is never simple.
 boolean isMultiple()
          Allinstances always produces a set.
 XpathConstraintNode.XpathFragment translate(XpathConstraintNode.BindingContext ctx)
          allInstances() is translated to a search for the given type.
 
Methods inherited from class de.interactive_instruments.ShapeChange.TargetHelper.XpathConstraintNode
addChild, bindsVariable, containsError, generatingAttribute, isAndOrLogic, isDependentOn, isVarOrAttribBased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectClass

protected ClassInfo objectClass
Constructor Detail

XpathConstraintNode.AllInstances

public XpathConstraintNode.AllInstances(XpathHelper xpathHelper,
                                        ClassInfo ci,
                                        boolean negated)
Ctor

Parameters:
xpathHelper - The schema object
ci - ClassInfo of the class to enumerate
negated - May be negated if of type boolean
Method Detail

isMultiple

public boolean isMultiple()

Allinstances always produces a set.

Overrides:
isMultiple in class XpathConstraintNode
Returns:
Flag indicating whether the node can return multiple values

hasSimpleType

public boolean hasSimpleType()

allInstances() is never simple.

Overrides:
hasSimpleType in class XpathConstraintNode
Returns:
Flag indicating whether the node has a simple type

hasIdentity

public boolean hasIdentity()

This predicate finds out whether the allInstances results in a collection of instances, which conceptually have identity.

Overrides:
hasIdentity in class XpathConstraintNode
Returns:
Flag indicating whether the node is an identity carrying type

translate

public XpathConstraintNode.XpathFragment translate(XpathConstraintNode.BindingContext ctx)

allInstances() is translated to a search for the given type. The result is a nodeset containing all the given features.

In compiling x.allInstances() we create a nodeset union (n1|...|ni), where nk=//Tk[@gml:id] and Tk is one of the concrete derivations of the type x, including x.

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.