-
- qname = ctx.getStatementArgument();
- schemaPath = ctx.getSchemaPath().get();
-
- Long declaredPositionInit = null;
- for (final EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) {
- if (effectiveStatement instanceof PositionEffectiveStatement) {
- declaredPositionInit = ((PositionEffectiveStatement) effectiveStatement).argument();
- }
- }
-
- declaredPosition = declaredPositionInit;
- }
-
- public Long getDeclaredPosition() {
- return declaredPosition;
- }
-
- public String getName() {
- return qname.getLocalName();
- }
-
- public QName getQName() {
- return qname;
- }
-
- public SchemaPath getPath() {
- return schemaPath;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + qname.hashCode();
- result = prime * result + schemaPath.hashCode();
- result = prime * result + Objects.hashCode(declaredPosition);
- result = prime * result + getUnknownSchemaNodes().hashCode();
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final BitsTypeDefinition.Bit other = (BitsTypeDefinition.Bit) obj;
- return Objects.equals(qname, other.getQName()) && Objects.equals(schemaPath, other.getPath());