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

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

public static class SchematronConstraintNode.Attribute
extends SchematronConstraintNode

This class represents a chain of attribute selectors based on some value source such as a variable, a select() or allInstances. The value source is the sole child of the Attribute object.


Nested Class Summary
protected static class SchematronConstraintNode.Attribute.AttrComp
           
 
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  SchematronConstraintNode.Attribute.AttrComp[] attributes
           
 
Fields inherited from class de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode
children, negated, parent, schemaObject
 
Constructor Summary
SchematronConstraintNode.Attribute(SchematronSchema schemaObject, OclNode.AttributeCallExp attr, boolean negated)
          Ctor - starting from AttributeCallExp
SchematronConstraintNode.Attribute(SchematronSchema schemaObject, SchematronConstraintNode.Attribute.AttrComp atc, boolean negated)
          Ctor - starting from AttrComp
 
Method Summary
 void appendAbsorbedAttribute(int absorptionType, OclNode.AttributeCallExp attr)
          This method marks the last attribute component as being absorbed by the construct before.
 void appendAttribute(OclNode.AttributeCallExp aex)
          Append another AttributeCallExp and associated layout info as an additional qualification.
 void appendAttribute(SchematronConstraintNode.Attribute.AttrComp atc)
          Append another AttrComp and associated layout info as an additional qualification.
 SchematronConstraintNode.Attribute generatingAttribute()
          This inquires the Attribute node this Attribute is generated by.
 boolean hasIdentity()
          This predicate finds out whether the Attribute as a whole results in instances, which conceptually have identity.
 boolean hasIdentity(int idx)
          This predicate finds out whether the Attribute component at the given index idx results in a schema type, which carries identity.
 boolean hasSimpleType()
          This predicate finds out whether the Attribute as a whole results in a simple XML schema type.
 boolean hasSimpleType(int idx)
          This predicate finds out whether the Attribute component at the given index idx results in a simple XML schema type.
 boolean isMultiple()
          This method returns true if any of the OclNode.Attribute objects it is made of has a possible cardinality greater than 1.
 boolean isPropertyAbsorbing()
          This Attribute predicate finds out, whether the last attribute component in the object is implemented as a group and is therefore absorbing its properties.
 boolean isVarOrAttribBased(OclNode.Declaration vardecl)
          This method determines whether this Attribute is dependent on the Variable passed as argument.
 SchematronConstraintNode.Attribute splitBefore(int at)
          Split the Attribute object before the given index.
 SchematronConstraintNode.XpathFragment translate(SchematronConstraintNode.BindingContext ctx)
          This function translates the Attribute to an Xpath fragment accessing that attribute.
 
Methods inherited from class de.interactive_instruments.ShapeChange.Target.XmlSchema.SchematronConstraintNode
addChild, containsError, isAndOrLogic, isDependentOn, nodeVariableIsBoundTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributes

protected SchematronConstraintNode.Attribute.AttrComp[] attributes
Constructor Detail

SchematronConstraintNode.Attribute

public SchematronConstraintNode.Attribute(SchematronSchema schemaObject,
                                          OclNode.AttributeCallExp attr,
                                          boolean negated)
Ctor - starting from AttributeCallExp

Parameters:
schemaObject - The schema object
attr - The (possibly first) AttributeCallExp object
negated - May be negated if of type boolean

SchematronConstraintNode.Attribute

public SchematronConstraintNode.Attribute(SchematronSchema schemaObject,
                                          SchematronConstraintNode.Attribute.AttrComp atc,
                                          boolean negated)
Ctor - starting from AttrComp

Parameters:
schemaObject - The schema object
atc - AttrComp object
negated - May be negated if of type boolean
Method Detail

appendAttribute

public void appendAttribute(OclNode.AttributeCallExp aex)

Append another AttributeCallExp and associated layout info as an additional qualification.

Parameters:
aex - The AttributeCallExp to be appended be null)

appendAttribute

public void appendAttribute(SchematronConstraintNode.Attribute.AttrComp atc)

Append another AttrComp and associated layout info as an additional qualification.

Parameters:
aex - The AttrComp object to be appended be null)

appendAbsorbedAttribute

public void appendAbsorbedAttribute(int absorptionType,
                                    OclNode.AttributeCallExp attr)
This method marks the last attribute component as being absorbed by the construct before. This also includes nilReason implementation. The type (1=simple absorption, 2=reason) and the associated OclNode are stored together with the last attribute component.

Parameters:
absorptionType - Implementation type: 1=normal absorption, 2=reason
attr - The OclNode representing the absorbed property.

splitBefore

public SchematronConstraintNode.Attribute splitBefore(int at)
Split the Attribute object before the given index.

Parameters:
at - The index before to split
Returns:
Right hand part of the split, which contains the left hand part as its child.

isPropertyAbsorbing

public boolean isPropertyAbsorbing()

This Attribute predicate finds out, whether the last attribute component in the object is implemented as a group and is therefore absorbing its properties. If there is already a property absorbed on the attribute, the absorbed property will be asked.

Note that this is a necessary condition for appying GML's nilReason pattern.

Returns:
The required flag indicating that properties are absorbed

isVarOrAttribBased

public boolean isVarOrAttribBased(OclNode.Declaration vardecl)

This method determines whether this Attribute is dependent on the Variable 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 Attribute is generated by. Alas, it's this Attribute!

Overrides:
generatingAttribute in class SchematronConstraintNode
Returns:
The retrieved Attribute node

isMultiple

public boolean isMultiple()

This method returns true if any of the OclNode.Attribute objects it is made of has a possible cardinality greater than 1.

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

hasSimpleType

public boolean hasSimpleType()

This predicate finds out whether the Attribute as a whole results in a simple XML schema type. Note that for convenience reasons this also includes the GML's xsi:nil construct.

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

hasSimpleType

public boolean hasSimpleType(int idx)

This predicate finds out whether the Attribute component at the given index idx results in a simple XML schema type. Note that for convenience reasons this also includes the GML's xsi:nil construct.

Parameters:
idx - Index of the attribute component
Returns:
Flag indicating whether the attribute component has a simple type

hasIdentity

public boolean hasIdentity()

This predicate finds out whether the Attribute as a whole results in instances, which conceptually have identity.

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

hasIdentity

public boolean hasIdentity(int idx)

This predicate finds out whether the Attribute component at the given index idx results in a schema type, which carries identity. Note that for convenience reasons this also includes GML's xsi:nil construct.

Parameters:
idx - Index of the attribute component
Returns:
Flag indicating whether the attribute component has identity

translate

public SchematronConstraintNode.XpathFragment translate(SchematronConstraintNode.BindingContext ctx)

This function translates the Attribute to an Xpath fragment accessing that attribute. Attributes can be negated, in which case they are boolean and not multiple.

Specified by:
translate in class SchematronConstraintNode
Parameters:
ctx - BindingContext this node shall be compiled in
Returns:
XpathFragment representing the Attribute access


Copyright © 2015. All rights reserved.