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

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

public static class SchematronConstraintNode.Variable
extends SchematronConstraintNode

This class represents an OCL variable. It wraps the Declaration node of the OclNode object. If it happens to be boolean it can be negated.


Nested Class Summary
 
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  OclNode.Declaration vardecl
           
 
Fields inherited from class de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode
children, negated, parent, schemaObject
 
Constructor Summary
SchematronConstraintNode.Variable(SchematronSchema schemaObject, OclNode.Declaration vardecl, boolean neg)
          Ctor
 
Method Summary
 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.
 
Methods inherited from class de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode
addChild, containsError, isAndOrLogic, isMultiple, nodeVariableIsBoundTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vardecl

protected OclNode.Declaration vardecl
Constructor Detail

SchematronConstraintNode.Variable

public SchematronConstraintNode.Variable(SchematronSchema schemaObject,
                                         OclNode.Declaration vardecl,
                                         boolean neg)
Ctor

Parameters:
schemaObject - The schema object
vardecl - OclNode.Declaration object
neg - Negation flag
Method Detail

getName

public String getName()
Variable name inquiry function.

Returns:
Name of variable

isDependentOn

public boolean isDependentOn(OclNode.Declaration vardecl)

This method determines whether this variable is identical to the one passed as argument.

Overrides:
isDependentOn in class SchematronConstraintNode
Parameters:
vardecl - The Declaration of the variable
Returns:
Flag indicating the inquired dependency

isVarOrAttribBased

public boolean isVarOrAttribBased(OclNode.Declaration vardecl)

This method determines whether this variable is identical to the one passed as argument.

Overrides:
isVarOrAttribBased in class SchematronConstraintNode
Parameters:
vardecl - The Declaration of the variable
Returns:
Flag indicating the inquired property

generatingAttribute

public SchematronConstraintNode.Attribute generatingAttribute()

This inquires the Attribute node this Variable is generated by if any.

Overrides:
generatingAttribute in class SchematronConstraintNode
Returns:
The retrieved Attribute node if there is such a thing

hasSimpleType

public boolean hasSimpleType()

This predicate finds out whether the Variable results in a simple XML schema type.

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

hasIdentity

public boolean hasIdentity()

This predicate finds out whether the Variable results in an instance, which conceptually has identity.

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

translate

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.

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


Copyright © 2015. All rights reserved.