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

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

public static class SchematronConstraintNode.Cast
extends SchematronConstraintNode

This class represents oclAsType(), which is for casting a type to one of its subtypes.


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  ClassInfo argumentClass
           
protected  String targetClassName
           
 
Fields inherited from class de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode
children, negated, parent, schemaObject
 
Constructor Summary
SchematronConstraintNode.Cast(SchematronSchema schemaObject)
          Ctor
 
Method Summary
 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.
 SchematronConstraintNode.XpathFragment translate(SchematronConstraintNode.BindingContext ctx)
          This compiles the Cast to an Xpath fragment.
 
Methods inherited from class de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode
addChild, containsError, generatingAttribute, isAndOrLogic, isDependentOn, isMultiple, isVarOrAttribBased, nodeVariableIsBoundTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

argumentClass

protected ClassInfo argumentClass

targetClassName

protected String targetClassName
Constructor Detail

SchematronConstraintNode.Cast

public SchematronConstraintNode.Cast(SchematronSchema schemaObject)
Ctor

Parameters:
schemaObject - The schema object
Method Detail

setClass

public 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.

Parameters:
ci - ClassInfo representing the type to be cast to

hasSimpleType

public boolean hasSimpleType()

This predicate finds out whether the Cast 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 Cast 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 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.

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.