public static class XpathConstraintNode.Cast extends XpathConstraintNode
This class represents oclAsType(), which is for casting a type to one of its subtypes.
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
Modifier and Type | Field and Description |
---|---|
protected ClassInfo |
argumentClass |
protected String |
targetClassName |
children, negated, parent, xpathHelper
Constructor and Description |
---|
Cast(XpathHelper xpathHelper)
Ctor
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasIdentity()
This predicate finds out whether the Cast results in an instance,
which conceptually has identity.
|
boolean |
hasSimpleType()
This predicate finds out whether the Cast results in a simple
XML schema type.
|
void |
setClass(ClassInfo ci)
If the class to be cast to 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 Cast to an Xpath fragment.
|
addChild, bindsVariable, containsError, generatingAttribute, isAndOrLogic, isDependentOn, isMultiple, isVarOrAttribBased
protected ClassInfo argumentClass
protected String targetClassName
public Cast(XpathHelper xpathHelper)
xpathHelper
- The schema objectpublic void setClass(ClassInfo ci)
ci
- ClassInfo representing the type to be cast topublic boolean hasSimpleType()
This predicate finds out whether the Cast results in a simple XML schema type.
hasSimpleType
in class XpathConstraintNode
public boolean hasIdentity()
This predicate finds out whether the Cast results in an instance, which conceptually has identity.
hasIdentity
in class XpathConstraintNode
public XpathConstraintNode.XpathFragment translate(XpathConstraintNode.BindingContext ctx)
This compiles the Cast to an Xpath fragment.
We realize this by making sure the current element is of the requested type or any of its concrete subtypes.
translate
in class XpathConstraintNode
ctx
- BindingContext this node shall be compiled inCopyright © 2018. All rights reserved.