public static class SchematronConstraintNode.Variable extends 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
Modifier and Type | Field and Description |
---|---|
protected OclNode.Declaration |
vardecl |
children, negated, parent, schemaObject
Constructor and Description |
---|
Variable(SchematronSchema schemaObject,
OclNode.Declaration vardecl,
boolean neg)
Ctor
|
Modifier and Type | Method and Description |
---|---|
SchematronConstraintNode.Attribute |
generatingAttribute()
This inquires the Attribute node this Variable is generated
by if any.
|
String |
getName()
Variable name inquiry function.
|
boolean |
hasIdentity()
This predicate finds out whether the Variable results in an
instance, which conceptually has identity.
|
boolean |
hasSimpleType()
This predicate finds out whether the Variable results in a simple
XML schema type.
|
boolean |
isDependentOn(OclNode.Declaration vardecl)
This method determines whether this variable is identical to the
one passed as argument.
|
boolean |
isVarOrAttribBased(OclNode.Declaration vardecl)
This method determines whether this variable is identical to the
one passed as argument.
|
SchematronConstraintNode.XpathFragment |
translate(SchematronConstraintNode.BindingContext ctx)
This compiles a node to an Xpath expression, which stands for
the given variable.
|
addChild, containsError, isAndOrLogic, isMultiple, nodeVariableIsBoundTo
protected OclNode.Declaration vardecl
public Variable(SchematronSchema schemaObject, OclNode.Declaration vardecl, boolean neg)
schemaObject
- The schema objectvardecl
- OclNode.Declaration objectneg
- Negation flagpublic String getName()
public boolean isDependentOn(OclNode.Declaration vardecl)
This method determines whether this variable is identical to the one passed as argument.
isDependentOn
in class SchematronConstraintNode
vardecl
- The Declaration of the variablepublic boolean isVarOrAttribBased(OclNode.Declaration vardecl)
This method determines whether this variable is identical to the one passed as argument.
isVarOrAttribBased
in class SchematronConstraintNode
vardecl
- The Declaration of the variablepublic SchematronConstraintNode.Attribute generatingAttribute()
This inquires the Attribute node this Variable is generated by if any.
generatingAttribute
in class SchematronConstraintNode
public boolean hasSimpleType()
This predicate finds out whether the Variable results in a simple XML schema type.
hasSimpleType
in class SchematronConstraintNode
public boolean hasIdentity()
This predicate finds out whether the Variable results in an instance, which conceptually has identity.
hasIdentity
in class SchematronConstraintNode
public SchematronConstraintNode.XpathFragment translate(SchematronConstraintNode.BindingContext ctx)
This compiles a node to an Xpath expression, which stands for the given variable.
If the variable is defined in a surrounding 'let' construct, a proper translation for the use of the variable can always be achieved, given that the initial value of the variable translates properly. If the use of the variable is in ISCURRENT context, the variable definition will be mapped into a Schematron <let> definition. Otherwise the initial value is substituted in place of the variable.
Other variable references are treated as follows.
The only variable which can be properly translated in all cases is self, which will be mapped to current() or to '.', if compiled in a ISCURRENT context. Variable definitions from iterators require to be on the context stack of the expression, which is widely dependent on how the expression environment could be represented in Xpath.
translate
in class SchematronConstraintNode
ctx
- BindingContext this node shall be compiled inCopyright © 2018. All rights reserved.