-
Notifications
You must be signed in to change notification settings - Fork 5
refactor: introduce IControlSelection/IControlMatching common interfaces #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
david-waltermire
merged 5 commits into
metaschema-framework:develop
from
david-waltermire:fix/control-selection-common-interface
Apr 23, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a865bf4
refactor: introduce IControlSelection/IControlMatching common interfaces
david-waltermire de7ec52
refactor: rename shared/assessment select-control-by-id classes
david-waltermire ef644ff
refactor: move control-common select types up from profile package
david-waltermire 43f5507
refactor: rename AbstractProfileMatching to AbstractControlMatching
david-waltermire 315aa28
fix(pmd): add protected constructor and suppress implicit functional …
david-waltermire File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/dev/metaschema/oscal/lib/model/control/AbstractControlMatching.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: none | ||
| * SPDX-License-Identifier: CC0-1.0 | ||
| */ | ||
|
|
||
| package dev.metaschema.oscal.lib.model.control; | ||
|
|
||
| public abstract class AbstractControlMatching implements IControlMatching { | ||
| protected AbstractControlMatching() { | ||
| // base class for generated matching bindings | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/dev/metaschema/oscal/lib/model/control/IControlMatching.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: none | ||
| * SPDX-License-Identifier: CC0-1.0 | ||
| */ | ||
|
|
||
| package dev.metaschema.oscal.lib.model.control; | ||
|
|
||
| @SuppressWarnings("PMD.ImplicitFunctionalInterface") | ||
| public interface IControlMatching { | ||
|
|
||
| String getPattern(); | ||
|
|
||
| } |
18 changes: 18 additions & 0 deletions
18
src/main/java/dev/metaschema/oscal/lib/model/control/IControlSelection.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: none | ||
| * SPDX-License-Identifier: CC0-1.0 | ||
| */ | ||
|
|
||
| package dev.metaschema.oscal.lib.model.control; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public interface IControlSelection { | ||
|
|
||
| String getWithChildControls(); | ||
|
|
||
| List<String> getWithIds(); | ||
|
|
||
| List<? extends IControlMatching> getMatching(); | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 60
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 401
🏁 Script executed:
# Let's read the actual file mentioned in the review to understand the context wc -l src/main/metaschema-bindings/oscal-metaschema-bindings.xmlRepository: metaschema-framework/liboscal-java
Length of output: 140
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 1330
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 310
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 156
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 2976
🏁 Script executed:
# Read the IControlSelection interface cat src/main/java/dev/metaschema/oscal/lib/model/control/IControlSelection.javaRepository: metaschema-framework/liboscal-java
Length of output: 381
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 310
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 60
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 308
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 308
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 912
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 3470
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 246
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 60
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 467
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 244
🏁 Script executed:
# Examine the interface cat src/main/java/dev/metaschema/oscal/lib/model/control/IControlCommonSelectControlById.javaRepository: metaschema-framework/liboscal-java
Length of output: 414
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 60
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 566
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 148
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 60
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 207
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 454
🏁 Script executed:
Repository: metaschema-framework/liboscal-java
Length of output: 962
Add
extend-base-classtoAssessmentCommonSelectControlByIdto implementIControlSelection.The
select-control-by-idbinding inoscal_assessment-common_metaschema.xmllacks anextend-base-class, unlike its counterpart inoscal_control-common_metaschema.xml. The control-common binding extendsAbstractControlCommonSelectControlById, which implementsIControlCommonSelectControlById(which extendsIControlSelection), enabling polymorphic usage via the module-agnostic interface. Without a corresponding base class for the assessment module,AssessmentCommonSelectControlByIdwon't implementIControlSelection, breaking consistency with PR objectives for module-agnostic interfaces.Consider creating
AbstractAssessmentCommonSelectControlByIdas the extend-base-class for this binding to maintain interface consistency across modules.🤖 Prompt for AI Agents