Skip to content

Commit

Permalink
Corrected mismatched context name in the XSD vs module definition. Us…
Browse files Browse the repository at this point in the history
…ing XSD, since this is what has been used for validation.
  • Loading branch information
david-waltermire committed Jun 21, 2024
1 parent ae5b99c commit aedb2c0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public final class MetapathContext implements IBoundObject {
private AssemblyConstraints _constraints;

@BoundAssembly(
useName = "metapath-context",
useName = "context",
maxOccurs = -1,
groupAs = @GroupAs(name = "metapath-contexts", inJson = JsonGroupAsBehavior.LIST))
private List<MetapathContext> _metapathContexts;
groupAs = @GroupAs(name = "contexts", inJson = JsonGroupAsBehavior.LIST))
private List<MetapathContext> _contexts;

@BoundField(
formalName = "Remarks",
Expand Down Expand Up @@ -132,12 +132,12 @@ public void setConstraints(AssemblyConstraints value) {
_constraints = value;
}

public List<MetapathContext> getMetapathContexts() {
return _metapathContexts;
public List<MetapathContext> getContexts() {
return _contexts;
}

public void setMetapathContexts(List<MetapathContext> value) {
_metapathContexts = value;
public void setContexts(List<MetapathContext> value) {
_contexts = value;
}

/**
Expand All @@ -147,12 +147,12 @@ public void setMetapathContexts(List<MetapathContext> value) {
* the item to add
* @return {@code true}
*/
public boolean addMetapathContext(MetapathContext item) {
public boolean addContext(MetapathContext item) {
MetapathContext value = ObjectUtils.requireNonNull(item, "item cannot be null");
if (_metapathContexts == null) {
_metapathContexts = new LinkedList<>();
if (_contexts == null) {
_contexts = new LinkedList<>();
}
return _metapathContexts.add(value);
return _contexts.add(value);
}

/**
Expand All @@ -163,9 +163,9 @@ public boolean addMetapathContext(MetapathContext item) {
* the item to remove
* @return {@code true} if the item was removed or {@code false} otherwise
*/
public boolean removeMetapathContext(MetapathContext item) {
public boolean removeContext(MetapathContext item) {
MetapathContext value = ObjectUtils.requireNonNull(item, "item cannot be null");
return _metapathContexts != null && _metapathContexts.remove(value);
return _contexts != null && _contexts.remove(value);
}

public Remarks getRemarks() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public final class MetaschemaMetaConstraints implements IBoundObject {
private DefinitionContext _definitionContext;

@BoundAssembly(
useName = "metapath-context",
useName = "context",
minOccurs = 1,
maxOccurs = -1,
groupAs = @GroupAs(name = "metapath-contexts", inJson = JsonGroupAsBehavior.LIST))
private List<MetapathContext> _metapathContexts;
groupAs = @GroupAs(name = "contexts", inJson = JsonGroupAsBehavior.LIST))
private List<MetapathContext> _contexts;

public MetaschemaMetaConstraints() {
this(null);
Expand All @@ -94,12 +94,12 @@ public void setDefinitionContext(DefinitionContext value) {
_definitionContext = value;
}

public List<MetapathContext> getMetapathContexts() {
return _metapathContexts;
public List<MetapathContext> getContexts() {
return _contexts;
}

public void setMetapathContexts(List<MetapathContext> value) {
_metapathContexts = value;
public void setContexts(List<MetapathContext> value) {
_contexts = value;
}

/**
Expand All @@ -109,12 +109,12 @@ public void setMetapathContexts(List<MetapathContext> value) {
* the item to add
* @return {@code true}
*/
public boolean addMetapathContext(MetapathContext item) {
public boolean addContext(MetapathContext item) {
MetapathContext value = ObjectUtils.requireNonNull(item, "item cannot be null");
if (_metapathContexts == null) {
_metapathContexts = new LinkedList<>();
if (_contexts == null) {
_contexts = new LinkedList<>();
}
return _metapathContexts.add(value);
return _contexts.add(value);
}

/**
Expand All @@ -125,9 +125,9 @@ public boolean addMetapathContext(MetapathContext item) {
* the item to remove
* @return {@code true} if the item was removed or {@code false} otherwise
*/
public boolean removeMetapathContext(MetapathContext item) {
public boolean removeContext(MetapathContext item) {
MetapathContext value = ObjectUtils.requireNonNull(item, "item cannot be null");
return _metapathContexts != null && _metapathContexts.remove(value);
return _contexts != null && _contexts.remove(value);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected IConstraintSet parseResource(@NonNull URI resource, @NonNull Deque<URI
} else if (constraintsDocument instanceof MetaschemaMetaConstraints) {
MetaschemaMetaConstraints obj = (MetaschemaMetaConstraints) constraintsDocument;

List<ITargetedConstraints> targetedConstraints = CollectionUtil.listOrEmpty(obj.getMetapathContexts()).stream()
List<ITargetedConstraints> targetedConstraints = CollectionUtil.listOrEmpty(obj.getContexts()).stream()
.flatMap(context -> parseContext(ObjectUtils.notNull(context), null, source)
.getTargetedConstraints().stream())
.collect(Collectors.toList());
Expand Down Expand Up @@ -271,7 +271,7 @@ private Context parseContext(
}
Context context = new Context(metapaths, constraints);

List<Context> childContexts = CollectionUtil.listOrEmpty(contextObj.getMetapathContexts()).stream()
List<Context> childContexts = CollectionUtil.listOrEmpty(contextObj.getContexts()).stream()
.map(childObj -> parseContext(ObjectUtils.notNull(childObj), context, source))
.collect(Collectors.toList());

Expand Down

0 comments on commit aedb2c0

Please sign in to comment.