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.
Modifier and Type | Class and Description |
---|---|
protected static class |
SchematronConstraintNode.Attribute.AttrComp |
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 SchematronConstraintNode.Attribute.AttrComp[] |
attributes |
children, negated, parent, schemaObject
Constructor and Description |
---|
Attribute(SchematronSchema schemaObject,
OclNode.AttributeCallExp attr,
boolean negated)
Ctor - starting from AttributeCallExp
|
Attribute(SchematronSchema schemaObject,
SchematronConstraintNode.Attribute.AttrComp atc,
boolean negated)
Ctor - starting from AttrComp
|
Modifier and Type | Method and Description |
---|---|
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.
|
addChild, containsError, isAndOrLogic, isDependentOn, nodeVariableIsBoundTo
protected SchematronConstraintNode.Attribute.AttrComp[] attributes
public Attribute(SchematronSchema schemaObject, OclNode.AttributeCallExp attr, boolean negated)
schemaObject
- The schema objectattr
- The (possibly first) AttributeCallExp objectnegated
- May be negated if of type booleanpublic Attribute(SchematronSchema schemaObject, SchematronConstraintNode.Attribute.AttrComp atc, boolean negated)
schemaObject
- The schema objectatc
- AttrComp objectnegated
- May be negated if of type booleanpublic void appendAttribute(OclNode.AttributeCallExp aex)
Append another AttributeCallExp and associated layout info as an additional qualification.
aex
- The AttributeCallExp to be appended
be null)public void appendAttribute(SchematronConstraintNode.Attribute.AttrComp atc)
Append another AttrComp and associated layout info as an additional qualification.
aex
- The AttrComp object to be appended
be null)public void appendAbsorbedAttribute(int absorptionType, OclNode.AttributeCallExp attr)
absorptionType
- Implementation type: 1=normal absorption, 2=reasonattr
- The OclNode representing the absorbed property.public SchematronConstraintNode.Attribute splitBefore(int at)
at
- The index before to splitpublic 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.
public boolean isVarOrAttribBased(OclNode.Declaration vardecl)
This method determines whether this Attribute is dependent on the Variable passed as argument.
isVarOrAttribBased
in class SchematronConstraintNode
vardecl
- The Declaration of the variablepublic SchematronConstraintNode.Attribute generatingAttribute()
This inquires the Attribute node this Attribute is generated by. Alas, it's this Attribute!
generatingAttribute
in class SchematronConstraintNode
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.
isMultiple
in class SchematronConstraintNode
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.
hasSimpleType
in class SchematronConstraintNode
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.
idx
- Index of the attribute componentpublic boolean hasIdentity()
This predicate finds out whether the Attribute as a whole results in instances, which conceptually have identity.
hasIdentity
in class SchematronConstraintNode
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.
idx
- Index of the attribute componentpublic 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.
translate
in class SchematronConstraintNode
ctx
- BindingContext this node shall be compiled inCopyright © 2017. All rights reserved.