From dff71d3a298eecb7e7cb844d9315fbc2e101adc2 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Mon, 2 Dec 2024 13:23:33 -0500 Subject: [PATCH 01/11] Feature/anonymous functions (#266) * Hooked up the data type specific cast methods using the data type service as the source of data types. This provides for long-term scalability as new data types are added. * Completed testing eqname and varref cases for the arrow operator. Resolves #68. * Inline functions are now working. Resolves #242. * Refactored Metapath expression to use an interface instead of the implementation for returned instances. Updated all uses to use IMetaschemaExpression. Changed uses of evaluateAs using the ResultType.SEQUENCE to just use evaluate. Removed ResultType.SEQUENCE. * Applied suggestions from code review --- .../core/datatype/DataTypeService.java | 14 + .../core/metapath/DynamicContext.java | 11 +- .../core/metapath/IMetapathExpression.java | 290 +++++++++++++++++ .../metaschema/core/metapath/IPrintable.java | 22 -- .../core/metapath/MetapathExpression.java | 256 +-------------- .../core/metapath/StaticContext.java | 1 + .../metapath/antlr/AbstractAstVisitor.java | 50 ++- .../metapath/cst/AbstractCSTVisitorBase.java | 41 ++- .../core/metapath/cst/AbstractExpression.java | 2 +- .../cst/AbstractExpressionVisitor.java | 13 +- .../metapath/cst/AnonymousFunctionCall.java | 122 +++++++ .../core/metapath/cst/BuildCSTVisitor.java | 95 +++++- .../core/metapath/cst/CSTPrinter.java | 15 +- .../metapath/cst/DynamicFunctionCall.java | 84 +++++ .../metaschema/core/metapath/cst/For.java | 2 +- .../cst/{items => }/FunctionCallAccessor.java | 50 ++- .../metapath/cst/ICstExpressionFactory.java | 1 - .../core/metapath/cst/IExpression.java | 2 +- .../core/metapath/cst/IExpressionVisitor.java | 25 +- .../metaschema/core/metapath/cst/Let.java | 2 +- .../core/metapath/cst/Metapath.java | 2 +- .../core/metapath/cst/StaticFunctionCall.java | 43 ++- .../core/metapath/cst/VariableReference.java | 2 +- .../cst/items/ArraySequenceConstructor.java | 2 +- .../cst/items/ArraySquareConstructor.java | 2 +- .../metapath/cst/items/DecimalLiteral.java | 2 +- .../metapath/cst/items/EmptySequence.java | 2 +- .../metapath/cst/items/IntegerLiteral.java | 2 +- .../core/metapath/cst/items/Intersect.java | 2 +- .../metapath/cst/items/MapConstructor.java | 4 +- .../metapath/cst/items/PostfixLookup.java | 4 +- .../core/metapath/cst/items/Quantified.java | 2 +- .../core/metapath/cst/items/Range.java | 2 +- .../core/metapath/cst/items/SimpleMap.java | 2 +- .../core/metapath/cst/items/StringConcat.java | 2 +- .../metapath/cst/items/StringLiteral.java | 2 +- .../core/metapath/cst/items/UnaryLookup.java | 4 +- .../core/metapath/cst/items/Union.java | 2 +- .../cst/logic/AbstractFilterExpression.java | 2 +- .../core/metapath/cst/logic/And.java | 2 +- .../core/metapath/cst/logic/Except.java | 2 +- .../metapath/cst/logic/GeneralComparison.java | 2 +- .../core/metapath/cst/logic/If.java | 2 +- .../core/metapath/cst/logic/Negate.java | 4 +- .../core/metapath/cst/logic/Or.java | 2 +- .../cst/logic/PredicateExpression.java | 2 +- .../metapath/cst/logic/ValueComparison.java | 2 +- .../AbstractBasicArithmeticExpression.java | 2 +- .../core/metapath/cst/math/Addition.java | 4 +- .../core/metapath/cst/math/Division.java | 4 +- .../metapath/cst/math/IntegerDivision.java | 4 +- .../core/metapath/cst/math/Modulo.java | 4 +- .../metapath/cst/math/Multiplication.java | 4 +- .../core/metapath/cst/math/Subtraction.java | 4 +- .../cst/path/AbstractPathExpression.java | 2 +- .../core/metapath/cst/path/Axis.java | 2 +- .../core/metapath/cst/path/ContextItem.java | 2 +- .../core/metapath/cst/path/Flag.java | 2 +- .../core/metapath/cst/path/ModelInstance.java | 2 +- .../core/metapath/cst/path/NameTest.java | 2 +- .../cst/path/RelativeDoubleSlashPath.java | 2 +- .../metapath/cst/path/RelativeSlashPath.java | 2 +- .../cst/path/RootDoubleSlashPath.java | 2 +- .../metapath/cst/path/RootSlashOnlyPath.java | 2 +- .../core/metapath/cst/path/RootSlashPath.java | 2 +- .../core/metapath/cst/path/Step.java | 2 +- .../core/metapath/cst/path/Wildcard.java | 2 +- .../cst/type/AbstractCastingExpression.java | 2 +- .../core/metapath/cst/type/Cast.java | 2 +- .../core/metapath/cst/type/Castable.java | 2 +- .../core/metapath/cst/type/InstanceOf.java | 2 +- .../core/metapath/cst/type/Treat.java | 2 +- .../metapath/function/AbstractFunction.java | 48 --- .../core/metapath/function/ArgumentImpl.java | 9 +- .../core/metapath/function/CalledContext.java | 110 +++++++ .../function/ComparisonFunctions.java | 19 +- .../metapath/function/DefaultFunction.java | 302 ++---------------- .../core/metapath/function/FunctionUtils.java | 2 +- .../core/metapath/function/IArgument.java | 21 +- .../core/metapath/function/IFunction.java | 4 +- .../metapath/function/IFunctionExecutor.java | 2 +- .../function/impl/AbstractFunction.java | 286 +++++++++++++++++ .../{ => impl}/OperationFunctions.java | 7 +- .../function/library/ArrayAppend.java | 4 +- .../function/library/ArrayFlatten.java | 2 +- .../metapath/function/library/ArrayGet.java | 4 +- .../metapath/function/library/ArrayHead.java | 4 +- .../function/library/ArrayInsertBefore.java | 4 +- .../metapath/function/library/ArrayJoin.java | 4 +- .../metapath/function/library/ArrayPut.java | 4 +- .../function/library/ArrayRemove.java | 2 +- .../function/library/ArrayReverse.java | 4 +- .../metapath/function/library/ArraySize.java | 2 +- .../function/library/ArraySubarray.java | 4 +- .../metapath/function/library/ArrayTail.java | 2 +- .../function/library/CastFunction.java | 15 +- .../library/DefaultFunctionLibrary.java | 81 +---- .../core/metapath/function/library/FnAbs.java | 2 +- .../core/metapath/function/library/FnAvg.java | 4 +- .../metapath/function/library/FnBaseUri.java | 2 +- .../metapath/function/library/FnBoolean.java | 2 +- .../metapath/function/library/FnCeiling.java | 2 +- .../metapath/function/library/FnCompare.java | 2 +- .../metapath/function/library/FnConcat.java | 2 +- .../metapath/function/library/FnContains.java | 2 +- .../metapath/function/library/FnCount.java | 2 +- .../function/library/FnCurrentDateTime.java | 2 +- .../function/library/FnCurrentTime.java | 2 +- .../metapath/function/library/FnData.java | 2 +- .../core/metapath/function/library/FnDoc.java | 2 +- .../function/library/FnDocumentAvailable.java | 2 +- .../function/library/FnDocumentUri.java | 2 +- .../metapath/function/library/FnEmpty.java | 2 +- .../metapath/function/library/FnEndsWith.java | 2 +- .../metapath/function/library/FnExists.java | 2 +- .../metapath/function/library/FnFalse.java | 2 +- .../metapath/function/library/FnHead.java | 2 +- .../function/library/FnImplicitTimezone.java | 2 +- .../function/library/FnInsertBefore.java | 2 +- .../function/library/FnLowerCase.java | 2 +- .../metapath/function/library/FnMatches.java | 2 +- .../metapath/function/library/FnMinMax.java | 2 +- .../function/library/FnNormalizeSpace.java | 2 +- .../core/metapath/function/library/FnNot.java | 2 +- .../metapath/function/library/FnPath.java | 2 +- .../metapath/function/library/FnRemove.java | 2 +- .../function/library/FnResolveUri.java | 2 +- .../metapath/function/library/FnReverse.java | 2 +- .../metapath/function/library/FnRound.java | 2 +- .../function/library/FnStartsWith.java | 2 +- .../function/library/FnStaticBaseUri.java | 2 +- .../metapath/function/library/FnString.java | 2 +- .../function/library/FnStringLength.java | 2 +- .../function/library/FnSubstring.java | 2 +- .../function/library/FnSubstringAfter.java | 2 +- .../function/library/FnSubstringBefore.java | 2 +- .../core/metapath/function/library/FnSum.java | 4 +- .../metapath/function/library/FnTail.java | 2 +- .../metapath/function/library/FnTokenize.java | 2 +- .../metapath/function/library/FnTrue.java | 2 +- .../function/library/FnUpperCase.java | 2 +- .../function/library/MapContains.java | 4 +- .../metapath/function/library/MapEntry.java | 4 +- .../metapath/function/library/MapFind.java | 4 +- .../metapath/function/library/MapGet.java | 4 +- .../metapath/function/library/MapKeys.java | 2 +- .../metapath/function/library/MapMerge.java | 4 +- .../metapath/function/library/MapPut.java | 4 +- .../metapath/function/library/MapRemove.java | 4 +- .../metapath/function/library/MapSize.java | 2 +- .../function/library/MpRecurseDepth.java | 10 +- .../function/library/NumericFunction.java | 2 +- .../core/metapath/impl/AbstractArrayItem.java | 6 +- .../metapath/impl/AbstractKeySpecifier.java | 4 +- .../core/metapath/impl/AbstractMapItem.java | 6 +- .../core/metapath/impl/AbstractSequence.java | 2 +- .../core/metapath/impl/ArrayItemN.java | 2 +- .../core/metapath/impl/MapItemN.java | 2 +- .../core/metapath/item/DefaultItemWriter.java | 2 - .../metapath/{ => item}/ICollectionValue.java | 3 +- .../metaschema/core/metapath/item/IItem.java | 2 - .../core/metapath/item/IItemWriter.java | 1 - .../core/metapath/{ => item}/ISequence.java | 3 +- .../item/atomic/AbstractAtomicItemBase.java | 9 +- .../metapath/item/atomic/IAnyAtomicItem.java | 8 +- .../metapath/item/atomic/IIntegerItem.java | 2 +- .../metapath/item/function/IArrayItem.java | 4 +- .../metapath/item/function/IKeySpecifier.java | 4 +- .../core/metapath/item/function/IMapItem.java | 4 +- .../metapath/item/node/AbstractNodeItem.java | 25 +- .../metapath/item/node/INodeItemFactory.java | 14 +- .../metapath/type/IAtomicOrUnionType.java | 2 +- .../core/metapath/type/ISequenceType.java | 2 +- .../core/metapath/type/Occurrence.java | 2 +- .../metapath/type/impl/SequenceTypeImpl.java | 4 +- .../AbstractConstraintValidationHandler.java | 2 +- .../DefaultConstraintValidator.java | 6 +- ...xternalConstraintsModulePostProcessor.java | 11 +- ...CollectingConstraintValidationHandler.java | 2 +- .../core/model/constraint/IConstraint.java | 2 +- .../IConstraintValidationHandler.java | 2 +- .../core/model/constraint/IIndex.java | 9 +- .../core/model/constraint/IKeyField.java | 4 +- .../core/model/constraint/ILet.java | 8 +- .../LoggingConstraintValidationHandler.java | 2 +- ...AbstractConfigurableMessageConstraint.java | 6 +- .../constraint/impl/AbstractConstraint.java | 10 +- .../impl/DefaultExpectConstraint.java | 8 +- .../constraint/impl/DefaultKeyField.java | 8 +- .../model/constraint/impl/DefaultLet.java | 8 +- .../core/util/CustomCollectors.java | 2 +- .../core/metapath/ISequenceTest.java | 1 + .../core/metapath/MetapathExpressionTest.java | 9 +- .../core/metapath/OperationFunctionsTest.java | 2 +- .../metaschema/core/metapath/TestUtils.java | 2 + .../cst/AnonymousFunctionCallTest.java | 66 ++++ .../metapath/cst/ArrowExpressionTest.java | 59 +++- .../metapath/cst/BuildCstVisitorTest.java | 41 ++- .../metapath/cst/items/QuantifiedTest.java | 10 +- .../core/metapath/cst/items/RangeTest.java | 7 +- .../cst/logic/CSTLogicalExpressionsTest.java | 8 +- .../cst/logic/PredicateExpressionTest.java | 2 +- .../cst/logic/ValueComparisonTest.java | 2 +- .../core/metapath/cst/path/FlagTest.java | 2 +- .../metapath/cst/path/RootSlashOnlyTest.java | 2 +- .../core/metapath/cst/path/StepTest.java | 83 ++--- .../core/metapath/cst/type/CastTest.java | 12 +- .../core/metapath/cst/type/CastableTest.java | 12 +- .../metapath/cst/type/InstanceOfTest.java | 11 +- .../function/OperationFunctionsTest.java | 1 + .../function/library/ArrayAppendTest.java | 6 +- .../function/library/ArrayFlattenTest.java | 7 +- .../function/library/ArrayGetTest.java | 6 +- .../function/library/ArrayHeadTest.java | 7 +- .../library/ArrayInsertBeforeTest.java | 6 +- .../function/library/ArrayJoinTest.java | 6 +- .../function/library/ArrayPutTest.java | 6 +- .../function/library/ArrayRemoveTest.java | 6 +- .../function/library/ArrayReverseTest.java | 6 +- .../function/library/ArraySizeTest.java | 6 +- .../function/library/ArraySubarrayTest.java | 6 +- .../function/library/ArrayTailTest.java | 6 +- .../function/library/CastFunctionTest.java | 78 +++++ .../metapath/function/library/FnAbsTest.java | 2 +- .../metapath/function/library/FnAvgTest.java | 2 +- .../function/library/FnBooleanTest.java | 2 +- .../function/library/FnCeilingTest.java | 2 +- .../function/library/FnConcatTest.java | 7 +- .../function/library/FnContainsTest.java | 6 +- .../function/library/FnCountTest.java | 2 +- .../function/library/FnCurrentTimeTest.java | 6 +- .../function/library/FnEmptyTest.java | 8 +- .../function/library/FnEndsWithTest.java | 6 +- .../function/library/FnExistsTest.java | 2 +- .../function/library/FnFalseTest.java | 2 +- .../metapath/function/library/FnHeadTest.java | 7 +- .../library/FnImplicitTimezoneTest.java | 6 +- .../function/library/FnInsertBeforeTest.java | 7 +- .../function/library/FnLowerCaseTest.java | 6 +- .../function/library/FnMatchesTest.java | 8 +- .../function/library/FnMinMaxTest.java | 2 +- .../library/FnNormalizeSpaceTest.java | 6 +- .../metapath/function/library/FnNotTest.java | 2 +- .../function/library/FnRemoveTest.java | 7 +- .../function/library/FnReverseTest.java | 8 +- .../function/library/FnRoundTest.java | 2 +- .../function/library/FnStartsWithTest.java | 2 +- .../function/library/FnStringLengthTest.java | 8 +- .../function/library/FnStringTest.java | 8 +- .../library/FnSubstringAfterTest.java | 6 +- .../library/FnSubstringBeforeTest.java | 6 +- .../function/library/FnSubstringTest.java | 6 +- .../metapath/function/library/FnSumTest.java | 2 +- .../metapath/function/library/FnTailTest.java | 7 +- .../function/library/FnTokenizeTest.java | 8 +- .../metapath/function/library/FnTrueTest.java | 2 +- .../function/library/FnUpperCaseTest.java | 6 +- .../function/library/FunctionTestBase.java | 4 +- .../function/library/MapContainsTest.java | 6 +- .../function/library/MapEntryTest.java | 6 +- .../function/library/MapFindTest.java | 6 +- .../metapath/function/library/MapGetTest.java | 15 +- .../function/library/MapKeysTest.java | 8 +- .../function/library/MapMergeTest.java | 6 +- .../metapath/function/library/MapPutTest.java | 6 +- .../function/library/MapRemoveTest.java | 6 +- .../function/library/MapSizeTest.java | 6 +- .../item/function/IArrayItemTest.java | 10 +- .../metapath/item/function/LookupTest.java | 16 +- .../model/xml/MetaConstraintLoaderTest.java | 4 +- .../codegen/impl/AnnotationGenerator.java | 2 +- .../databind/metapath/function/Model.java | 2 +- .../model/impl/InstanceModelFieldComplex.java | 2 +- .../model/metaschema/binding/METASCHEMA.java | 3 +- .../databind/codegen/BasicMetaschemaTest.java | 10 +- .../databind/io/DefaultBoundLoaderTest.java | 13 +- .../metapath/EvaluateMetapathCommand.java | 8 +- pom.xml | 10 + .../schemagen/AbstractGenerationState.java | 4 +- 279 files changed, 2023 insertions(+), 1331 deletions(-) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java delete mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IPrintable.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCall.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/{items => }/FunctionCallAccessor.java (61%) delete mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/AbstractFunction.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/CalledContext.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/{ => impl}/OperationFunctions.java (98%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => item}/ICollectionValue.java (96%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => item}/ISequence.java (99%) create mode 100644 core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCallTest.java create mode 100644 core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunctionTest.java diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DataTypeService.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DataTypeService.java index 00994b6a2..de0db3d2f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DataTypeService.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DataTypeService.java @@ -18,6 +18,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.Collection; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; @@ -216,6 +217,19 @@ public IItemType getItemTypeByItemClass(Class clazz) { return itemTypeByItemClass.get(clazz); } + /** + * Get the collection of all registered data type adapters provided by this + * service. + *

+ * The returned collection is unmodifiable. + * + * @return the data type adapters + */ + @NonNull + public Collection> getDataTypes() { + return ObjectUtils.notNull(atomicTypeByAdapterClass.values()); + } + /** * Lookup a specific {@link IDataTypeAdapter} by its adapter class. * diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java index 1a4e88a73..09f918f00 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java @@ -10,8 +10,9 @@ import gov.nist.secauto.metaschema.core.configuration.DefaultConfiguration; import gov.nist.secauto.metaschema.core.configuration.IConfiguration; import gov.nist.secauto.metaschema.core.configuration.IMutableConfiguration; -import gov.nist.secauto.metaschema.core.metapath.function.DefaultFunction.CallingContext; +import gov.nist.secauto.metaschema.core.metapath.function.CalledContext; import gov.nist.secauto.metaschema.core.metapath.function.IFunction.FunctionProperty; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.IUriResolver; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; @@ -75,7 +76,7 @@ private static class SharedState { @NonNull private final Map availableDocuments; @NonNull - private final Map> functionResultCache; + private final Map> functionResultCache; @Nullable private CachingLoader documentLoader; @NonNull @@ -92,7 +93,7 @@ public SharedState(@NonNull StaticContext staticContext) { this.functionResultCache = ObjectUtils.notNull(Caffeine.newBuilder() .maximumSize(5000) .expireAfterAccess(10, TimeUnit.MINUTES) - .>build().asMap()); + .>build().asMap()); this.configuration = new DefaultConfiguration<>(); this.configuration.enableFeature(MetapathEvaluationFeature.METAPATH_EVALUATE_PREDICATES); } @@ -194,7 +195,7 @@ public void setDocumentLoader(@NonNull IDocumentLoader documentLoader) { * @return the cached result sequence for the function call */ @Nullable - public ISequence getCachedResult(@NonNull CallingContext callingContext) { + public ISequence getCachedResult(@NonNull CalledContext callingContext) { return sharedState.functionResultCache.get(callingContext); } @@ -208,7 +209,7 @@ public ISequence getCachedResult(@NonNull CallingContext callingContext) { * @param result * the function call result */ - public void cacheResult(@NonNull CallingContext callingContext, @NonNull ISequence result) { + public void cacheResult(@NonNull CalledContext callingContext, @NonNull ISequence result) { ISequence old = sharedState.functionResultCache.put(callingContext, result); assert old == null; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java new file mode 100644 index 000000000..9a2a15799 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java @@ -0,0 +1,290 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath; + +import gov.nist.secauto.metaschema.core.metapath.MetapathExpression.ConversionFunction; +import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; +import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; +import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; + +import java.math.BigDecimal; + +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; + +public interface IMetapathExpression { + + /** + * Identifies the expected type for a Metapath evaluation result. + */ + enum ResultType { + /** + * The result is expected to be a {@link BigDecimal} value. + */ + NUMBER(BigDecimal.class, sequence -> { + INumericItem numeric = FunctionUtils.toNumeric(sequence, true); + return numeric == null ? null : numeric.asDecimal(); + }), + /** + * The result is expected to be a {@link String} value. + */ + STRING(String.class, sequence -> { + IAnyAtomicItem item = ISequence.of(sequence.atomize()).getFirstItem(true); + return item == null ? "" : item.asString(); + }), + /** + * The result is expected to be a {@link Boolean} value. + */ + BOOLEAN(Boolean.class, sequence -> FnBoolean.fnBoolean(sequence).toBoolean()), + /** + * The result is expected to be an {@link IItem} value. + */ + ITEM(IItem.class, sequence -> sequence.getFirstItem(true)); + + @NonNull + private final Class clazz; + private final ConversionFunction converter; + + ResultType(@NonNull Class clazz, @NonNull ConversionFunction converter) { + this.clazz = clazz; + this.converter = converter; + } + + /** + * Get the expected class for the result type. + * + * @return the expected class + * + */ + @NonNull + public Class expectedClass() { + return clazz; + } + + /** + * Convert the provided sequence to the expected type. + * + * @param + * the Java type of the expected return value + * @param sequence + * the Metapath result sequence to convert + * @return the converted sequence as the expected type + * @throws TypeMetapathException + * if the provided sequence is incompatible with the expected result + * type + */ + @Nullable + public T convert(@NonNull ISequence sequence) { + try { + return ObjectUtils.asNullableType(converter.convert(sequence)); + } catch (ClassCastException ex) { + throw new InvalidTypeMetapathException(null, + String.format("Unable to cast to expected result type '%s' using expected type '%s'.", + name(), + expectedClass().getName()), + ex); + } + } + } + + /** + * Get the Metapath expression identifying the current context node. + * + * @return the context expression + */ + @NonNull + static IMetapathExpression contextNode() { + return MetapathExpression.CONTEXT_NODE; + } + + /** + * Compile a Metapath expression string. + * + * @param path + * the metapath expression + * @return the compiled expression object + * @throws MetapathException + * if an error occurred while compiling the Metapath expression + */ + @NonNull + static IMetapathExpression compile(@NonNull String path) { + return MetapathExpression.compile(path, StaticContext.instance()); + } + + /** + * Compiles a Metapath expression string using the provided static context. + * + * @param path + * the metapath expression + * @param staticContext + * the static evaluation context + * @return the compiled expression object + * @throws MetapathException + * if an error occurred while compiling the Metapath expression + */ + @NonNull + static IMetapathExpression compile(@NonNull String path, @NonNull StaticContext staticContext) { + return MetapathExpression.compile(path, staticContext); + } + + /** + * Get the original Metapath expression as a string. + * + * @return the expression + */ + @NonNull + String getPath(); + + /** + * Get the static context used to compile this Metapath. + * + * @return the static context + */ + @NonNull + StaticContext getStaticContext(); + + /** + * Evaluate this Metapath expression without a specific focus. The required + * result type will be determined by the {@code resultType} argument. + * + * @param + * the expected result type + * @param resultType + * the type of result to produce + * @return the converted result + * @throws TypeMetapathException + * if the provided sequence is incompatible with the requested result + * type + * @throws MetapathException + * if an error occurred during evaluation + * @see ResultType#convert(ISequence) + */ + @Nullable + default T evaluateAs(@NonNull ResultType resultType) { + return evaluateAs(null, resultType); + } + + /** + * Evaluate this Metapath expression using the provided {@code focus} as the + * initial evaluation context. The required result type will be determined by + * the {@code resultType} argument. + * + * @param + * the expected result type + * @param focus + * the focus of the expression + * @param resultType + * the type of result to produce + * @return the converted result + * @throws TypeMetapathException + * if the provided sequence is incompatible with the requested result + * type + * @throws MetapathException + * if an error occurred during evaluation + * @see ResultType#convert(ISequence) + */ + @Nullable + default T evaluateAs( + @Nullable IItem focus, + @NonNull ResultType resultType) { + ISequence result = evaluate(focus); + return resultType.convert(result); + } + + /** + * Evaluate this Metapath expression using the provided {@code focus} as the + * initial evaluation context. The specific result type will be determined by + * the {@code resultType} argument. + *

+ * This variant allow for reuse of a provided {@code dynamicContext}. + * + * @param + * the expected result type + * @param focus + * the outer focus of the expression + * @param resultType + * the type of result to produce + * @param dynamicContext + * the dynamic context to use for evaluation + * @return the converted result + * @throws TypeMetapathException + * if the provided sequence is incompatible with the requested result + * type + * @throws MetapathException + * if an error occurred during evaluation + * @see ResultType#convert(ISequence) + */ + @Nullable + default T evaluateAs( + @Nullable IItem focus, + @NonNull ResultType resultType, + @NonNull DynamicContext dynamicContext) { + ISequence result = evaluate(focus, dynamicContext); + return resultType.convert(result); + } + + /** + * Evaluate this Metapath expression without a specific focus. + * + * @param + * the type of items contained in the resulting sequence + * @return a sequence of Metapath items representing the result of the + * evaluation + * @throws MetapathException + * if an error occurred during evaluation + */ + @NonNull + default ISequence evaluate() { + return evaluate((IItem) null); + } + + /** + * Evaluate this Metapath expression using the provided {@code focus} as the + * initial evaluation context. + * + * @param + * the type of items contained in the resulting sequence + * @param focus + * the outer focus of the expression + * @return a sequence of Metapath items representing the result of the + * evaluation + * @throws MetapathException + * if an error occurred during evaluation + */ + @NonNull + default ISequence evaluate( + @Nullable IItem focus) { + return evaluate(focus, new DynamicContext(getStaticContext())); + } + + /** + * Evaluate this Metapath expression using the provided {@code focus} as the + * initial evaluation context. + *

+ * This variant allow for reuse of a provided {@code dynamicContext}. + * + * @param + * the type of items contained in the resulting sequence + * @param focus + * the outer focus of the expression + * @param dynamicContext + * the dynamic context to use for evaluation + * @return a sequence of Metapath items representing the result of the + * evaluation + * @throws MetapathException + * if an error occurred during evaluation + */ + @NonNull + ISequence evaluate( + @Nullable IItem focus, + @NonNull DynamicContext dynamicContext); +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IPrintable.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IPrintable.java deleted file mode 100644 index cb63888fc..000000000 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IPrintable.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SPDX-FileCopyrightText: none - * SPDX-License-Identifier: CC0-1.0 - */ - -package gov.nist.secauto.metaschema.core.metapath; - -import edu.umd.cs.findbugs.annotations.NonNull; - -/** - * Identifies the implementation as being able to produce a string value for - * output. - */ -public interface IPrintable { - /** - * Get the string value. - * - * @return the string value - */ - @NonNull - String asString(); -} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpression.java index a8792b363..3b0004452 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpression.java @@ -13,13 +13,8 @@ import gov.nist.secauto.metaschema.core.metapath.cst.CSTPrinter; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.path.ContextItem; -import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; -import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.antlr.v4.runtime.CharStreams; @@ -34,7 +29,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; -import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import edu.umd.cs.findbugs.annotations.NonNull; @@ -46,84 +40,7 @@ @SuppressWarnings({ "PMD.CouplingBetweenObjects" // necessary since this class aggregates functionality }) -public class MetapathExpression { - - /** - * Identifies the expected type for a Metapath evaluation result. - */ - public enum ResultType { - /** - * The result is expected to be a {@link BigDecimal} value. - */ - NUMBER(BigDecimal.class, sequence -> { - INumericItem numeric = FunctionUtils.toNumeric(sequence, true); - return numeric == null ? null : numeric.asDecimal(); - }), - /** - * The result is expected to be a {@link String} value. - */ - STRING(String.class, sequence -> { - IAnyAtomicItem item = ISequence.of(sequence.atomize()).getFirstItem(true); - return item == null ? "" : item.asString(); - }), - /** - * The result is expected to be a {@link Boolean} value. - */ - BOOLEAN(Boolean.class, sequence -> FnBoolean.fnBoolean(sequence).toBoolean()), - /** - * The result is expected to be an {@link ISequence} value. - */ - SEQUENCE(ISequence.class, sequence -> sequence), - /** - * The result is expected to be an {@link IItem} value. - */ - ITEM(IItem.class, sequence -> sequence.getFirstItem(true)); - - @NonNull - private final Class clazz; - private final ConversionFunction converter; - - ResultType(@NonNull Class clazz, @NonNull ConversionFunction converter) { - this.clazz = clazz; - this.converter = converter; - } - - /** - * Get the expected class for the result type. - * - * @return the expected class - * - */ - @NonNull - public Class expectedClass() { - return clazz; - } - - /** - * Convert the provided sequence to the expected type. - * - * @param - * the Java type of the expected return value - * @param sequence - * the Metapath result sequence to convert - * @return the converted sequence as the expected type - * @throws TypeMetapathException - * if the provided sequence is incompatible with the expected result - * type - */ - @Nullable - public T convert(@NonNull ISequence sequence) { - try { - return ObjectUtils.asNullableType(converter.convert(sequence)); - } catch (ClassCastException ex) { - throw new InvalidTypeMetapathException(null, - String.format("Unable to cast to expected result type '%s' using expected type '%s'.", - name(), - expectedClass().getName()), - ex); - } - } - } +class MetapathExpression implements IMetapathExpression { /** * The Metapath expression identifying the current context node. @@ -140,20 +57,6 @@ public T convert(@NonNull ISequence sequence) { @NonNull private final StaticContext staticContext; - /** - * Compiles a Metapath expression string. - * - * @param path - * the metapath expression - * @return the compiled expression object - * @throws MetapathException - * if an error occurred while compiling the Metapath expression - */ - @NonNull - public static MetapathExpression compile(@NonNull String path) { - return compile(path, StaticContext.instance()); - } - /** * Compiles a Metapath expression string using the provided static context. * @@ -254,12 +157,7 @@ protected MetapathExpression( this.staticContext = staticContext; } - /** - * Get the original Metapath expression as a string. - * - * @return the expression - */ - @NonNull + @Override public String getPath() { return path; } @@ -274,13 +172,8 @@ protected IExpression getASTNode() { return expression; } - /** - * Get the static context used to compile this Metapath. - * - * @return the static context - */ - @NonNull - protected StaticContext getStaticContext() { + @Override + public StaticContext getStaticContext() { return staticContext; } @@ -289,146 +182,14 @@ public String toString() { return CSTPrinter.toString(getASTNode()); } - /** - * Evaluate this Metapath expression without a specific focus. The required - * result type will be determined by the {@code resultType} argument. - * - * @param - * the expected result type - * @param resultType - * the type of result to produce - * @return the converted result - * @throws TypeMetapathException - * if the provided sequence is incompatible with the requested result - * type - * @throws MetapathException - * if an error occurred during evaluation - * @see ResultType#convert(ISequence) - */ - @Nullable - public T evaluateAs(@NonNull ResultType resultType) { - return evaluateAs(null, resultType); - } - - /** - * Evaluate this Metapath expression using the provided {@code focus} as the - * initial evaluation context. The required result type will be determined by - * the {@code resultType} argument. - * - * @param - * the expected result type - * @param focus - * the outer focus of the expression - * @param resultType - * the type of result to produce - * @return the converted result - * @throws TypeMetapathException - * if the provided sequence is incompatible with the requested result - * type - * @throws MetapathException - * if an error occurred during evaluation - * @see ResultType#convert(ISequence) - */ - @Nullable - public T evaluateAs( - @Nullable IItem focus, - @NonNull ResultType resultType) { - ISequence result = evaluate(focus); - return resultType.convert(result); - } - - /** - * Evaluate this Metapath expression using the provided {@code focus} as the - * initial evaluation context. The specific result type will be determined by - * the {@code resultType} argument. - *

- * This variant allow for reuse of a provided {@code dynamicContext}. - * - * @param - * the expected result type - * @param focus - * the outer focus of the expression - * @param resultType - * the type of result to produce - * @param dynamicContext - * the dynamic context to use for evaluation - * @return the converted result - * @throws TypeMetapathException - * if the provided sequence is incompatible with the requested result - * type - * @throws MetapathException - * if an error occurred during evaluation - * @see ResultType#convert(ISequence) - */ - @Nullable - public T evaluateAs( - @Nullable IItem focus, - @NonNull ResultType resultType, - @NonNull DynamicContext dynamicContext) { - ISequence result = evaluate(focus, dynamicContext); - return resultType.convert(result); - } - - /** - * Evaluate this Metapath expression without a specific focus. - * - * @param - * the type of items contained in the resulting sequence - * @return a sequence of Metapath items representing the result of the - * evaluation - * @throws MetapathException - * if an error occurred during evaluation - */ - @NonNull - public ISequence evaluate() { - return evaluate((IItem) null); - } - - /** - * Evaluate this Metapath expression using the provided {@code focus} as the - * initial evaluation context. - * - * @param - * the type of items contained in the resulting sequence - * @param focus - * the outer focus of the expression - * @return a sequence of Metapath items representing the result of the - * evaluation - * @throws MetapathException - * if an error occurred during evaluation - */ - @SuppressWarnings("unchecked") - @NonNull - public ISequence evaluate( - @Nullable IItem focus) { - return (ISequence) evaluate(focus, new DynamicContext(getStaticContext())); - } - - /** - * Evaluate this Metapath expression using the provided {@code focus} as the - * initial evaluation context. - *

- * This variant allow for reuse of a provided {@code dynamicContext}. - * - * @param - * the type of items contained in the resulting sequence - * @param focus - * the outer focus of the expression - * @param dynamicContext - * the dynamic context to use for evaluation - * @return a sequence of Metapath items representing the result of the - * evaluation - * @throws MetapathException - * if an error occurred during evaluation - */ - @SuppressWarnings("unchecked") + @Override @NonNull public ISequence evaluate( @Nullable IItem focus, @NonNull DynamicContext dynamicContext) { try { - return (ISequence) getASTNode().accept(dynamicContext, ISequence.of(focus)); - } catch (MetapathException ex) { // NOPMD - intentional + return ObjectUtils.asType(getASTNode().accept(dynamicContext, ISequence.of(focus))); + } catch (MetapathException ex) { throw new MetapathException( String.format("An error occurred while evaluating the expression '%s'. %s", getPath(), @@ -442,4 +203,5 @@ interface ConversionFunction { @Nullable Object convert(@NonNull ISequence sequence); } + } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java index c49412a3b..45ab73d3f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java @@ -39,6 +39,7 @@ * The implementation of a Metapath * static context. */ +// FIXME: refactor well-known into a new class public final class StaticContext { @NonNull private static final Map WELL_KNOWN_NAMESPACES; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/antlr/AbstractAstVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/antlr/AbstractAstVisitor.java index a61c80eab..74eec5120 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/antlr/AbstractAstVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/antlr/AbstractAstVisitor.java @@ -246,6 +246,40 @@ public R visitArgument(Metapath10.ArgumentContext ctx) { throw new IllegalStateException(ERR_NO_DELEGATION); } + // ============================================================ + // https://www.w3.org/TR/xpath-31/#doc-xpath31-NamedFunctionRef + // ============================================================ + + @Override + public R visitNamedfunctionref(Metapath10.NamedfunctionrefContext ctx) { + throw new UnsupportedOperationException("expression not supported"); + } + + // ============================================== + // https://www.w3.org/TR/xpath-31/#id-inline-func + // ============================================== + + @Override + public R visitFunctionitemexpr(Metapath10.FunctionitemexprContext ctx) { + assert ctx != null; + return delegateToChild(ctx); + } + + /** + * Handle the provided expression. + * + * @param ctx + * the provided expression context + * @return the result + */ + protected abstract R handleInlinefunctionexpr(@NonNull Metapath10.InlinefunctionexprContext ctx); + + @Override + public R visitInlinefunctionexpr(Metapath10.InlinefunctionexprContext ctx) { + assert ctx != null; + return handle(ctx, this::handleInlinefunctionexpr); + } + // ======================================================================= // Enclosed Expressions - https://www.w3.org/TR/xpath-31/#id-enclosed-expr // ======================================================================= @@ -1018,16 +1052,6 @@ public R visitArrowfunctionspecifier(Metapath10.ArrowfunctionspecifierContext ct throw new IllegalStateException(ERR_NO_DELEGATION); } - @Override - public R visitNamedfunctionref(Metapath10.NamedfunctionrefContext ctx) { - throw new UnsupportedOperationException("expression not supported"); - } - - @Override - public R visitInlinefunctionexpr(Metapath10.InlinefunctionexprContext ctx) { - throw new UnsupportedOperationException("expression not supported"); - } - /* * ========================================================== * The following are handled inline by other expression types @@ -1225,12 +1249,6 @@ public R visitFunctionbody(Metapath10.FunctionbodyContext ctx) { throw new IllegalStateException(ERR_NO_DELEGATION); } - @Override - public R visitFunctionitemexpr(Metapath10.FunctionitemexprContext ctx) { - // should never be called, since this is handled by the parent expression - throw new IllegalStateException(ERR_NO_DELEGATION); - } - @Override public R visitTypedeclaration(Metapath10.TypedeclarationContext ctx) { // should never be called, since this is handled by the parent expression diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractCSTVisitorBase.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractCSTVisitorBase.java index ef2124bec..afa4387c9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractCSTVisitorBase.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractCSTVisitorBase.java @@ -113,6 +113,45 @@ public IExpression visit(ParseTree tree) { return super.visit(tree); } + /** + * Parse the provided context as an n-ary phrase. + * + * @param + * the Java type of the antlr context to parse + * @param + * the Java type of the child expressions produced by this parser + * @param + * the Java type of the outer expression produced by the parser + * @param context + * the antlr context to parse + * @param startIndex + * the child index to start parsing on + * @param step + * the increment to advance while parsing child expressions + * @param parser + * a binary function used to produce child expressions + * @return the outer expression or {@code null} if no children exist to parse + */ + @Nullable + protected + List nairyToList( + @NonNull CONTEXT context, + int startIndex, + int step, + @NonNull BiFunction parser) { + int numChildren = context.getChildCount(); + + List retval = null; + if (startIndex < numChildren) { + retval = new ArrayList<>((numChildren - startIndex) / step); + for (int idx = startIndex; idx < numChildren; idx += step) { + R result = parser.apply(context, idx); + retval.add(result); + } + } + return retval; + } + /** * Parse the provided context as an n-ary phrase. * @@ -135,7 +174,7 @@ public IExpression visit(ParseTree tree) { * @return the outer expression or {@code null} if no children exist to parse */ @Nullable - protected + protected R nairyToCollection( @NonNull CONTEXT context, int startIndex, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java index 0ca25d703..c1cce8dc6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpressionVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpressionVisitor.java index 43a21acce..208723d80 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpressionVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpressionVisitor.java @@ -9,7 +9,6 @@ import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySquareConstructor; import gov.nist.secauto.metaschema.core.metapath.cst.items.DecimalLiteral; import gov.nist.secauto.metaschema.core.metapath.cst.items.EmptySequence; -import gov.nist.secauto.metaschema.core.metapath.cst.items.FunctionCallAccessor; import gov.nist.secauto.metaschema.core.metapath.cst.items.IntegerLiteral; import gov.nist.secauto.metaschema.core.metapath.cst.items.Intersect; import gov.nist.secauto.metaschema.core.metapath.cst.items.MapConstructor; @@ -210,7 +209,17 @@ public RESULT visitFlag(Flag expr, CONTEXT context) { } @Override - public RESULT visitFunctionCall(StaticFunctionCall expr, CONTEXT context) { + public RESULT visitStaticFunctionCall(StaticFunctionCall expr, CONTEXT context) { + return visitChildren(expr, context); + } + + @Override + public RESULT visitDynamicFunctionCall(DynamicFunctionCall expr, CONTEXT context) { + return visitChildren(expr, context); + } + + @Override + public RESULT visitAnonymousFunctionCall(AnonymousFunctionCall expr, CONTEXT context) { return visitChildren(expr, context); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCall.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCall.java new file mode 100644 index 000000000..27a5b6862 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCall.java @@ -0,0 +1,122 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.cst; + +import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractFunction; +import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; + +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; + +/** + * Executes an unnamed function call based on a client provided Metapath + * expression that is declared inline within a Metapath expression. + */ +public class AnonymousFunctionCall + extends AbstractFunction + implements IExpression, IFunction { + @NonNull + private static final Set PROPERTIES = ObjectUtils.notNull(EnumSet.of( + FunctionProperty.DETERMINISTIC)); + @NonNull + private final ISequenceType result; + @NonNull + private final IExpression body; + + /** + * Construct a new function call expression. + * + * @param arguments + * the parameter declarations for the function call + * @param result + * the expected result of the function call + * @param body + * the Metapath expression that implements the logic of the function + */ + public AnonymousFunctionCall( + @NonNull List arguments, + @NonNull ISequenceType result, + @NonNull IExpression body) { + super("(anonymous)-" + UUID.randomUUID().toString(), "", arguments); + this.result = result; + this.body = body; + } + + @Override + public List getChildren() { + return ObjectUtils.notNull(List.of(body)); + } + + @Override + public Class getBaseResultType() { + return IFunction.class; + } + + @Override + public RESULT accept(IExpressionVisitor visitor, CONTEXT context) { + return visitor.visitAnonymousFunctionCall(this, context); + } + + @Override + public ISequence accept(DynamicContext dynamicContext, ISequence focus) { + return ISequence.of(this); + } + + @SuppressWarnings("null") + @Override + public String toASTString() { + return String.format("%s[arguments=%s,return=%s]", + getClass().getName(), getName(), + getArguments(), + result.toSignature()); + } + + @Override + public Set getProperties() { + return PROPERTIES; + } + + @Override + public ISequenceType getResult() { + return result; + } + + @Override + @NonNull + protected ISequence executeInternal( + @NonNull List> arguments, + @NonNull DynamicContext dynamicContext, + @Nullable IItem focus) { + + DynamicContext subContext = dynamicContext.subContext(); + if (arguments.size() != getArguments().size()) { + throw new IllegalArgumentException("Number of arguments does not match the number of parameters."); + } + + Iterator> args = arguments.iterator(); + Iterator params = getArguments().iterator(); + while (args.hasNext() && params.hasNext()) { + ISequence sequence = args.next(); + IArgument param = params.next(); + + subContext.bindVariableValue(param.getName(), ObjectUtils.notNull(sequence)); + } + + return body.accept(subContext, ISequence.of(focus)); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java index 304d61246..7c8243227 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java @@ -8,12 +8,12 @@ import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10; +import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10.ParamContext; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10Lexer; import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySequenceConstructor; import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySquareConstructor; import gov.nist.secauto.metaschema.core.metapath.cst.items.DecimalLiteral; import gov.nist.secauto.metaschema.core.metapath.cst.items.EmptySequence; -import gov.nist.secauto.metaschema.core.metapath.cst.items.FunctionCallAccessor; import gov.nist.secauto.metaschema.core.metapath.cst.items.IntegerLiteral; import gov.nist.secauto.metaschema.core.metapath.cst.items.Intersect; import gov.nist.secauto.metaschema.core.metapath.cst.items.MapConstructor; @@ -61,12 +61,14 @@ import gov.nist.secauto.metaschema.core.metapath.cst.type.Treat; import gov.nist.secauto.metaschema.core.metapath.cst.type.TypeTestSupport; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.impl.AbstractKeySpecifier; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -101,6 +103,10 @@ public class BuildCSTVisitor extends AbstractCSTVisitorBase { @NonNull + private static final ISequenceType DEFAULT_FUNCTION_SEQUENCE_TYPE + = ISequenceType.of(IItemType.item(), Occurrence.ZERO_OR_MORE); + + @NonNull private final StaticContext context; /** @@ -381,6 +387,53 @@ protected IExpression handleFunctioncall(Metapath10.FunctioncallContext ctx) { arguments); } + // ============================================================ + // https://www.w3.org/TR/xpath-31/#doc-xpath31-NamedFunctionRef + // ============================================================ + + @Override + public IExpression visitNamedfunctionref(Metapath10.NamedfunctionrefContext ctx) { + throw new UnsupportedOperationException("expression not supported"); + } + + // ============================================== + // https://www.w3.org/TR/xpath-31/#id-inline-func + // ============================================== + + @Override + public IExpression handleInlinefunctionexpr(Metapath10.InlinefunctionexprContext context) { + // parse the param list + List parameters = ObjectUtils.notNull(context.paramlist() == null + ? CollectionUtil.emptyList() + : nairyToList( + ObjectUtils.notNull(context.paramlist()), + 0, + 2, + (ctx, idx) -> { + int pos = (idx - 1) / 2; + ParamContext tree = ctx.param(pos); + return IArgument.of( + getContext().parseVariableName(ObjectUtils.notNull(tree.eqname().getText())), + tree.typedeclaration() == null + ? DEFAULT_FUNCTION_SEQUENCE_TYPE + : TypeTestSupport.parseSequenceType( + ObjectUtils.notNull(tree.typedeclaration().sequencetype()), + getContext())); + })); + + // parse the result type + ISequenceType resultSequenceType = context.sequencetype() == null + ? DEFAULT_FUNCTION_SEQUENCE_TYPE + : TypeTestSupport.parseSequenceType( + ObjectUtils.notNull(context.sequencetype()), + getContext()); + + // parse the function body + IExpression body = visit(context.functionbody().enclosedexpr()); + + return new AnonymousFunctionCall(parameters, resultSequenceType, body); + } + // ========================================================================= // Filter Expressions - https://www.w3.org/TR/xpath-31/#id-filter-expression // ========================================================================= @@ -448,7 +501,8 @@ protected IExpression handlePostfixexpr(Metapath10.PostfixexprContext context) { // map or array access using function call syntax result = new FunctionCallAccessor( left, - ObjectUtils.notNull(parseArgumentList((Metapath10.ArgumentlistContext) tree).findFirst().get())); + ObjectUtils.notNull(parseArgumentList((Metapath10.ArgumentlistContext) tree) + .collect(Collectors.toUnmodifiableList()))); } else if (tree instanceof Metapath10.PredicateContext) { result = new PredicateExpression( left, @@ -1154,16 +1208,12 @@ protected IExpression handleSimplemapexpr(Metapath10.SimplemapexprContext contex @Override protected IExpression handleArrowexpr(Metapath10.ArrowexprContext context) { - // FIXME: handle additional syntax for varef and parenthesized - return handleGroupedNAiry(context, 0, 3, (ctx, idx, left) -> { // the next child is "=>" assert "=>".equals(ctx.getChild(idx).getText()); int offset = (idx - 1) / 3; - Metapath10.ArrowfunctionspecifierContext fcCtx - = ctx.getChild(Metapath10.ArrowfunctionspecifierContext.class, offset); Metapath10.ArgumentlistContext argumentCtx = ctx.getChild(Metapath10.ArgumentlistContext.class, offset); try (Stream args = Stream.concat( @@ -1171,12 +1221,35 @@ protected IExpression handleArrowexpr(Metapath10.ArrowexprContext context) { parseArgumentList(ObjectUtils.notNull(argumentCtx)))) { assert args != null; - List arguments = ObjectUtils.notNull(args.collect(Collectors.toUnmodifiableList())); + // prepend the focus + List arguments = ObjectUtils.notNull(args + .collect(Collectors.toUnmodifiableList())); + + Metapath10.ArrowfunctionspecifierContext arrowCtx + = ctx.getChild(Metapath10.ArrowfunctionspecifierContext.class, offset); + if (arrowCtx.eqname() != null) { + // named function + return new StaticFunctionCall( + () -> getContext().lookupFunction(ObjectUtils.notNull(arrowCtx.eqname().getText()), arguments.size()), + arguments); + } + + IExpression result; + if (arrowCtx.varref() != null) { + // function instance or name reference + result = new VariableReference(getContext().parseVariableName( + ObjectUtils.notNull(arrowCtx.varref().varname().eqname().getText()))); + } else if (arrowCtx.parenthesizedexpr() != null) { + // function expression + result = visit(arrowCtx.parenthesizedexpr().expr()); + } else { + throw new StaticMetapathException( + StaticMetapathException.INVALID_PATH_GRAMMAR, + String.format("Unable to get function name using arrow specifier '%s'.", arrowCtx.getText())); + } - return new StaticFunctionCall( - () -> getContext().lookupFunction( - ObjectUtils.notNull(fcCtx.eqname().getText()), - arguments.size()), + return new DynamicFunctionCall( + result, arguments); } }); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/CSTPrinter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/CSTPrinter.java index e4ec93920..0c449750a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/CSTPrinter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/CSTPrinter.java @@ -9,7 +9,6 @@ import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySquareConstructor; import gov.nist.secauto.metaschema.core.metapath.cst.items.DecimalLiteral; import gov.nist.secauto.metaschema.core.metapath.cst.items.EmptySequence; -import gov.nist.secauto.metaschema.core.metapath.cst.items.FunctionCallAccessor; import gov.nist.secauto.metaschema.core.metapath.cst.items.IntegerLiteral; import gov.nist.secauto.metaschema.core.metapath.cst.items.Intersect; import gov.nist.secauto.metaschema.core.metapath.cst.items.MapConstructor; @@ -192,8 +191,18 @@ public String visitFlag(Flag expr, State context) { } @Override - public String visitFunctionCall(StaticFunctionCall expr, State context) { - return appendNode(expr, super.visitFunctionCall(expr, context), context); + public String visitStaticFunctionCall(StaticFunctionCall expr, State context) { + return appendNode(expr, super.visitStaticFunctionCall(expr, context), context); + } + + @Override + public String visitDynamicFunctionCall(DynamicFunctionCall expr, State context) { + return appendNode(expr, super.visitDynamicFunctionCall(expr, context), context); + } + + @Override + public String visitAnonymousFunctionCall(AnonymousFunctionCall expr, State context) { + return appendNode(expr, super.visitAnonymousFunctionCall(expr, context), context); } @Override diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java new file mode 100644 index 000000000..26941f69c --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java @@ -0,0 +1,84 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.cst; + +import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import edu.umd.cs.findbugs.annotations.NonNull; + +/** + * Executes a function call based on a specifier expression that is used to + * determine the function and multiple argument expressions that are used to + * determine the function arguments. + */ +public class DynamicFunctionCall implements IExpression { + @NonNull + private final IExpression functionIdentifier; + @NonNull + private final List arguments; + + /** + * Construct a new function call expression. + * + * @param functionIdentifier + * the function expression, identifying either a function or function + * name + * @param arguments + * the expressions used to provide arguments to the function call + */ + public DynamicFunctionCall(@NonNull IExpression functionIdentifier, @NonNull List arguments) { + this.functionIdentifier = functionIdentifier; + this.arguments = arguments; + } + + @Override + public List getChildren() { + return ObjectUtils.notNull(Stream.concat( + Stream.of(functionIdentifier), + arguments.stream()) + .collect(Collectors.toUnmodifiableList())); + } + + @Override + public Class getBaseResultType() { + return IItem.class; + } + + @Override + public RESULT accept(IExpressionVisitor visitor, CONTEXT context) { + return visitor.visitDynamicFunctionCall(this, context); + } + + @Override + public ISequence accept(DynamicContext dynamicContext, ISequence focus) { + List> arguments = ObjectUtils.notNull(this.arguments.stream() + .map(expression -> expression.accept(dynamicContext, focus)).collect(Collectors.toList())); + + IItem specifier = functionIdentifier.accept(dynamicContext, focus).getFirstItem(true); + IFunction function; + if (specifier instanceof IFunction) { + function = (IFunction) specifier; + } else if (specifier != null) { + function = dynamicContext.getStaticContext().lookupFunction( + specifier.toAtomicItem().asString(), + arguments.size()); + } else { + throw new StaticMetapathException( + StaticMetapathException.NO_FUNCTION_MATCH, + "Unable to get function name. The error specifier is an empty sequence."); + } + return function.execute(arguments, dynamicContext, focus); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/For.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/For.java index 01aea3ddf..35c95228f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/For.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/For.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.Let.VariableDeclaration; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.LinkedList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/FunctionCallAccessor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java similarity index 61% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/FunctionCallAccessor.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java index 5e0fbcd62..02e81feb4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/FunctionCallAccessor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java @@ -3,23 +3,24 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.cst.items; +package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; -import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.ArrayGet; import gov.nist.secauto.metaschema.core.metapath.function.library.MapGet; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import edu.umd.cs.findbugs.annotations.NonNull; @@ -27,7 +28,7 @@ public class FunctionCallAccessor implements IExpression { @NonNull private final IExpression base; @NonNull - private final IExpression argument; + private final List arguments; /** * Construct a new functional call accessor. @@ -35,13 +36,12 @@ public class FunctionCallAccessor implements IExpression { * @param base * the expression whose result is used as the map or array to perform * the lookup on - * @param keyOrIndex - * the value to find, which will be the key for a map or the index for - * an array + * @param arguments + * the function call argument expressions */ - public FunctionCallAccessor(@NonNull IExpression base, @NonNull IExpression keyOrIndex) { + public FunctionCallAccessor(@NonNull IExpression base, @NonNull List arguments) { this.base = base; - this.argument = keyOrIndex; + this.arguments = arguments; } /** @@ -60,21 +60,39 @@ public IExpression getBase() { * @return the argument */ @NonNull - public IExpression getArgument() { - return argument; + public List getArguments() { + return arguments; } @SuppressWarnings("null") @Override - public List getChildren() { - return List.of(getBase(), getArgument()); + public List getChildren() { + return Stream.concat(Stream.of(getBase()), getArguments().stream()) + .collect(Collectors.toUnmodifiableList()); } + @SuppressWarnings("PMD.OnlyOneReturn") @Override public ISequence accept(DynamicContext dynamicContext, ISequence focus) { ISequence target = getBase().accept(dynamicContext, focus); IItem collection = target.getFirstItem(true); - IAnyAtomicItem key = ISequence.of(getArgument().accept(dynamicContext, focus).atomize()) + + if (collection instanceof AnonymousFunctionCall) { + return ((AnonymousFunctionCall) collection).execute( + ObjectUtils.notNull(getArguments().stream() + .map(expr -> expr.accept(dynamicContext, focus)) + .collect(Collectors.toUnmodifiableList())), + dynamicContext, + focus); + } + + // the value to find, which will be the key for a map or the index for an array + IExpression argument = getArguments().stream().findFirst() + .orElseThrow(() -> new StaticMetapathException( + StaticMetapathException.NO_FUNCTION_MATCH, + "No key provided for array or map lookup")); + + IAnyAtomicItem key = ISequence.of(argument.accept(dynamicContext, focus).atomize()) .getFirstItem(false); if (key == null) { throw new StaticMetapathException(StaticMetapathException.NO_FUNCTION_MATCH, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/ICstExpressionFactory.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/ICstExpressionFactory.java index 4a3c4e048..a6f5d3877 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/ICstExpressionFactory.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/ICstExpressionFactory.java @@ -10,7 +10,6 @@ import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySquareConstructor; import gov.nist.secauto.metaschema.core.metapath.cst.items.DecimalLiteral; import gov.nist.secauto.metaschema.core.metapath.cst.items.EmptySequence; -import gov.nist.secauto.metaschema.core.metapath.cst.items.FunctionCallAccessor; import gov.nist.secauto.metaschema.core.metapath.cst.logic.And; import gov.nist.secauto.metaschema.core.metapath.cst.logic.Except; import gov.nist.secauto.metaschema.core.metapath.cst.logic.If; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpression.java index 1d6075ba3..c54615d39 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpression.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpressionVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpressionVisitor.java index e8bbe6243..19480dfe2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpressionVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpressionVisitor.java @@ -9,7 +9,6 @@ import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySquareConstructor; import gov.nist.secauto.metaschema.core.metapath.cst.items.DecimalLiteral; import gov.nist.secauto.metaschema.core.metapath.cst.items.EmptySequence; -import gov.nist.secauto.metaschema.core.metapath.cst.items.FunctionCallAccessor; import gov.nist.secauto.metaschema.core.metapath.cst.items.IntegerLiteral; import gov.nist.secauto.metaschema.core.metapath.cst.items.Intersect; import gov.nist.secauto.metaschema.core.metapath.cst.items.MapConstructor; @@ -197,7 +196,29 @@ public interface IExpressionVisitor { * the processing context * @return the visitation result or {@code null} if no result was produced */ - RESULT visitFunctionCall(@NonNull StaticFunctionCall expr, @NonNull CONTEXT context); + RESULT visitStaticFunctionCall(@NonNull StaticFunctionCall expr, @NonNull CONTEXT context); + + /** + * Visit the CST node. + * + * @param expr + * the CST node to visit + * @param context + * the processing context + * @return the visitation result or {@code null} if no result was produced + */ + RESULT visitDynamicFunctionCall(@NonNull DynamicFunctionCall expr, @NonNull CONTEXT context); + + /** + * Visit the CST node. + * + * @param expr + * the CST node to visit + * @param context + * the processing context + * @return the visitation result or {@code null} if no result was produced + */ + RESULT visitAnonymousFunctionCall(@NonNull AnonymousFunctionCall expr, @NonNull CONTEXT context); /** * Visit the CST node. diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Let.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Let.java index 9ae87e923..47c887a87 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Let.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Let.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Metapath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Metapath.java index 369d23726..6ee1b9f0e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Metapath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Metapath.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java index fc329c615..2cd85e4ec 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; @@ -19,23 +19,39 @@ import edu.umd.cs.findbugs.annotations.NonNull; import nl.talsmasoftware.lazy4j.Lazy; +/** + * Executes a function call based on the provided function and multiple argument + * expressions that are used to determine the function arguments. + *

+ * This class handles static function calls where the name of the function is + * known during static analysis (the parsing phase), as opposed to dynamic or + * anonymous function calls where the name is not available or known until + * execution. + *

+ * Static functions are resolved during the parsing phase and must exist in the + * function registry. + */ +// FIXME: Change compilation to error when a non-existant function is called. +// Manage this error where the compilation is requested public class StaticFunctionCall implements IExpression { - @NonNull - private final List arguments; @NonNull private final Lazy functionSupplier; + @NonNull + private final List arguments; /** * Construct a new function call expression. * * @param functionSupplier - * the function implementation supplier + * the function supplier, which is used to lazy fetch the function + * allowing the containing Metapaths to parse even if a function does + * not exist during the parsing phase. * @param arguments * the expressions used to provide arguments to the function call */ public StaticFunctionCall(@NonNull Supplier functionSupplier, @NonNull List arguments) { - this.arguments = arguments; this.functionSupplier = ObjectUtils.notNull(Lazy.lazy(functionSupplier)); + this.arguments = arguments; } /** @@ -46,8 +62,16 @@ public StaticFunctionCall(@NonNull Supplier functionSupplier, @NonNul * @throws StaticMetapathException * if the function was not found */ + @NonNull public IFunction getFunction() { - return ObjectUtils.notNull(functionSupplier.get()); + IFunction function = functionSupplier.get(); + if (function == null) { + throw new StaticMetapathException( + StaticMetapathException.NO_FUNCTION_MATCH, + String.format( + "No matching function found for the given name and arguments")); + } + return function; } @Override @@ -63,17 +87,18 @@ public Class getBaseResultType() { @SuppressWarnings("null") @Override public String toASTString() { - return String.format("%s[name=%s]", getClass().getName(), getFunction().getQName()); + return String.format("%s[name=%s, arity=%d]", getClass().getName(), getFunction().getQName(), + getFunction().arity()); } @Override public RESULT accept(IExpressionVisitor visitor, CONTEXT context) { - return visitor.visitFunctionCall(this, context); + return visitor.visitStaticFunctionCall(this, context); } @Override public ISequence accept(DynamicContext dynamicContext, ISequence focus) { - List> arguments = ObjectUtils.notNull(getChildren().stream() + List> arguments = ObjectUtils.notNull(this.arguments.stream() .map(expression -> expression.accept(dynamicContext, focus)).collect(Collectors.toList())); IFunction function = getFunction(); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/VariableReference.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/VariableReference.java index b8b78c46e..c775e8647 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/VariableReference.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/VariableReference.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySequenceConstructor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySequenceConstructor.java index 32f6ba745..26f584d77 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySequenceConstructor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySequenceConstructor.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySquareConstructor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySquareConstructor.java index f79185922..5668989eb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySquareConstructor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySquareConstructor.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/DecimalLiteral.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/DecimalLiteral.java index 626c4e739..18432f253 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/DecimalLiteral.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/DecimalLiteral.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; import java.math.BigDecimal; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/EmptySequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/EmptySequence.java index 9cf7ad6a3..1ca7038bd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/EmptySequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/EmptySequence.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.Collections; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/IntegerLiteral.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/IntegerLiteral.java index 9bb45d8b5..2a92f3153 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/IntegerLiteral.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/IntegerLiteral.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Intersect.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Intersect.java index 1a2c9423e..f5543f928 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Intersect.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Intersect.java @@ -5,11 +5,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.cst.logic.AbstractFilterExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/MapConstructor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/MapConstructor.java index 44c12c60c..82836ac45 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/MapConstructor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/MapConstructor.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/PostfixLookup.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/PostfixLookup.java index b07a5a2f6..ecaadea6a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/PostfixLookup.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/PostfixLookup.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Quantified.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Quantified.java index 8ef354ca5..1071f9f90 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Quantified.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Quantified.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Range.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Range.java index 985026c74..c30ffe2bc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Range.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Range.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractBinaryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/SimpleMap.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/SimpleMap.java index 9cbe5bbcf..cf2502fbb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/SimpleMap.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/SimpleMap.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractBinaryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringConcat.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringConcat.java index ed5a8be7e..2b3561ee7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringConcat.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringConcat.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNAryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnConcat; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringLiteral.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringLiteral.java index e8c6b356e..c1235f019 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringLiteral.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringLiteral.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/UnaryLookup.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/UnaryLookup.java index 6a8c2aed4..417a2c962 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/UnaryLookup.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/UnaryLookup.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Union.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Union.java index 4b488a372..0b320914e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Union.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Union.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNAryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/AbstractFilterExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/AbstractFilterExpression.java index 23fc150bd..659e0d7c4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/AbstractFilterExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/AbstractFilterExpression.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractBinaryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/And.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/And.java index ade1200db..2bd3aad20 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/And.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/And.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNAryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Except.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Except.java index 5b88a1c78..8170b61c5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Except.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Except.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/GeneralComparison.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/GeneralComparison.java index e772f756a..d2ac892de 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/GeneralComparison.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/GeneralComparison.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/If.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/If.java index c3e78ba28..a00c15fd5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/If.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/If.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Negate.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Negate.java index 71c7bcb7e..41c245413 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Negate.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Negate.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractUnaryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Or.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Or.java index abd9e94c9..cf6e933f3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Or.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Or.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNAryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import java.util.Arrays; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpression.java index 8808011a3..35d63d1c7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpression.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathEvaluationFeature; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.cst.items.IntegerLiteral; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparison.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparison.java index 31f2640a4..00c1727c8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparison.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparison.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractBasicArithmeticExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractBasicArithmeticExpression.java index 10e6dfccb..e04d0a18b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractBasicArithmeticExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractBasicArithmeticExpression.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Addition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Addition.java index 38bb20797..5a8263343 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Addition.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Addition.java @@ -5,11 +5,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Division.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Division.java index 25075bcd8..d13cda286 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Division.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Division.java @@ -5,11 +5,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/IntegerDivision.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/IntegerDivision.java index 80ecc996b..f72ee98a2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/IntegerDivision.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/IntegerDivision.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Modulo.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Modulo.java index a9d92058c..050f0c10f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Modulo.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Modulo.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Multiplication.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Multiplication.java index 24414866a..f943a2cd2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Multiplication.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Multiplication.java @@ -5,11 +5,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Subtraction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Subtraction.java index c42c9b32e..b16e493a8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Subtraction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Subtraction.java @@ -5,11 +5,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java index 4f0cb4a62..7403c311a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.item.node.ICycledAssemblyNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java index 7437c4250..024e270d8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java index 6eeb3bf6d..d28205946 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java @@ -7,9 +7,9 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import java.util.Collections; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java index 1a3548120..b78a167b5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNamedInstanceExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java index 76f713c68..3f87895ea 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNamedInstanceExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java index 8df1d9dfe..b787ee242 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeDoubleSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeDoubleSlashPath.java index 178df185c..e1f2694de 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeDoubleSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeDoubleSlashPath.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import java.util.stream.Stream; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeSlashPath.java index 0edc32d1b..03d87c34d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeSlashPath.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java index deff2aae5..383fc62a3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java index d8034a453..51a880769 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java index a50c66d9a..3b46b6351 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Step.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Step.java index bb4d2825e..aff388ef2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Step.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Step.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java index 2569be173..fbb0d49fd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/AbstractCastingExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/AbstractCastingExpression.java index 7bb4fd7be..1b9d0a388 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/AbstractCastingExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/AbstractCastingExpression.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Cast.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Cast.java index 85538bfbb..89cf201b4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Cast.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Cast.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Castable.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Castable.java index 1171d3296..ba9bc0697 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Castable.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Castable.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOf.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOf.java index e1d556c93..d86812771 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOf.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOf.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java index 171a13fec..00c74e7b8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java @@ -7,10 +7,10 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/AbstractFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/AbstractFunction.java deleted file mode 100644 index 434605dcf..000000000 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/AbstractFunction.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SPDX-FileCopyrightText: none - * SPDX-License-Identifier: CC0-1.0 - */ - -package gov.nist.secauto.metaschema.core.metapath.function; - -import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; - -import java.util.List; - -import edu.umd.cs.findbugs.annotations.NonNull; - -abstract class AbstractFunction implements IFunction { - @NonNull - private final IEnhancedQName qname; - @NonNull - private final List arguments; - - protected AbstractFunction( - @NonNull String name, - @NonNull String namespace, - @NonNull List arguments) { - this(IEnhancedQName.of(namespace, name), arguments); - } - - protected AbstractFunction( - @NonNull IEnhancedQName qname, - @NonNull List arguments) { - this.qname = qname; - this.arguments = arguments; - } - - @Override - public IEnhancedQName getQName() { - return qname; - } - - @Override - public int arity() { - return arguments.size(); - } - - @Override - public List getArguments() { - return arguments; - } -} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArgumentImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArgumentImpl.java index 49ee84036..4ce49e68e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArgumentImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArgumentImpl.java @@ -6,6 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; +import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import java.util.Objects; @@ -13,17 +14,17 @@ class ArgumentImpl implements IArgument { @NonNull - private final String name; + private final IEnhancedQName name; @NonNull private final ISequenceType sequenceType; - protected ArgumentImpl(@NonNull String name, @NonNull ISequenceType sequenceType) { + protected ArgumentImpl(@NonNull IEnhancedQName name, @NonNull ISequenceType sequenceType) { this.name = name; this.sequenceType = sequenceType; } @Override - public String getName() { + public IEnhancedQName getName() { return name; } @@ -38,7 +39,7 @@ public String toSignature() { StringBuilder builder = new StringBuilder(); // name - builder.append(getName()) + builder.append(getName().toEQName()) .append(" as ") .append(getSequenceType().toSignature()); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/CalledContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/CalledContext.java new file mode 100644 index 000000000..b9511031f --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/CalledContext.java @@ -0,0 +1,110 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.function; + +import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; + +import java.util.List; +import java.util.Objects; + +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; + +/** + * Represents an immutable execution context for function calls in Metapath + * expressions. + *

+ * This class is designed to support both named and anonymous functions by + * maintaining the function instance, its arguments, and the current context + * item. It ensures thread-safety through immutability and is primarily used + * during the evaluation of Metapath expressions and for caching the function + * results. + */ +public final class CalledContext { + @NonNull + private final IFunction function; + @Nullable + private final IItem contextItem; + @NonNull + private final List> arguments; + + /** + * Creates an immutable execution context for a function call. + * + * @param function + * the function to be executed + * @param arguments + * the list of evaluated arguments as sequences, must match function's + * arity + * @param contextItem + * the optional context item representing the current node in scope + */ + public CalledContext( + @NonNull IFunction function, + @NonNull List> arguments, + @Nullable IItem contextItem) { + this.function = function; + this.contextItem = contextItem; + this.arguments = arguments; + } + + /** + * Get the function instance associated with the calling context. + * + * @return the function instance + */ + @NonNull + public IFunction getFunction() { + return function; + } + + /** + * Get the node item focus associated with the calling context. + * + * @return the context item, or null if no context is set + */ + @Nullable + public IItem getContextItem() { + return contextItem; + } + + /** + * Get the arguments associated with the calling context. + * + * @return the arguments + */ + @NonNull + public List> getArguments() { + return arguments; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + getFunction().hashCode(); + return prime * result + Objects.hash(contextItem, arguments); + } + + @SuppressWarnings("PMD.OnlyOneReturn") + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + CalledContext other = (CalledContext) obj; + if (!getFunction().equals(other.getFunction())) { + return false; + } + return Objects.equals(function, other.function) + && Objects.equals(arguments, other.arguments) + && Objects.equals(contextItem, other.contextItem); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ComparisonFunctions.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ComparisonFunctions.java index f6135d79b..b5ecd4bc4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ComparisonFunctions.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ComparisonFunctions.java @@ -5,8 +5,9 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; import gov.nist.secauto.metaschema.core.metapath.function.library.FnNot; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; @@ -210,39 +211,29 @@ public static IBooleanItem compare( // NOPMD - unavoidable * @return the comparison result */ @NonNull - public static IBooleanItem stringCompare(@NonNull IStringItem left, @NonNull Operator operator, + public static IBooleanItem stringCompare( + @NonNull IStringItem left, + @NonNull Operator operator, @NonNull IStringItem right) { int result = left.compareTo(right); boolean retval; switch (operator) { case EQ: - // retval = OperationFunctions.opNumericEqual(left.compare(right), - // IIntegerItem.ZERO); retval = result == 0; break; case GE: - // retval = OperationFunctions.opNumericGreaterThan(left.compare(right), - // IIntegerItem.NEGATIVE_ONE); retval = result >= 0; break; case GT: - // retval = OperationFunctions.opNumericGreaterThan(left.compare(right), - // IIntegerItem.ZERO); retval = result > 0; break; case LE: - // retval = OperationFunctions.opNumericLessThan(left.compare(right), - // IIntegerItem.ONE); retval = result <= 0; break; case LT: - // retval = OperationFunctions.opNumericLessThan(left.compare(right), - // IIntegerItem.ZERO); retval = result < 0; break; case NE: - // retval = FnNot.fnNot(OperationFunctions.opNumericEqual(left.compare(right), - // IIntegerItem.ZERO)); retval = result != 0; break; default: diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DefaultFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DefaultFunction.java index 33cb600ba..d7747d02a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DefaultFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DefaultFunction.java @@ -6,27 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import java.util.ArrayList; import java.util.Collections; import java.util.EnumSet; -import java.util.Iterator; import java.util.List; -import java.util.Objects; import java.util.Set; -import java.util.stream.Stream; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; @@ -85,282 +74,27 @@ public ISequenceType getResult() { } /** - * Converts arguments in an attempt to align with the function's signature. + * Execute the provided function using the provided arguments, dynamic context, + * and focus. * - * @param function - * the function - * @param parameters - * the argument parameters + * @param arguments + * the function arguments * @param dynamicContext * the dynamic evaluation context - * @return the converted argument list - */ - @NonNull - public static List> convertArguments( - @NonNull IFunction function, - @NonNull List> parameters, - @NonNull DynamicContext dynamicContext) { - @NonNull - List> retval = new ArrayList<>(parameters.size()); - - Iterator argumentIterator = function.getArguments().iterator(); - IArgument argument = null; - for (ISequence parameter : parameters) { - if (argumentIterator.hasNext()) { - argument = argumentIterator.next(); - } else if (!function.isArityUnbounded()) { - throw new InvalidTypeMetapathException( - null, - String.format("argument signature doesn't match '%s'", function.toSignature())); - } - - assert argument != null; - assert parameter != null; - - retval.add(convertArgument(argument, parameter, dynamicContext)); - } - return retval; - } - - @SuppressWarnings("unused") - @NonNull - private static ISequence convertArgument( - @NonNull IArgument argument, - @NonNull ISequence parameter, - @NonNull DynamicContext dynamicContext) { - // apply occurrence - ISequence retval = argument.getSequenceType().getOccurrence().getSequenceHandler().handle(parameter); - - // apply function conversion and type promotion to the parameter - if (!retval.isEmpty()) { - IItemType type = argument.getSequenceType().getType(); - // this is not required to be an empty sequence - retval = convertSequence(argument, retval, type); - - // verify resulting values - Class argumentClass = type.getItemClass(); - for (IItem item : retval.getValue()) { - Class itemClass = item.getClass(); - if (!argumentClass.isAssignableFrom(itemClass)) { - throw new InvalidTypeMetapathException( - item, - String.format("The type '%s' is not a subtype of '%s'", - StaticContext.lookupItemType(itemClass), - type)); - } - } - } - return retval; - } - - /** - * Based on XPath 3.1 - * function - * conversion rules. - * - * @param argument - * the function argument signature details - * @param sequence - * the sequence to convert - * @param requiredSequenceType - * the expected item type for the sequence - * @return the converted sequence + * @param focus + * the current focus item in the evaluation context. This represents + * the context item for anonymous function evaluation. May be null for + * functions that don't require context item access. + * @return a sequence containing the result of the execution + * @throws MetapathException + * if an error occurred while executing the function */ - @NonNull - protected static ISequence convertSequence( - @NonNull IArgument argument, - @NonNull ISequence sequence, - @NonNull IItemType requiredSequenceType) { - Class requiredSequenceTypeClass = requiredSequenceType.getItemClass(); - - Stream stream = sequence.safeStream(); - - if (IAnyAtomicItem.class.isAssignableFrom(requiredSequenceTypeClass)) { - Stream atomicStream = stream.flatMap(IItem::atomize); - - // if (IUntypedAtomicItem.class.isInstance(item)) { // NOPMD - // // TODO: apply cast to atomic type - // } - - if (IStringItem.class.equals(requiredSequenceTypeClass)) { - // promote URIs to strings if a string is required - atomicStream = atomicStream.map(item -> IAnyUriItem.class.isInstance(item) ? IStringItem.cast(item) : item); - } - - stream = atomicStream; - } - - stream = stream.peek(item -> { - if (!requiredSequenceTypeClass.isInstance(item)) { - throw new InvalidTypeMetapathException( - item, - String.format("The type '%s' is not a subtype of '%s'", - item.getClass().getName(), - requiredSequenceTypeClass.getName())); - } - }); - assert stream != null; - - return ISequence.of(stream); - } - - private IItem getContextItem(@NonNull ISequence focus) { - IItem contextItem = null; - if (isFocusDepenent()) { - contextItem = focus.getFirstItem(true); - if (contextItem == null) { - throw new DynamicMetapathException(DynamicMetapathException.DYNAMIC_CONTEXT_ABSENT, "The context is empty"); - } - } - return contextItem; - } - @Override - public ISequence execute( - @NonNull List> arguments, + @NonNull + protected ISequence executeInternal( + @NonNull List> arguments, @NonNull DynamicContext dynamicContext, - @NonNull ISequence focus) { - - try { - IItem contextItem = getContextItem(focus); - - List> convertedArguments = convertArguments(this, arguments, dynamicContext); - - CallingContext callingContext = null; - ISequence result = null; - if (isDeterministic()) { - // check cache - callingContext = new CallingContext(convertedArguments, contextItem); - // TODO: implement something like computeIfAbsent - // attempt to get the result from the cache - result = dynamicContext.getCachedResult(callingContext); - } - - if (result == null) { - result = handler.execute(this, convertedArguments, dynamicContext, contextItem); - - if (callingContext != null) { - // add result to cache - dynamicContext.cacheResult(callingContext, result); - } - } - - // logger.info(String.format("Executed function '%s' with arguments '%s' - // producing result '%s'", - // toSignature(), convertedArguments.toString(), result.asList().toString())); - return result; - } catch (MetapathException ex) { - throw new MetapathException(String.format("Unable to execute function '%s'", toSignature()), ex); - } - } - - @Override - public int hashCode() { - return Objects.hash(getQName(), getArguments(), handler, properties, result); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; // NOPMD - readability - } - if (obj == null || getClass() != obj.getClass()) { - return false; // NOPMD - readability - } - DefaultFunction other = (DefaultFunction) obj; - return Objects.equals(getQName(), other.getQName()) - && Objects.equals(getArguments(), other.getArguments()) - && Objects.equals(handler, other.handler) - && Objects.equals(properties, other.properties) - && Objects.equals(result, other.result); - } - - @Override - public String toString() { - return toSignature(); - } - - public final class CallingContext { - @Nullable - private final IItem contextItem; - @NonNull - private final List> arguments; - - /** - * Set up the execution context for this function. - * - * @param arguments - * the function arguments - * @param contextItem - * the current node context - */ - private CallingContext(@NonNull List> arguments, @Nullable IItem contextItem) { - this.contextItem = contextItem; - this.arguments = arguments; - } - - /** - * Get the function instance associated with the calling context. - * - * @return the function instance - */ - @NonNull - public DefaultFunction getFunction() { - return DefaultFunction.this; - } - - /** - * Get the node item focus associated with the calling context. - * - * @return the function instance - */ - @Nullable - public IItem getContextItem() { - return contextItem; - } - - /** - * Get the arguments associated with the calling context. - * - * @return the arguments - */ - @NonNull - public List> getArguments() { - return arguments; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + getFunction().hashCode(); - return prime * result + Objects.hash(contextItem, arguments); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; // NOPMD - readability - } - if (obj == null || getClass() != obj.getClass()) { - return false; // NOPMD - readability - } - CallingContext other = (CallingContext) obj; - if (!getFunction().equals(other.getFunction())) { - return false; // NOPMD - readability - } - return Objects.equals(arguments, other.arguments) && Objects.equals(contextItem, other.contextItem); - } - } - - @Override - public Object getValue() { - // never a value - return null; - } - - @Override - public void accept(IItemVisitor visitor) { - visitor.visit(this); + @Nullable IItem focus) { + return handler.execute(this, arguments, dynamicContext, focus); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java index 77819650f..ae6851155 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java index af1ef9401..e1f231729 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java @@ -11,6 +11,7 @@ import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; +import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -22,13 +23,19 @@ * Represents a single function argument signature. */ public interface IArgument { + @SuppressWarnings("PMD.ShortMethodName") + @NonNull + static IArgument of(@NonNull IEnhancedQName name, @NonNull ISequenceType sequenceType) { + return new ArgumentImpl(name, sequenceType); + } + /** * Get the argument's name. * * @return the argument's name */ @NonNull - String getName(); + IEnhancedQName getName(); /** * Get information about the type of sequence supported by the argument. @@ -56,11 +63,19 @@ static Builder builder() { return new Builder(); } + @NonNull + private static String resolveArgumentName(@NonNull String prefix) { + if (!"".equals(prefix)) { + throw new UnsupportedOperationException("Lexical qualified names are not allowed."); + } + return ""; + } + /** * Used to create an argument's signature using a builder pattern. */ final class Builder { - private String name; + private IEnhancedQName name; @NonNull private IItemType type; private Occurrence occurrence; @@ -82,7 +97,7 @@ public Builder name(@NonNull String name) { if (Objects.requireNonNull(name, "name").isBlank()) { throw new IllegalArgumentException("the name must be non-blank"); } - this.name = name.trim(); + this.name = EQNameFactory.instance().parseName(name, IArgument::resolveArgumentName); return this; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java index 6343516f7..815a5f015 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; @@ -146,7 +146,7 @@ default boolean isContextDepenent() { * otherwise * @see FunctionProperty#FOCUS_DEPENDENT */ - default boolean isFocusDepenent() { + default boolean isFocusDependent() { return getProperties().contains(FunctionProperty.FOCUS_DEPENDENT); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionExecutor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionExecutor.java index 36eaedc70..606d3c630 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionExecutor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionExecutor.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java new file mode 100644 index 000000000..ba0a1fc70 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java @@ -0,0 +1,286 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.function.impl; + +import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; +import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.function.CalledContext; +import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.type.IItemType; +import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; +import gov.nist.secauto.metaschema.core.util.CollectionUtil; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import java.util.stream.Stream; + +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; + +public abstract class AbstractFunction implements IFunction { + @NonNull + private final IEnhancedQName qname; + @NonNull + private final List arguments; + + protected AbstractFunction( + @NonNull String name, + @NonNull String namespace, + @NonNull List arguments) { + this(IEnhancedQName.of(namespace, name), arguments); + } + + protected AbstractFunction( + @NonNull IEnhancedQName qname, + @NonNull List arguments) { + this.qname = qname; + this.arguments = arguments; + } + + @Override + public IEnhancedQName getQName() { + return qname; + } + + @Override + public int arity() { + return arguments.size(); + } + + @Override + public List getArguments() { + return arguments; + } + + @Override + public Object getValue() { + // never a value + return null; + } + + @Override + public void accept(IItemVisitor visitor) { + visitor.visit(this); + } + + /** + * Converts arguments in an attempt to align with the function's signature. + * + * @param function + * the function + * @param parameters + * the argument parameters + * @param dynamicContext + * the dynamic evaluation context + * @return a new unmodifiable list containing the converted arguments + */ + @NonNull + public static List> convertArguments( + @NonNull IFunction function, + @NonNull List> parameters, + @NonNull DynamicContext dynamicContext) { + List> retval = new ArrayList<>(parameters.size()); + Iterator argumentIterator = function.getArguments().iterator(); + IArgument argument = null; + for (ISequence parameter : parameters) { + if (argumentIterator.hasNext()) { + argument = argumentIterator.next(); + } else if (!function.isArityUnbounded()) { + throw new InvalidTypeMetapathException( + null, + String.format("argument signature doesn't match '%s'", function.toSignature())); + } + + assert argument != null; + assert parameter != null; + + retval.add(convertArgument(argument, parameter)); + } + return CollectionUtil.unmodifiableList(retval); + } + + @NonNull + private static ISequence convertArgument( + @NonNull IArgument argument, + @NonNull ISequence parameter) { + // apply occurrence + ISequence retval = argument.getSequenceType().getOccurrence().getSequenceHandler().handle(parameter); + + // apply function conversion and type promotion to the parameter + if (!retval.isEmpty()) { + IItemType type = argument.getSequenceType().getType(); + // this is not required to be an empty sequence + retval = convertSequence(argument, retval, type); + + // verify resulting values + Class argumentClass = type.getItemClass(); + for (IItem item : retval.getValue()) { + Class itemClass = item.getClass(); + if (!argumentClass.isAssignableFrom(itemClass)) { + throw new InvalidTypeMetapathException( + item, + String.format("The type '%s' is not a subtype of '%s'", + StaticContext.lookupItemType(itemClass), + type)); + } + } + } + return retval; + } + + /** + * Based on XPath 3.1 + * function + * conversion rules. + * + * @param argument + * the function argument signature details + * @param sequence + * the sequence to convert + * @param requiredSequenceType + * the expected item type for the sequence + * @return the converted sequence + */ + @NonNull + protected static ISequence convertSequence( + @NonNull IArgument argument, + @NonNull ISequence sequence, + @NonNull IItemType requiredSequenceType) { + Class requiredSequenceTypeClass = requiredSequenceType.getItemClass(); + + Stream stream = sequence.safeStream(); + + if (IAnyAtomicItem.class.isAssignableFrom(requiredSequenceTypeClass)) { + Stream atomicStream = stream.flatMap(IItem::atomize); + + // if (IUntypedAtomicItem.class.isInstance(item)) { // NOPMD + // // TODO: apply cast to atomic type + // } + + if (IStringItem.class.equals(requiredSequenceTypeClass)) { + // promote URIs to strings if a string is required + atomicStream = atomicStream.map(item -> IAnyUriItem.class.isInstance(item) ? IStringItem.cast(item) : item); + } + + stream = atomicStream; + } + + stream = stream.peek(item -> { + if (!requiredSequenceTypeClass.isInstance(item)) { + throw new InvalidTypeMetapathException( + item, + String.format("The type '%s' is not a subtype of '%s'", + item.getClass().getName(), + requiredSequenceTypeClass.getName())); + } + }); + assert stream != null; + + return ISequence.of(stream); + } + + private IItem getContextItem(@NonNull ISequence focus) { + IItem contextItem = focus.getFirstItem(true); + if (isFocusDependent() && contextItem == null) { + throw new DynamicMetapathException(DynamicMetapathException.DYNAMIC_CONTEXT_ABSENT, "The context is empty"); + } + return contextItem; + } + + @Override + public ISequence execute( + @NonNull List> arguments, + @NonNull DynamicContext dynamicContext, + @NonNull ISequence focus) { + + try { + IItem contextItem = getContextItem(focus); + + List> convertedArguments = convertArguments(this, arguments, dynamicContext); + + CalledContext callingContext = null; + ISequence result = null; + if (isDeterministic()) { + // check cache + callingContext = new CalledContext(this, convertedArguments, contextItem); + // TODO: implement something like computeIfAbsent + // attempt to get the result from the cache + result = dynamicContext.getCachedResult(callingContext); + } + + if (result == null) { + result = executeInternal(convertedArguments, dynamicContext, contextItem); + + if (callingContext != null) { + // add result to cache + dynamicContext.cacheResult(callingContext, result); + } + } + + // logger.info(String.format("Executed function '%s' with arguments '%s' + // producing result '%s'", + // toSignature(), convertedArguments.toString(), result.asList().toString())); + return result; + } catch (MetapathException ex) { + throw new MetapathException(String.format("Unable to execute function '%s'", toSignature()), ex); + } + } + + /** + * Execute the provided function using the provided arguments, dynamic context, + * and focus. + * + * @param arguments + * the function arguments + * @param dynamicContext + * the dynamic evaluation context + * @param focus + * the current focus + * @return a sequence containing the result of the execution + * @throws MetapathException + * if an error occurred while executing the function + */ + @NonNull + protected abstract ISequence executeInternal( + @NonNull List> arguments, + @NonNull DynamicContext dynamicContext, + @Nullable IItem focus); + + @Override + public int hashCode() { + return Objects.hash(getQName(), getArguments()); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; // NOPMD - readability + } + if (obj == null || getClass() != obj.getClass()) { + return false; // NOPMD - readability + } + AbstractFunction other = (AbstractFunction) obj; + return Objects.equals(getQName(), other.getQName()) + && Objects.equals(getArguments(), other.getArguments()); + } + + @Override + public String toString() { + return toSignature(); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctions.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/OperationFunctions.java similarity index 98% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctions.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/OperationFunctions.java index 3f9145e98..8aca81644 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctions.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/OperationFunctions.java @@ -3,8 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.function; // NOPMD - intentional +package gov.nist.secauto.metaschema.core.metapath.function.impl; // NOPMD - intentional +import gov.nist.secauto.metaschema.core.metapath.function.ArithmeticFunctionException; +import gov.nist.secauto.metaschema.core.metapath.function.DateTimeFunctionException; +import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; @@ -352,7 +355,7 @@ public static IDateTimeItem opSubtractDayTimeDurationFromDateTime( @NonNull IDateTimeItem moment, @NonNull IDayTimeDurationItem duration) { return IDateTimeWithTimeZoneItem.valueOf( - ObjectUtils.notNull(moment.asZonedDateTime().plus(duration.asDuration()))); + ObjectUtils.notNull(moment.asZonedDateTime().minus(duration.asDuration()))); } /** diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppend.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppend.java index 28b907e67..0cb5afcee 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppend.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppend.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlatten.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlatten.java index 950c9f8ca..07f498403 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlatten.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlatten.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java index 9e54c93e3..291d8475c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHead.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHead.java index 5b8092e82..8abf3cdbc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHead.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHead.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java index d9c77c94a..751938471 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoin.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoin.java index c5ac89a76..8ed1e4483 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoin.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoin.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java index 455006302..abf3e1d58 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java index f1d57afd7..c6575e86a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverse.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverse.java index 653342838..010cfcd32 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverse.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverse.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySize.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySize.java index 9cd0805a5..574b7caff 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySize.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySize.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java index 1f26b06a2..83c9453ad 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTail.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTail.java index 1c521d2d3..0f87fdf42 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTail.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTail.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunction.java index 27b7e40f6..7d69294f4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunction.java @@ -6,15 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.IFunctionExecutor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.type.AbstractAtomicOrUnionType; import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; @@ -33,11 +34,19 @@ public final class CastFunction implements IFunctio @NonNull private final IAtomicOrUnionType.ICastExecutor castExecutor; + @NonNull + static IFunction signature( + @NonNull IEnhancedQName name, + @NonNull IAtomicOrUnionType resultingAtomicType, + @NonNull IAtomicOrUnionType.ICastExecutor executor) { + return signature(name.getNamespace(), name.getLocalName(), resultingAtomicType, executor); + } + @NonNull static IFunction signature( @NonNull String namespace, @NonNull String name, - @NonNull IAtomicOrUnionType resulingAtomicType, + @NonNull IAtomicOrUnionType resultingAtomicType, @NonNull IAtomicOrUnionType.ICastExecutor executor) { return IFunction.builder() .name(name) @@ -50,7 +59,7 @@ static IFunction signature( .type(IAnyAtomicItem.type()) .zeroOrOne() .build()) - .returnType(resulingAtomicType) + .returnType(resultingAtomicType) .returnZeroOrOne() .functionHandler(newCastExecutor(executor)) .build(); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java index 97c57fe8e..4c4e7b25f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java @@ -5,19 +5,11 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; +import gov.nist.secauto.metaschema.core.datatype.DataTypeService; +import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionLibrary; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INcNameItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INonNegativeIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IPositiveIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -26,7 +18,6 @@ * function * specification. */ -@SuppressWarnings({ "removal" }) @SuppressFBWarnings("UWF_UNWRITTEN_FIELD") public class DefaultFunctionLibrary extends FunctionLibrary { @@ -254,70 +245,12 @@ public DefaultFunctionLibrary() { // NOPMD - intentional registerFunction(MapRemove.SIGNATURE); // P3: https://www.w3.org/TR/xpath-functions-31/#func-map-for-each - // // xpath casting functions - // FIXME: add these - // registerFunction( - // CastFunction.signature(MetapathConstants.NS_XML_SCHEMA, "boolean", - // IBooleanItem.class, IBooleanItem::cast)); - // registerFunction(CastFunction.signature( - // MetapathConstants.NS_XML_SCHEMA, "date", IDateItem.class, IDateItem::cast)); - // registerFunction(CastFunction.signature( - // MetapathConstants.NS_XML_SCHEMA, "dateTime", IDateTimeItem.class, - // IDateTimeItem::cast)); - // registerFunction(CastFunction.signature( - // MetapathConstants.NS_XML_SCHEMA, "decimal", IDecimalItem.class, - // IDecimalItem::cast)); - // registerFunction(CastFunction.signature( - // MetapathConstants.NS_XML_SCHEMA, "duration", IDurationItem.class, - // IDurationItem::cast)); - // registerFunction(CastFunction.signature( - // MetapathConstants.NS_XML_SCHEMA, "integer", IIntegerItem.class, - // IIntegerItem::cast)); - // registerFunction(CastFunction.signature( - // MetapathConstants.NS_XML_SCHEMA, "NCName", INcNameItem.class, - // INcNameItem::cast)); - // registerFunction(CastFunction.signature( - // MetapathConstants.NS_XML_SCHEMA, "nonNegativeInteger", - // INonNegativeIntegerItem.class, - // INonNegativeIntegerItem::cast)); - // registerFunction(CastFunction.signature( - // MetapathConstants.NS_XML_SCHEMA, "positiveInteger", - // IPositiveIntegerItem.class, - // IPositiveIntegerItem::cast)); - // registerFunction(CastFunction.signature( - // MetapathConstants.NS_XML_SCHEMA, "string", IStringItem.class, - // IStringItem::cast)); - // metapath casting functions - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, "boolean", IBooleanItem.type(), IBooleanItem::cast)); - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, "date", IDateItem.type(), IDateItem::cast)); - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, "date-time", IDateTimeItem.type(), IDateTimeItem::cast)); - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, "decimal", IDecimalItem.type(), IDecimalItem::cast)); - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, "duration", IDurationItem.type(), IDurationItem::cast)); - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, "integer", IIntegerItem.type(), IIntegerItem::cast)); - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, "ncname", INcNameItem.type(), INcNameItem::cast)); - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, - "non-negative-integer", - INonNegativeIntegerItem.type(), - INonNegativeIntegerItem::cast)); - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, - "positive-integer", - IPositiveIntegerItem.type(), - IPositiveIntegerItem::cast)); - registerFunction(CastFunction.signature( - MetapathConstants.NS_METAPATH, - "string", - IStringItem.type(), - IStringItem::cast)); + DataTypeService.instance().getDataTypes().stream() + .map(IDataTypeAdapter::getItemType) + .forEachOrdered(type -> { + registerFunction(CastFunction.signature(type.getQName(), type, type::cast)); + }); // extra functions registerFunction(MpRecurseDepth.SIGNATURE_ONE_ARG); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbs.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbs.java index 28079300e..943a5f924 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbs.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbs.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvg.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvg.java index 299182971..0e70ed55c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvg.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvg.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBaseUri.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBaseUri.java index 135068b43..8ea5299fc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBaseUri.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBaseUri.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBoolean.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBoolean.java index b4a80816c..fc523ee1a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBoolean.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBoolean.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeiling.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeiling.java index 38d040a53..59354697d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeiling.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeiling.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCompare.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCompare.java index c5bb1f6fa..daa9b740d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCompare.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCompare.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcat.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcat.java index 2561414a1..1d71b46ac 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcat.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcat.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContains.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContains.java index 75697dad0..8c43dc82e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContains.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContains.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCount.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCount.java index 4316e5988..36d86f8ec 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCount.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCount.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentDateTime.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentDateTime.java index b6d56525a..90f072f29 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentDateTime.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentDateTime.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeWithTimeZoneItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTime.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTime.java index de42f8077..bc648aa1f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTime.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTime.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITimeItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITimeWithTimeZoneItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnData.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnData.java index 94bd29e4f..ad5cc0ab3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnData.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnData.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDoc.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDoc.java index 9a32fa797..0d26c6157 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDoc.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDoc.java @@ -6,7 +6,6 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.DocumentFunctionException; @@ -14,6 +13,7 @@ import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailable.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailable.java index 61279b88b..1687d8245 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailable.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailable.java @@ -6,7 +6,6 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.DocumentFunctionException; @@ -15,6 +14,7 @@ import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.UriFunctionException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentUri.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentUri.java index 2098573e9..ea447fcaf 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentUri.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentUri.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmpty.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmpty.java index 505cd2e51..33abc9d53 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmpty.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmpty.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWith.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWith.java index 313afc9b6..fdd8c75ff 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWith.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWith.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExists.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExists.java index 222220e59..5eac41385 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExists.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExists.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalse.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalse.java index cba9c5f9b..20f5e24a3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalse.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalse.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHead.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHead.java index a1e1e028c..6f68e5be3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHead.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHead.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezone.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezone.java index 6972a9224..d6d7bfb10 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezone.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezone.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBefore.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBefore.java index ccded7a96..80995eb5e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBefore.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBefore.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCase.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCase.java index 8e095ca0b..53df351e9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCase.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCase.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatches.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatches.java index f2faf5a7d..70338d601 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatches.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatches.java @@ -6,7 +6,6 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; @@ -14,6 +13,7 @@ import gov.nist.secauto.metaschema.core.metapath.function.regex.RegexUtil; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegularExpressionMetapathException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMax.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMax.java index 62c2a9a6b..907f4d773 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMax.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMax.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpace.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpace.java index f3c3dc199..ab93eb232 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpace.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpace.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNot.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNot.java index afc7d1180..c89dc240f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNot.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNot.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnPath.java index e305b90b4..cfd7a0705 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnPath.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemove.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemove.java index a5a1ed10c..35f8298f8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemove.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemove.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnResolveUri.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnResolveUri.java index e9b504915..50bc0909c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnResolveUri.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnResolveUri.java @@ -6,7 +6,6 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; @@ -14,6 +13,7 @@ import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.function.UriFunctionException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverse.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverse.java index 61e08b598..5d65df9b1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverse.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverse.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRound.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRound.java index 163ff1791..6ec69c8d3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRound.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRound.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWith.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWith.java index 1bdf83175..7baae01b4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWith.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWith.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStaticBaseUri.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStaticBaseUri.java index d2950068d..84f25bcc2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStaticBaseUri.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStaticBaseUri.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnString.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnString.java index 4b6ffd19d..e1d4e0024 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnString.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnString.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidTypeFunctionException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLength.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLength.java index 1bd2f1cf9..cc9d012a1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLength.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLength.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstring.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstring.java index af80cb840..2049f8d0e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstring.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstring.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java index 27e20c64b..3de5ca32b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java index 7ba0e8c73..234452a63 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSum.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSum.java index cd7c98c5d..61ce339e5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSum.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSum.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTail.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTail.java index c44b46818..4583ec7de 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTail.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTail.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenize.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenize.java index 32159e51a..388b09f3b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenize.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenize.java @@ -6,7 +6,6 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; @@ -14,6 +13,7 @@ import gov.nist.secauto.metaschema.core.metapath.function.regex.RegexUtil; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegularExpressionMetapathException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrue.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrue.java index 16a8f0329..b1ba91d00 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrue.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrue.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCase.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCase.java index e2b14bfe1..2ff840f83 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCase.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCase.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContains.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContains.java index 721182397..aff55b8dc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContains.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContains.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntry.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntry.java index 99c70715b..6351053eb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntry.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntry.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFind.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFind.java index 77a7403e7..1cb391ddf 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFind.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFind.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGet.java index 3277ab483..5c7b62396 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGet.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeys.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeys.java index 0783b0f83..eb93b21e0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeys.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeys.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMerge.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMerge.java index 859d67557..bcef07c3a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMerge.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMerge.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.JsonFunctionException; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPut.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPut.java index bf590da64..a7e058ca9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPut.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPut.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemove.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemove.java index cf7b0bf11..4c5b63ab8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemove.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemove.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSize.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSize.java index 903f3b257..53623c773 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSize.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSize.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java index 05280867d..874ca1f6b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java @@ -6,15 +6,15 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -111,9 +111,9 @@ private static ISequence recurseDepth( @NonNull ISequence initialContext, @NonNull IStringItem recursionPath, @NonNull DynamicContext dynamicContext) { - MetapathExpression recursionMetapath; + IMetapathExpression recursionMetapath; try { - recursionMetapath = MetapathExpression.compile(recursionPath.asString(), dynamicContext.getStaticContext()); + recursionMetapath = IMetapathExpression.compile(recursionPath.asString(), dynamicContext.getStaticContext()); } catch (MetapathException ex) { throw new StaticMetapathException(StaticMetapathException.INVALID_PATH_GRAMMAR, ex.getMessage(), ex); } @@ -138,7 +138,7 @@ private static ISequence recurseDepth( @NonNull public static ISequence recurseDepth( @NonNull ISequence initialContext, - @NonNull MetapathExpression recursionMetapath, + @NonNull IMetapathExpression recursionMetapath, @NonNull DynamicContext dynamicContext) { return ISequence.of(ObjectUtils.notNull(initialContext.stream() diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/NumericFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/NumericFunction.java index 4cc724951..549a6ddc3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/NumericFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/NumericFunction.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.IFunctionExecutor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractArrayItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractArrayItem.java index b221bf593..28a4ffbcf 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractArrayItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractArrayItem.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; @@ -75,7 +75,7 @@ public boolean isContextDepenent() { } @Override - public boolean isFocusDepenent() { + public boolean isFocusDependent() { return false; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractKeySpecifier.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractKeySpecifier.java index c7c66256d..f29568012 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractKeySpecifier.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractKeySpecifier.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.function.library.ArrayGet; import gov.nist.secauto.metaschema.core.metapath.function.library.MapGet; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMapItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMapItem.java index 1cd3aa13e..ce6491b33 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMapItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMapItem.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.library.MapGet; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; @@ -87,7 +87,7 @@ public boolean isContextDepenent() { } @Override - public boolean isFocusDepenent() { + public boolean isFocusDependent() { return false; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java index c1cfb384b..b6e762a8a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.impl; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.stream.Collectors; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ArrayItemN.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ArrayItemN.java index 2e5fbf8a5..4f9f05dcb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ArrayItemN.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ArrayItemN.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.impl; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MapItemN.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MapItemN.java index 23d5bec49..babf5f81a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MapItemN.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MapItemN.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.impl; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/DefaultItemWriter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/DefaultItemWriter.java index 525dd6a88..96dba299e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/DefaultItemWriter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/DefaultItemWriter.java @@ -5,8 +5,6 @@ package gov.nist.secauto.metaschema.core.metapath.item; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAtomicValuedItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ICollectionValue.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ICollectionValue.java similarity index 96% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ICollectionValue.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ICollectionValue.java index 8b5292a22..afa063800 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ICollectionValue.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ICollectionValue.java @@ -3,9 +3,8 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath; +package gov.nist.secauto.metaschema.core.metapath.item; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItem.java index 9fb5e4c2f..900cbdab6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItem.java @@ -6,8 +6,6 @@ package gov.nist.secauto.metaschema.core.metapath.item; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.InvalidTypeFunctionException; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemWriter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemWriter.java index c67aea426..a4c380dad 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemWriter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemWriter.java @@ -5,7 +5,6 @@ package gov.nist.secauto.metaschema.core.metapath.item; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ISequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java similarity index 99% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ISequence.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java index a640b269e..feb413e74 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ISequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath; +package gov.nist.secauto.metaschema.core.metapath.item; import gov.nist.secauto.metaschema.core.metapath.impl.AbstractSequence; import gov.nist.secauto.metaschema.core.metapath.impl.SequenceN; import gov.nist.secauto.metaschema.core.metapath.impl.SingletonSequence; import gov.nist.secauto.metaschema.core.metapath.impl.StreamSequence; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAtomicItemBase.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAtomicItemBase.java index 3333dc640..ff9f9c7cc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAtomicItemBase.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAtomicItemBase.java @@ -31,12 +31,17 @@ public String asString() { public String toSignature() { return ObjectUtils.notNull(new StringBuilder() .append(getType().toSignature()) - .append("(") + .append('(') .append(getValueSignature()) - .append(")") + .append(')') .toString()); } + /** + * Get the string to use for the item's value in the item's signature. + * + * @return the value string + */ @NonNull protected abstract String getValueSignature(); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyAtomicItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyAtomicItem.java index 219e080a3..73be4d6ba 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyAtomicItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyAtomicItem.java @@ -50,11 +50,13 @@ default IAnyAtomicItem toAtomicItem() { Object getValue(); /** - * Get a new {@link IStringItem} based on the the textual value of the item's - * "wrapped" value. + * Converts this atomic item to a string item representation. * - * @return a new string item + * @return a new {@link IStringItem} containing the string representation of + * this item + * @see #asString() */ + @NonNull default IStringItem asStringItem() { return IStringItem.valueOf(asString()); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java index bbc958726..4fc93dd53 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java @@ -64,7 +64,7 @@ default IAtomicOrUnionType getType() { static IIntegerItem valueOf(@NonNull String value) { try { return valueOf(MetaschemaDataTypeProvider.INTEGER.parse(value)); - } catch (NumberFormatException ex) { + } catch (IllegalArgumentException ex) { throw new InvalidTypeMetapathException(null, ex.getMessage(), ex); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java index 45f6b9998..eb25fb900 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java @@ -5,13 +5,13 @@ package gov.nist.secauto.metaschema.core.metapath.item.function; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.impl.AbstractArrayItem; import gov.nist.secauto.metaschema.core.metapath.impl.ArrayItemN; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IKeySpecifier.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IKeySpecifier.java index d0aecaf23..a1bfa4a11 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IKeySpecifier.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IKeySpecifier.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.item.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.stream.Stream; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java index c4e13acf8..5bad883dc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java @@ -5,13 +5,13 @@ package gov.nist.secauto.metaschema.core.metapath.item.function; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.impl.AbstractMapItem; import gov.nist.secauto.metaschema.core.metapath.impl.MapItemN; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItem.java index 7d6043af6..58aff1707 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItem.java @@ -7,18 +7,33 @@ public abstract class AbstractNodeItem implements INodeItem { + /** + * Generates a string signature for this node item in the format: + * {@code type⪻location_metapath⪼} or {@code type⪻location_metapath⪼(value)} + * where: + *

+ * The special characters ⪻ and ⪼ are used as delimiters to clearly separate the + * type from the location Metapath expression. + * + * @return the string signature of this node item + */ @Override public final String toSignature() { StringBuilder builder = new StringBuilder() .append(getType().toSignature()) - .append("⪻") + .append('⪻') .append(getMetapath()) - .append("⪼"); + .append('⪼'); String value = getValueSignature(); if (value != null) { - builder.append("("); - builder.append(value); - builder.append(")"); + builder.append('(') + .append(value) + .append(')'); } return ObjectUtils.notNull(builder.toString()); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemFactory.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemFactory.java index 6b18dc16b..ad88f7f06 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemFactory.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemFactory.java @@ -1,7 +1,7 @@ package gov.nist.secauto.metaschema.core.metapath.item.node; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceGrouped; @@ -135,8 +135,8 @@ IFieldNodeItem newFieldNodeItem( * @param definition * the global definition * @param baseUri - * the base URI to use for this node item when evaluating a - * {@link MetapathExpression} + * the base URI to use for this node item when evaluating an + * {@link IMetapathExpression} * @return the new field node item */ @NonNull @@ -217,8 +217,8 @@ IAssemblyNodeItem newAssemblyNodeItem( * @param definition * the global definition * @param baseUri - * the base URI to use for this node item when evaluating a - * {@link MetapathExpression} + * the base URI to use for this node item when evaluating an + * {@link IMetapathExpression} * @return the new assembly node item */ @NonNull @@ -233,8 +233,8 @@ IAssemblyNodeItem newAssemblyNodeItem( * @param definition * the global definition * @param baseUri - * the base URI to use for this node item when evaluating a - * {@link MetapathExpression} + * the base URI to use for this node item when evaluating an + * {@link IMetapathExpression} * @param value * the associated data * @return the new assembly node item diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IAtomicOrUnionType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IAtomicOrUnionType.java index d445fab1e..1de1ed90c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IAtomicOrUnionType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IAtomicOrUnionType.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.type; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.type.impl.NonAdapterAtomicItemType; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/ISequenceType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/ISequenceType.java index 2caad97ec..a68c6798d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/ISequenceType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/ISequenceType.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.type; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.type.impl.SequenceTypeImpl; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/Occurrence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/Occurrence.java index 4b34784e4..a62481feb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/Occurrence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/Occurrence.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.type; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.Objects; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/SequenceTypeImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/SequenceTypeImpl.java index 5bd2edb58..13a92d3b9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/SequenceTypeImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/SequenceTypeImpl.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.core.metapath.type.impl; -import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java index f40e06a80..678c22cab 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java index 84646fbd3..df08aab3a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java @@ -10,10 +10,10 @@ import gov.nist.secauto.metaschema.core.configuration.IMutableConfiguration; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.AbstractNodeItemVisitor; import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; @@ -676,7 +676,7 @@ private void validateExpect( @NonNull INodeItem node, @NonNull ISequence targets, @NonNull DynamicContext dynamicContext) { - MetapathExpression metapath = MetapathExpression.compile( + IMetapathExpression metapath = IMetapathExpression.compile( constraint.getTest(), dynamicContext.getStaticContext()); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java index c35f8bb5e..acd3a89ff 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java @@ -6,11 +6,10 @@ package gov.nist.secauto.metaschema.core.model.constraint; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression.ResultType; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; @@ -94,8 +93,8 @@ private static void applyConstraints( for (ITargetedConstraints targeted : set.getTargetedConstraintsForModule(module)) { // apply targeted constraints String targetExpression = targeted.getTargetExpression(); - MetapathExpression metapath = MetapathExpression.compile(targetExpression, dynamicContext.getStaticContext()); - ISequence items = metapath.evaluateAs(moduleItem, ResultType.SEQUENCE, dynamicContext); + IMetapathExpression metapath = IMetapathExpression.compile(targetExpression, dynamicContext.getStaticContext()); + ISequence items = metapath.evaluate(moduleItem, dynamicContext); assert items != null; // first build a map to ensure the constraint is only applied once to each @@ -113,7 +112,7 @@ private static void applyConstraints( } } - private static boolean filterNonDefinitionItem(IItem item, @NonNull MetapathExpression metapath) { + private static boolean filterNonDefinitionItem(IItem item, @NonNull IMetapathExpression metapath) { boolean retval = item instanceof IDefinitionNodeItem; if (!retval) { LOGGER.atError().log( diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/FindingCollectingConstraintValidationHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/FindingCollectingConstraintValidationHandler.java index ceef60623..12e645a5e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/FindingCollectingConstraintValidationHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/FindingCollectingConstraintValidationHandler.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.model.constraint.IConstraint.Level; import gov.nist.secauto.metaschema.core.model.validation.IValidationFinding.Kind; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java index 8036a6db3..7bf0abcbc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IDescribable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidationHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidationHandler.java index 5bc3a09b0..e6327feab 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidationHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidationHandler.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java index 41907d012..06d4d5ace 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java @@ -6,9 +6,8 @@ package gov.nist.secauto.metaschema.core.model.constraint; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression.ResultType; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; @@ -161,11 +160,11 @@ private static String buildKeyItem( @NonNull INodeItem item, @NonNull IKeyField keyField, @NonNull DynamicContext dynamicContext) { - MetapathExpression keyMetapath = keyField.getTargetMetapath(); + IMetapathExpression keyMetapath = keyField.getTargetMetapath(); IItem keyItem; try { - keyItem = keyMetapath.evaluateAs(item, ResultType.ITEM, dynamicContext); + keyItem = keyMetapath.evaluateAs(item, IMetapathExpression.ResultType.ITEM, dynamicContext); } catch (InvalidTypeMetapathException ex) { throw new MetapathException("Key path did not result in a single item", ex); } @@ -193,7 +192,7 @@ private static String buildKeyItem( * the current key value * @return the final key value */ - private static String applyPattern(@NonNull MetapathExpression keyMetapath, @NonNull String keyValue, + private static String applyPattern(@NonNull IMetapathExpression keyMetapath, @NonNull String keyValue, @NonNull Pattern pattern) { Matcher matcher = pattern.matcher(keyValue); if (!matcher.matches()) { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IKeyField.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IKeyField.java index f9366372d..54e91447d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IKeyField.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IKeyField.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.constraint; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.impl.DefaultKeyField; @@ -62,7 +62,7 @@ static IKeyField of( * @return the compiled Metapath expression */ @NonNull - MetapathExpression getTargetMetapath(); + IMetapathExpression getTargetMetapath(); /** * A pattern to use to retrieve the value. If non-{@code null}, the first diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ILet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ILet.java index e422873a7..7bde9c621 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ILet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ILet.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.model.constraint; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.impl.DefaultLet; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; @@ -44,7 +44,7 @@ static ILet of( try { return of( name, - MetapathExpression.compile(valueExpression, source.getStaticContext()), + IMetapathExpression.compile(valueExpression, source.getStaticContext()), source, remarks); } catch (MetapathException ex) { @@ -75,7 +75,7 @@ static ILet of( @NonNull static ILet of( @NonNull IEnhancedQName name, - @NonNull MetapathExpression valueExpression, + @NonNull IMetapathExpression valueExpression, @NonNull ISource source, @Nullable MarkupMultiline remarks) { return new DefaultLet(name, valueExpression, source, remarks); @@ -95,7 +95,7 @@ static ILet of( * @return the Metapath expression to use to query the value */ @NonNull - MetapathExpression getValueExpression(); + IMetapathExpression getValueExpression(); /** * Information about the source resource containing the let statement. diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/LoggingConstraintValidationHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/LoggingConstraintValidationHandler.java index ec0d5beb8..e44d60d2d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/LoggingConstraintValidationHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/LoggingConstraintValidationHandler.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.model.constraint.IConstraint.Level; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java index 2e220c173..fe7a34a90 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; @@ -95,8 +95,8 @@ public String generateMessage(@NonNull INodeItem item, @NonNull DynamicContext c return ObjectUtils.notNull(ReplacementScanner.replaceTokens(message, METAPATH_VALUE_TEMPLATE_PATTERN, match -> { String metapath = ObjectUtils.notNull(match.group(2)); - MetapathExpression expr = MetapathExpression.compile(metapath, context.getStaticContext()); - return expr.evaluateAs(item, MetapathExpression.ResultType.STRING, context); + IMetapathExpression expr = IMetapathExpression.compile(metapath, context.getStaticContext()); + return expr.evaluateAs(item, IMetapathExpression.ResultType.STRING, context); }).toString()); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java index 4739ec786..66f0f8599 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java @@ -8,8 +8,8 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; @@ -44,7 +44,7 @@ public abstract class AbstractConstraint implements IConstraint { // NOPMD - int @NonNull private final Map> properties; @NonNull - private final Lazy targetMetapath; + private final Lazy targetMetapath; /** * Construct a new Metaschema constraint. @@ -85,7 +85,7 @@ protected AbstractConstraint( this.properties = properties; this.remarks = remarks; this.targetMetapath = ObjectUtils.notNull( - Lazy.lazy(() -> MetapathExpression.compile( + Lazy.lazy(() -> IMetapathExpression.compile( target, source.getStaticContext()))); } @@ -137,7 +137,7 @@ public MarkupMultiline getRemarks() { * @return the compiled Metapath expression */ @NonNull - public final MetapathExpression getTargetMetapath() { + public final IMetapathExpression getTargetMetapath() { return ObjectUtils.notNull(targetMetapath.get()); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java index ea6774882..a1c00f953 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; @@ -31,7 +31,7 @@ public final class DefaultExpectConstraint extends AbstractConfigurableMessageConstraint implements IExpectConstraint { @NonNull - private final Lazy testMetapath; + private final Lazy testMetapath; /** * Construct a new expect constraint. @@ -73,7 +73,7 @@ public DefaultExpectConstraint( @Nullable MarkupMultiline remarks) { super(id, formalName, description, source, level, target, properties, message, remarks); this.testMetapath = ObjectUtils.notNull( - Lazy.lazy(() -> MetapathExpression.compile( + Lazy.lazy(() -> IMetapathExpression.compile( test, source.getStaticContext()))); } @@ -84,7 +84,7 @@ public DefaultExpectConstraint( * @return the compiled Metapath expression */ @NonNull - public MetapathExpression getTestMetapath() { + public IMetapathExpression getTestMetapath() { return ObjectUtils.notNull(testMetapath.get()); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultKeyField.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultKeyField.java index 929d99660..9be2c9feb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultKeyField.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultKeyField.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.constraint.impl; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.IKeyField; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -22,7 +22,7 @@ public class DefaultKeyField implements IKeyField { @Nullable private final Pattern pattern; @NonNull - private final Lazy target; + private final Lazy target; @Nullable private final MarkupMultiline remarks; @@ -45,7 +45,7 @@ public DefaultKeyField( @Nullable MarkupMultiline remarks, @NonNull ISource source) { this.pattern = pattern; - this.target = ObjectUtils.notNull(Lazy.lazy(() -> MetapathExpression.compile(target, source.getStaticContext()))); + this.target = ObjectUtils.notNull(Lazy.lazy(() -> IMetapathExpression.compile(target, source.getStaticContext()))); this.remarks = remarks; } @@ -60,7 +60,7 @@ public String getTarget() { } @Override - public MetapathExpression getTargetMetapath() { + public IMetapathExpression getTargetMetapath() { return ObjectUtils.notNull(target.get()); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultLet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultLet.java index 191c1b458..22b743f39 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultLet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultLet.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.constraint.impl; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.ILet; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; @@ -24,7 +24,7 @@ public class DefaultLet implements ILet { @NonNull private final IEnhancedQName name; @NonNull - private final MetapathExpression valueExpression; + private final IMetapathExpression valueExpression; @NonNull private final ISource source; @Nullable @@ -44,7 +44,7 @@ public class DefaultLet implements ILet { */ public DefaultLet( @NonNull IEnhancedQName name, - @NonNull MetapathExpression metapath, + @NonNull IMetapathExpression metapath, @NonNull ISource source, @Nullable MarkupMultiline remarks) { this.name = name; @@ -59,7 +59,7 @@ public IEnhancedQName getName() { } @Override - public MetapathExpression getValueExpression() { + public IMetapathExpression getValueExpression() { return valueExpression; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java b/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java index 03eb2e86c..b3cbcc4e6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.util; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.ArrayList; import java.util.Collections; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ISequenceTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ISequenceTest.java index f640da8e2..149084706 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ISequenceTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ISequenceTest.java @@ -11,6 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java index 28049f580..52c0e3b78 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java @@ -10,6 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import org.junit.jupiter.api.Disabled; @@ -37,7 +38,7 @@ void testCorrect() { continue; } // System.out.println(line); - MetapathExpression.compile(line); + IMetapathExpression.compile(line); } } // @@ -60,13 +61,13 @@ void testCorrect() { @Test void testSyntaxError() { assertThrows(MetapathException.class, () -> { - MetapathExpression.compile("**"); + IMetapathExpression.compile("**"); }); } @Test void test() { - MetapathExpression path = MetapathExpression.compile("2 eq 1 + 1"); + IMetapathExpression path = IMetapathExpression.compile("2 eq 1 + 1"); ISequence result = path.evaluate(); assertNotNull(result, "null result"); assertTrue(!result.isEmpty(), "result was empty"); @@ -77,7 +78,7 @@ void test() { @Test void testMalformedIf() throws IOException { StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { - MetapathExpression.compile("if 'a' = '1.1.2' then true() else false()"); + IMetapathExpression.compile("if 'a' = '1.1.2' then true() else false()"); }); assertEquals(StaticMetapathException.INVALID_PATH_GRAMMAR, ex.getCode()); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/OperationFunctionsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/OperationFunctionsTest.java index 2bfffb40a..69628dd63 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/OperationFunctionsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/OperationFunctionsTest.java @@ -9,7 +9,7 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; import static org.junit.jupiter.api.Assertions.assertEquals; -import gov.nist.secauto.metaschema.core.metapath.function.OperationFunctions; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/TestUtils.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/TestUtils.java index 377451545..ab5d76757 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/TestUtils.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/TestUtils.java @@ -5,7 +5,9 @@ package gov.nist.secauto.metaschema.core.metapath; +import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCallTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCallTest.java new file mode 100644 index 000000000..e0ecb1d2a --- /dev/null +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCallTest.java @@ -0,0 +1,66 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.cst; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.StaticContext; + +import org.junit.jupiter.api.Test; + +/** + * Unit tests for anonymous function calls in Metapath expressions. + *

+ * These tests validate the compilation and execution of anonymous functions as + * defined in the Metaschema specification. + */ +class AnonymousFunctionCallTest { + private static final String NS = "http://example.com/ns"; + + /** + * Tests the basic functionality of anonymous function definition and execution. + * This test validates: + *

    + *
  • Function definition using the 'let' syntax
  • + *
  • Function execution with string parameters
  • + *
  • String concatenation within the function body
  • + *
+ */ + @Test + void test() { + StaticContext staticContext = StaticContext.builder() + .namespace("ex", NS) + .build(); + DynamicContext dynamicContext = new DynamicContext(staticContext); + + String metapath = "let $function := function($str) as meta:string { fn:concat('extra ',$str) } " + + "return $function('cool')"; + + assertEquals( + "extra cool", + IMetapathExpression.compile(metapath, staticContext).evaluateAs( + null, + IMetapathExpression.ResultType.STRING, + dynamicContext)); + } + + @Test + void testMultipleParameters() { + // FIXME: Add test for function with multiple parameters + } + + @Test + void testDifferentReturnTypes() { + // FIXME: Add test for functions returning different types + } + + @Test + void testErrorCases() { + // FIXME: Add test for invalid function definitions + } +} diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java index 64f354a3e..c7a907f29 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java @@ -6,13 +6,22 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.bool; -import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; +import static gov.nist.secauto.metaschema.core.metapath.TestUtils.string; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -23,19 +32,53 @@ class ArrowExpressionTest extends ExpressionTestBase { + private static final String NS = "http://example.com/ns"; + private static Stream provideValues() { // NOPMD - false positive return Stream.of( - // Arguments.of(ISequence.of(string("true")), "true() => string()"), - Arguments.of(ISequence.of(bool(false)), "() => exists()"), - Arguments.of(ISequence.of(integer(3)), "(1, 2) => sum()")); + Arguments.of(ISequence.of(string("ABC")), "'abc' => upper-case()"), + Arguments.of(ISequence.of(string("123")), "'1' => concat('2') => concat('3')"), + Arguments.of(ISequence.of(bool(true)), "() => $ex:var1()")); } + /** + * Tests the casting functionality using various input strings and target types. + *

+ * The dynamic context is created fresh for each test case to ensure isolation. + * + * @param text + * The input string to cast + * @param type + * The target type to cast to + * @param expected + * The expected result after casting + */ @ParameterizedTest @MethodSource("provideValues") void testArrowExpression(@NonNull ISequence expected, @NonNull String metapath) { + StaticContext staticContext = StaticContext.builder() + .namespace("ex", NS) + .build(); + DynamicContext dynamicContext = new DynamicContext(staticContext); + dynamicContext.bindVariableValue(IEnhancedQName.of(NS, "var1"), ISequence.of(string("fn:empty"))); + assertEquals( expected, - MetapathExpression.compile(metapath).evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, - newDynamicContext())); + IMetapathExpression.compile(metapath, staticContext).evaluate(null, dynamicContext)); + } + + @Test + void testArrowExpressionWithUndefinedVariable() { + StaticContext staticContext = StaticContext.builder() + .namespace("ex", NS) + .build(); + DynamicContext dynamicContext = new DynamicContext(staticContext); + + MetapathException ex = assertThrows( + MetapathException.class, + () -> IMetapathExpression.compile("() => $ex:undefined()", staticContext) + .evaluate(null, dynamicContext)); + assertEquals(StaticMetapathException.NOT_DEFINED, + ObjectUtils.requireNonNull((AbstractCodedMetapathException) ex.getCause()).getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java index 5a4908ff9..e071027e0 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java @@ -21,9 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression.ResultType; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.antlr.FailingErrorListener; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10; @@ -36,6 +34,7 @@ import gov.nist.secauto.metaschema.core.metapath.cst.logic.ValueComparison; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUuidItem; @@ -124,13 +123,13 @@ void testAbbreviatedParentAxis() { StaticContext staticContext = newStaticContext(); // compile expression String path = "../field2"; - MetapathExpression expr = MetapathExpression.compile(path, staticContext); + IMetapathExpression expr = IMetapathExpression.compile(path, staticContext); // select starting node IDocumentNodeItem document = newTestDocument(); IFieldNodeItem field - = MetapathExpression.compile("/root/field1", staticContext) - .evaluateAs(document, ResultType.ITEM); + = IMetapathExpression.compile("/root/field1", staticContext) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM); assert field != null; // evaluate @@ -146,13 +145,13 @@ void testParentAxisMatch() { // select starting node IDocumentNodeItem document = newTestDocument(); - IFieldNodeItem field = MetapathExpression.compile("/root/field1", staticContext) - .evaluateAs(document, ResultType.ITEM); + IFieldNodeItem field = IMetapathExpression.compile("/root/field1", staticContext) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM); assert field != null; // compile expression - IItem result = MetapathExpression.compile("parent::root", staticContext) - .evaluateAs(field, ResultType.ITEM); + IItem result = IMetapathExpression.compile("parent::root", staticContext) + .evaluateAs(field, IMetapathExpression.ResultType.ITEM); assert result != null; assertAll( @@ -166,13 +165,13 @@ void testParentAxisNonMatch() { // select starting node IDocumentNodeItem document = newTestDocument(); - IFieldNodeItem field = MetapathExpression.compile("/root/field1", staticContext) - .evaluateAs(document, ResultType.ITEM); + IFieldNodeItem field = IMetapathExpression.compile("/root/field1", staticContext) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM); assert field != null; // compile expression String path = "parent::other"; - MetapathExpression expr = MetapathExpression.compile(path, staticContext); + IMetapathExpression expr = IMetapathExpression.compile(path, staticContext); // evaluate ISequence result = expr.evaluate(field); @@ -185,7 +184,7 @@ void testParentAxisDocument() { // compile expression String path = "parent::other"; - MetapathExpression expr = MetapathExpression.compile(path, staticContext); + IMetapathExpression expr = IMetapathExpression.compile(path, staticContext); // select starting node IDocumentNodeItem document = newTestDocument(); @@ -200,7 +199,7 @@ void testAbbreviatedForwardAxisModelName() { StaticContext staticContext = newStaticContext(); String path = "./root"; - MetapathExpression expr = MetapathExpression.compile(path, staticContext); + IMetapathExpression expr = IMetapathExpression.compile(path, staticContext); // select starting node IDocumentNodeItem document = newTestDocument(); @@ -218,12 +217,12 @@ void testAbbreviatedForwardAxisFlagName() { StaticContext staticContext = newStaticContext(); String path = "./@flag"; - MetapathExpression expr = MetapathExpression.compile(path, staticContext); + IMetapathExpression expr = IMetapathExpression.compile(path, staticContext); // select starting node IDocumentNodeItem document = newTestDocument(); - IFieldNodeItem field = MetapathExpression.compile("/root/field2", staticContext) - .evaluateAs(document, ResultType.ITEM); + IFieldNodeItem field = IMetapathExpression.compile("/root/field2", staticContext) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM); assert field != null; // evaluate @@ -239,12 +238,12 @@ void testForwardstepChild() { StaticContext staticContext = newStaticContext(); String path = "child::*"; - MetapathExpression expr = MetapathExpression.compile(path, staticContext); + IMetapathExpression expr = IMetapathExpression.compile(path, staticContext); // select starting node IDocumentNodeItem document = newTestDocument(); - IRootAssemblyNodeItem root = MetapathExpression.compile("/root", staticContext) - .evaluateAs(document, ResultType.ITEM, new DynamicContext(staticContext)); + IRootAssemblyNodeItem root = IMetapathExpression.compile("/root", staticContext) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, new DynamicContext(staticContext)); assert root != null; // evaluate diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/QuantifiedTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/QuantifiedTest.java index 5631496b0..04294adbf 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/QuantifiedTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/QuantifiedTest.java @@ -9,7 +9,7 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -25,17 +25,17 @@ private static Stream testQuantified() { // NOPMD - false positive return Stream.of( Arguments.of( true, - MetapathExpression.compile("some $x in (1, 2, 3), $y in (2, 3, 4) satisfies $x + $y = 4")), + IMetapathExpression.compile("some $x in (1, 2, 3), $y in (2, 3, 4) satisfies $x + $y = 4")), Arguments.of( false, - MetapathExpression.compile("every $x in (1, 2, 3), $y in (2, 3, 4) satisfies $x + $y = 4"))); + IMetapathExpression.compile("every $x in (1, 2, 3), $y in (2, 3, 4) satisfies $x + $y = 4"))); } @ParameterizedTest @MethodSource - void testQuantified(boolean expected, @NonNull MetapathExpression metapath) { + void testQuantified(boolean expected, @NonNull IMetapathExpression metapath) { DynamicContext dynamicContext = newDynamicContext(); - assertEquals(expected, metapath.evaluateAs(null, MetapathExpression.ResultType.BOOLEAN, dynamicContext)); + assertEquals(expected, metapath.evaluateAs(null, IMetapathExpression.ResultType.BOOLEAN, dynamicContext)); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/RangeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/RangeTest.java index 392290f58..60c373df7 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/RangeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/RangeTest.java @@ -9,8 +9,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -43,7 +43,6 @@ private static Stream provideValues() { // NOPMD - false positive void testRange(@NonNull ISequence expected, @NonNull String metapath) { assertEquals( expected, - MetapathExpression.compile(metapath).evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, - newDynamicContext())); + IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/CSTLogicalExpressionsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/CSTLogicalExpressionsTest.java index 2514267b3..52b342a30 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/CSTLogicalExpressionsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/CSTLogicalExpressionsTest.java @@ -9,9 +9,9 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -65,7 +65,7 @@ void testAnd(IBooleanItem bool1, IBooleanItem bool2, IBooleanItem expectedResult ISequence result = expr.accept(dynamicContext, focus); assertEquals(ISequence.of(expectedResult), result); - result = MetapathExpression.compile(ObjectUtils.notNull( + result = IMetapathExpression.compile(ObjectUtils.notNull( new StringBuilder() .append(bool1.toBoolean() ? "true()" : "false()") .append(" and ") @@ -109,7 +109,7 @@ void testOr(IBooleanItem bool1, IBooleanItem bool2, IBooleanItem expectedResult) ISequence result = expr.accept(dynamicContext, focus); assertEquals(ISequence.of(expectedResult), result, "Sequence does not match"); - result = MetapathExpression.compile(ObjectUtils.notNull( + result = IMetapathExpression.compile(ObjectUtils.notNull( new StringBuilder() .append(bool1.toBoolean() ? "true()" : "false()") .append(" or ") diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpressionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpressionTest.java index a4d6d9831..cbf910680 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpressionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpressionTest.java @@ -9,8 +9,8 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparisonTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparisonTest.java index 19ca40e16..0459b707b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparisonTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparisonTest.java @@ -9,10 +9,10 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/FlagTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/FlagTest.java index 2c4c34bbf..a56b4c562 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/FlagTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/FlagTest.java @@ -9,7 +9,7 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.NodeItemKind; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java index 9b7e970a3..561d3077a 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java @@ -9,7 +9,7 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java index 2cee195bd..35e47d9ab 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; @@ -276,11 +276,11 @@ IDocumentNodeItem getTestNodeItem() { void testSelfAxis() { DynamicContext dynamicContext = newDynamicContext(); - IModelNodeItem nodeB = MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(getTestNodeItem(), MetapathExpression.ResultType.ITEM, dynamicContext); + IModelNodeItem nodeB = IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(getTestNodeItem(), IMetapathExpression.ResultType.ITEM, dynamicContext); - INodeItem actual = MetapathExpression.compile("self::*", dynamicContext.getStaticContext()) - .evaluateAs(nodeB, MetapathExpression.ResultType.ITEM, dynamicContext); + INodeItem actual = IMetapathExpression.compile("self::*", dynamicContext.getStaticContext()) + .evaluateAs(nodeB, IMetapathExpression.ResultType.ITEM, dynamicContext); Assertions.assertThat(actual) .isEqualTo(nodeB) @@ -292,11 +292,11 @@ void testParentAxis() { DynamicContext dynamicContext = newDynamicContext(); IModelNodeItem nodeB = ObjectUtils.requireNonNull( - MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(getTestNodeItem(), MetapathExpression.ResultType.ITEM, dynamicContext)); + IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(getTestNodeItem(), IMetapathExpression.ResultType.ITEM, dynamicContext)); - INodeItem actual = MetapathExpression.compile("parent::*", dynamicContext.getStaticContext()) - .evaluateAs(nodeB, MetapathExpression.ResultType.ITEM, dynamicContext); + INodeItem actual = IMetapathExpression.compile("parent::*", dynamicContext.getStaticContext()) + .evaluateAs(nodeB, IMetapathExpression.ResultType.ITEM, dynamicContext); Assertions.assertThat(actual) .isEqualTo(nodeB.getParentNodeItem()) @@ -307,10 +307,10 @@ void testParentAxis() { void testFlagAxis() { DynamicContext dynamicContext = newDynamicContext(); - IModelNodeItem nodeB = MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(getTestNodeItem(), MetapathExpression.ResultType.ITEM, dynamicContext); + IModelNodeItem nodeB = IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(getTestNodeItem(), IMetapathExpression.ResultType.ITEM, dynamicContext); - ISequence actual = MetapathExpression.compile("flag::*", dynamicContext.getStaticContext()) + ISequence actual = IMetapathExpression.compile("flag::*", dynamicContext.getStaticContext()) .evaluate(nodeB, dynamicContext); Assertions.assertThat(actual.getValue()) @@ -325,11 +325,12 @@ void testAncestorAxis() { IDocumentNodeItem document = getTestNodeItem(); - IModelNodeItem nodeB = MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(document, MetapathExpression.ResultType.ITEM, dynamicContext); + IModelNodeItem nodeB = IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, dynamicContext); - ISequence actual = MetapathExpression.compile("ancestor::*", dynamicContext.getStaticContext()) - .evaluate(nodeB, dynamicContext); + ISequence actual + = IMetapathExpression.compile("ancestor::*", dynamicContext.getStaticContext()) + .evaluate(nodeB, dynamicContext); Assertions.assertThat(actual.getValue()).isEqualTo(List.of( document.getRootAssemblyNodeItem() @@ -345,11 +346,11 @@ void testAncestorOrSelfAxis() { IDocumentNodeItem document = getTestNodeItem(); - IModelNodeItem nodeB = MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(document, MetapathExpression.ResultType.ITEM, dynamicContext); + IModelNodeItem nodeB = IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, dynamicContext); ISequence actual - = MetapathExpression.compile("ancestor-or-self::*", dynamicContext.getStaticContext()) + = IMetapathExpression.compile("ancestor-or-self::*", dynamicContext.getStaticContext()) .evaluate(nodeB, dynamicContext); Assertions.assertThat(actual.getValue()).isEqualTo(List.of( @@ -368,11 +369,11 @@ void testChildrenAxis() { IDocumentNodeItem document = getTestNodeItem(); IModelNodeItem nodeB - = ObjectUtils.requireNonNull(MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(document, MetapathExpression.ResultType.ITEM, dynamicContext)); + = ObjectUtils.requireNonNull(IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, dynamicContext)); ISequence actual - = MetapathExpression.compile("child::*", dynamicContext.getStaticContext()) + = IMetapathExpression.compile("child::*", dynamicContext.getStaticContext()) .evaluate(nodeB, dynamicContext); Assertions.assertThat(actual.getValue()).isEqualTo( @@ -389,11 +390,11 @@ void testDescendantAxis() { IDocumentNodeItem document = getTestNodeItem(); IModelNodeItem node2 - = ObjectUtils.requireNonNull(MetapathExpression.compile("/root/node-2", dynamicContext.getStaticContext()) - .evaluateAs(document, MetapathExpression.ResultType.ITEM, dynamicContext)); + = ObjectUtils.requireNonNull(IMetapathExpression.compile("/root/node-2", dynamicContext.getStaticContext()) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, dynamicContext)); ISequence actual - = MetapathExpression.compile("descendant::*", dynamicContext.getStaticContext()) + = IMetapathExpression.compile("descendant::*", dynamicContext.getStaticContext()) .evaluate(node2, dynamicContext); IModelNodeItem nodeA @@ -426,11 +427,11 @@ void testDescendantOrSelfAxis() { IDocumentNodeItem document = getTestNodeItem(); IModelNodeItem node2 - = ObjectUtils.requireNonNull(MetapathExpression.compile("/root/node-2", dynamicContext.getStaticContext()) - .evaluateAs(document, MetapathExpression.ResultType.ITEM, dynamicContext)); + = ObjectUtils.requireNonNull(IMetapathExpression.compile("/root/node-2", dynamicContext.getStaticContext()) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, dynamicContext)); ISequence actual - = MetapathExpression.compile("descendant-or-self::*", dynamicContext.getStaticContext()) + = IMetapathExpression.compile("descendant-or-self::*", dynamicContext.getStaticContext()) .evaluate(node2, dynamicContext); IModelNodeItem nodeA @@ -464,11 +465,11 @@ void testFollowingSiblingAxis() { IDocumentNodeItem document = getTestNodeItem(); IModelNodeItem nodeB - = ObjectUtils.requireNonNull(MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(document, MetapathExpression.ResultType.ITEM, dynamicContext)); + = ObjectUtils.requireNonNull(IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, dynamicContext)); ISequence actual - = MetapathExpression.compile("following-sibling::*", dynamicContext.getStaticContext()) + = IMetapathExpression.compile("following-sibling::*", dynamicContext.getStaticContext()) .evaluate(nodeB, dynamicContext); IModelNodeItem node2 = document.getRootAssemblyNodeItem() @@ -486,11 +487,11 @@ void testPrecedingSiblingAxis() { IDocumentNodeItem document = getTestNodeItem(); IModelNodeItem nodeB - = ObjectUtils.requireNonNull(MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(document, MetapathExpression.ResultType.ITEM, dynamicContext)); + = ObjectUtils.requireNonNull(IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, dynamicContext)); ISequence actual - = MetapathExpression.compile("preceding-sibling::*", dynamicContext.getStaticContext()) + = IMetapathExpression.compile("preceding-sibling::*", dynamicContext.getStaticContext()) .evaluate(nodeB, dynamicContext); IModelNodeItem node2 = document.getRootAssemblyNodeItem() @@ -508,11 +509,11 @@ void testFollowingAxis() { IDocumentNodeItem document = getTestNodeItem(); IModelNodeItem nodeB - = ObjectUtils.requireNonNull(MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(document, MetapathExpression.ResultType.ITEM, dynamicContext)); + = ObjectUtils.requireNonNull(IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, dynamicContext)); ISequence actual - = MetapathExpression.compile("following::*", dynamicContext.getStaticContext()) + = IMetapathExpression.compile("following::*", dynamicContext.getStaticContext()) .evaluate(nodeB, dynamicContext); IModelNodeItem node2 = document.getRootAssemblyNodeItem() @@ -537,11 +538,11 @@ void testPrecedingAxis() { IDocumentNodeItem document = getTestNodeItem(); IModelNodeItem nodeB - = ObjectUtils.requireNonNull(MetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) - .evaluateAs(document, MetapathExpression.ResultType.ITEM, dynamicContext)); + = ObjectUtils.requireNonNull(IMetapathExpression.compile("/root/node-2/b", dynamicContext.getStaticContext()) + .evaluateAs(document, IMetapathExpression.ResultType.ITEM, dynamicContext)); ISequence actual - = MetapathExpression.compile("preceding::*", dynamicContext.getStaticContext()) + = IMetapathExpression.compile("preceding::*", dynamicContext.getStaticContext()) .evaluate(nodeB, dynamicContext); IModelNodeItem node2 = document.getRootAssemblyNodeItem() diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java index 4e6efd270..1f995032d 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java @@ -17,7 +17,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; @@ -105,8 +105,8 @@ static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testCast(@NonNull IAnyAtomicItem actual, @NonNull String singleType, @NonNull IAnyAtomicItem expected) { - MetapathExpression metapath = MetapathExpression.compile(". cast as " + singleType); - IItem result = metapath.evaluateAs(actual, MetapathExpression.ResultType.ITEM); + IMetapathExpression metapath = IMetapathExpression.compile(". cast as " + singleType); + IItem result = metapath.evaluateAs(actual, IMetapathExpression.ResultType.ITEM); assertEquals( expected, @@ -117,7 +117,7 @@ void testCast(@NonNull IAnyAtomicItem actual, @NonNull String singleType, @NonNu @Test void testInvalidTypePrefix() { StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { - MetapathExpression.compile("'a' cast as foo:bar"); + IMetapathExpression.compile("'a' cast as foo:bar"); }); assertEquals(StaticMetapathException.PREFIX_NOT_EXPANDABLE, ex.getCode()); } @@ -125,7 +125,7 @@ void testInvalidTypePrefix() { @Test void testInvalidType() { StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { - MetapathExpression.compile("'a' cast as meta:bar"); + IMetapathExpression.compile("'a' cast as meta:bar"); }); assertEquals(StaticMetapathException.CAST_UNKNOWN_TYPE, ex.getCode()); } @@ -133,7 +133,7 @@ void testInvalidType() { @Test void testAnyAtomicType() { StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { - MetapathExpression.compile("'a' cast as meta:any-atomic-type"); + IMetapathExpression.compile("'a' cast as meta:any-atomic-type"); }); assertEquals(StaticMetapathException.CAST_ANY_ATOMIC, ex.getCode()); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java index a542b3b26..5a774a4c4 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -38,8 +38,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testCastable(@NonNull IAnyAtomicItem actual, @NonNull String singleType) { - MetapathExpression metapath = MetapathExpression.compile(". castable as " + singleType); - boolean result = ObjectUtils.notNull(metapath.evaluateAs(actual, MetapathExpression.ResultType.BOOLEAN)); + IMetapathExpression metapath = IMetapathExpression.compile(". castable as " + singleType); + boolean result = ObjectUtils.notNull(metapath.evaluateAs(actual, IMetapathExpression.ResultType.BOOLEAN)); assertTrue( result, @@ -49,7 +49,7 @@ void testCastable(@NonNull IAnyAtomicItem actual, @NonNull String singleType) { @Test void testInvalidTypePrefix() { StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { - MetapathExpression.compile("'a' castable as foo:bar"); + IMetapathExpression.compile("'a' castable as foo:bar"); }); assertEquals(StaticMetapathException.PREFIX_NOT_EXPANDABLE, ex.getCode()); } @@ -57,7 +57,7 @@ void testInvalidTypePrefix() { @Test void testInvalidType() { StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { - MetapathExpression.compile("'a' castable as meta:bar"); + IMetapathExpression.compile("'a' castable as meta:bar"); }); assertEquals(StaticMetapathException.CAST_UNKNOWN_TYPE, ex.getCode()); } @@ -65,7 +65,7 @@ void testInvalidType() { @Test void testAnyAtomicType() { StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { - MetapathExpression.compile("'a' castable as meta:any-atomic-type"); + IMetapathExpression.compile("'a' castable as meta:any-atomic-type"); }); assertEquals(StaticMetapathException.CAST_ANY_ATOMIC, ex.getCode()); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java index 51a0b1d53..f9e055042 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java @@ -11,7 +11,7 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; @@ -85,8 +85,8 @@ void testMatch(@NonNull String test, boolean expected) { IEnhancedQName.of("M"), IMapItem.of(integer(0), string("no"), integer(1), string("yes")).toSequence()); - MetapathExpression metapath = MetapathExpression.compile(test); - Boolean result = metapath.evaluateAs(null, MetapathExpression.ResultType.BOOLEAN, dynamicContext); + Boolean result = IMetapathExpression.compile(test) + .evaluateAs(null, IMetapathExpression.ResultType.BOOLEAN, dynamicContext); assertEquals( expected, @@ -140,14 +140,13 @@ void testMatchNodeItem(@NonNull String test, boolean expected) { StaticContext staticContext = StaticContext.builder() .namespace("x", NS) .build(); - MetapathExpression metapath = MetapathExpression.compile(test, staticContext); - DynamicContext dynamicContext = new DynamicContext(staticContext); dynamicContext.bindVariableValue( IEnhancedQName.of("M"), IMapItem.of(integer(0), string("no"), integer(1), string("yes")).toSequence()); - Boolean result = metapath.evaluateAs(documentNodeItem, MetapathExpression.ResultType.BOOLEAN, dynamicContext); + Boolean result = IMetapathExpression.compile(test, staticContext) + .evaluateAs(documentNodeItem, IMetapathExpression.ResultType.BOOLEAN, dynamicContext); assertEquals( expected, diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctionsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctionsTest.java index a9eb83e80..fca82d17b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctionsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctionsTest.java @@ -9,6 +9,7 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; import static org.junit.jupiter.api.Assertions.assertEquals; +import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; import gov.nist.secauto.metaschema.core.metapath.function.library.FunctionTestBase; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppendTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppendTest.java index a121be452..8a49a51f6 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppendTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppendTest.java @@ -11,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; @@ -37,8 +37,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlattenTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlattenTest.java index a1917c6e9..5f0099d8c 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlattenTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlattenTest.java @@ -10,8 +10,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -40,8 +40,7 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull ISequence expected, @NonNull String metapath) { - ISequence result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, newDynamicContext()); + ISequence result = IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGetTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGetTest.java index 11bd2b2f6..3170fcf96 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGetTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGetTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; @@ -37,8 +37,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHeadTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHeadTest.java index 4a40249b0..0e66adb54 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHeadTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHeadTest.java @@ -12,8 +12,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -43,8 +43,7 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull ISequence expected, @NonNull String metapath) { - ISequence result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, newDynamicContext()); + ISequence result = IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBeforeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBeforeTest.java index 1e1f50d8b..c2705a343 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBeforeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBeforeTest.java @@ -11,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; @@ -40,8 +40,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoinTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoinTest.java index 11e4a6f87..efd13817f 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoinTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoinTest.java @@ -11,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; @@ -46,8 +46,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPutTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPutTest.java index 06449d6f3..af252ca96 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPutTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPutTest.java @@ -11,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; @@ -41,8 +41,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemoveTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemoveTest.java index 3285e7f01..207ffb200 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemoveTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemoveTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; @@ -46,8 +46,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverseTest.java index 4a59b973f..d3cab0911 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverseTest.java @@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; @@ -44,8 +44,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySizeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySizeTest.java index c42fe69b8..289eddf3d 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySizeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySizeTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; @@ -43,8 +43,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IIntegerItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarrayTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarrayTest.java index 7f0bc2149..4d4cdcddf 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarrayTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarrayTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; @@ -51,8 +51,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTailTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTailTest.java index ccbcaf7bb..8243a943e 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTailTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTailTest.java @@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import org.junit.jupiter.params.ParameterizedTest; @@ -42,8 +42,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IArrayItem expected, @NonNull String metapath) { - IArrayItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IArrayItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunctionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunctionTest.java new file mode 100644 index 000000000..afe1732cc --- /dev/null +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunctionTest.java @@ -0,0 +1,78 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.function.library; + +import static gov.nist.secauto.metaschema.core.metapath.TestUtils.bool; +import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; +import static gov.nist.secauto.metaschema.core.metapath.TestUtils.string; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.stream.Stream; + +import edu.umd.cs.findbugs.annotations.NonNull; + +class CastFunctionTest + extends ExpressionTestBase { + + private static Stream provideValues() { // NOPMD - false positive + return Stream.of( + // Boolean cases + Arguments.of(string("ABCD0"), IBooleanItem.type(), bool(false)), + Arguments.of(string("true"), IBooleanItem.type(), bool(true)), + Arguments.of(string("0"), IBooleanItem.type(), bool(false)), + Arguments.of(string("1"), IBooleanItem.type(), bool(true)), + Arguments.of(string("yes"), IBooleanItem.type(), bool(false)), + Arguments.of(string("no"), IBooleanItem.type(), bool(false)), + Arguments.of(string("TRUE"), IBooleanItem.type(), bool(true)), + Arguments.of(string(""), IBooleanItem.type(), bool(false)), + Arguments.of(string(" "), IBooleanItem.type(), bool(false)), + // Integer cases + Arguments.of(string("1234567"), IIntegerItem.type(), integer(1234567)), + Arguments.of(string("-1234567"), IIntegerItem.type(), integer(-1234567)), + Arguments.of(string("0"), IIntegerItem.type(), integer(0)), + Arguments.of( + string(ObjectUtils.notNull(Integer.toString(Integer.MAX_VALUE))), + IIntegerItem.type(), + integer(Integer.MAX_VALUE)), + Arguments.of( + string(ObjectUtils.notNull(Integer.toString(Integer.MIN_VALUE))), + IIntegerItem.type(), + integer(Integer.MIN_VALUE))); + } + + @ParameterizedTest + @MethodSource("provideValues") + void testExpression(@NonNull IStringItem text, @NonNull IAtomicOrUnionType type, + @NonNull IAnyAtomicItem expected) { + IAnyAtomicItem result = IMetapathExpression.compile(type.getQName().toEQName() + "('" + text.asString() + "')") + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); + assertEquals(expected, result); + } + + @Test + void testInvalidCasts() { + assertThrows(MetapathException.class, () -> { + IMetapathExpression.compile(IIntegerItem.type().getQName().toEQName() + "('invalid')") + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); + }); + } +} diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbsTest.java index d637e8e39..5be429705 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbsTest.java @@ -8,7 +8,7 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.decimal; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvgTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvgTest.java index f219f8398..d36ab830d 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvgTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvgTest.java @@ -13,9 +13,9 @@ import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertInstanceOf; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBooleanTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBooleanTest.java index 2bcba4bb4..f41de971f 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBooleanTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBooleanTest.java @@ -14,10 +14,10 @@ import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNull; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUntypedAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeilingTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeilingTest.java index c2ea37004..c023a50e9 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeilingTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeilingTest.java @@ -8,7 +8,7 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.decimal; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcatTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcatTest.java index ae023c36e..2ad0a40d5 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcatTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcatTest.java @@ -9,8 +9,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -49,8 +49,7 @@ private static Stream provideValues() { // NOPMD - false positive void testExpression(@NonNull ISequence expected, @NonNull String metapath) { assertEquals( expected, - MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, newDynamicContext())); + IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContainsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContainsTest.java index e5096fc5b..edc72ac48 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContainsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContainsTest.java @@ -8,7 +8,7 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.bool; import static org.junit.jupiter.api.Assertions.assertEquals; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import org.junit.jupiter.params.ParameterizedTest; @@ -36,8 +36,8 @@ static Stream provideValues() { @ParameterizedTest @MethodSource("provideValues") void test(@NonNull IBooleanItem expected, @NonNull String metapath) { - IBooleanItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IBooleanItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCountTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCountTest.java index 14ecd4a5e..f1c19b935 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCountTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCountTest.java @@ -9,8 +9,8 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.string; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTimeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTimeTest.java index 3dac9af77..86f39cf05 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTimeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTimeTest.java @@ -7,7 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.junit.jupiter.api.Test; @@ -15,8 +15,8 @@ class FnCurrentTimeTest { @Test void test() { - String currentTime = ObjectUtils.notNull(MetapathExpression.compile("fn:current-time()") - .evaluateAs(MetapathExpression.ResultType.STRING)); + String currentTime = ObjectUtils.notNull(IMetapathExpression.compile("fn:current-time()") + .evaluateAs(IMetapathExpression.ResultType.STRING)); System.out.println(currentTime); assertFalse(currentTime.isBlank()); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmptyTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmptyTest.java index c552eee48..db86e7f70 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmptyTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmptyTest.java @@ -8,8 +8,8 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.bool; import static org.junit.jupiter.api.Assertions.assertEquals; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -55,7 +55,7 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void test(@NonNull ISequence expected, @NonNull String metapath) { - assertEquals(expected, MetapathExpression.compile(metapath).evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, - newDynamicContext())); + assertEquals(expected, + IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWithTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWithTest.java index e636964db..f9dd405c7 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWithTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWithTest.java @@ -8,7 +8,7 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.bool; import static org.junit.jupiter.api.Assertions.assertEquals; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import org.junit.jupiter.params.ParameterizedTest; @@ -36,8 +36,8 @@ static Stream provideValues() { @ParameterizedTest @MethodSource("provideValues") void test(@NonNull IBooleanItem expected, @NonNull String metapath) { - IBooleanItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IBooleanItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExistsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExistsTest.java index efc40d4d9..67f839a42 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExistsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExistsTest.java @@ -8,8 +8,8 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.bool; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalseTest.java index cb651fedd..ba5ef0b43 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalseTest.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHeadTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHeadTest.java index f8e4de65e..2506aea26 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHeadTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHeadTest.java @@ -10,8 +10,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -39,7 +39,6 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void test(@NonNull ISequence expected, @NonNull String metapath) { - assertEquals(expected, MetapathExpression.compile(metapath).evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, - newDynamicContext())); + assertEquals(expected, IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezoneTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezoneTest.java index 8b17ca80e..8dde12304 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezoneTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezoneTest.java @@ -8,7 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -22,8 +22,8 @@ class FnImplicitTimezoneTest { @Test void test() { DynamicContext context = new DynamicContext(); - IDayTimeDurationItem currentTime = ObjectUtils.notNull(MetapathExpression.compile("fn:implicit-timezone()") - .evaluateAs(null, MetapathExpression.ResultType.ITEM, context)); + IDayTimeDurationItem currentTime = ObjectUtils.notNull(IMetapathExpression.compile("fn:implicit-timezone()") + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, context)); assertEquals( context.getCurrentDateTime().getOffset().get(ChronoField.OFFSET_SECONDS), diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBeforeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBeforeTest.java index 1e11df45a..2194e9e37 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBeforeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBeforeTest.java @@ -9,8 +9,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -44,7 +44,6 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void test(@NonNull ISequence expected, @NonNull String metapath) { - assertEquals(expected, MetapathExpression.compile(metapath).evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, - newDynamicContext())); + assertEquals(expected, IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCaseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCaseTest.java index febe46935..0b99ec0d9 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCaseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCaseTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; @@ -32,8 +32,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IStringItem expected, @NonNull String metapath) { - IStringItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IStringItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java index 5c2f19b3b..23f5e7272 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java @@ -13,10 +13,10 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegularExpressionMetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; @@ -70,8 +70,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void test(@NonNull IBooleanItem expected, @NonNull String metapath) { - assertEquals(expected, MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, + assertEquals(expected, IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext())); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMaxTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMaxTest.java index 8f1c52d40..7726b9ff8 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMaxTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMaxTest.java @@ -12,9 +12,9 @@ import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertInstanceOf; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java index e6f98a681..25dbe5214 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java @@ -12,8 +12,8 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; @@ -39,8 +39,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IStringItem expected, @NonNull String metapath) { - IStringItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IStringItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNotTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNotTest.java index 22ebf3394..848b09dfb 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNotTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNotTest.java @@ -14,10 +14,10 @@ import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNull; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUntypedAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemoveTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemoveTest.java index 69f29e973..b5b057277 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemoveTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemoveTest.java @@ -9,8 +9,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -47,7 +47,6 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void test(@NonNull ISequence expected, @NonNull String metapath) { - assertEquals(expected, MetapathExpression.compile(metapath).evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, - newDynamicContext())); + assertEquals(expected, IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverseTest.java index bdebc73a0..f72853ac2 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverseTest.java @@ -11,8 +11,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -46,7 +46,7 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void test(@NonNull ISequence expected, @NonNull String metapath) { - assertEquals(expected, MetapathExpression.compile(metapath).evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, - newDynamicContext())); + assertEquals(expected, + IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRoundTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRoundTest.java index cc34ef5f6..5710e8dd2 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRoundTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRoundTest.java @@ -8,7 +8,7 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.decimal; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWithTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWithTest.java index b1ec5a545..a1f68a2d1 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWithTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWithTest.java @@ -8,7 +8,7 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.bool; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.string; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java index e20018fa5..70dace849 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java @@ -12,9 +12,9 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; @@ -43,8 +43,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IIntegerItem expected, @NonNull String metapath) { - IIntegerItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IIntegerItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java index 140a48e8f..35fbd51c9 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java @@ -14,10 +14,10 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; import gov.nist.secauto.metaschema.core.metapath.function.InvalidTypeFunctionException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.CollectionUtil; @@ -51,8 +51,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IStringItem expected, @NonNull String metapath) { - IStringItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IStringItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfterTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfterTest.java index 6306cbd5d..a32433da8 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfterTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfterTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; @@ -40,8 +40,8 @@ private static Stream provideValues() { // NOPMD - false positive void testExpression(@NonNull IStringItem expected, @NonNull String metapath) { assertEquals( expected, - MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext())); + IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBeforeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBeforeTest.java index af439ed7b..8a9e6dc8e 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBeforeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBeforeTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; @@ -40,8 +40,8 @@ private static Stream provideValues() { // NOPMD - false positive void testExpression(@NonNull IStringItem expected, @NonNull String metapath) { assertEquals( expected, - MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext())); + IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringTest.java index 62f43d14a..37d14cf44 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; @@ -65,8 +65,8 @@ private static Stream provideValues() { // NOPMD - false positive void testExpression(@NonNull IStringItem expected, @NonNull String metapath) { assertEquals( expected, - MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext())); + IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSumTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSumTest.java index de9780af9..2e7c317c3 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSumTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSumTest.java @@ -12,9 +12,9 @@ import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertInstanceOf; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTailTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTailTest.java index 127389567..0aab9bf5f 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTailTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTailTest.java @@ -10,8 +10,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -42,7 +42,6 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void test(@NonNull ISequence expected, @NonNull String metapath) { - assertEquals(expected, MetapathExpression.compile(metapath).evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, - newDynamicContext())); + assertEquals(expected, IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java index b0ceaf432..a44f7c390 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java @@ -11,10 +11,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegularExpressionMetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.junit.jupiter.api.Test; @@ -55,9 +55,7 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void test(@NonNull ISequence expected, @NonNull String metapath) { - assertEquals(expected, MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, - newDynamicContext())); + assertEquals(expected, IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } @Test diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrueTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrueTest.java index f02a95f35..166650702 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrueTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrueTest.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCaseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCaseTest.java index 3cd7799f4..ae95acfb8 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCaseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCaseTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; @@ -32,8 +32,8 @@ private static Stream provideValues() { // NOPMD - false positive @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull IStringItem expected, @NonNull String metapath) { - IStringItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IStringItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FunctionTestBase.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FunctionTestBase.java index 2e45715ab..7ad52e43b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FunctionTestBase.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FunctionTestBase.java @@ -10,10 +10,10 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import java.util.List; @@ -101,7 +101,7 @@ public static ISequence executeFunction( @NonNull List> arguments) { DynamicContext context = dynamicContext == null ? new DynamicContext() : dynamicContext; - ISequence focusSeqence = function.isFocusDepenent() + ISequence focusSeqence = function.isFocusDependent() ? focus == null ? ISequence.empty() : focus : ISequence.empty(); return (ISequence) function.execute( diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContainsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContainsTest.java index 18c8527bf..2217b5346 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContainsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContainsTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; @@ -46,8 +46,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntryTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntryTest.java index 8195960f1..5bea47794 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntryTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntryTest.java @@ -11,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; @@ -37,8 +37,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IMapItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFindTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFindTest.java index c072e0425..2ac1c9424 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFindTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFindTest.java @@ -13,7 +13,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; @@ -52,8 +52,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGetTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGetTest.java index 3dcba8a5e..0df719b7d 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGetTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGetTest.java @@ -10,8 +10,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; import org.junit.jupiter.params.ParameterizedTest; @@ -33,17 +33,14 @@ private static Stream provideValues() { // NOPMD - false positive Arguments.of( sequence(), "let $week := " + LookupTest.WEEKDAYS_GERMAN + " return map:get($week, 9)"), - Arguments.of( - sequence(), - "map:get(map:entry(7,()), 7)")); + Arguments.of(sequence(), "map:get(map:entry(7,()), 7)")); } @ParameterizedTest @MethodSource("provideValues") void testExpression(@NonNull ISequence expected, @NonNull String metapath) { - - ISequence result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, newDynamicContext()); - assertEquals(expected, result); + assertEquals( + expected, + IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeysTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeysTest.java index 4812930fb..684fa8a05 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeysTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeysTest.java @@ -9,8 +9,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import org.junit.jupiter.api.Test; @@ -23,8 +23,8 @@ class MapKeysTest @Test void test() { - ISequence result = MetapathExpression.compile("map:keys(map{1:\"yes\", 2:\"no\"})") - .evaluateAs(null, MetapathExpression.ResultType.SEQUENCE); + ISequence result = IMetapathExpression.compile("map:keys(map{1:\"yes\", 2:\"no\"})") + .evaluate(null); assert result != null; // use a set to allow any ordering of the keys, since we have no control over diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMergeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMergeTest.java index e5b28f061..7cdd66849 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMergeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMergeTest.java @@ -13,7 +13,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; @@ -85,8 +85,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPutTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPutTest.java index ec96bae18..bbd3b4cf7 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPutTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPutTest.java @@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; @@ -57,8 +57,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IMapItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemoveTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemoveTest.java index 90c4ec1b9..a003bd274 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemoveTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemoveTest.java @@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; @@ -73,8 +73,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IMapItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSizeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSizeTest.java index 895c15c0d..8ab6d858b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSizeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSizeTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; @@ -37,8 +37,8 @@ private static Stream provideValues() { // NOPMD - false positive @MethodSource("provideValues") void testExpression(@NonNull IIntegerItem expected, @NonNull String metapath) { - IItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItemTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItemTest.java index e167745e8..d081061b4 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItemTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItemTest.java @@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -40,8 +40,8 @@ private static Stream squareConstructorValues() { // NOPMD - false po @ParameterizedTest @MethodSource("squareConstructorValues") void testSquareConstructor(@NonNull IArrayItem expected, @NonNull String metapath) { - IArrayItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IArrayItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } @@ -59,8 +59,8 @@ private static Stream curlyConstructorValues() { // NOPMD - false pos @ParameterizedTest @MethodSource("curlyConstructorValues") void testCurlyConstructor(@NonNull IArrayItem expected, @NonNull String metapath) { - IArrayItem result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.ITEM, newDynamicContext()); + IArrayItem result = IMetapathExpression.compile(metapath) + .evaluateAs(null, IMetapathExpression.ResultType.ITEM, newDynamicContext()); assertEquals(expected, result); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java index 36478ce55..95e86b3e4 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java @@ -16,8 +16,8 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -108,9 +108,7 @@ private static Stream functionCallLookupValues() { // NOPMD - false p @ParameterizedTest @MethodSource("functionCallLookupValues") void testFunctionCallLookup(@NonNull ISequence expected, @NonNull String metapath) { - ISequence result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, newDynamicContext()); - assertEquals(expected, result); + assertEquals(expected, IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } private static Stream postfixLookupValues() { // NOPMD - false positive @@ -142,9 +140,7 @@ private static Stream postfixLookupValues() { // NOPMD - false positi @ParameterizedTest @MethodSource("postfixLookupValues") void testPostfixLookup(@NonNull ISequence expected, @NonNull String metapath) { - ISequence result = MetapathExpression.compile(metapath) - .evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, newDynamicContext()); - assertEquals(expected, result); + assertEquals(expected, IMetapathExpression.compile(metapath).evaluate(null, newDynamicContext())); } @Test @@ -152,8 +148,8 @@ void testUnaryLookupMissingMember() { ArrayException thrown = assertThrows( ArrayException.class, () -> { - ISequence result = MetapathExpression.compile("([1,2,3], [1,2,5], [1,2])[?3 = 5]") - .evaluateAs(null, MetapathExpression.ResultType.SEQUENCE, newDynamicContext()); + ISequence result = IMetapathExpression.compile("([1,2,3], [1,2,5], [1,2])[?3 = 5]") + .evaluate(null, newDynamicContext()); assertNotNull(result); result.safeStream(); }); diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/MetaConstraintLoaderTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/MetaConstraintLoaderTest.java index 59e21bb64..1841dbf7a 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/MetaConstraintLoaderTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/MetaConstraintLoaderTest.java @@ -8,7 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.function.library.FnPath; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; @@ -42,7 +42,7 @@ void test() throws MetaschemaException, IOException { Paths.get("metaschema/examples/computer-example.xml").toUri()); IXmlMetaschemaModule module = loader.load(moduleUri); - MetapathExpression expression = MetapathExpression.compile("//@id", module.getModuleStaticContext()); + IMetapathExpression expression = IMetapathExpression.compile("//@id", module.getModuleStaticContext()); IModuleNodeItem moduleItem = INodeItemFactory.instance().newModuleNodeItem(module); for (IItem item : expression.evaluate(moduleItem)) { IDefinitionNodeItem nodeItem = (IDefinitionNodeItem) item; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java index f1f8d2e4d..7c3efe340 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java @@ -12,7 +12,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/metapath/function/Model.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/metapath/function/Model.java index 5fb4615cf..0a4dc2ad5 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/metapath/function/Model.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/metapath/function/Model.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.databind.metapath.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IDefinition; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/InstanceModelFieldComplex.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/InstanceModelFieldComplex.java index 4b65c0ac2..112ecb4c6 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/InstanceModelFieldComplex.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/InstanceModelFieldComplex.java @@ -171,7 +171,7 @@ private InstanceModelFieldComplex( if (jsonKey != null) { flagFilter = flag -> !jsonKey.equals(flag); } - return getDefinition().getJsonProperties(flagFilter); + return definition.getJsonProperties(flagFilter); })); this.properties = ObjectUtils.notNull( Lazy.lazy(() -> CollectionUtil.unmodifiableMap(ObjectUtils.notNull( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java index c12e148eb..4ac2bc226 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java @@ -108,8 +108,7 @@ public class METASCHEMA implements IBoundObject { private final IMetaschemaData __metaschemaData; /** - * "Determines if the Metaschema module is abstract (‘yes’) or not - * (‘no’)." + * Determines if the Metaschema module is abstract ("yes") or not ("no"). */ @BoundFlag( formalName = "Is Abstract?", diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java index 4b820f5c2..872a19882 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java @@ -13,9 +13,9 @@ import static org.junit.jupiter.api.Assertions.fail; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.IConstraintLoader; import gov.nist.secauto.metaschema.core.model.MetaschemaException; @@ -204,19 +204,19 @@ void testExistsWithVariable() throws IOException, URISyntaxException, Metaschema // ISequence imports = importsMetapath.evaluate(moduleItem, dynamicContext); - MetapathExpression allImportsExpression = MetapathExpression.compile( + IMetapathExpression allImportsExpression = IMetapathExpression.compile( "recurse-depth(/METASCHEMA,'for $import in ./import return doc(resolve-uri($import/@href))/METASCHEMA')", staticContext); ISequence allImports = allImportsExpression.evaluate(moduleItem, dynamicContext); allImports.getValue(); - MetapathExpression path = MetapathExpression.compile("exists($all-imports/define-assembly/root-name)", + IMetapathExpression path = IMetapathExpression.compile("exists($all-imports/define-assembly/root-name)", staticContext); boolean result = ObjectUtils.requireNonNull(path.evaluateAs( moduleItem, - MetapathExpression.ResultType.BOOLEAN, + IMetapathExpression.ResultType.BOOLEAN, dynamicContext.subContext().bindVariableValue(IEnhancedQName.of("all-imports"), allImports))); assertTrue(result, "no root"); diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoaderTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoaderTest.java index 01254c8dd..17136bf5d 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoaderTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoaderTest.java @@ -7,8 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.MetaschemaException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -36,10 +35,10 @@ void testIssue187() throws IOException, MetaschemaException { IDocumentNodeItem docItem = loader.loadAsNodeItem(ObjectUtils.notNull( Paths.get("src/test/resources/content/issue187-instance.xml"))); - MetapathExpression metapath = MetapathExpression.compile("//a//b", docItem.getStaticContext()); - - ISequence result = metapath.evaluate(docItem); - - assertEquals(8, result.size()); + assertEquals( + 8, + IMetapathExpression.compile("//a//b", docItem.getStaticContext()) + .evaluate(docItem) + .size()); } } diff --git a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java index 5ab8be68c..78fa20ec4 100644 --- a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java +++ b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java @@ -13,11 +13,11 @@ import gov.nist.secauto.metaschema.cli.processor.command.ExtraArgument; import gov.nist.secauto.metaschema.cli.processor.command.ICommandExecutor; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.ISequence; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.item.DefaultItemWriter; import gov.nist.secauto.metaschema.core.metapath.item.IItemWriter; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.IModule; @@ -192,8 +192,8 @@ private void executeCommand( try { // Parse and compile the Metapath expression - MetapathExpression compiledMetapath = MetapathExpression.compile(expression, staticContext); - ISequence sequence = compiledMetapath.evaluate(item, new DynamicContext(staticContext)); + ISequence sequence = IMetapathExpression.compile(expression, staticContext) + .evaluate(item, new DynamicContext(staticContext)); // handle the metapath results try (Writer stringWriter = new StringWriter()) { diff --git a/pom.xml b/pom.xml index 3f82ea8e0..24dd123c5 100644 --- a/pom.xml +++ b/pom.xml @@ -630,6 +630,16 @@ false + + org.apache.maven.plugins + maven-release-plugin + + SemVerVersionPolicy + v@{project.version} + clean verify + true + + org.apache.maven.plugins maven-deploy-plugin diff --git a/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/AbstractGenerationState.java b/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/AbstractGenerationState.java index d870d224c..1dc51b273 100644 --- a/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/AbstractGenerationState.java +++ b/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/AbstractGenerationState.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.schemagen; import gov.nist.secauto.metaschema.core.configuration.IConfiguration; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.IModule; import gov.nist.secauto.metaschema.core.model.INamedInstance; @@ -93,7 +93,7 @@ protected static AllowedValueCollection getContextIndependentEnumeratedValues( closed = true; } - if (!MetapathExpression.CONTEXT_NODE.getPath().equals(constraint.getTarget())) { + if (!IMetapathExpression.contextNode().getPath().equals(constraint.getTarget())) { values = CollectionUtil.emptyList(); break; } From 71f93467d2ac0e6967947a836277adc311efec86 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Thu, 28 Nov 2024 14:05:22 -0500 Subject: [PATCH 02/11] Refactored coded exception to store the prefix. Created sub-exceptions for array handling. --- .../metapath/DynamicMetapathException.java | 19 ++-- .../core/metapath/IMetapathExpression.java | 18 +++- .../metapath/StaticMetapathException.java | 20 ++-- .../core/metapath/cst/BuildCSTVisitor.java | 2 +- .../function/ArithmeticFunctionException.java | 20 ++-- .../function/DateTimeFunctionException.java | 20 ++-- .../function/DocumentFunctionException.java | 20 ++-- .../InvalidArgumentFunctionException.java | 19 ++-- .../InvalidTypeFunctionException.java | 15 ++- .../function/JsonFunctionException.java | 19 ++-- .../function/UriFunctionException.java | 20 ++-- .../metapath/function/library/ArrayGet.java | 14 +-- .../function/library/ArrayInsertBefore.java | 11 ++- .../metapath/function/library/ArrayPut.java | 15 ++- .../function/library/ArrayRemove.java | 11 ++- .../function/library/ArraySubarray.java | 35 +++---- .../RegularExpressionMetapathException.java | 19 ++-- .../impl/AbstractMetapathExpression.java | 32 +++++++ .../core/metapath/impl/AbstractSequence.java | 1 + .../CodedMetapathException.java} | 57 ++++++++---- .../impl/ErroniousMetapathExpression.java | 29 ++++++ .../{ => impl}/MetapathExpression.java | 33 ++----- .../atomic/AbstractUntypedAtomicItem.java | 2 +- .../item/atomic/impl/AbstractStringItem.java | 2 +- .../item/atomic/impl/AbstractUriItem.java | 2 +- .../item/function/ArrayException.java | 80 ---------------- .../metapath/item/function/IArrayItem.java | 4 +- .../core/metapath/item/function/IMapItem.java | 4 +- ...ndexOutOfBoundsArrayMetapathException.java | 58 ++++++++++++ .../NegativeLengthArrayMetapathException.java | 58 ++++++++++++ .../function}/impl/AbstractArrayItem.java | 2 +- .../function}/impl/AbstractKeySpecifier.java | 12 +-- .../function}/impl/AbstractMapItem.java | 2 +- .../function}/impl/AbstractStringMapKey.java | 2 +- .../{ => item/function}/impl/ArrayItemN.java | 2 +- .../function/impl/ArrayMetapathException.java | 91 +++++++++++++++++++ .../function}/impl/ImmutableCollections.java | 2 +- .../{ => item/function}/impl/MapItemN.java | 2 +- .../metapath/type/TypeMetapathException.java | 19 ++-- .../metapath/cst/ArrowExpressionTest.java | 4 +- .../metapath/item/function/LookupTest.java | 5 +- 41 files changed, 503 insertions(+), 299 deletions(-) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMetapathExpression.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{AbstractCodedMetapathException.java => impl/CodedMetapathException.java} (58%) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => impl}/MetapathExpression.java (91%) delete mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/ArrayException.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => item/function}/impl/AbstractArrayItem.java (98%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => item/function}/impl/AbstractKeySpecifier.java (96%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => item/function}/impl/AbstractMapItem.java (98%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => item/function}/impl/AbstractStringMapKey.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => item/function}/impl/ArrayItemN.java (94%) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => item/function}/impl/ImmutableCollections.java (98%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{ => item/function}/impl/MapItemN.java (95%) diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java index 95d8512b7..1c2a85c71 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java @@ -5,12 +5,18 @@ package gov.nist.secauto.metaschema.core.metapath; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; + /** * MPDY: Exceptions related to the Metapath dynamic context and dynamic * evaluation. */ public class DynamicMetapathException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "MPDY"; /** * the serial version UID. @@ -52,7 +58,7 @@ public class DynamicMetapathException * the exception message */ public DynamicMetapathException(int code, String message) { - super(code, message); + super(PREFIX, code, message); } /** @@ -67,7 +73,7 @@ public DynamicMetapathException(int code, String message) { * the original exception cause */ public DynamicMetapathException(int code, String message, Throwable cause) { - super(code, message, cause); + super(PREFIX, code, message, cause); } /** @@ -80,11 +86,6 @@ public DynamicMetapathException(int code, String message, Throwable cause) { * the original exception cause */ public DynamicMetapathException(int code, Throwable cause) { - super(code, cause); - } - - @Override - public String getCodePrefix() { - return "MPDY"; + super(PREFIX, code, cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java index 9a2a15799..47d230b4f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.MetapathExpression.ConversionFunction; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; +import gov.nist.secauto.metaschema.core.metapath.impl.MetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; @@ -21,6 +21,9 @@ import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; +/** + * Supports compiling and executing Metapath expressions. + */ public interface IMetapathExpression { /** @@ -88,12 +91,18 @@ public T convert(@NonNull ISequence sequence) { return ObjectUtils.asNullableType(converter.convert(sequence)); } catch (ClassCastException ex) { throw new InvalidTypeMetapathException(null, - String.format("Unable to cast to expected result type '%s' using expected type '%s'.", - name(), - expectedClass().getName()), + String.format("Unable to cast type '%s' to expected result type '%s'.", + expectedClass().getName(), + name()), ex); } } + + @FunctionalInterface + interface ConversionFunction { + @Nullable + Object convert(@NonNull ISequence sequence); + } } /** @@ -287,4 +296,5 @@ default ISequence evaluate( ISequence evaluate( @Nullable IItem focus, @NonNull DynamicContext dynamicContext); + } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathException.java index da3842e2f..c621e9435 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathException.java @@ -5,13 +5,19 @@ package gov.nist.secauto.metaschema.core.metapath; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; + /** * MPST: Exceptions related to the Metapath static context and static * evaluation. */ @SuppressWarnings("PMD.DataClass") public class StaticMetapathException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "MPST"; /** * err:MPST0003: It * is a static @@ -133,7 +139,7 @@ public class StaticMetapathException * the original exception cause */ public StaticMetapathException(int code, String message, Throwable cause) { - super(code, message, cause); + super(PREFIX, code, message, cause); } /** @@ -146,7 +152,7 @@ public StaticMetapathException(int code, String message, Throwable cause) { * the exception message */ public StaticMetapathException(int code, String message) { - super(code, message); + super(PREFIX, code, message); } /** @@ -159,12 +165,6 @@ public StaticMetapathException(int code, String message) { * the original exception cause */ public StaticMetapathException(int code, Throwable cause) { - super(code, cause); + super(PREFIX, code, cause); } - - @Override - public String getCodePrefix() { - return "MPST"; - } - } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java index 7c8243227..051ad2014 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java @@ -62,9 +62,9 @@ import gov.nist.secauto.metaschema.core.metapath.cst.type.TypeTestSupport; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; -import gov.nist.secauto.metaschema.core.metapath.impl.AbstractKeySpecifier; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractKeySpecifier; import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java index 5540dbc76..24064245c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java @@ -5,13 +5,17 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; /** * Represents an error that occurred while performing mathematical operations. */ public class ArithmeticFunctionException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "FOAR"; /** * err:FOAR0001: @@ -43,7 +47,7 @@ public class ArithmeticFunctionException * the exception message */ public ArithmeticFunctionException(int code, String message) { - super(code, message); + super(PREFIX, code, message); } /** @@ -58,7 +62,7 @@ public ArithmeticFunctionException(int code, String message) { * the original exception cause */ public ArithmeticFunctionException(int code, String message, Throwable cause) { - super(code, message, cause); + super(PREFIX, code, message, cause); } /** @@ -71,12 +75,6 @@ public ArithmeticFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public ArithmeticFunctionException(int code, Throwable cause) { - super(code, cause); - } - - @Override - public String getCodePrefix() { - return "FOAR"; + super(PREFIX, code, cause); } - } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java index 0b99a50b7..f120493ef 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java @@ -5,13 +5,17 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; /** * FODT: Exceptions related to Date/Time/Duration errors. */ public class DateTimeFunctionException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "FODT"; /** * err:FODT0001: @@ -49,7 +53,7 @@ public class DateTimeFunctionException * the exception message */ public DateTimeFunctionException(int code, String message) { - super(code, message); + super(PREFIX, code, message); } /** @@ -64,7 +68,7 @@ public DateTimeFunctionException(int code, String message) { * the original exception cause */ public DateTimeFunctionException(int code, String message, Throwable cause) { - super(code, message, cause); + super(PREFIX, code, message, cause); } /** @@ -77,12 +81,6 @@ public DateTimeFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public DateTimeFunctionException(int code, Throwable cause) { - super(code, cause); - } - - @Override - public String getCodePrefix() { - return "FODT"; + super(PREFIX, code, cause); } - } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java index 1875cd071..148a20ee3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java @@ -5,14 +5,18 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; import gov.nist.secauto.metaschema.core.metapath.function.library.FnDoc; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; /** * FODC: Exceptions representing document related errors. */ public class DocumentFunctionException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "FODC"; /** * err:FODC0002: @@ -51,7 +55,7 @@ public class DocumentFunctionException * the exception message */ public DocumentFunctionException(int code, String message) { - super(code, message); + super(PREFIX, code, message); } /** @@ -66,7 +70,7 @@ public DocumentFunctionException(int code, String message) { * the original exception cause */ public DocumentFunctionException(int code, String message, Throwable cause) { - super(code, message, cause); + super(PREFIX, code, message, cause); } /** @@ -79,12 +83,6 @@ public DocumentFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public DocumentFunctionException(int code, Throwable cause) { - super(code, cause); - } - - @Override - public String getCodePrefix() { - return "FODC"; + super(PREFIX, code, cause); } - } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java index 0da7f0249..39c596fd8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java @@ -5,13 +5,17 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; /** * FORG: Exceptions related to argument types. */ public class InvalidArgumentFunctionException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "FORG"; /** * err:FOTY0012: @@ -61,7 +63,7 @@ public class InvalidTypeFunctionException * the item the exception applies to */ public InvalidTypeFunctionException(int code, @NonNull IItem item) { - super(code, generateMessage(item)); + super(PREFIX, code, generateMessage(item)); } /** @@ -76,7 +78,7 @@ public InvalidTypeFunctionException(int code, @NonNull IItem item) { * the original exception cause */ public InvalidTypeFunctionException(int code, @NonNull IItem item, Throwable cause) { - super(code, generateMessage(item), cause); + super(PREFIX, code, generateMessage(item), cause); } private static String generateMessage(@NonNull IItem item) { @@ -91,9 +93,4 @@ private static String generateMessage(@NonNull IItem item) { } return retval; } - - @Override - public String getCodePrefix() { - return "FOTY"; - } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java index 240e36098..5512eb4e0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java @@ -5,10 +5,14 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; public class JsonFunctionException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "FOJS"; /** * err:FOJS0003: @@ -39,7 +43,7 @@ public class JsonFunctionException * the exception message */ public JsonFunctionException(int code, String message) { - super(code, message); + super(PREFIX, code, message); } /** @@ -54,7 +58,7 @@ public JsonFunctionException(int code, String message) { * the original exception cause */ public JsonFunctionException(int code, String message, Throwable cause) { - super(code, message, cause); + super(PREFIX, code, message, cause); } /** @@ -67,11 +71,6 @@ public JsonFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public JsonFunctionException(int code, Throwable cause) { - super(code, cause); - } - - @Override - public String getCodePrefix() { - return "FOJS"; + super(PREFIX, code, cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java index e536ca5ab..149a8ec71 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java @@ -5,14 +5,18 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; import gov.nist.secauto.metaschema.core.metapath.function.library.FnResolveUri; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; /** * FONS: Exceptions related to function namespaces. */ public class UriFunctionException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "FONS"; /** * err:FONS0004: @@ -45,7 +49,7 @@ public class UriFunctionException * the exception message */ public UriFunctionException(int code, String message) { - super(code, message); + super(PREFIX, code, message); } /** @@ -60,7 +64,7 @@ public UriFunctionException(int code, String message) { * the original exception cause */ public UriFunctionException(int code, String message, Throwable cause) { - super(code, message, cause); + super(PREFIX, code, message, cause); } /** @@ -73,12 +77,6 @@ public UriFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public UriFunctionException(int code, Throwable cause) { - super(code, cause); - } - - @Override - public String getCodePrefix() { - return "FONS"; + super(PREFIX, code, cause); } - } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java index 291d8475c..fb6fd6cd2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java @@ -14,8 +14,8 @@ import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; @@ -78,12 +78,12 @@ private static ISequence execute(@NonNull IFunction function, * @param positionItem * the integer position of the item to retrieve * @return the retrieved item - * @throws ArrayException + * @throws IndexOutOfBoundsArrayMetapathException * if the position is not in the range of 1 to array:size */ @NonNull public static T get( - @NonNull List target, + @NonNull IArrayItem target, @NonNull IIntegerItem positionItem) { return get(target, positionItem.asInteger().intValue()); } @@ -99,18 +99,18 @@ public static T get( * @param position * the integer position of the item to retrieve * @return the retrieved item - * @throws ArrayException + * @throws IndexOutOfBoundsArrayMetapathException * if the position is not in the range of 1 to array:size */ @NonNull public static T get( - @NonNull List target, + @NonNull IArrayItem target, int position) { try { return ObjectUtils.requireNonNull(target.get(position - 1)); } catch (IndexOutOfBoundsException ex) { - throw new ArrayException( - ArrayException.INDEX_OUT_OF_BOUNDS, + throw new IndexOutOfBoundsArrayMetapathException( + target, String.format("The index %d is outside the range of values for the array size '%d'.", position, target.size()), diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java index 751938471..a008df47d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java @@ -14,8 +14,9 @@ import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.function.NegativeLengthArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; @@ -91,7 +92,9 @@ private static ISequence> execute(@No * @param member * the Metapath item to insert into the identified array * @return a new array containing the modification - * @throws ArrayException + * @throws NegativeLengthArrayMetapathException + * if the position is negative + * @throws IndexOutOfBoundsArrayMetapathException * if the position is not in the range of 1 to array:size */ @NonNull @@ -115,7 +118,9 @@ public static IArrayItem insertBefore( * @param member * the Metapath item to insert into the identified array * @return a new array containing the modification - * @throws ArrayException + * @throws NegativeLengthArrayMetapathException + * if the position is negative + * @throws IndexOutOfBoundsArrayMetapathException * if the position is not in the range of 1 to array:size */ @NonNull diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java index abf3e1d58..45903a3fe 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java @@ -14,8 +14,9 @@ import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.function.NegativeLengthArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; @@ -92,7 +93,9 @@ private static ISequence> e * @param member * the Metapath item to replace the identified array member with * @return a new array containing the modification - * @throws ArrayException + * @throws NegativeLengthArrayMetapathException + * if the position is negative + * @throws IndexOutOfBoundsArrayMetapathException * if the position is not in the range of 1 to array:size */ @NonNull @@ -116,7 +119,9 @@ public static IArrayItem put( * @param member * the Metapath item to replace the identified array member with * @return a new array containing the modification - * @throws ArrayException + * @throws NegativeLengthArrayMetapathException + * if the position is negative + * @throws IndexOutOfBoundsArrayMetapathException * if the position is not in the range of 1 to array:size */ @NonNull @@ -128,8 +133,8 @@ public static IArrayItem put( try { copy.set(position - 1, member); } catch (IndexOutOfBoundsException ex) { - throw new ArrayException( - ArrayException.INDEX_OUT_OF_BOUNDS, + throw new IndexOutOfBoundsArrayMetapathException( + array, String.format("The position %d is outside the range of values for the array of size '%d'.", position, copy.size()), diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java index c6575e86a..2816bac46 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java @@ -13,8 +13,9 @@ import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.function.NegativeLengthArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.Collection; @@ -83,7 +84,9 @@ private static ISequence> execute(@NonNull IFunc * @param positions * the integer position of the items to remove * @return a new array containing the modification - * @throws ArrayException + * @throws NegativeLengthArrayMetapathException + * if the position is negative + * @throws IndexOutOfBoundsArrayMetapathException * if the position is not in the range of 1 to array:size */ @NonNull @@ -108,7 +111,9 @@ public static IArrayItem removeItems( * @param positions * the integer position of the items to remove * @return a new array containing the modification - * @throws ArrayException + * @throws NegativeLengthArrayMetapathException + * if the position is negative + * @throws IndexOutOfBoundsArrayMetapathException * if the position is not in the range of 1 to array:size */ @NonNull diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java index 83c9453ad..ba174a1e8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java @@ -14,8 +14,9 @@ import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.function.NegativeLengthArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; @@ -120,8 +121,8 @@ private static ISequence> executeThre * @param startItem * the integer position of the item to start with (inclusive) * @return a new array item consisting of the items in the identified range - * @throws ArrayException - * if the position is not in the range of 1 to array:size + * @throws IndexOutOfBoundsArrayMetapathException + * if the start position is not in the range of 1 to array:size */ @SuppressWarnings("PMD.OnlyOneReturn") @NonNull @@ -145,9 +146,10 @@ public static IArrayItem subarray( * the integer count of items to include starting with the item at the * start position * @return a new array item consisting of the items in the identified range - * @throws ArrayException - * if the length is negative or the position is not in the range of 1 - * to array:size + * @throws NegativeLengthArrayMetapathException + * if the length is negative + * @throws IndexOutOfBoundsArrayMetapathException + * if the start position is not in the range of 1 to array:size */ @SuppressWarnings("PMD.OnlyOneReturn") @NonNull @@ -169,9 +171,8 @@ public static IArrayItem subarray( * @param start * the integer position of the item to start with (inclusive) * @return a new array item consisting of the items in the identified range - * @throws ArrayException - * if the length is negative or the position is not in the range of 1 - * to array:size + * @throws IndexOutOfBoundsArrayMetapathException + * if the start position is not in the range of 1 to array:size */ @NonNull public static IArrayItem subarray( @@ -194,9 +195,10 @@ public static IArrayItem subarray( * the integer count of items to include starting with the item at the * start position * @return a new array item consisting of the items in the identified range - * @throws ArrayException - * if the length is negative or the position is not in the range of 1 - * to array:size + * @throws NegativeLengthArrayMetapathException + * if the length is negative + * @throws IndexOutOfBoundsArrayMetapathException + * if the start position is not in the range of 1 to array:size */ @NonNull public static IArrayItem subarray( @@ -204,16 +206,17 @@ public static IArrayItem subarray( int start, int length) { if (length < 0) { - throw new ArrayException( - ArrayException.NEGATIVE_ARRAY_LENGTH, String.format("The length '%d' is negative.", length)); + throw new NegativeLengthArrayMetapathException( + array, + String.format("The length '%d' is negative.", length)); } List copy; try { copy = array.subList(start - 1, start - 1 + length); } catch (IndexOutOfBoundsException ex) { - throw new ArrayException( - ArrayException.INDEX_OUT_OF_BOUNDS, + throw new IndexOutOfBoundsArrayMetapathException( + array, String.format("The start + length (%d + %d) exceeds the array length '%d'.", start, length, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java index db981e975..2cb8b57bc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java @@ -5,10 +5,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.regex; -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; public class RegularExpressionMetapathException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "MPRX"; /** * the serial version UID. */ @@ -65,7 +69,7 @@ public class RegularExpressionMetapathException * the original exception cause */ public RegularExpressionMetapathException(int code, String message, Throwable cause) { - super(code, message, cause); + super(PREFIX, code, message, cause); } /** @@ -78,7 +82,7 @@ public RegularExpressionMetapathException(int code, String message, Throwable ca * the exception message */ public RegularExpressionMetapathException(int code, String message) { - super(code, message); + super(PREFIX, code, message); } /** @@ -91,11 +95,6 @@ public RegularExpressionMetapathException(int code, String message) { * the original exception cause */ public RegularExpressionMetapathException(int code, Throwable cause) { - super(code, cause); - } - - @Override - public String getCodePrefix() { - return "MPRX"; + super(PREFIX, code, cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMetapathExpression.java new file mode 100644 index 000000000..72baf7231 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMetapathExpression.java @@ -0,0 +1,32 @@ + +package gov.nist.secauto.metaschema.core.metapath.impl; + +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.StaticContext; + +import edu.umd.cs.findbugs.annotations.NonNull; + +public abstract class AbstractMetapathExpression implements IMetapathExpression { + + @NonNull + private final String path; + @NonNull + private final StaticContext staticContext; + + public AbstractMetapathExpression( + @NonNull String path, + @NonNull StaticContext context) { + this.path = path; + this.staticContext = context; + } + + @Override + public String getPath() { + return path; + } + + @Override + public StaticContext getStaticContext() { + return staticContext; + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java index b6e762a8a..bb56991e4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.ImmutableCollections; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.stream.Collectors; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/AbstractCodedMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/CodedMetapathException.java similarity index 58% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/AbstractCodedMetapathException.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/CodedMetapathException.java index c55f6356c..dd62508c1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/AbstractCodedMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/CodedMetapathException.java @@ -3,21 +3,29 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath; +package gov.nist.secauto.metaschema.core.metapath.impl; +import gov.nist.secauto.metaschema.core.metapath.MetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; /** * This Metapath exception base class is used for all exceptions that have a * defined error code family and value. */ -public abstract class AbstractCodedMetapathException +public class CodedMetapathException extends MetapathException { /** * the serial version UID. */ private static final long serialVersionUID = 1L; + /** + * The error prefix which identifies what kind of error it is. + */ + @NonNull + private final String prefix; /** * The error code. @@ -28,13 +36,16 @@ public abstract class AbstractCodedMetapathException * Constructs a new Metapath exception with the provided {@code code}, * {@code message}, and no cause. * + * @param prefix + * the error code prefix * @param code - * the error code value + * the error code * @param message * the exception message */ - public AbstractCodedMetapathException(int code, String message) { + public CodedMetapathException(@NonNull String prefix, int code, String message) { super(message); + this.prefix = prefix; this.code = code; } @@ -42,15 +53,18 @@ public AbstractCodedMetapathException(int code, String message) { * Constructs a new Metapath exception with the provided {@code code}, * {@code message}, and {@code cause}. * + * @param prefix + * the error code prefix * @param code - * the error code value + * the error code * @param message * the exception message * @param cause * the original exception cause */ - public AbstractCodedMetapathException(int code, String message, Throwable cause) { + protected CodedMetapathException(@NonNull String prefix, int code, String message, Throwable cause) { super(message, cause); + this.prefix = prefix; this.code = code; } @@ -58,18 +72,21 @@ public AbstractCodedMetapathException(int code, String message, Throwable cause) * Constructs a new Metapath exception with a {@code null} message and the * provided {@code cause}. * + * @param prefix + * the error code prefix * @param code - * the error code value + * the error code * @param cause * the original exception cause */ - public AbstractCodedMetapathException(int code, Throwable cause) { + public CodedMetapathException(@NonNull String prefix, int code, Throwable cause) { super(cause); + this.prefix = prefix; this.code = code; } @Override - public String getMessage() { + public final String getMessage() { String message = getMessageText(); return String.format("%s%s", getCodeAsString(), message == null ? "" : ": " + message); } @@ -80,32 +97,34 @@ public String getMessage() { * @return the message text or {@code null} */ @Nullable - public String getMessageText() { + public final String getMessageText() { return super.getMessage(); } /** - * Get the error code value. + * Get the error code prefix, which indicates what type of error it is. * - * @return the error code value + * @return the error code prefix */ - public int getCode() { - return code; + public final String getPrefix() { + return prefix; } /** - * Get the error code family. + * Get the error code value. * - * @return the error code family + * @return the error code value */ - public abstract String getCodePrefix(); + public final int getCode() { + return code; + } /** * Get a combination of the error code family and value. * * @return the full error code. */ - protected String getCodeAsString() { - return String.format("%s%04d", getCodePrefix(), getCode()); + public final String getCodeAsString() { + return String.format("%s%04d", getPrefix(), getCode()); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java new file mode 100644 index 000000000..565c0174b --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java @@ -0,0 +1,29 @@ + +package gov.nist.secauto.metaschema.core.metapath.impl; + +import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; + +import edu.umd.cs.findbugs.annotations.NonNull; + +public class ErroniousMetapathExpression + extends AbstractMetapathExpression { + @NonNull + private final MetapathException throwable; + + public ErroniousMetapathExpression( + @NonNull String path, + @NonNull StaticContext staticContext, + @NonNull MetapathException throwable) { + super(path, staticContext); + this.throwable = throwable; + } + + @Override + public ISequence evaluate(IItem focus, DynamicContext dynamicContext) { + throw throwable; + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpression.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java index 3b0004452..047c3b595 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java @@ -3,8 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath; +package gov.nist.secauto.metaschema.core.metapath.impl; +import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; import gov.nist.secauto.metaschema.core.metapath.antlr.FailingErrorListener; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10Lexer; @@ -40,7 +44,8 @@ @SuppressWarnings({ "PMD.CouplingBetweenObjects" // necessary since this class aggregates functionality }) -class MetapathExpression implements IMetapathExpression { +public class MetapathExpression + extends AbstractMetapathExpression { /** * The Metapath expression identifying the current context node. @@ -49,13 +54,8 @@ class MetapathExpression implements IMetapathExpression { public static final MetapathExpression CONTEXT_NODE = new MetapathExpression(".", ContextItem.instance(), StaticContext.instance()); private static final Logger LOGGER = LogManager.getLogger(MetapathExpression.class); - - @NonNull - private final String path; @NonNull private final IExpression expression; - @NonNull - private final StaticContext staticContext; /** * Compiles a Metapath expression string using the provided static context. @@ -152,14 +152,8 @@ protected MetapathExpression( @NonNull String path, @NonNull IExpression expr, @NonNull StaticContext staticContext) { - this.path = path; + super(path, staticContext); this.expression = expr; - this.staticContext = staticContext; - } - - @Override - public String getPath() { - return path; } /** @@ -172,11 +166,6 @@ protected IExpression getASTNode() { return expression; } - @Override - public StaticContext getStaticContext() { - return staticContext; - } - @Override public String toString() { return CSTPrinter.toString(getASTNode()); @@ -198,10 +187,4 @@ public ISequence evaluate( } } - @FunctionalInterface - interface ConversionFunction { - @Nullable - Object convert(@NonNull ISequence sequence); - } - } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractUntypedAtomicItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractUntypedAtomicItem.java index 1bf43d499..c3539fa6b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractUntypedAtomicItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractUntypedAtomicItem.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.item.atomic; -import gov.nist.secauto.metaschema.core.metapath.impl.AbstractStringMapKey; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractStringMapKey; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractStringItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractStringItem.java index 19008fe78..2c2d0e069 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractStringItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractStringItem.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.impl.AbstractStringMapKey; import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractStringMapKey; import java.util.regex.Pattern; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractUriItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractUriItem.java index eaea731f1..a7a8b415a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractUriItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractUriItem.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.impl.AbstractStringMapKey; import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractStringMapKey; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/ArrayException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/ArrayException.java deleted file mode 100644 index 6ba0d8dc6..000000000 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/ArrayException.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * SPDX-FileCopyrightText: none - * SPDX-License-Identifier: CC0-1.0 - */ - -package gov.nist.secauto.metaschema.core.metapath.item.function; - -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; - -/** - * Represents an error that occurred while performing mathematical operations. - */ -public class ArrayException - extends AbstractCodedMetapathException { - /** - * err:FOAY0001: - * This error is raised when the $length argument to array:subarray is negative. - */ - public static final int INDEX_OUT_OF_BOUNDS = 1; - /** - * err:FOAY0002: - * This error is raised whenever numeric operations result in an overflow or - * underflow. - */ - public static final int NEGATIVE_ARRAY_LENGTH = 2; - - /** - * the serial version UID. - */ - private static final long serialVersionUID = 2L; - - /** - * Constructs a new exception with the provided {@code code}, {@code message}, - * and no cause. - * - * @param code - * the error code value - * @param message - * the exception message - */ - public ArrayException(int code, String message) { - super(code, message); - } - - /** - * Constructs a new exception with the provided {@code code}, {@code message}, - * and {@code cause}. - * - * @param code - * the error code value - * @param message - * the exception message - * @param cause - * the original exception cause - */ - public ArrayException(int code, String message, Throwable cause) { - super(code, message, cause); - } - - /** - * Constructs a new exception with the provided {@code code}, no message, and - * the {@code cause}. - * - * @param code - * the error code value - * @param cause - * the original exception cause - */ - public ArrayException(int code, Throwable cause) { - super(code, cause); - } - - @Override - public String getCodePrefix() { - return "FOAY"; - } - -} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java index eb25fb900..89a2ac40b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.item.function; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.impl.AbstractArrayItem; -import gov.nist.secauto.metaschema.core.metapath.impl.ArrayItemN; import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractArrayItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.ArrayItemN; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java index 5bad883dc..91fc3dddd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.item.function; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.impl.AbstractMapItem; -import gov.nist.secauto.metaschema.core.metapath.impl.MapItemN; import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractMapItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.MapItemN; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java new file mode 100644 index 000000000..7551d69eb --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java @@ -0,0 +1,58 @@ + +package gov.nist.secauto.metaschema.core.metapath.item.function; + +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.ArrayMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; + +/** + * err:FOAY0001: + * This error is raised when an integer used to select a member of an array is + * outside the range of values for that array. + */ +public class IndexOutOfBoundsArrayMetapathException + extends ArrayMetapathException { + + /** + * Constructs a new exception with the provided {@code code}, {@code message}, + * and no cause. + * + * @param item + * the array item involved + * @param message + * the exception message + */ + public IndexOutOfBoundsArrayMetapathException(@NonNull IArrayItem item, String message) { + super(INDEX_OUT_OF_BOUNDS, item, message); + } + + /** + * Constructs a new exception with the provided {@code code}, {@code message}, + * and {@code cause}. + * + * @param item + * the array item involved + * @param message + * the exception message + * @param cause + * the original exception cause + */ + public IndexOutOfBoundsArrayMetapathException(@NonNull IArrayItem item, String message, + Throwable cause) { + super(INDEX_OUT_OF_BOUNDS, item, message, cause); + } + + /** + * Constructs a new exception with the provided {@code code}, no message, and + * the {@code cause}. + * + * @param item + * the array item involved + * @param cause + * the original exception cause + */ + public IndexOutOfBoundsArrayMetapathException(@NonNull IArrayItem item, Throwable cause) { + super(INDEX_OUT_OF_BOUNDS, item, cause); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java new file mode 100644 index 000000000..2015e90cb --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java @@ -0,0 +1,58 @@ + +package gov.nist.secauto.metaschema.core.metapath.item.function; + +import gov.nist.secauto.metaschema.core.metapath.item.function.impl.ArrayMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; + +/** + * err:FOAY0001: + * This error is raised when an integer used to select a member of an array is + * outside the range of values for that array. + */ +public class NegativeLengthArrayMetapathException + extends ArrayMetapathException { + + /** + * Constructs a new exception with the provided {@code code}, {@code message}, + * and no cause. + * + * @param item + * the array item involved + * @param message + * the exception message + */ + public NegativeLengthArrayMetapathException(@NonNull IArrayItem item, String message) { + super(NEGATIVE_ARRAY_LENGTH, item, message); + } + + /** + * Constructs a new exception with the provided {@code code}, {@code message}, + * and {@code cause}. + * + * @param item + * the array item involved + * @param message + * the exception message + * @param cause + * the original exception cause + */ + public NegativeLengthArrayMetapathException(@NonNull IArrayItem item, String message, + Throwable cause) { + super(NEGATIVE_ARRAY_LENGTH, item, message, cause); + } + + /** + * Constructs a new exception with the provided {@code code}, no message, and + * the {@code cause}. + * + * @param item + * the array item involved + * @param cause + * the original exception cause + */ + public NegativeLengthArrayMetapathException(@NonNull IArrayItem item, Throwable cause) { + super(NEGATIVE_ARRAY_LENGTH, item, cause); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractArrayItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractArrayItem.java similarity index 98% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractArrayItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractArrayItem.java index 28a4ffbcf..78e98dfbe 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractArrayItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractArrayItem.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.impl; +package gov.nist.secauto.metaschema.core.metapath.item.function.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractKeySpecifier.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractKeySpecifier.java similarity index 96% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractKeySpecifier.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractKeySpecifier.java index f29568012..cbecebdc2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractKeySpecifier.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractKeySpecifier.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.impl; +package gov.nist.secauto.metaschema.core.metapath.item.function.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; @@ -14,10 +14,10 @@ import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.ArrayException; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -174,8 +174,8 @@ protected Stream lookupInArray( try { return ObjectUtils.notNull(Stream.ofNullable(ArrayGet.get(targetItem, index))); } catch (IndexOutOfBoundsException ex) { - throw new ArrayException( - ArrayException.INDEX_OUT_OF_BOUNDS, + throw new IndexOutOfBoundsArrayMetapathException( + targetItem, String.format("The index '%d' is outside the range of values for the array size '%d'.", index + 1, targetItem.size()), @@ -243,8 +243,8 @@ protected Stream lookupInArray( try { return Stream.ofNullable(ArrayGet.get(targetItem, index)); } catch (IndexOutOfBoundsException ex) { - throw new ArrayException( - ArrayException.INDEX_OUT_OF_BOUNDS, + throw new IndexOutOfBoundsArrayMetapathException( + targetItem, String.format("The index %d is outside the range of values for the array size '%d'.", index + 1, targetItem.size()), diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMapItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractMapItem.java similarity index 98% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMapItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractMapItem.java index ce6491b33..78adfa6e7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMapItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractMapItem.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.impl; +package gov.nist.secauto.metaschema.core.metapath.item.function.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractStringMapKey.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractStringMapKey.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractStringMapKey.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractStringMapKey.java index be145cd1a..e123da357 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractStringMapKey.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractStringMapKey.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.impl; +package gov.nist.secauto.metaschema.core.metapath.item.function.impl; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ArrayItemN.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayItemN.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ArrayItemN.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayItemN.java index 4f9f05dcb..20d266813 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ArrayItemN.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayItemN.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.impl; +package gov.nist.secauto.metaschema.core.metapath.item.function.impl; import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java new file mode 100644 index 000000000..e91d73d33 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java @@ -0,0 +1,91 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.item.function.impl; + +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; + +import edu.umd.cs.findbugs.annotations.NonNull; + +/** + * Represents an error that occurred while performing mathematical operations. + */ +public class ArrayMetapathException + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "FOAY"; + /** + * err:FOAY0001: + * This error is raised when an integer used to select a member of an array is + * outside the range of values for that array. + */ + protected static final int INDEX_OUT_OF_BOUNDS = 1; + /** + * err:FOAY0001: + * This error is raised when the $length argument to array:subarray is negative. + */ + public static final int NEGATIVE_ARRAY_LENGTH = 2; + + /** + * the serial version UID. + */ + private static final long serialVersionUID = 2L; + + @NonNull + private final IArrayItem item; + + /** + * Constructs a new exception with the provided {@code code}, {@code message}, + * and no cause. + * + * @param code + * the error code value + * @param item + * the array item involved + * @param message + * the exception message + */ + public ArrayMetapathException(int code, @NonNull IArrayItem item, String message) { + super(PREFIX, code, message); + this.item = item; + } + + /** + * Constructs a new exception with the provided {@code code}, {@code message}, + * and {@code cause}. + * + * @param code + * the error code value + * @param item + * the array item involved + * @param message + * the exception message + * @param cause + * the original exception cause + */ + public ArrayMetapathException(int code, @NonNull IArrayItem item, String message, Throwable cause) { + super(PREFIX, code, message, cause); + this.item = item; + } + + /** + * Constructs a new exception with the provided {@code code}, no message, and + * the {@code cause}. + * + * @param code + * the error code value + * @param item + * the array item involved + * @param cause + * the original exception cause + */ + public ArrayMetapathException(int code, @NonNull IArrayItem item, Throwable cause) { + super(PREFIX, code, cause); + this.item = item; + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ImmutableCollections.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ImmutableCollections.java similarity index 98% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ImmutableCollections.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ImmutableCollections.java index 86ddac548..8c4b810ae 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ImmutableCollections.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ImmutableCollections.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.impl; +package gov.nist.secauto.metaschema.core.metapath.item.function.impl; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MapItemN.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/MapItemN.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MapItemN.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/MapItemN.java index babf5f81a..0b61691c7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MapItemN.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/MapItemN.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.impl; +package gov.nist.secauto.metaschema.core.metapath.item.function.impl; import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java index aed0b5b81..980923b28 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java @@ -5,13 +5,17 @@ package gov.nist.secauto.metaschema.core.metapath.type; -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; + +import edu.umd.cs.findbugs.annotations.NonNull; /** * MPTY: Exceptions related to Metapath type errors. */ public class TypeMetapathException - extends AbstractCodedMetapathException { + extends CodedMetapathException { + @NonNull + private static final String PREFIX = "MPTY"; /** * err:MPTY0004: It * is a type error @@ -57,7 +61,7 @@ public class TypeMetapathException * the original exception cause */ public TypeMetapathException(int code, String message, Throwable cause) { - super(code, message, cause); + super(PREFIX, code, message, cause); } /** @@ -70,7 +74,7 @@ public TypeMetapathException(int code, String message, Throwable cause) { * the exception message */ public TypeMetapathException(int code, String message) { - super(code, message); + super(PREFIX, code, message); } /** @@ -83,11 +87,6 @@ public TypeMetapathException(int code, String message) { * the original exception cause */ public TypeMetapathException(int code, Throwable cause) { - super(code, cause); - } - - @Override - public String getCodePrefix() { - return "MPTY"; + super(PREFIX, code, cause); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java index c7a907f29..4995f3c98 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java @@ -10,13 +10,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import gov.nist.secauto.metaschema.core.metapath.AbstractCodedMetapathException; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -79,6 +79,6 @@ void testArrowExpressionWithUndefinedVariable() { () -> IMetapathExpression.compile("() => $ex:undefined()", staticContext) .evaluate(null, dynamicContext)); assertEquals(StaticMetapathException.NOT_DEFINED, - ObjectUtils.requireNonNull((AbstractCodedMetapathException) ex.getCause()).getCode()); + ObjectUtils.requireNonNull((CodedMetapathException) ex.getCause()).getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java index 95e86b3e4..5e27fd55e 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java @@ -145,14 +145,13 @@ void testPostfixLookup(@NonNull ISequence expected, @NonNull String metapath) @Test void testUnaryLookupMissingMember() { - ArrayException thrown = assertThrows( - ArrayException.class, + IndexOutOfBoundsArrayMetapathException thrown = assertThrows( + IndexOutOfBoundsArrayMetapathException.class, () -> { ISequence result = IMetapathExpression.compile("([1,2,3], [1,2,5], [1,2])[?3 = 5]") .evaluate(null, newDynamicContext()); assertNotNull(result); result.safeStream(); }); - assertEquals(ArrayException.INDEX_OUT_OF_BOUNDS, thrown.getCode()); } } From af15652cdd7da88b1950b3ca59d29bdfb3b112b7 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Thu, 28 Nov 2024 14:26:51 -0500 Subject: [PATCH 03/11] Added absent dynamic context sub-exception. --- ...ContextAbsentDynamicMetapathException.java | 49 +++++++++++++++++++ .../core/metapath/DynamicContext.java | 8 ++- .../metapath/DynamicMetapathException.java | 2 +- .../core/metapath/cst/path/ContextItem.java | 4 +- .../function/impl/AbstractFunction.java | 4 +- .../impl/AbstractMetapathExpression.java | 4 ++ .../impl/ErroniousMetapathExpression.java | 4 ++ ...ndexOutOfBoundsArrayMetapathException.java | 12 +++-- .../NegativeLengthArrayMetapathException.java | 6 +++ .../function/impl/ArrayMetapathException.java | 9 ++++ .../core/util/CustomCollectors.java | 2 +- .../library/FnNormalizeSpaceTest.java | 5 +- .../function/library/FnStringLengthTest.java | 5 +- .../function/library/FnStringTest.java | 5 +- .../metapath/item/function/LookupTest.java | 2 +- 15 files changed, 97 insertions(+), 24 deletions(-) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ContextAbsentDynamicMetapathException.java diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ContextAbsentDynamicMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ContextAbsentDynamicMetapathException.java new file mode 100644 index 000000000..e2ec9dcc3 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ContextAbsentDynamicMetapathException.java @@ -0,0 +1,49 @@ + +package gov.nist.secauto.metaschema.core.metapath; + +/** + * err:MPDY0002: It + * is a dynamic + * error if evaluation of an expression relies on some part of the + * dynamic + * context that is + * absent. + */ +public class ContextAbsentDynamicMetapathException + extends DynamicMetapathException { + + private static final long serialVersionUID = 1L; + + /** + * Constructs a new exception with the provided {@code message} and no cause. + * + * @param message + * the exception message + */ + public ContextAbsentDynamicMetapathException(String message) { + super(DYNAMIC_CONTEXT_ABSENT, message); + } + + /** + * Constructs a new exception with the provided {@code message} and + * {@code cause}. + * + * @param message + * the exception message + * @param cause + * the original exception cause + */ + public ContextAbsentDynamicMetapathException(String message, Throwable cause) { + super(DYNAMIC_CONTEXT_ABSENT, message, cause); + } + + /** + * Constructs a new exception with the provided {@code cause} and no message. + * + * @param cause + * the original exception cause + */ + public ContextAbsentDynamicMetapathException(Throwable cause) { + super(DYNAMIC_CONTEXT_ABSENT, cause); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java index 09f918f00..ce198d679 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java @@ -160,16 +160,14 @@ public Map getAvailableDocuments() { * Get the document loader assigned to this dynamic context. * * @return the loader - * @throws DynamicMetapathException - * with an error code - * {@link DynamicMetapathException#DYNAMIC_CONTEXT_ABSENT} if a - * document loader is not configured for this dynamic context + * @throws ContextAbsentDynamicMetapathException + * if a document loader is not configured for this dynamic context */ @NonNull public IDocumentLoader getDocumentLoader() { IDocumentLoader retval = sharedState.documentLoader; if (retval == null) { - throw new DynamicMetapathException(DynamicMetapathException.DYNAMIC_CONTEXT_ABSENT, + throw new ContextAbsentDynamicMetapathException( "No document loader configured for the dynamic context."); } return retval; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java index 1c2a85c71..271eb931c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java @@ -31,7 +31,7 @@ public class DynamicMetapathException * context that is * absent. */ - public static final int DYNAMIC_CONTEXT_ABSENT = 2; + protected static final int DYNAMIC_CONTEXT_ABSENT = 2; /** * err:MPDY0050: It diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java index d28205946..5c3bdf74c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; +import gov.nist.secauto.metaschema.core.metapath.ContextAbsentDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; @@ -67,7 +67,7 @@ public RESULT accept(IExpressionVisitor visit @Override public ISequence accept(DynamicContext dynamicContext, ISequence focus) { if (focus.isEmpty()) { - throw new DynamicMetapathException(DynamicMetapathException.DYNAMIC_CONTEXT_ABSENT, "The context is empty"); + throw new ContextAbsentDynamicMetapathException("The context item is empty"); } return focus; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java index ba0a1fc70..f6979c09d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.function.impl; +import gov.nist.secauto.metaschema.core.metapath.ContextAbsentDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.function.CalledContext; @@ -197,7 +197,7 @@ protected static ISequence convertSequence( private IItem getContextItem(@NonNull ISequence focus) { IItem contextItem = focus.getFirstItem(true); if (isFocusDependent() && contextItem == null) { - throw new DynamicMetapathException(DynamicMetapathException.DYNAMIC_CONTEXT_ABSENT, "The context is empty"); + throw new ContextAbsentDynamicMetapathException("The context item is empty"); } return contextItem; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMetapathExpression.java index 72baf7231..1d9f6c22c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractMetapathExpression.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ package gov.nist.secauto.metaschema.core.metapath.impl; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java index 565c0174b..21a204ba3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ package gov.nist.secauto.metaschema.core.metapath.impl; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java index 7551d69eb..45a4ab664 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ package gov.nist.secauto.metaschema.core.metapath.item.function; @@ -14,8 +18,10 @@ public class IndexOutOfBoundsArrayMetapathException extends ArrayMetapathException { + private static final long serialVersionUID = 1L; + /** - * Constructs a new exception with the provided {@code code}, {@code message}, + * Constructs a new exception with the provided {@code item}, {@code message}, * and no cause. * * @param item @@ -28,7 +34,7 @@ public IndexOutOfBoundsArrayMetapathException(@NonNull IArrayItem item, Strin } /** - * Constructs a new exception with the provided {@code code}, {@code message}, + * Constructs a new exception with the provided {@code item}, {@code message}, * and {@code cause}. * * @param item @@ -44,7 +50,7 @@ public IndexOutOfBoundsArrayMetapathException(@NonNull IArrayItem item, Strin } /** - * Constructs a new exception with the provided {@code code}, no message, and + * Constructs a new exception with the provided {@code item}, no message, and * the {@code cause}. * * @param item diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java index 2015e90cb..3639a47c8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ package gov.nist.secauto.metaschema.core.metapath.item.function; @@ -14,6 +18,8 @@ public class NegativeLengthArrayMetapathException extends ArrayMetapathException { + private static final long serialVersionUID = 1L; + /** * Constructs a new exception with the provided {@code code}, {@code message}, * and no cause. diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java index e91d73d33..3fee861ad 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java @@ -88,4 +88,13 @@ public ArrayMetapathException(int code, @NonNull IArrayItem item, Throwable c super(PREFIX, code, cause); this.item = item; } + + /** + * Get the array item involved in the exception. + * + * @return the array item + */ + public IArrayItem getArrayItem() { + return item; + } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java b/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java index b3cbcc4e6..b8f56f7ad 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java @@ -271,7 +271,7 @@ public static BinaryOperator useLastMapper() { @Override public Supplier> supplier() { - return ObjectUtils.notNull(ArrayList::new); + return ArrayList::new; } @Override diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java index 25dbe5214..0c37899d1 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; +import gov.nist.secauto.metaschema.core.metapath.ContextAbsentDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; @@ -46,7 +46,7 @@ void testExpression(@NonNull IStringItem expected, @NonNull String metapath) { @Test void testNoFocus() { - DynamicMetapathException throwable = assertThrows(DynamicMetapathException.class, + assertThrows(ContextAbsentDynamicMetapathException.class, () -> { try { FunctionTestBase.executeFunction( @@ -58,6 +58,5 @@ void testNoFocus() { throw ex.getCause(); } }); - assertEquals(DynamicMetapathException.DYNAMIC_CONTEXT_ABSENT, throwable.getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java index 70dace849..f73f028db 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; +import gov.nist.secauto.metaschema.core.metapath.ContextAbsentDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; @@ -61,7 +61,7 @@ void testFocusStringTest() { @Test void testNoFocus() { - DynamicMetapathException throwable = assertThrows(DynamicMetapathException.class, + assertThrows(ContextAbsentDynamicMetapathException.class, () -> { try { FunctionTestBase.executeFunction( @@ -73,6 +73,5 @@ void testNoFocus() { throw ex.getCause(); } }); - assertEquals(DynamicMetapathException.DYNAMIC_CONTEXT_ABSENT, throwable.getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java index 35fbd51c9..164b00f85 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java @@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; +import gov.nist.secauto.metaschema.core.metapath.ContextAbsentDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; @@ -58,7 +58,7 @@ void testExpression(@NonNull IStringItem expected, @NonNull String metapath) { @Test void testNoFocus() { - DynamicMetapathException throwable = assertThrows(DynamicMetapathException.class, + assertThrows(ContextAbsentDynamicMetapathException.class, () -> { try { FunctionTestBase.executeFunction( @@ -70,7 +70,6 @@ void testNoFocus() { throw ex.getCause(); } }); - assertEquals(DynamicMetapathException.DYNAMIC_CONTEXT_ABSENT, throwable.getCode()); } @Test diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java index 5e27fd55e..a78f40351 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java @@ -145,7 +145,7 @@ void testPostfixLookup(@NonNull ISequence expected, @NonNull String metapath) @Test void testUnaryLookupMissingMember() { - IndexOutOfBoundsArrayMetapathException thrown = assertThrows( + assertThrows( IndexOutOfBoundsArrayMetapathException.class, () -> { ISequence result = IMetapathExpression.compile("([1,2,3], [1,2,5], [1,2])[?3 = 5]") From fd559d8b34f614a8c5751b2c6e8e2d36970610b4 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Fri, 29 Nov 2024 00:07:34 -0500 Subject: [PATCH 04/11] Added sub-exceptions for the DynamicMetapathException. Fixed a bug where root paths were not raising the correct MPDY0050 error when a node was used in the context that did not have a document node ancestor. --- ...ContextAbsentDynamicMetapathException.java | 4 ++ .../metapath/DynamicMetapathException.java | 2 +- ...alidTreatTypeDynamicMetapathException.java | 41 +++++++++++++++ .../cst/path/AbstractPathExpression.java | 2 +- .../core/metapath/cst/path/Axis.java | 2 +- .../core/metapath/cst/path/Flag.java | 2 +- .../core/metapath/cst/path/ModelInstance.java | 2 +- .../core/metapath/cst/path/NameTest.java | 2 +- .../cst/path/RootDoubleSlashPath.java | 9 ++-- .../metapath/cst/path/RootSlashOnlyPath.java | 13 ++--- .../core/metapath/cst/path/RootSlashPath.java | 15 +----- .../core/metapath/cst/path/Wildcard.java | 2 +- .../core/metapath/cst/type/Treat.java | 5 +- .../core/metapath/item/ItemUtils.java | 51 ++++++++++++++++--- .../metapath/cst/BuildCstVisitorTest.java | 2 +- .../metapath/cst/path/RootSlashOnlyTest.java | 35 ++++++++++--- .../core/metapath/cst/path/StepTest.java | 2 +- .../metapath/cst/type/InstanceOfTest.java | 2 +- .../DefaultConstraintValidatorTest.java | 2 +- .../node/MockNodeItemFactory.java | 10 +++- 20 files changed, 150 insertions(+), 55 deletions(-) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTreatTypeDynamicMetapathException.java rename core/src/test/java/gov/nist/secauto/metaschema/core/{metapath/item => testing}/node/MockNodeItemFactory.java (92%) diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ContextAbsentDynamicMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ContextAbsentDynamicMetapathException.java index e2ec9dcc3..c11f445d0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ContextAbsentDynamicMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ContextAbsentDynamicMetapathException.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ package gov.nist.secauto.metaschema.core.metapath; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java index 271eb931c..1f35d449d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java @@ -46,7 +46,7 @@ public class DynamicMetapathException * "/" or "//" in a path expression is an abbreviation for an initial step that * includes the clause treat as document-node(). */ - public static final int TREAT_DOES_NOT_MATCH_TYPE = 50; + protected static final int TREAT_DOES_NOT_MATCH_TYPE = 50; /** * Constructs a new exception with the provided {@code code}, {@code message}, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTreatTypeDynamicMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTreatTypeDynamicMetapathException.java new file mode 100644 index 000000000..c3831c0d2 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTreatTypeDynamicMetapathException.java @@ -0,0 +1,41 @@ + +package gov.nist.secauto.metaschema.core.metapath; + +public class InvalidTreatTypeDynamicMetapathException + extends DynamicMetapathException { + + private static final long serialVersionUID = 1L; + + /** + * Constructs a new exception with the provided {@code message} and no cause. + * + * @param message + * the exception message + */ + public InvalidTreatTypeDynamicMetapathException(String message) { + super(TREAT_DOES_NOT_MATCH_TYPE, message); + } + + /** + * Constructs a new exception with the provided {@code message} and + * {@code cause}. + * + * @param message + * the exception message + * @param cause + * the original exception cause + */ + public InvalidTreatTypeDynamicMetapathException(String message, Throwable cause) { + super(TREAT_DOES_NOT_MATCH_TYPE, message, cause); + } + + /** + * Constructs a new exception with the provided {@code cause} and no message. + * + * @param cause + * the original exception cause + */ + public InvalidTreatTypeDynamicMetapathException(Throwable cause) { + super(TREAT_DOES_NOT_MATCH_TYPE, cause); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java index 7403c311a..591b245d3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java @@ -56,7 +56,7 @@ protected Stream searchExpression( = (Stream) expression.accept(dynamicContext, outerFocus).stream(); Stream childMatches = outerFocus.stream() - .map(ItemUtils::checkItemIsNodeItemForStep) + .map(ItemUtils::checkItemIsNodeItem) .flatMap(focusedNode -> { Stream matches; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java index 024e270d8..b3b192adf 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java @@ -89,7 +89,7 @@ public ISequence accept( retval = ISequence.empty(); } else { retval = ISequence.of(ObjectUtils.notNull(outerFocus.stream() - .map(ItemUtils::checkItemIsNodeItemForStep) + .map(ItemUtils::checkItemIsNodeItem) .flatMap(item -> { assert item != null; return execute(item); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java index b78a167b5..b17c6b906 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java @@ -48,7 +48,7 @@ public ISequence accept( DynamicContext dynamicContext, ISequence focus) { return ISequence.of(ObjectUtils.notNull(focus.stream() - .map(ItemUtils::checkItemIsNodeItemForStep) + .map(ItemUtils::checkItemIsNodeItem) .flatMap(item -> { assert item != null; return match(item); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java index 3f87895ea..e25b75aa2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java @@ -50,7 +50,7 @@ public RESULT accept(IExpressionVisitor visit DynamicContext dynamicContext, ISequence focus) { return ISequence.of(ObjectUtils.notNull(focus.stream() - .map(ItemUtils::checkItemIsNodeItemForStep) + .map(ItemUtils::checkItemIsNodeItem) .flatMap(item -> { assert item != null; return match(dynamicContext, item); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java index b787ee242..7cce923fd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java @@ -58,7 +58,7 @@ public ISequence accept( DynamicContext dynamicContext, ISequence focus) { return ISequence.of(ObjectUtils.notNull(focus.stream() - .map(ItemUtils::checkItemIsNodeItemForStep) + .map(ItemUtils::checkItemIsNodeItem) .filter(this::match))); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java index 383fc62a3..764c21eeb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java @@ -9,6 +9,7 @@ import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import edu.umd.cs.findbugs.annotations.NonNull; @@ -32,8 +33,10 @@ public RESULT accept(IExpressionVisitor visit } @Override - public ISequence accept( - DynamicContext dynamicContext, ISequence context) { - return ISequence.of(search(getExpression(), dynamicContext, context)); + public ISequence accept(DynamicContext dynamicContext, ISequence focus) { + return ISequence.of(search( + getExpression(), + dynamicContext, + ItemUtils.getDocumentNodeItems(focus))); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java index 51a880769..2bf61bda7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java @@ -10,10 +10,9 @@ import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; +import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; -import gov.nist.secauto.metaschema.core.util.CustomCollectors; -import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; @@ -36,13 +35,7 @@ public RESULT accept(IExpressionVisitor visit } @Override - public ISequence accept( - DynamicContext dynamicContext, - ISequence focus) { - - return ObjectUtils.notNull(focus.stream() - .map(ItemUtils::checkItemIsNodeItemForStep) - .map(item -> Axis.ANCESTOR_OR_SELF.execute(ObjectUtils.notNull(item)).findFirst().get()) - .collect(CustomCollectors.toSequence())); + public ISequence accept(DynamicContext dynamicContext, ISequence focus) { + return ItemUtils.getDocumentNodeItems(focus); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java index 3b46b6351..06063dafe 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java @@ -10,8 +10,6 @@ import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; -import gov.nist.secauto.metaschema.core.util.CustomCollectors; -import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; @@ -35,16 +33,7 @@ public RESULT accept(IExpressionVisitor visit } @Override - public ISequence accept( - DynamicContext dynamicContext, - ISequence focus) { - - ISequence roots = ObjectUtils.notNull(focus.stream() - .map(ItemUtils::checkItemIsNodeItemForStep) - // the previous checks for a null instance - .flatMap(item -> Axis.ANCESTOR_OR_SELF.execute(ObjectUtils.notNull(item)).limit(1)) - .collect(CustomCollectors.toSequence())); - - return getExpression().accept(dynamicContext, roots); + public ISequence accept(DynamicContext dynamicContext, ISequence focus) { + return getExpression().accept(dynamicContext, ItemUtils.getDocumentNodeItems(focus)); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java index fbb0d49fd..95015ee72 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java @@ -46,7 +46,7 @@ public RESULT accept(IExpressionVisitor visit @Override public ISequence accept( DynamicContext dynamicContext, ISequence focus) { - Stream nodes = ObjectUtils.notNull(focus.stream().map(ItemUtils::checkItemIsNodeItemForStep)); + Stream nodes = ObjectUtils.notNull(focus.stream().map(ItemUtils::checkItemIsNodeItem)); return ISequence.of(match(nodes)); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java index 00c74e7b8..f17dacd89 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathException; +import gov.nist.secauto.metaschema.core.metapath.InvalidTreatTypeDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.IItem; @@ -58,8 +58,7 @@ public List getChildren() { public ISequence accept(DynamicContext dynamicContext, ISequence focus) { ISequence retval = value.accept(dynamicContext, focus); if (!type.matches(retval)) { - throw new DynamicMetapathException( - DynamicMetapathException.TREAT_DOES_NOT_MATCH_TYPE, + throw new InvalidTreatTypeDynamicMetapathException( String.format("The sequence '%s' does not match the sequence type '%s'.", retval, type.toSignature())); } return retval; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java index a19629c31..e9be55ca2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java @@ -5,8 +5,12 @@ package gov.nist.secauto.metaschema.core.metapath.item; +import gov.nist.secauto.metaschema.core.metapath.InvalidTreatTypeDynamicMetapathException; +import gov.nist.secauto.metaschema.core.metapath.cst.path.Axis; +import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; @@ -21,7 +25,7 @@ private ItemUtils() { } /** - * Checks that the item is a node item. + * Checks that the item is an {@link INodeItem}. * * @param item * the item to check @@ -29,20 +33,53 @@ private ItemUtils() { * @throws TypeMetapathException * if the item is {@code null} or not an {@link INodeItem} */ - // FIXME: make this a method on the type implementation @NonNull - public static INodeItem checkItemIsNodeItemForStep(@Nullable IItem item) { - if (item instanceof INodeItem) { - return (INodeItem) item; + public static INodeItem checkItemIsNodeItem(@Nullable IItem item) { + return checkItemIsType(item, INodeItem.class); + } + + /** + * Checks that the item is an {@link IDocumentNodeItem}. + * + * @param item + * the item to check + * @return the item cast to a {@link INodeItem} + * @throws TypeMetapathException + * if the item is {@code null} or not an {@link INodeItem} + */ + @NonNull + public static IDocumentNodeItem checkItemIsDocumentNodeItem(@Nullable IItem item) { + return checkItemIsType(item, IDocumentNodeItem.class); + } + + @NonNull + private static T checkItemIsType(@Nullable IItem item, @NonNull Class itemClass) { + if (itemClass.isInstance(item)) { + return ObjectUtils.notNull(itemClass.cast(item)); } + if (item == null) { throw new TypeMetapathException(TypeMetapathException.NOT_A_NODE_ITEM_FOR_STEP, "Item is null."); } + throw new TypeMetapathException(TypeMetapathException.NOT_A_NODE_ITEM_FOR_STEP, String.format( - "The item of type '%s' is not a INodeItem.", - item.getClass().getName())); + "The item of type '%s' is not of the type '%s'.", + item.getClass().getName(), + itemClass.getName())); + } + + @NonNull + public static ISequence getDocumentNodeItems(@NonNull ISequence items) { + return ISequence.of(ObjectUtils.notNull(items.stream() + // ensures a non-null INodeItem instance + .map(ItemUtils::checkItemIsNodeItem) + .map(item -> Axis.ANCESTOR_OR_SELF.execute(ObjectUtils.notNull(item)) + .filter(IDocumentNodeItem.class::isInstance) + .map(ItemUtils::checkItemIsDocumentNodeItem) + .findFirst().orElseThrow(() -> new InvalidTreatTypeDynamicMetapathException( + String.format("The node '%s' is not the descendant of a document node.", item.getMetapath())))))); } /** diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java index e071027e0..205a149ba 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java @@ -43,8 +43,8 @@ import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; +import gov.nist.secauto.metaschema.core.testing.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.antlr.v4.runtime.CharStreams; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java index 561d3077a..24e3cbade 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java @@ -6,39 +6,60 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.doReturn; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.InvalidTreatTypeDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; +import gov.nist.secauto.metaschema.core.testing.node.MockNodeItemFactory; +import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.api.Test; +import java.net.URI; + class RootSlashOnlyTest extends ExpressionTestBase { @Test void testRootSlashOnlyPathUsingDocument() { - IDocumentNodeItem nodeContext = newDocumentNodeMock(); - assert nodeContext != null; + IDocumentNodeItem item = new MockNodeItemFactory().document( + URI.create("https://example.com/resource"), + IEnhancedQName.of("https://example.com/ns", "root"), + CollectionUtil.emptyList(), + CollectionUtil.emptyList()); + assert item != null; RootSlashOnlyPath expr = new RootSlashOnlyPath(); DynamicContext dynamicContext = newDynamicContext(); - ISequence result = expr.accept(dynamicContext, ISequence.of(nodeContext)); - assertEquals(ISequence.of(nodeContext), result); + ISequence result = expr.accept(dynamicContext, ISequence.of(item)); + assertEquals(ISequence.of(item), result); } @Test void testRootSlashOnlyPathUsingNonDocument() { - INodeItem item = newNonDocumentNodeMock("non-document"); + INodeItem item = new MockNodeItemFactory().assembly( + IEnhancedQName.of("https://example.com/ns", "non-root"), + CollectionUtil.emptyList(), + CollectionUtil.emptyList()); + // ensure the correct position is provided + doReturn(1).when(item).getPosition(); + assert item != null; RootSlashOnlyPath expr = new RootSlashOnlyPath(); DynamicContext dynamicContext = newDynamicContext(); - ISequence result = expr.accept(dynamicContext, ISequence.of(item)); - assertEquals(ISequence.of(item), result); + assertThrows(InvalidTreatTypeDynamicMetapathException.class, () -> { + expr.accept(dynamicContext, ISequence.of(item)) + // ensure the stream is processed + .safeStream(); + }); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java index 35e47d9ab..6b144ccd0 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java @@ -14,8 +14,8 @@ import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; +import gov.nist.secauto.metaschema.core.testing.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.assertj.core.api.Assertions; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java index f9e055042..72b3d7291 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java @@ -18,8 +18,8 @@ import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUuidItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; +import gov.nist.secauto.metaschema.core.testing.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.junit.jupiter.params.ParameterizedTest; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java index 7416ffa31..ccaa81704 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java @@ -25,10 +25,10 @@ import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; +import gov.nist.secauto.metaschema.core.testing.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/MockNodeItemFactory.java b/core/src/test/java/gov/nist/secauto/metaschema/core/testing/node/MockNodeItemFactory.java similarity index 92% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/MockNodeItemFactory.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/testing/node/MockNodeItemFactory.java index aa6352f9a..114fcd3f7 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/MockNodeItemFactory.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/testing/node/MockNodeItemFactory.java @@ -1,11 +1,19 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.testing.node; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.withSettings; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.NodeItemKind; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; From c9e412bf45972768713e9c79a3cc16e28b8bd3e0 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Fri, 29 Nov 2024 22:06:48 -0500 Subject: [PATCH 05/11] Started refactoring the base of the MetapathException tree to have two branches: StaticMetapathError and DynamicMetapathError. StaticMetapathErrors should be limited to compilation, while DynamicMetapathErrors should be limited to execution. --- .../core/metapath/DynamicContext.java | 4 +- .../core/metapath/DynamicMetapathError.java | 96 +++++++++++++ .../metapath/DynamicMetapathException.java | 10 +- .../metaschema/core/metapath/IErrorCode.java | 47 +++++++ ...alidTreatTypeDynamicMetapathException.java | 4 + .../core/metapath/StaticContext.java | 106 +++++++------- ...xception.java => StaticMetapathError.java} | 67 +++++++-- .../metapath/cst/AbstractCSTVisitorBase.java | 10 +- .../core/metapath/cst/BuildCSTVisitor.java | 16 +-- .../metapath/cst/DynamicFunctionCall.java | 6 +- .../metapath/cst/FunctionCallAccessor.java | 8 +- .../core/metapath/cst/StaticFunctionCall.java | 8 +- .../core/metapath/cst/path/Axis.java | 6 +- .../metapath/cst/path/RootSlashOnlyPath.java | 4 +- .../function/ArithmeticFunctionException.java | 11 +- .../function/DateTimeFunctionException.java | 11 +- .../function/DocumentFunctionException.java | 11 +- .../metapath/function/FunctionService.java | 10 +- .../core/metapath/function/IArgument.java | 4 +- .../core/metapath/function/IFunction.java | 6 +- .../InvalidArgumentFunctionException.java | 11 +- .../InvalidTypeFunctionException.java | 9 +- .../function/JsonFunctionException.java | 11 +- .../function/UriFunctionException.java | 11 +- .../function/library/MpRecurseDepth.java | 4 +- .../RegularExpressionMetapathException.java | 11 +- .../metapath/impl/CodedMetapathException.java | 130 ------------------ .../core/metapath/impl/ErrorCodeImpl.java | 66 +++++++++ .../metapath/impl/MetapathExpression.java | 10 +- .../core/metapath/item/ItemUtils.java | 22 +-- .../function/impl/ArrayMetapathException.java | 11 +- .../metapath/type/TypeMetapathException.java | 12 +- .../type/impl/DynamicTypeSupport.java | 8 +- .../core/model/util/ModuleUtils.java | 6 +- .../core/metapath/MetapathExpressionTest.java | 4 +- .../core/metapath/StaticContextTest.java | 4 +- .../metapath/cst/ArrowExpressionTest.java | 7 +- .../core/metapath/cst/type/CastTest.java | 14 +- .../core/metapath/cst/type/CastableTest.java | 14 +- .../function/library/FnMatchesTest.java | 4 +- .../function/library/FnStringTest.java | 2 +- .../function/library/FnTokenizeTest.java | 6 +- .../model/metaschema/impl/ModelSupport.java | 4 +- .../AbstractModelDefinitionJsonSchema.java | 4 +- 44 files changed, 477 insertions(+), 353 deletions(-) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathError.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IErrorCode.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{StaticMetapathException.java => StaticMetapathError.java} (78%) delete mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/CodedMetapathException.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErrorCodeImpl.java diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java index ce198d679..3da9228da 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java @@ -270,8 +270,8 @@ public ISequence getVariableValue(@NonNull IEnhancedQName name) { if (letVariableMap.containsKey(name.getIndexPosition())) { throw new MetapathException(String.format("Variable '%s' has null contents.", name)); } - throw new StaticMetapathException( - StaticMetapathException.NOT_DEFINED, + throw new StaticMetapathError( + StaticMetapathError.NOT_DEFINED, String.format("Variable '%s' not defined in the dynamic context.", name)); } return retval; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathError.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathError.java new file mode 100644 index 000000000..bbfb3c8c3 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathError.java @@ -0,0 +1,96 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath; + +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; + +/** + * This Metapath exception base class is used for all exceptions that have a + * defined error code family and value. + */ +public class DynamicMetapathError + extends MetapathException { + + /** + * the serial version UID. + */ + private static final long serialVersionUID = 1L; + /** + * The error prefix which identifies what kind of error it is. + */ + @NonNull + private final IErrorCode errorCode; + + /** + * Constructs a new Metapath exception with the provided {@code code}, + * {@code message}, and no cause. + * + * @param errorCode + * the error code that identifies the type of error + * @param message + * the exception message + */ + public DynamicMetapathError(@NonNull IErrorCode errorCode, String message) { + super(message); + this.errorCode = errorCode; + } + + /** + * Constructs a new Metapath exception with the provided {@code code}, + * {@code message}, and {@code cause}. + * + * @param errorCode + * the error code that identifies the type of error + * @param message + * the exception message + * @param cause + * the original exception cause + */ + protected DynamicMetapathError(@NonNull IErrorCode errorCode, String message, Throwable cause) { + super(message, cause); + this.errorCode = errorCode; + } + + /** + * Constructs a new Metapath exception with a {@code null} message and the + * provided {@code cause}. + * + * @param errorCode + * the error code that identifies the type of error + * @param cause + * the original exception cause + */ + public DynamicMetapathError(@NonNull IErrorCode errorCode, Throwable cause) { + super(cause); + this.errorCode = errorCode; + } + + @Override + public final String getMessage() { + String message = getMessageText(); + return String.format("%s%s", getErrorCode().toString(), message == null ? "" : ": " + message); + } + + /** + * Get the message text without the error code prefix. + * + * @return the message text or {@code null} + */ + @Nullable + public final String getMessageText() { + return super.getMessage(); + } + + /** + * Get the error code, which indicates what type of error it is. + * + * @return the error code + */ + public final IErrorCode getErrorCode() { + return errorCode; + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java index 1f35d449d..e5cdc809d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathException.java @@ -5,8 +5,6 @@ package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; - import edu.umd.cs.findbugs.annotations.NonNull; /** @@ -14,7 +12,7 @@ * evaluation. */ public class DynamicMetapathException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "MPDY"; @@ -58,7 +56,7 @@ public class DynamicMetapathException * the exception message */ public DynamicMetapathException(int code, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -73,7 +71,7 @@ public DynamicMetapathException(int code, String message) { * the original exception cause */ public DynamicMetapathException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -86,6 +84,6 @@ public DynamicMetapathException(int code, String message, Throwable cause) { * the original exception cause */ public DynamicMetapathException(int code, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IErrorCode.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IErrorCode.java new file mode 100644 index 000000000..b19ed2068 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IErrorCode.java @@ -0,0 +1,47 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath; + +import gov.nist.secauto.metaschema.core.metapath.impl.ErrorCodeImpl; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; + +import edu.umd.cs.findbugs.annotations.NonNull; + +/** + * Provides an error code that identifies the type of message. + */ +public interface IErrorCode { + @SuppressWarnings("PMD.ShortMethodName") + @NonNull + static IErrorCode of(@NonNull String prefix, int code) { + return new ErrorCodeImpl(prefix, code); + } + + /** + * Get the error code prefix, which indicates what type of error it is. + * + * @return the error code prefix + */ + @NonNull + String getPrefix(); + + /** + * Get the error code value. + * + * @return the error code value + */ + int getCode(); + + /** + * Get a combination of the error code family and value. + * + * @return the full error code. + */ + @NonNull + default String getCodeAsString() { + return ObjectUtils.notNull(String.format("%s%04d", getPrefix(), getCode())); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTreatTypeDynamicMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTreatTypeDynamicMetapathException.java index c3831c0d2..c83ca6559 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTreatTypeDynamicMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTreatTypeDynamicMetapathException.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ package gov.nist.secauto.metaschema.core.metapath; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java index 45ab73d3f..06754ceb2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java @@ -272,9 +272,9 @@ private String getDefaultFunctionNamespace() { * @param name * the name * @return the parsed qualified name - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#PREFIX_NOT_EXPANDABLE} - * if a non-empty prefix is provided + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if + * a non-empty prefix is provided */ @NonNull public IEnhancedQName parseAtomicTypeName(@NonNull String name) { @@ -297,24 +297,24 @@ private String resolveAtomicTypePrefix(@NonNull String prefix) { * Lookup the atomic type with the provided name in the static context. *

* This method will first attempt to expand the namespace prefix for a lexical - * QName. A {@link StaticMetapathException} with the code - * {@link StaticMetapathException#PREFIX_NOT_EXPANDABLE} if the prefix is not - * know to the static context. + * QName. A {@link StaticMetapathError} with the code + * {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if the prefix is not know + * to the static context. *

* Once the qualified name has been produced, the atomic type will be retrieved * from the available atomic types. If the atomic type was not found, a - * {@link StaticMetapathException} with the code - * {@link StaticMetapathException#UNKNOWN_TYPE} will be thrown. Otherwise, the - * type information is returned for the matching atomic type. + * {@link StaticMetapathError} with the code + * {@link StaticMetapathError#UNKNOWN_TYPE} will be thrown. Otherwise, the type + * information is returned for the matching atomic type. * * @param name * the namespace qualified or lexical name of the data type. * @return the data type information - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#PREFIX_NOT_EXPANDABLE} - * if the lexical name was not able to be expanded or the code - * {@link StaticMetapathException#NO_FUNCTION_MATCH} if a matching - * type was not found + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if + * the lexical name was not able to be expanded or the code + * {@link StaticMetapathError#NO_FUNCTION_MATCH} if a matching type + * was not found */ @NonNull public IAtomicOrUnionType lookupAtomicType(@NonNull String name) { @@ -328,16 +328,16 @@ public IAtomicOrUnionType lookupAtomicType(@NonNull String name) { * @param qname * the qualified name * @return the type - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#UNKNOWN_TYPE} if the - * type was not found + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#UNKNOWN_TYPE} if the type + * was not found */ @NonNull public static IAtomicOrUnionType lookupAtomicType(@NonNull IEnhancedQName qname) { IAtomicOrUnionType retval = DataTypeService.instance().getAtomicTypeByQNameIndex(qname.getIndexPosition()); if (retval == null) { - throw new StaticMetapathException( - StaticMetapathException.UNKNOWN_TYPE, + throw new StaticMetapathError( + StaticMetapathError.UNKNOWN_TYPE, String.format("The atomic type named '%s' was not found.", qname)); } return retval; @@ -349,16 +349,16 @@ public static IAtomicOrUnionType lookupAtomicType(@NonNull IEnhancedQName qna * @param clazz * the item class associated with the atomic type * @return the type - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#UNKNOWN_TYPE} if the - * type was not found + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#UNKNOWN_TYPE} if the type + * was not found */ @NonNull public static IAtomicOrUnionType lookupAtomicType(Class clazz) { IAtomicOrUnionType retval = DataTypeService.instance().getAtomicTypeByItemClass(clazz); if (retval == null) { - throw new StaticMetapathException( - StaticMetapathException.UNKNOWN_TYPE, + throw new StaticMetapathError( + StaticMetapathError.UNKNOWN_TYPE, String.format("The atomic type for item class '%s' was not found.", clazz.getName())); } return retval; @@ -370,16 +370,16 @@ public static IAtomicOrUnionType lookupAtomicType( * @param clazz * the item class associated with the atomic type * @return the type - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#UNKNOWN_TYPE} if the - * type was not found + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#UNKNOWN_TYPE} if the type + * was not found */ @NonNull public static IItemType lookupItemType(Class clazz) { IItemType retval = DataTypeService.instance().getItemTypeByItemClass(clazz); if (retval == null) { - throw new StaticMetapathException( - StaticMetapathException.UNKNOWN_TYPE, + throw new StaticMetapathError( + StaticMetapathError.UNKNOWN_TYPE, String.format("The item type for item class '%s' was not found.", clazz.getName())); } return retval; @@ -409,14 +409,14 @@ private String resolveFunctionPrefix(@NonNull String prefix) { * * @param prefix * the lexical prefix to check - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#PREFIX_NOT_EXPANDABLE} - * if a non-empty prefix is provided + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if + * a non-empty prefix is provided */ private static void checkForUnknownPrefix(@NonNull String prefix) { if (!prefix.isEmpty()) { - throw new StaticMetapathException( - StaticMetapathException.PREFIX_NOT_EXPANDABLE, + throw new StaticMetapathError( + StaticMetapathError.PREFIX_NOT_EXPANDABLE, String.format("The namespace prefix '%s' is not expandable.", prefix)); } @@ -426,25 +426,25 @@ private static void checkForUnknownPrefix(@NonNull String prefix) { * Lookup a known Metapath function based on the function's name and arity. *

* This method will first attempt to expand the namespace prefix for a lexical - * QName. A {@link StaticMetapathException} with the code - * {@link StaticMetapathException#PREFIX_NOT_EXPANDABLE} if the prefix is not - * know to the static context. + * QName. A {@link StaticMetapathError} with the code + * {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if the prefix is not know + * to the static context. *

* Once the qualified name has been produced, the function will be retrieved * from the available functions. If the function was not found, a - * {@link StaticMetapathException} with the code - * {@link StaticMetapathException#UNKNOWN_TYPE} will be thrown. Otherwise, the - * data type information is returned for the matching data type. + * {@link StaticMetapathError} with the code + * {@link StaticMetapathError#UNKNOWN_TYPE} will be thrown. Otherwise, the data + * type information is returned for the matching data type. * * @param name * the qualified or lexical name of the function * @param arity * the number of arguments * @return the type - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#PREFIX_NOT_EXPANDABLE} - * if the lexical name was not able to be expanded or the code - * {@link StaticMetapathException#NO_FUNCTION_MATCH} if a matching + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if + * the lexical name was not able to be expanded or the code + * {@link StaticMetapathError#NO_FUNCTION_MATCH} if a matching * function was not found */ @NonNull @@ -461,9 +461,9 @@ public IFunction lookupFunction(@NonNull String name, int arity) { * @param arity * the number of arguments * @return the type - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#NO_FUNCTION_MATCH} if - * a matching function was not found + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#NO_FUNCTION_MATCH} if a + * matching function was not found */ @NonNull public static IFunction lookupFunction(@NonNull IEnhancedQName qname, int arity) { @@ -492,9 +492,9 @@ public static IFunction lookupFunction(@NonNull IEnhancedQName qname, int arity) * @param name * the name * @return the parsed qualified name - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#PREFIX_NOT_EXPANDABLE} - * if a non-empty prefix is provided + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if + * a non-empty prefix is provided */ @NonNull public IEnhancedQName parseFlagName(@NonNull String name) { @@ -803,9 +803,9 @@ public interface EQNameResolver { * @param name * the name to resolve * @return the URI string or {@code null} if the prefix is unbound - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#PREFIX_NOT_EXPANDABLE} - * if a non-empty prefix is provided + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if + * a non-empty prefix is provided */ @NonNull IEnhancedQName resolve(@NonNull String name); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java similarity index 78% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathException.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java index c621e9435..687486359 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java @@ -5,17 +5,16 @@ package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; - import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; /** * MPST: Exceptions related to the Metapath static context and static * evaluation. */ @SuppressWarnings("PMD.DataClass") -public class StaticMetapathException - extends CodedMetapathException { +public class StaticMetapathError + extends MetapathException { @NonNull private static final String PREFIX = "MPST"; /** @@ -126,6 +125,11 @@ public class StaticMetapathException * the serial version UID. */ private static final long serialVersionUID = 2L; + /** + * The error prefix which identifies what kind of error it is. + */ + @NonNull + private final IErrorCode errorCode; /** * Constructs a new exception with the provided {@code code}, {@code message}, @@ -138,8 +142,24 @@ public class StaticMetapathException * @param cause * the original exception cause */ - public StaticMetapathException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + public StaticMetapathError(int code, String message, Throwable cause) { + this(IErrorCode.of(PREFIX, code), message, cause); + } + + /** + * Constructs a new exception with the provided {@code code}, {@code message}, + * and {@code cause}. + * + * @param errorCode + * the error code + * @param message + * the exception message + * @param cause + * the original exception cause + */ + public StaticMetapathError(@NonNull IErrorCode errorCode, String message, Throwable cause) { + super(message, cause); + this.errorCode = errorCode; } /** @@ -151,8 +171,9 @@ public StaticMetapathException(int code, String message, Throwable cause) { * @param message * the exception message */ - public StaticMetapathException(int code, String message) { - super(PREFIX, code, message); + public StaticMetapathError(int code, String message) { + super(message); + this.errorCode = IErrorCode.of(PREFIX, code); } /** @@ -164,7 +185,33 @@ public StaticMetapathException(int code, String message) { * @param cause * the original exception cause */ - public StaticMetapathException(int code, Throwable cause) { - super(PREFIX, code, cause); + public StaticMetapathError(int code, Throwable cause) { + super(cause); + this.errorCode = IErrorCode.of(PREFIX, code); + } + + @Override + public final String getMessage() { + String message = getMessageText(); + return String.format("%s%s", getErrorCode().toString(), message == null ? "" : ": " + message); + } + + /** + * Get the message text without the error code prefix. + * + * @return the message text or {@code null} + */ + @Nullable + public final String getMessageText() { + return super.getMessage(); + } + + /** + * Get the error code, which indicates what type of error it is. + * + * @return the error code + */ + public final IErrorCode getErrorCode() { + return errorCode; } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractCSTVisitorBase.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractCSTVisitorBase.java index afa4387c9..fb3c544ac 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractCSTVisitorBase.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractCSTVisitorBase.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.antlr.AbstractAstVisitor; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -49,7 +49,7 @@ public abstract class AbstractCSTVisitorBase * if {@code true} require the resulting QName to have a namespace, or * {@code false} otherwise * @return the QName - * @throws StaticMetapathException + * @throws StaticMetapathError * if the expanded QName prefix is not bound or if the resulting * namespace is invalid */ @@ -86,8 +86,8 @@ static QName toQName(@NonNull Metapath10.EqnameContext eqname, @NonNull StaticCo } namespaceUri = context.lookupNamespaceForPrefix(prefix); if (namespaceUri == null && requireNamespace) { - throw new StaticMetapathException( - StaticMetapathException.PREFIX_NOT_EXPANDABLE, + throw new StaticMetapathError( + StaticMetapathError.PREFIX_NOT_EXPANDABLE, String.format("The static context does not have a namespace URI configured for prefix '%s'.", prefix)); } } @@ -97,7 +97,7 @@ static QName toQName(@NonNull Metapath10.EqnameContext eqname, @NonNull StaticCo retval = new QName(localName); } else { if ("http://www.w3.org/2000/xmlns/".equals(namespaceUri)) { - throw new StaticMetapathException(StaticMetapathException.NAMESPACE_MISUSE, + throw new StaticMetapathError(StaticMetapathError.NAMESPACE_MISUSE, "The namespace of an expanded QName cannot be: http://www.w3.org/2000/xmlns/"); } retval = new QName(namespaceUri, localName); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java index 051ad2014..667308805 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10.ParamContext; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10Lexer; @@ -1142,16 +1142,16 @@ private IAtomicOrUnionType getTypeForCast(@NonNull String name) { IAtomicOrUnionType type; try { type = getContext().lookupAtomicType(name); - } catch (StaticMetapathException ex) { - if (StaticMetapathException.UNKNOWN_TYPE == ex.getCode()) { - throw new StaticMetapathException(StaticMetapathException.CAST_UNKNOWN_TYPE, ex); + } catch (StaticMetapathError ex) { + if (StaticMetapathError.UNKNOWN_TYPE == ex.getErrorCode().getCode()) { + throw new StaticMetapathError(StaticMetapathError.CAST_UNKNOWN_TYPE, ex); } throw ex; } if (IItemType.anyAtomic().equals(type)) { - throw new StaticMetapathException( - StaticMetapathException.CAST_ANY_ATOMIC, + throw new StaticMetapathError( + StaticMetapathError.CAST_ANY_ATOMIC, String.format("Type cannot be '%s',", IItemType.anyAtomic())); } return type; @@ -1243,8 +1243,8 @@ protected IExpression handleArrowexpr(Metapath10.ArrowexprContext context) { // function expression result = visit(arrowCtx.parenthesizedexpr().expr()); } else { - throw new StaticMetapathException( - StaticMetapathException.INVALID_PATH_GRAMMAR, + throw new StaticMetapathError( + StaticMetapathError.INVALID_PATH_GRAMMAR, String.format("Unable to get function name using arrow specifier '%s'.", arrowCtx.getText())); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java index 26941f69c..3e36b81a9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; @@ -75,8 +75,8 @@ public ISequence accept(DynamicContext dynamicContext, ISequence focus) { specifier.toAtomicItem().asString(), arguments.size()); } else { - throw new StaticMetapathException( - StaticMetapathException.NO_FUNCTION_MATCH, + throw new StaticMetapathError( + StaticMetapathError.NO_FUNCTION_MATCH, "Unable to get function name. The error specifier is an empty sequence."); } return function.execute(arguments, dynamicContext, focus); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java index 02e81feb4..bcfbd4cdb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.function.library.ArrayGet; import gov.nist.secauto.metaschema.core.metapath.function.library.MapGet; import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; @@ -88,14 +88,14 @@ public ISequence accept(DynamicContext dynamicContext, ISequenc // the value to find, which will be the key for a map or the index for an array IExpression argument = getArguments().stream().findFirst() - .orElseThrow(() -> new StaticMetapathException( - StaticMetapathException.NO_FUNCTION_MATCH, + .orElseThrow(() -> new StaticMetapathError( + StaticMetapathError.NO_FUNCTION_MATCH, "No key provided for array or map lookup")); IAnyAtomicItem key = ISequence.of(argument.accept(dynamicContext, focus).atomize()) .getFirstItem(false); if (key == null) { - throw new StaticMetapathException(StaticMetapathException.NO_FUNCTION_MATCH, + throw new StaticMetapathError(StaticMetapathError.NO_FUNCTION_MATCH, "No key provided for functional call lookup"); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java index 2cd85e4ec..24348fc9a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; @@ -59,15 +59,15 @@ public StaticFunctionCall(@NonNull Supplier functionSupplier, @NonNul * * @return the function or {@code null} if no function matched the defined name * and arguments - * @throws StaticMetapathException + * @throws StaticMetapathError * if the function was not found */ @NonNull public IFunction getFunction() { IFunction function = functionSupplier.get(); if (function == null) { - throw new StaticMetapathException( - StaticMetapathException.NO_FUNCTION_MATCH, + throw new StaticMetapathError( + StaticMetapathError.NO_FUNCTION_MATCH, String.format( "No matching function found for the given name and arguments")); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java index b3b192adf..578f4e57e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; @@ -36,8 +36,8 @@ public enum Axis implements IExpression { FOLLOWING(INodeItem::following), PRECEDING(INodeItem::preceding), NAMESPACE(focus -> { - throw new StaticMetapathException( - StaticMetapathException.AXIS_NAMESPACE_UNSUPPORTED, + throw new StaticMetapathError( + StaticMetapathError.AXIS_NAMESPACE_UNSUPPORTED, "The 'namespace' axis is not supported"); }); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java index 2bf61bda7..46481257f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentBasedNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; @@ -35,7 +35,7 @@ public RESULT accept(IExpressionVisitor visit } @Override - public ISequence accept(DynamicContext dynamicContext, ISequence focus) { + public ISequence accept(DynamicContext dynamicContext, ISequence focus) { return ItemUtils.getDocumentNodeItems(focus); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java index 24064245c..b9a3590cd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java @@ -5,7 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; @@ -13,7 +14,7 @@ * Represents an error that occurred while performing mathematical operations. */ public class ArithmeticFunctionException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "FOAR"; /** @@ -47,7 +48,7 @@ public class ArithmeticFunctionException * the exception message */ public ArithmeticFunctionException(int code, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -62,7 +63,7 @@ public ArithmeticFunctionException(int code, String message) { * the original exception cause */ public ArithmeticFunctionException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -75,6 +76,6 @@ public ArithmeticFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public ArithmeticFunctionException(int code, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java index f120493ef..cfd470895 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java @@ -5,7 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; @@ -13,7 +14,7 @@ * FODT: Exceptions related to Date/Time/Duration errors. */ public class DateTimeFunctionException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "FODT"; /** @@ -53,7 +54,7 @@ public class DateTimeFunctionException * the exception message */ public DateTimeFunctionException(int code, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -68,7 +69,7 @@ public DateTimeFunctionException(int code, String message) { * the original exception cause */ public DateTimeFunctionException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -81,6 +82,6 @@ public DateTimeFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public DateTimeFunctionException(int code, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java index 148a20ee3..6f1eb3311 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java @@ -5,8 +5,9 @@ package gov.nist.secauto.metaschema.core.metapath.function; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import gov.nist.secauto.metaschema.core.metapath.function.library.FnDoc; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; @@ -14,7 +15,7 @@ * FODC: Exceptions representing document related errors. */ public class DocumentFunctionException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "FODC"; /** @@ -55,7 +56,7 @@ public class DocumentFunctionException * the exception message */ public DocumentFunctionException(int code, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -70,7 +71,7 @@ public DocumentFunctionException(int code, String message) { * the original exception cause */ public DocumentFunctionException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -83,6 +84,6 @@ public DocumentFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public DocumentFunctionException(int code, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java index 3e42a3d3d..3e32bf474 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -85,16 +85,16 @@ public Stream stream() { * the count of arguments for use in determining an argument signature * match * @return the matching function or {@code null} if no match exists - * @throws StaticMetapathException - * with the code {@link StaticMetapathException#NO_FUNCTION_MATCH} if - * a matching function was not found + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#NO_FUNCTION_MATCH} if a + * matching function was not found */ @NonNull public IFunction getFunction(@NonNull IEnhancedQName name, int arity) { IFunction retval = getLibrary().getFunction(name, arity); if (retval == null) { - throw new StaticMetapathException(StaticMetapathException.NO_FUNCTION_MATCH, + throw new StaticMetapathError(StaticMetapathError.NO_FUNCTION_MATCH, String.format("unable to find function with name '%s' having arity '%d'", name, arity)); } return retval; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java index e1f231729..fac1b9f23 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; @@ -114,7 +114,7 @@ public Builder name(@NonNull String name) { public Builder type(@NonNull IEnhancedQName name) { try { this.type = StaticContext.lookupAtomicType(name); - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { throw new IllegalArgumentException( String.format("No data type with the name '%s'.", name), ex); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java index 815a5f015..f0a39b698 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; @@ -408,7 +408,7 @@ public Builder allowUnboundedArity(boolean allow) { public Builder returnType(@NonNull String name) { try { this.returnType = getStaticContext().lookupAtomicType(name); - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { throw new IllegalArgumentException( String.format("No data type with the name '%s'.", name), ex); } @@ -426,7 +426,7 @@ public Builder returnType(@NonNull String name) { public Builder returnType(@NonNull IEnhancedQName name) { try { this.returnType = StaticContext.lookupAtomicType(name); - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { throw new IllegalArgumentException( String.format("No data type with the name '%s'.", name), ex); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java index 39c596fd8..324e4965e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java @@ -5,7 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; @@ -13,7 +14,7 @@ * FORG: Exceptions related to argument types. */ public class InvalidArgumentFunctionException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "FORG"; @@ -56,7 +57,7 @@ public class InvalidArgumentFunctionException * the original exception cause */ public InvalidArgumentFunctionException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -69,7 +70,7 @@ public InvalidArgumentFunctionException(int code, String message, Throwable caus * the exception message */ public InvalidArgumentFunctionException(int code, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -82,6 +83,6 @@ public InvalidArgumentFunctionException(int code, String message) { * the original exception cause */ public InvalidArgumentFunctionException(int code, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java index e3ab53bff..8f5ecd53e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java @@ -5,7 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; @@ -17,7 +18,7 @@ * FOTY: Exceptions related to type errors. */ public class InvalidTypeFunctionException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "FOTY"; /** @@ -63,7 +64,7 @@ public class InvalidTypeFunctionException * the item the exception applies to */ public InvalidTypeFunctionException(int code, @NonNull IItem item) { - super(PREFIX, code, generateMessage(item)); + super(IErrorCode.of(PREFIX, code), generateMessage(item)); } /** @@ -78,7 +79,7 @@ public InvalidTypeFunctionException(int code, @NonNull IItem item) { * the original exception cause */ public InvalidTypeFunctionException(int code, @NonNull IItem item, Throwable cause) { - super(PREFIX, code, generateMessage(item), cause); + super(IErrorCode.of(PREFIX, code), generateMessage(item), cause); } private static String generateMessage(@NonNull IItem item) { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java index 5512eb4e0..bd99030bb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java @@ -5,12 +5,13 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; public class JsonFunctionException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "FOJS"; /** @@ -43,7 +44,7 @@ public class JsonFunctionException * the exception message */ public JsonFunctionException(int code, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -58,7 +59,7 @@ public JsonFunctionException(int code, String message) { * the original exception cause */ public JsonFunctionException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -71,6 +72,6 @@ public JsonFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public JsonFunctionException(int code, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java index 149a8ec71..a979b2503 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java @@ -5,8 +5,9 @@ package gov.nist.secauto.metaschema.core.metapath.function; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import gov.nist.secauto.metaschema.core.metapath.function.library.FnResolveUri; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; @@ -14,7 +15,7 @@ * FONS: Exceptions related to function namespaces. */ public class UriFunctionException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "FONS"; /** @@ -49,7 +50,7 @@ public class UriFunctionException * the exception message */ public UriFunctionException(int code, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -64,7 +65,7 @@ public UriFunctionException(int code, String message) { * the original exception cause */ public UriFunctionException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -77,6 +78,6 @@ public UriFunctionException(int code, String message, Throwable cause) { * the original exception cause */ public UriFunctionException(int code, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java index 874ca1f6b..e544c8995 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java @@ -9,7 +9,7 @@ import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; @@ -115,7 +115,7 @@ private static ISequence recurseDepth( try { recursionMetapath = IMetapathExpression.compile(recursionPath.asString(), dynamicContext.getStaticContext()); } catch (MetapathException ex) { - throw new StaticMetapathException(StaticMetapathException.INVALID_PATH_GRAMMAR, ex.getMessage(), ex); + throw new StaticMetapathError(StaticMetapathError.INVALID_PATH_GRAMMAR, ex.getMessage(), ex); } return recurseDepth(initialContext, recursionMetapath, dynamicContext); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java index 2cb8b57bc..63abe5984 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java @@ -5,12 +5,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.regex; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; public class RegularExpressionMetapathException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "MPRX"; /** @@ -69,7 +70,7 @@ public class RegularExpressionMetapathException * the original exception cause */ public RegularExpressionMetapathException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -82,7 +83,7 @@ public RegularExpressionMetapathException(int code, String message, Throwable ca * the exception message */ public RegularExpressionMetapathException(int code, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -95,6 +96,6 @@ public RegularExpressionMetapathException(int code, String message) { * the original exception cause */ public RegularExpressionMetapathException(int code, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/CodedMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/CodedMetapathException.java deleted file mode 100644 index dd62508c1..000000000 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/CodedMetapathException.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * SPDX-FileCopyrightText: none - * SPDX-License-Identifier: CC0-1.0 - */ - -package gov.nist.secauto.metaschema.core.metapath.impl; - -import gov.nist.secauto.metaschema.core.metapath.MetapathException; - -import edu.umd.cs.findbugs.annotations.NonNull; -import edu.umd.cs.findbugs.annotations.Nullable; - -/** - * This Metapath exception base class is used for all exceptions that have a - * defined error code family and value. - */ -public class CodedMetapathException - extends MetapathException { - - /** - * the serial version UID. - */ - private static final long serialVersionUID = 1L; - /** - * The error prefix which identifies what kind of error it is. - */ - @NonNull - private final String prefix; - - /** - * The error code. - */ - private final int code; - - /** - * Constructs a new Metapath exception with the provided {@code code}, - * {@code message}, and no cause. - * - * @param prefix - * the error code prefix - * @param code - * the error code - * @param message - * the exception message - */ - public CodedMetapathException(@NonNull String prefix, int code, String message) { - super(message); - this.prefix = prefix; - this.code = code; - } - - /** - * Constructs a new Metapath exception with the provided {@code code}, - * {@code message}, and {@code cause}. - * - * @param prefix - * the error code prefix - * @param code - * the error code - * @param message - * the exception message - * @param cause - * the original exception cause - */ - protected CodedMetapathException(@NonNull String prefix, int code, String message, Throwable cause) { - super(message, cause); - this.prefix = prefix; - this.code = code; - } - - /** - * Constructs a new Metapath exception with a {@code null} message and the - * provided {@code cause}. - * - * @param prefix - * the error code prefix - * @param code - * the error code - * @param cause - * the original exception cause - */ - public CodedMetapathException(@NonNull String prefix, int code, Throwable cause) { - super(cause); - this.prefix = prefix; - this.code = code; - } - - @Override - public final String getMessage() { - String message = getMessageText(); - return String.format("%s%s", getCodeAsString(), message == null ? "" : ": " + message); - } - - /** - * Get the message text without the error code prefix. - * - * @return the message text or {@code null} - */ - @Nullable - public final String getMessageText() { - return super.getMessage(); - } - - /** - * Get the error code prefix, which indicates what type of error it is. - * - * @return the error code prefix - */ - public final String getPrefix() { - return prefix; - } - - /** - * Get the error code value. - * - * @return the error code value - */ - public final int getCode() { - return code; - } - - /** - * Get a combination of the error code family and value. - * - * @return the full error code. - */ - public final String getCodeAsString() { - return String.format("%s%04d", getPrefix(), getCode()); - } -} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErrorCodeImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErrorCodeImpl.java new file mode 100644 index 000000000..460cea94e --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErrorCodeImpl.java @@ -0,0 +1,66 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.impl; + +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; + +import edu.umd.cs.findbugs.annotations.NonNull; + +public class ErrorCodeImpl implements IErrorCode { + /** + * The error prefix which identifies what kind of error it is. + */ + @NonNull + private final String prefix; + + /** + * The error code. + */ + private final int code; + + /** + * Construct a new error code. + * + * @param prefix + * the error code prefix, which indicates what type of error it is + * @param code + * the error code value, which indicates the specific error + */ + public ErrorCodeImpl(@NonNull String prefix, int code) { + this.prefix = prefix; + this.code = code; + } + + /** + * Get the error code prefix, which indicates what type of error it is. + * + * @return the error code prefix + */ + @Override + public String getPrefix() { + return prefix; + } + + /** + * Get the error code value. + * + * @return the error code value + */ + @Override + public int getCode() { + return code; + } + + /** + * Get a combination of the error code family and value. + * + * @return the full error code. + */ + @Override + public final String toString() { + return getCodeAsString(); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java index 047c3b595..1889cc8e1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.antlr.FailingErrorListener; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10Lexer; @@ -82,16 +82,16 @@ public static MetapathExpression compile(@NonNull String path, @NonNull StaticCo IExpression expr = new BuildCSTVisitor(context).visit(tree); logCst(expr); retval = new MetapathExpression(path, expr, context); - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { String message = ex.getMessageText(); - throw new StaticMetapathException( - ex.getCode(), + throw new StaticMetapathError( + ex.getErrorCode(), String.format("Unable to compile path '%s'.%s", path, message == null ? "" : " " + message), ex); } catch (MetapathException | ParseCancellationException ex) { String msg = String.format("Unable to compile Metapath '%s'", path); LOGGER.atError().withThrowable(ex).log(msg); - throw new StaticMetapathException(StaticMetapathException.INVALID_PATH_GRAMMAR, msg, ex); + throw new StaticMetapathError(StaticMetapathError.INVALID_PATH_GRAMMAR, msg, ex); } } return retval; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java index e9be55ca2..de9e60155 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.metapath.InvalidTreatTypeDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.cst.path.Axis; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentBasedNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -38,20 +38,6 @@ public static INodeItem checkItemIsNodeItem(@Nullable IItem item) { return checkItemIsType(item, INodeItem.class); } - /** - * Checks that the item is an {@link IDocumentNodeItem}. - * - * @param item - * the item to check - * @return the item cast to a {@link INodeItem} - * @throws TypeMetapathException - * if the item is {@code null} or not an {@link INodeItem} - */ - @NonNull - public static IDocumentNodeItem checkItemIsDocumentNodeItem(@Nullable IItem item) { - return checkItemIsType(item, IDocumentNodeItem.class); - } - @NonNull private static T checkItemIsType(@Nullable IItem item, @NonNull Class itemClass) { if (itemClass.isInstance(item)) { @@ -71,13 +57,13 @@ private static T checkItemIsType(@Nullable IItem item, @NonNul } @NonNull - public static ISequence getDocumentNodeItems(@NonNull ISequence items) { + public static ISequence getDocumentNodeItems(@NonNull ISequence items) { return ISequence.of(ObjectUtils.notNull(items.stream() // ensures a non-null INodeItem instance .map(ItemUtils::checkItemIsNodeItem) .map(item -> Axis.ANCESTOR_OR_SELF.execute(ObjectUtils.notNull(item)) - .filter(IDocumentNodeItem.class::isInstance) - .map(ItemUtils::checkItemIsDocumentNodeItem) + .filter(IDocumentBasedNodeItem.class::isInstance) + .map(node -> (IDocumentBasedNodeItem) node) .findFirst().orElseThrow(() -> new InvalidTreatTypeDynamicMetapathException( String.format("The node '%s' is not the descendant of a document node.", item.getMetapath())))))); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java index 3fee861ad..4de690a3d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java @@ -5,7 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.item.function.impl; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import edu.umd.cs.findbugs.annotations.NonNull; @@ -14,7 +15,7 @@ * Represents an error that occurred while performing mathematical operations. */ public class ArrayMetapathException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "FOAY"; /** @@ -51,7 +52,7 @@ public class ArrayMetapathException * the exception message */ public ArrayMetapathException(int code, @NonNull IArrayItem item, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); this.item = item; } @@ -69,7 +70,7 @@ public ArrayMetapathException(int code, @NonNull IArrayItem item, String mess * the original exception cause */ public ArrayMetapathException(int code, @NonNull IArrayItem item, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); this.item = item; } @@ -85,7 +86,7 @@ public ArrayMetapathException(int code, @NonNull IArrayItem item, String mess * the original exception cause */ public ArrayMetapathException(int code, @NonNull IArrayItem item, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); this.item = item; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java index 980923b28..1203fe1da 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java @@ -5,7 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.type; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; @@ -13,7 +14,7 @@ * MPTY: Exceptions related to Metapath type errors. */ public class TypeMetapathException - extends CodedMetapathException { + extends DynamicMetapathError { @NonNull private static final String PREFIX = "MPTY"; /** @@ -31,6 +32,7 @@ public class TypeMetapathException * 2.5.5 * SequenceType Matching. */ + // FIXME: differentiate static vs dynamic errors public static final int INVALID_TYPE_ERROR = 4; /** * err:MPTY0019: It @@ -61,7 +63,7 @@ public class TypeMetapathException * the original exception cause */ public TypeMetapathException(int code, String message, Throwable cause) { - super(PREFIX, code, message, cause); + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -74,7 +76,7 @@ public TypeMetapathException(int code, String message, Throwable cause) { * the exception message */ public TypeMetapathException(int code, String message) { - super(PREFIX, code, message); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -87,6 +89,6 @@ public TypeMetapathException(int code, String message) { * the original exception cause */ public TypeMetapathException(int code, Throwable cause) { - super(PREFIX, code, cause); + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java index 0d694b072..064fef29d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticContext.EQNameResolver; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; @@ -89,7 +89,7 @@ public static boolean derivesFrom( IEnhancedQName expectedName = staticContext.parseModelName(expected); IAssemblyDefinition definition = actual.getDefinition(); return definition.getDefinitionQName().equals(expectedName); // AT is ET - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { throw new InvalidTypeMetapathException( null, String.format("The expected type '%s' is not known to the type system.", expected), @@ -105,7 +105,7 @@ private static boolean compareDefinition( try { IEnhancedQName expectedName = nameResolver.resolve(expected); retval = definition.getDefinitionQName().equals(expectedName); // AT is ET - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { // fail the definition name test retval = false; } @@ -120,7 +120,7 @@ private static boolean compareAtomicTypes( IAtomicOrUnionType expectedType; try { expectedType = staticContext.lookupAtomicType(expected); - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { throw new InvalidTypeMetapathException( null, String.format("The expected type '%s' is not known to the type system.", expected), diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/ModuleUtils.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/ModuleUtils.java index ab2973cb8..77bd6eafd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/ModuleUtils.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/ModuleUtils.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.util; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.model.IModule; import gov.nist.secauto.metaschema.core.model.ModelInitializationException; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; @@ -32,7 +32,7 @@ public static IEnhancedQName parseFlagName( @NonNull String name) { try { return module.getModuleStaticContext().parseFlagName(name); - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { throw new ModelInitializationException(ex); } } @@ -55,7 +55,7 @@ public static IEnhancedQName parseModelName( @NonNull String name) { try { return module.getModuleStaticContext().parseModelName(name); - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { throw new ModelInitializationException(ex); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java index 52c0e3b78..19cb54d02 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java @@ -77,9 +77,9 @@ void test() { @Test void testMalformedIf() throws IOException { - StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { + StaticMetapathError ex = assertThrows(StaticMetapathError.class, () -> { IMetapathExpression.compile("if 'a' = '1.1.2' then true() else false()"); }); - assertEquals(StaticMetapathException.INVALID_PATH_GRAMMAR, ex.getCode()); + assertEquals(StaticMetapathError.INVALID_PATH_GRAMMAR, ex.getErrorCode().getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/StaticContextTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/StaticContextTest.java index f2d5e69ac..b69b4aede 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/StaticContextTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/StaticContextTest.java @@ -141,11 +141,11 @@ void testVariableValues( @Test void lookupNonExistantDataType() { - StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { + StaticMetapathError ex = assertThrows(StaticMetapathError.class, () -> { StaticContext.instance().lookupAtomicType("xs:string"); }); - assertEquals(StaticMetapathException.PREFIX_NOT_EXPANDABLE, ex.getCode()); + assertEquals(StaticMetapathError.PREFIX_NOT_EXPANDABLE, ex.getErrorCode().getCode()); } @Test diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java index 4995f3c98..46cffdfb8 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java @@ -15,8 +15,7 @@ import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; -import gov.nist.secauto.metaschema.core.metapath.impl.CodedMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -78,7 +77,7 @@ void testArrowExpressionWithUndefinedVariable() { MetapathException.class, () -> IMetapathExpression.compile("() => $ex:undefined()", staticContext) .evaluate(null, dynamicContext)); - assertEquals(StaticMetapathException.NOT_DEFINED, - ObjectUtils.requireNonNull((CodedMetapathException) ex.getCause()).getCode()); + assertEquals(StaticMetapathError.NOT_DEFINED, + ObjectUtils.requireNonNull((StaticMetapathError) ex.getCause()).getErrorCode().getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java index 1f995032d..7456f0c05 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java @@ -18,7 +18,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; @@ -116,25 +116,25 @@ void testCast(@NonNull IAnyAtomicItem actual, @NonNull String singleType, @NonNu @Test void testInvalidTypePrefix() { - StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { + StaticMetapathError ex = assertThrows(StaticMetapathError.class, () -> { IMetapathExpression.compile("'a' cast as foo:bar"); }); - assertEquals(StaticMetapathException.PREFIX_NOT_EXPANDABLE, ex.getCode()); + assertEquals(StaticMetapathError.PREFIX_NOT_EXPANDABLE, ex.getErrorCode().getCode()); } @Test void testInvalidType() { - StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { + StaticMetapathError ex = assertThrows(StaticMetapathError.class, () -> { IMetapathExpression.compile("'a' cast as meta:bar"); }); - assertEquals(StaticMetapathException.CAST_UNKNOWN_TYPE, ex.getCode()); + assertEquals(StaticMetapathError.CAST_UNKNOWN_TYPE, ex.getErrorCode().getCode()); } @Test void testAnyAtomicType() { - StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { + StaticMetapathError ex = assertThrows(StaticMetapathError.class, () -> { IMetapathExpression.compile("'a' cast as meta:any-atomic-type"); }); - assertEquals(StaticMetapathException.CAST_ANY_ATOMIC, ex.getCode()); + assertEquals(StaticMetapathError.CAST_ANY_ATOMIC, ex.getErrorCode().getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java index 5a774a4c4..c0576527a 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java @@ -11,7 +11,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -48,25 +48,25 @@ void testCastable(@NonNull IAnyAtomicItem actual, @NonNull String singleType) { @Test void testInvalidTypePrefix() { - StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { + StaticMetapathError ex = assertThrows(StaticMetapathError.class, () -> { IMetapathExpression.compile("'a' castable as foo:bar"); }); - assertEquals(StaticMetapathException.PREFIX_NOT_EXPANDABLE, ex.getCode()); + assertEquals(StaticMetapathError.PREFIX_NOT_EXPANDABLE, ex.getErrorCode().getCode()); } @Test void testInvalidType() { - StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { + StaticMetapathError ex = assertThrows(StaticMetapathError.class, () -> { IMetapathExpression.compile("'a' castable as meta:bar"); }); - assertEquals(StaticMetapathException.CAST_UNKNOWN_TYPE, ex.getCode()); + assertEquals(StaticMetapathError.CAST_UNKNOWN_TYPE, ex.getErrorCode().getCode()); } @Test void testAnyAtomicType() { - StaticMetapathException ex = assertThrows(StaticMetapathException.class, () -> { + StaticMetapathError ex = assertThrows(StaticMetapathError.class, () -> { IMetapathExpression.compile("'a' castable as meta:any-atomic-type"); }); - assertEquals(StaticMetapathException.CAST_ANY_ATOMIC, ex.getCode()); + assertEquals(StaticMetapathError.CAST_ANY_ATOMIC, ex.getErrorCode().getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java index 23f5e7272..a3a2da592 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java @@ -107,7 +107,7 @@ void testInvalidPattern() { throw ex; } }); - assertEquals(RegularExpressionMetapathException.INVALID_EXPRESSION, throwable.getCode()); + assertEquals(RegularExpressionMetapathException.INVALID_EXPRESSION, throwable.getErrorCode().getCode()); } @Test @@ -131,6 +131,6 @@ void testInvalidFlag() { throw ex; } }); - assertEquals(RegularExpressionMetapathException.INVALID_FLAG, throwable.getCode()); + assertEquals(RegularExpressionMetapathException.INVALID_FLAG, throwable.getErrorCode().getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java index 164b00f85..090027510 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java @@ -106,6 +106,6 @@ void testInvalidArgumentType() { throw ex.getCause(); } }); - assertEquals(InvalidTypeFunctionException.ARGUMENT_TO_STRING_IS_FUNCTION, throwable.getCode()); + assertEquals(InvalidTypeFunctionException.ARGUMENT_TO_STRING_IS_FUNCTION, throwable.getErrorCode().getCode()); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java index a44f7c390..97d690e2c 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java @@ -76,7 +76,7 @@ void testMatchZeroLengthString() { throw ex; } }); - assertEquals(RegularExpressionMetapathException.MATCHES_ZERO_LENGTH_STRING, throwable.getCode()); + assertEquals(RegularExpressionMetapathException.MATCHES_ZERO_LENGTH_STRING, throwable.getErrorCode().getCode()); } @Test @@ -97,7 +97,7 @@ void testInvalidPattern() { throw ex; } }); - assertEquals(RegularExpressionMetapathException.INVALID_EXPRESSION, throwable.getCode()); + assertEquals(RegularExpressionMetapathException.INVALID_EXPRESSION, throwable.getErrorCode().getCode()); } @Test @@ -121,6 +121,6 @@ void testInvalidFlag() { throw ex; } }); - assertEquals(RegularExpressionMetapathException.INVALID_FLAG, throwable.getCode()); + assertEquals(RegularExpressionMetapathException.INVALID_FLAG, throwable.getErrorCode().getCode()); } } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ModelSupport.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ModelSupport.java index 181b6182f..cbcda4484 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ModelSupport.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ModelSupport.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; @@ -132,7 +132,7 @@ public static IDataTypeAdapter dataType( try { source.getStaticContext(); type = StaticContext.lookupAtomicType(qname); - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { throw new IllegalStateException("Unrecognized data type: " + qname, ex); } diff --git a/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/json/impl/AbstractModelDefinitionJsonSchema.java b/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/json/impl/AbstractModelDefinitionJsonSchema.java index 79bf3b121..fe1fae715 100644 --- a/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/json/impl/AbstractModelDefinitionJsonSchema.java +++ b/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/json/impl/AbstractModelDefinitionJsonSchema.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.schemagen.json.impl; -import gov.nist.secauto.metaschema.core.metapath.StaticMetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.IFlagInstance; import gov.nist.secauto.metaschema.core.model.IModelDefinition; @@ -58,7 +58,7 @@ protected AbstractModelDefinitionJsonSchema( try { jsonKeyFlag = definition.getFlagInstanceByName( ModuleUtils.parseFlagName(definition.getContainingModule(), jsonKeyFlagName).getIndexPosition()); - } catch (StaticMetapathException ex) { + } catch (StaticMetapathError ex) { throw new IllegalArgumentException(ex); } if (jsonKeyFlag == null) { From a9987e63a69f554f85dbcd56fb1e333650b0cb3b Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Sun, 1 Dec 2024 11:34:42 -0500 Subject: [PATCH 06/11] Cleaned up Metapath compilation in constraint implementations. Metapaths are now directly compiled at parse time. --- .../core/metapath/IMetapathExpression.java | 4 +- .../core/metapath/StaticMetapathError.java | 1 + .../RegularExpressionMetapathException.java | 1 + .../metapath/impl/MetapathExpression.java | 12 +++- .../constraint/AbstractConstraintBuilder.java | 7 ++- .../AbstractConstraintValidationHandler.java | 4 +- .../AbstractKeyConstraintBuilder.java | 10 ++++ .../ConstraintValidationFinding.java | 3 + .../DefaultConstraintValidator.java | 8 +-- .../constraint/DefaultScopedContraints.java | 4 ++ .../core/model/constraint/IConstraint.java | 9 +-- .../core/model/constraint/IConstraintSet.java | 3 + .../model/constraint/IExpectConstraint.java | 12 ++-- .../constraint/IFeatureModelConstrained.java | 4 ++ .../constraint/IFeatureValueConstrained.java | 4 ++ .../core/model/constraint/IIndex.java | 6 +- .../model/constraint/IIndexConstraint.java | 4 +- .../constraint/IIndexHasKeyConstraint.java | 2 +- .../core/model/constraint/IKeyField.java | 20 ++----- .../core/model/constraint/ILet.java | 39 ------------- .../model/constraint/ValidationFeature.java | 7 +++ .../model/constraint/ValueConstraintSet.java | 17 ++++++ ...AbstractConfigurableMessageConstraint.java | 2 +- .../constraint/impl/AbstractConstraint.java | 26 +++------ .../impl/AbstractKeyConstraint.java | 3 +- .../constraint/impl/DefaultAllowedValue.java | 3 + .../impl/DefaultAllowedValuesConstraint.java | 3 +- .../impl/DefaultCardinalityConstraint.java | 3 +- .../impl/DefaultExpectConstraint.java | 23 +++----- .../model/constraint/impl/DefaultIndex.java | 8 +++ .../impl/DefaultIndexConstraint.java | 3 +- .../impl/DefaultIndexHasKeyConstraint.java | 3 +- .../constraint/impl/DefaultKeyField.java | 26 +++------ .../impl/DefaultMatchesConstraint.java | 3 +- .../impl/DefaultUniqueConstraint.java | 3 +- .../model/xml/impl/ConstraintXmlSupport.java | 6 +- .../core/model/xml/impl/ModelFactory.java | 55 +++++++++++-------- .../DefaultConstraintValidatorTest.java | 4 +- .../codegen/impl/AnnotationGenerator.java | 26 ++++++--- .../model/annotations/AllowedValues.java | 2 +- .../databind/model/annotations/Expect.java | 2 +- .../model/impl/ConstraintFactory.java | 38 +++++++------ .../impl/ConstraintBindingSupport.java | 22 +++++--- .../databind/codegen/BasicMetaschemaTest.java | 2 + .../databind/codegen/GenerationTest.java | 2 + .../codegen/impl/AnnotationGeneratorTest.java | 3 +- .../io/MetaschemaModuleMetaschemaTest.java | 1 + .../nist/secauto/metaschema/cli/CLITest.java | 3 +- .../schemagen/AbstractGenerationState.java | 3 +- .../metaschema/schemagen/XmlSuiteTest.java | 1 + 50 files changed, 255 insertions(+), 205 deletions(-) diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java index 47d230b4f..2b78d0a64 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java @@ -112,7 +112,7 @@ interface ConversionFunction { */ @NonNull static IMetapathExpression contextNode() { - return MetapathExpression.CONTEXT_NODE; + return MetapathExpression.CONTEXT_METAPATH; } /** @@ -126,7 +126,7 @@ static IMetapathExpression contextNode() { */ @NonNull static IMetapathExpression compile(@NonNull String path) { - return MetapathExpression.compile(path, StaticContext.instance()); + return compile(path, StaticContext.instance()); } /** diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java index 687486359..867251b7b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java @@ -211,6 +211,7 @@ public final String getMessageText() { * * @return the error code */ + @NonNull public final IErrorCode getErrorCode() { return errorCode; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java index 63abe5984..85cbdd210 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/regex/RegularExpressionMetapathException.java @@ -10,6 +10,7 @@ import edu.umd.cs.findbugs.annotations.NonNull; +@SuppressWarnings("PMD.DataClass") public class RegularExpressionMetapathException extends DynamicMetapathError { @NonNull diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java index 1889cc8e1..45cf3f2be 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java @@ -51,8 +51,14 @@ public class MetapathExpression * The Metapath expression identifying the current context node. */ @NonNull - public static final MetapathExpression CONTEXT_NODE - = new MetapathExpression(".", ContextItem.instance(), StaticContext.instance()); + public static final String CONTEXT_EXPRESSION = "."; + + /** + * The Metapath expression identifying the current context node. + */ + @NonNull + public static final MetapathExpression CONTEXT_METAPATH + = new MetapathExpression(CONTEXT_EXPRESSION, ContextItem.instance(), StaticContext.instance()); private static final Logger LOGGER = LogManager.getLogger(MetapathExpression.class); @NonNull private final IExpression expression; @@ -73,7 +79,7 @@ public static MetapathExpression compile(@NonNull String path, @NonNull StaticCo @NonNull MetapathExpression retval; if (".".equals(path)) { - retval = CONTEXT_NODE; + retval = CONTEXT_METAPATH; } else { try { Metapath10 parser = newParser(path); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintBuilder.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintBuilder.java index 1ab6d3fa9..a571ebada 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintBuilder.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintBuilder.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.IConstraint.Level; @@ -42,7 +43,7 @@ public abstract class AbstractConstraintBuilder< @NonNull private Level level = IConstraint.DEFAULT_LEVEL; @NonNull - private String target = IConstraint.DEFAULT_TARGET_METAPATH; + private IMetapathExpression target = IMetapathExpression.contextNode(); @NonNull private Map> properties = new LinkedHashMap<>(); // NOPMD not thread safe private MarkupMultiline remarks; @@ -131,7 +132,7 @@ public T level(@NonNull Level level) { * @return this builder */ @NonNull - public T target(@NonNull String target) { + public T target(@NonNull IMetapathExpression target) { this.target = target; return getThis(); } @@ -283,7 +284,7 @@ protected Level getLevel() { * @return the target Metapath expression */ @NonNull - protected String getTarget() { + protected IMetapathExpression getTarget() { return target; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java index 678c22cab..f5a1f2a20 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java @@ -87,7 +87,7 @@ protected String newCardinalityMinimumViolationMessage( "The cardinality '%d' is below the required minimum '%d' for items matching '%s'.", testedItems.size(), constraint.getMinOccurs(), - constraint.getTarget())) + constraint.getTarget().getPath())) : constraint.generateMessage(target, dynamicContext); } @@ -284,7 +284,7 @@ protected String newExpectViolationMessage( @NonNull DynamicContext dynamicContext) { return constraint.getMessage() == null ? ObjectUtils.notNull(String.format("Expect constraint '%s' did not match the data at path '%s'", - constraint.getTest(), + constraint.getTest().getPath(), toPath(target))) : constraint.generateMessage(target, dynamicContext); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractKeyConstraintBuilder.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractKeyConstraintBuilder.java index ff3d35e59..79fdc961b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractKeyConstraintBuilder.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractKeyConstraintBuilder.java @@ -12,6 +12,16 @@ import edu.umd.cs.findbugs.annotations.NonNull; +/** + * Provides builder methods for the core data elements of an {@link IConstraint} + * that supports a custom message. + * + * @param + * the Java type of the implementing builder + * @param + * the Java type of the resulting built object + * @since 2.0.0 + */ public abstract class AbstractKeyConstraintBuilder< T extends AbstractKeyConstraintBuilder, R extends IKeyConstraint> diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ConstraintValidationFinding.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ConstraintValidationFinding.java index 6ec8c754c..ea3d4f981 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ConstraintValidationFinding.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ConstraintValidationFinding.java @@ -182,6 +182,9 @@ public static Builder builder(@NonNull IConstraint constraint, @NonNull INodeIte return new Builder(CollectionUtil.singletonList(constraint), node); } + /** + * Implements a builder pattern for creating constraint findings. + */ public static final class Builder { @NonNull private final List constraints; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java index df08aab3a..bdd67efe4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java @@ -392,7 +392,7 @@ private static String toErrorMessage( String id = constraint.getId(); if (id == null) { builder.append(" targeting the metapath '") - .append(constraint.getTarget()) + .append(constraint.getTarget().getPath()) .append('\''); } else { builder.append(" with id '") @@ -676,9 +676,7 @@ private void validateExpect( @NonNull INodeItem node, @NonNull ISequence targets, @NonNull DynamicContext dynamicContext) { - IMetapathExpression metapath = IMetapathExpression.compile( - constraint.getTest(), - dynamicContext.getStaticContext()); + IMetapathExpression test = constraint.getTest(); IConstraintValidationHandler handler = getConstraintValidationHandler(); targets.stream() @@ -687,7 +685,7 @@ private void validateExpect( if (item.hasValue()) { try { - ISequence result = metapath.evaluate(item, dynamicContext); + ISequence result = test.evaluate(item, dynamicContext); if (FnBoolean.fnBoolean(result).toBoolean()) { handlePass(constraint, node, item, dynamicContext); } else { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultScopedContraints.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultScopedContraints.java index b922b742a..f02a03be8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultScopedContraints.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultScopedContraints.java @@ -12,6 +12,10 @@ import edu.umd.cs.findbugs.annotations.NonNull; +/** + * Represents a collection of constraints to apply to a given module identified + * by the module's namespace and short name. + */ public class DefaultScopedContraints implements IScopedContraints { @NonNull private final URI namespace; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java index 7bf0abcbc..fb32c59e5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; @@ -65,10 +66,10 @@ enum Level { Level DEFAULT_LEVEL = Level.ERROR; /** - * The default target Metapath expression to use if no target is provided. + * The default target Metapath to use if no target is provided. */ @NonNull - String DEFAULT_TARGET_METAPATH = "."; + IMetapathExpression DEFAULT_TARGET_METAPATH = IMetapathExpression.contextNode(); /** * Get a string that identifies the provided constraint using the most specific @@ -86,7 +87,7 @@ static String getConstraintIdentity(@NonNull IConstraint constraint) { } else if (constraint.getFormalName() != null) { identity = String.format("with the formal name '%s'", constraint.getFormalName()); } else { - identity = String.format("targeting '%s'", constraint.getTarget()); + identity = String.format("targeting '%s'", constraint.getTarget().getPath()); } return ObjectUtils.notNull(identity); } @@ -122,7 +123,7 @@ static String getConstraintIdentity(@NonNull IConstraint constraint) { * @return a Metapath expression */ @NonNull - String getTarget(); + IMetapathExpression getTarget(); /** * Based on the provided {@code contextNodeItem}, find all nodes matching the diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintSet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintSet.java index 7916f4f86..8c1493c20 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintSet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintSet.java @@ -12,6 +12,9 @@ import edu.umd.cs.findbugs.annotations.NonNull; +/** + * A set of constraints targeted at the contents of a Metaschema module. + */ public interface IConstraintSet { /** * Get information about where the constraint set was sourced from. diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IExpectConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IExpectConstraint.java index d1bf60ffb..8370f0f07 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IExpectConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IExpectConstraint.java @@ -5,6 +5,8 @@ package gov.nist.secauto.metaschema.core.model.constraint; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.model.constraint.impl.DefaultExpectConstraint; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -23,7 +25,7 @@ public interface IExpectConstraint extends IConfigurableMessageConstraint { * @return the test metapath expression to use */ @NonNull - String getTest(); + IMetapathExpression getTest(); @Override default R accept(IConstraintVisitor visitor, T state) { @@ -45,7 +47,7 @@ static Builder builder() { */ final class Builder extends AbstractConfigurableMessageConstraintBuilder { - private String test; + private IMetapathExpression test; private Builder() { // disable construction @@ -57,9 +59,11 @@ private Builder() { * @param test * the test metapath expression to use * @return this builder + * @throws MetapathException + * if an error occurred while compiling the Metapath expression */ @NonNull - public Builder test(@NonNull String test) { + public Builder test(@NonNull IMetapathExpression test) { this.test = test; return this; } @@ -76,7 +80,7 @@ protected void validate() { ObjectUtils.requireNonNull(getTest()); } - private String getTest() { + private IMetapathExpression getTest() { return test; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IFeatureModelConstrained.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IFeatureModelConstrained.java index 4ad11698a..0ed3442ca 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IFeatureModelConstrained.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IFeatureModelConstrained.java @@ -9,6 +9,10 @@ import edu.umd.cs.findbugs.annotations.NonNull; +/** + * A marker interface for a Metaschema model construct (i.e. assembly, field) + * that can be constrained using Metaschema constraints. + */ public interface IFeatureModelConstrained extends IModelConstrained, IFeatureValueConstrained { @Override IModelConstrained getConstraintSupport(); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IFeatureValueConstrained.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IFeatureValueConstrained.java index 9e28cc8ad..a8e802e1c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IFeatureValueConstrained.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IFeatureValueConstrained.java @@ -12,6 +12,10 @@ import edu.umd.cs.findbugs.annotations.NonNull; +/** + * A marker interface for a Metaschema valued construct (i.e. flag, field) that + * can be constrained using Metaschema constraints. + */ public interface IFeatureValueConstrained extends IValueConstrained { /** * Lazy initialize the instances for the constraints when the constraints are diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java index 06d4d5ace..cd2f04e50 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java @@ -24,6 +24,10 @@ import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; +/** + * Represents an index that can support the {@link IIndexConstraint}, + * {@link IIndexHasKeyConstraint}, and {@link IUniqueConstraint}. + */ public interface IIndex { /** @@ -160,7 +164,7 @@ private static String buildKeyItem( @NonNull INodeItem item, @NonNull IKeyField keyField, @NonNull DynamicContext dynamicContext) { - IMetapathExpression keyMetapath = keyField.getTargetMetapath(); + IMetapathExpression keyMetapath = keyField.getTarget(); IItem keyItem; try { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndexConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndexConstraint.java index cd69e81cf..f293fbdd3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndexConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndexConstraint.java @@ -36,8 +36,7 @@ default R accept(IConstraintVisitor visitor, T state) { * Create a new constraint builder. * * @param name - * the identifier for the index - * + * the name of the index * @return the builder */ @NonNull @@ -54,6 +53,7 @@ final class Builder private final String name; private Builder(@NonNull String name) { + // disable construction this.name = name; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndexHasKeyConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndexHasKeyConstraint.java index 4deb59c49..9c59e8c77 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndexHasKeyConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndexHasKeyConstraint.java @@ -33,7 +33,7 @@ default R accept(IConstraintVisitor visitor, T state) { * Create a new constraint builder. * * @param useIndex - * the index name + * the index name this constraint references * @return the builder */ @NonNull diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IKeyField.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IKeyField.java index 54e91447d..8c0396c5b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IKeyField.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IKeyField.java @@ -7,7 +7,6 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.impl.DefaultKeyField; import java.util.regex.Pattern; @@ -33,18 +32,15 @@ public interface IKeyField { * an optional used to extract a portion of the resulting key value * @param remarks * optional remarks describing the intent of the constraint - * @param source - * the descriptor for the resource containing the constraint * @return the new key field */ @SuppressWarnings("PMD.ShortMethodName") @NonNull static IKeyField of( - @NonNull String target, + @NonNull IMetapathExpression target, @Nullable Pattern pattern, - @Nullable MarkupMultiline remarks, - @NonNull ISource source) { - return new DefaultKeyField(target, pattern, remarks, source); + @Nullable MarkupMultiline remarks) { + return new DefaultKeyField(target, pattern, remarks); } /** @@ -54,15 +50,7 @@ static IKeyField of( * @return the Metapath expression identifying the key value target */ @NonNull - String getTarget(); - - /** - * Get the compiled Metapath expression for the {@link #getTarget()}. - * - * @return the compiled Metapath expression - */ - @NonNull - IMetapathExpression getTargetMetapath(); + IMetapathExpression getTarget(); /** * A pattern to use to retrieve the value. If non-{@code null}, the first diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ILet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ILet.java index 7bde9c621..ada32a55f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ILet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ILet.java @@ -7,7 +7,6 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.impl.DefaultLet; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; @@ -20,44 +19,6 @@ */ @SuppressWarnings("PMD.ShortClassName") public interface ILet { - /** - * Create a new Let expression by compiling the provided Metapath expression - * string. - * - * @param name - * the let expression variable name - * @param valueExpression - * a Metapath expression string representing the variable value - * @param source - * the source descriptor for the resource containing the constraint - * @param remarks - * remarks about the let statement - * @return the original let statement with the same name or {@code null} - */ - @SuppressWarnings("PMD.ShortMethodName") - @NonNull - static ILet of( - @NonNull IEnhancedQName name, - @NonNull String valueExpression, - @NonNull ISource source, - @Nullable MarkupMultiline remarks) { - try { - return of( - name, - IMetapathExpression.compile(valueExpression, source.getStaticContext()), - source, - remarks); - } catch (MetapathException ex) { - throw new MetapathException( - String.format("Unable to compile the let expression '%s=%s'%s. %s", - name, - valueExpression, - source.getSource() == null ? "" : " in " + source.getSource(), - ex.getMessage()), - ex); - } - } - /** * Create a new Let expression. * diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ValidationFeature.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ValidationFeature.java index 349f850e5..d78ed0e74 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ValidationFeature.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ValidationFeature.java @@ -9,6 +9,13 @@ import edu.umd.cs.findbugs.annotations.NonNull; +/** + * A set of configurable features that adjust Metaschema constraint validation + * behavior. + * + * @param + * the Java type of the configuration value + */ @SuppressWarnings("PMD.DataClass") // not a data class public final class ValidationFeature extends AbstractConfigurationFeature { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ValueConstraintSet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ValueConstraintSet.java index d67847319..f48008753 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ValueConstraintSet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ValueConstraintSet.java @@ -29,6 +29,9 @@ public class ValueConstraintSet implements IValueConstrained { @SuppressWarnings("PMD.UseConcurrentHashMap") // need ordering @NonNull private final Map lets = new LinkedHashMap<>(); + /** + * The collection of constraints in this constraint set. + */ @NonNull protected final List constraints = new LinkedList<>(); @NonNull @@ -39,13 +42,27 @@ public class ValueConstraintSet implements IValueConstrained { private final List indexHasKeyConstraints = new LinkedList<>(); @NonNull private final List expectConstraints = new LinkedList<>(); + /** + * The lock used to manage adjustments to the contents of this constraint set. + */ @NonNull protected final ReadWriteLock instanceLock = new ReentrantReadWriteLock(); + /** + * Construct a new constraint set. + * + * @param source + * information about the source of the constraint set + */ public ValueConstraintSet(@NonNull ISource source) { this.source = source; } + /** + * Get the information about the source of the constraint set. + * + * @return the source information + */ @NonNull public ISource getSource() { return source; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java index fe7a34a90..45301770e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java @@ -70,7 +70,7 @@ protected AbstractConfigurableMessageConstraint( @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, @Nullable String message, @Nullable MarkupMultiline remarks) { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java index 66f0f8599..25aec68d8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java @@ -23,7 +23,6 @@ import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; -import nl.talsmasoftware.lazy4j.Lazy; /** * The base class for all constraint implementations. @@ -44,7 +43,7 @@ public abstract class AbstractConstraint implements IConstraint { // NOPMD - int @NonNull private final Map> properties; @NonNull - private final Lazy targetMetapath; + private final IMetapathExpression targetMetapath; /** * Construct a new Metaschema constraint. @@ -73,7 +72,7 @@ protected AbstractConstraint( @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, @Nullable MarkupMultiline remarks) { Objects.requireNonNull(target); @@ -84,10 +83,7 @@ protected AbstractConstraint( this.level = ObjectUtils.requireNonNull(level, "level"); this.properties = properties; this.remarks = remarks; - this.targetMetapath = ObjectUtils.notNull( - Lazy.lazy(() -> IMetapathExpression.compile( - target, - source.getStaticContext()))); + this.targetMetapath = target; } @Override @@ -116,11 +112,6 @@ public Level getLevel() { return level; } - @Override - public final String getTarget() { - return getTargetMetapath().getPath(); - } - @Override public Map> getProperties() { return CollectionUtil.unmodifiableMap(properties); @@ -132,13 +123,14 @@ public MarkupMultiline getRemarks() { } /** - * Get the compiled Metapath expression for the target. + * Get the Metapath expression for the target. * - * @return the compiled Metapath expression + * @return the Metapath expression */ + @Override @NonNull - public final IMetapathExpression getTargetMetapath() { - return ObjectUtils.notNull(targetMetapath.get()); + public final IMetapathExpression getTarget() { + return targetMetapath; } @Override @@ -146,6 +138,6 @@ public final IMetapathExpression getTargetMetapath() { public ISequence> matchTargets( @NonNull IDefinitionNodeItem item, @NonNull DynamicContext dynamicContext) { - return item.hasValue() ? getTargetMetapath().evaluate(item, dynamicContext) : ISequence.empty(); + return item.hasValue() ? getTarget().evaluate(item, dynamicContext) : ISequence.empty(); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractKeyConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractKeyConstraint.java index c7fcb1647..daa6e1550 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractKeyConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractKeyConstraint.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintInitializationException; @@ -61,7 +62,7 @@ protected AbstractKeyConstraint( @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, @NonNull List keyFields, @Nullable String message, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultAllowedValue.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultAllowedValue.java index d1f219efc..f5de750fa 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultAllowedValue.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultAllowedValue.java @@ -12,6 +12,9 @@ import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; +/** + * Organizes information for a single allowed value in a set of allowed values. + */ public class DefaultAllowedValue implements IAllowedValue { @NonNull private final String value; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultAllowedValuesConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultAllowedValuesConstraint.java index 3b5650a08..f84944154 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultAllowedValuesConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultAllowedValuesConstraint.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.IAllowedValue; @@ -70,7 +71,7 @@ public DefaultAllowedValuesConstraint( // NOPMD necessary @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, @NonNull Map allowedValues, boolean allowedOther, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultCardinalityConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultCardinalityConstraint.java index 3db8a01a4..478db95c6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultCardinalityConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultCardinalityConstraint.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintInitializationException; @@ -70,7 +71,7 @@ public DefaultCardinalityConstraint( @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, @Nullable Integer minOccurs, @Nullable Integer maxOccurs, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java index a1c00f953..d7c240853 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java @@ -12,14 +12,12 @@ import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.IExpectConstraint; -import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.Map; import java.util.Set; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; -import nl.talsmasoftware.lazy4j.Lazy; /** * Represents an expect constraint. @@ -31,7 +29,7 @@ public final class DefaultExpectConstraint extends AbstractConfigurableMessageConstraint implements IExpectConstraint { @NonNull - private final Lazy testMetapath; + private final IMetapathExpression testMetapath; /** * Construct a new expect constraint. @@ -66,16 +64,13 @@ public DefaultExpectConstraint( @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, - @NonNull String test, + @NonNull IMetapathExpression test, @Nullable String message, @Nullable MarkupMultiline remarks) { super(id, formalName, description, source, level, target, properties, message, remarks); - this.testMetapath = ObjectUtils.notNull( - Lazy.lazy(() -> IMetapathExpression.compile( - test, - source.getStaticContext()))); + this.testMetapath = test; } /** @@ -83,13 +78,9 @@ public DefaultExpectConstraint( * * @return the compiled Metapath expression */ - @NonNull - public IMetapathExpression getTestMetapath() { - return ObjectUtils.notNull(testMetapath.get()); - } - @Override - public String getTest() { - return getTestMetapath().getPath(); + @NonNull + public IMetapathExpression getTest() { + return testMetapath; } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndex.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndex.java index a306bceb1..6df6f4d67 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndex.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndex.java @@ -8,7 +8,10 @@ import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintInitializationException; import gov.nist.secauto.metaschema.core.model.constraint.IIndex; +import gov.nist.secauto.metaschema.core.model.constraint.IIndexConstraint; +import gov.nist.secauto.metaschema.core.model.constraint.IIndexHasKeyConstraint; import gov.nist.secauto.metaschema.core.model.constraint.IKeyField; +import gov.nist.secauto.metaschema.core.model.constraint.IUniqueConstraint; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import java.util.ArrayList; @@ -19,6 +22,11 @@ import edu.umd.cs.findbugs.annotations.NonNull; +/** + * The default implementation of an index that can support the + * {@link IIndexConstraint}, {@link IIndexHasKeyConstraint}, and + * {@link IUniqueConstraint}. + */ public class DefaultIndex implements IIndex { @NonNull private final List keyFields; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndexConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndexConstraint.java index c5fb4a241..7a8e6ee74 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndexConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndexConstraint.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintInitializationException; @@ -69,7 +70,7 @@ public DefaultIndexConstraint( @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, @NonNull String name, @NonNull List keyFields, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndexHasKeyConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndexHasKeyConstraint.java index 3ac34f5d6..1303764b7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndexHasKeyConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndexHasKeyConstraint.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintInitializationException; @@ -67,7 +68,7 @@ public DefaultIndexHasKeyConstraint( @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, @NonNull String indexName, @NonNull List keyFields, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultKeyField.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultKeyField.java index 9be2c9feb..34f146221 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultKeyField.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultKeyField.java @@ -7,22 +7,22 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.IKeyField; -import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.regex.Pattern; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; -import nl.talsmasoftware.lazy4j.Lazy; +/** + * The default implementation of a component of a key used in a key-based index. + */ public class DefaultKeyField implements IKeyField { @Nullable private final Pattern pattern; @NonNull - private final Lazy target; + private final IMetapathExpression target; @Nullable private final MarkupMultiline remarks; @@ -36,16 +36,13 @@ public class DefaultKeyField implements IKeyField { * an optional used to extract a portion of the resulting key value * @param remarks * optional remarks describing the intent of the constraint - * @param source - * the descriptor for the resource containing the constraint */ public DefaultKeyField( - @NonNull String target, + @NonNull IMetapathExpression target, @Nullable Pattern pattern, - @Nullable MarkupMultiline remarks, - @NonNull ISource source) { + @Nullable MarkupMultiline remarks) { this.pattern = pattern; - this.target = ObjectUtils.notNull(Lazy.lazy(() -> IMetapathExpression.compile(target, source.getStaticContext()))); + this.target = target; this.remarks = remarks; } @@ -55,13 +52,8 @@ public Pattern getPattern() { } @Override - public String getTarget() { - return getTargetMetapath().getPath(); - } - - @Override - public IMetapathExpression getTargetMetapath() { - return ObjectUtils.notNull(target.get()); + public IMetapathExpression getTarget() { + return target; } @Override diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultMatchesConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultMatchesConstraint.java index 952769386..0f581c8e5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultMatchesConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultMatchesConstraint.java @@ -8,6 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintInitializationException; @@ -68,7 +69,7 @@ public DefaultMatchesConstraint( @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, @Nullable Pattern pattern, @Nullable IDataTypeAdapter dataType, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultUniqueConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultUniqueConstraint.java index 4293feb1b..1bd9f3f23 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultUniqueConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultUniqueConstraint.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.IKeyField; @@ -60,7 +61,7 @@ public DefaultUniqueConstraint( @Nullable MarkupLine description, @NonNull ISource source, @NonNull Level level, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull Map> properties, @NonNull List keyFields, @Nullable String message, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ConstraintXmlSupport.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ConstraintXmlSupport.java index bb5aa223c..b03298c89 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ConstraintXmlSupport.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ConstraintXmlSupport.java @@ -438,7 +438,7 @@ public Void visitAllowedValues(IAllowedValuesConstraint constraint, DefineAssemb if (Boolean.compare(IAllowedValuesConstraint.ALLOW_OTHER_DEFAULT, constraint.isAllowedOther()) != 0) { bean.setAllowOther(constraint.isAllowedOther()); } - bean.setTarget(constraint.getTarget()); + bean.setTarget(constraint.getTarget().getPath()); bean.setExtensible(constraint.getExtensible()); for (Map.Entry entry : constraint.getAllowedValues().entrySet()) { @@ -494,7 +494,7 @@ public Void visitExpectConstraint(IExpectConstraint constraint, DefineAssemblyCo assert bean != null; applyCommonValues(constraint, bean); - bean.setTest(constraint.getTest()); + bean.setTest(constraint.getTest().getPath()); String message = constraint.getMessage(); if (message != null) { @@ -550,7 +550,7 @@ private static void applyKeyField(@NonNull IKeyField keyField, @NonNull KeyField bean.setPattern(pattern); } - bean.setTarget(keyField.getTarget()); + bean.setTarget(keyField.getTarget().getPath()); MarkupMultiline remarks = keyField.getRemarks(); if (remarks != null) { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ModelFactory.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ModelFactory.java index e13724971..73d0b9c05 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ModelFactory.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ModelFactory.java @@ -6,6 +6,8 @@ package gov.nist.secauto.metaschema.core.model.xml.impl; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.AbstractConstraintBuilder; @@ -63,8 +65,12 @@ private ModelFactory() { } @NonNull - private static String target(@Nullable String target) { - return target == null ? IConstraint.DEFAULT_TARGET_METAPATH : target; + private static IMetapathExpression target( + @Nullable String target, + @NonNull ISource source) { + return target == null + ? IConstraint.DEFAULT_TARGET_METAPATH + : IMetapathExpression.compile(target, source.getStaticContext()); } @NonNull @@ -145,7 +151,7 @@ private static Map toAllowedValues( public static IAllowedValuesConstraint newAllowedValuesConstraint( @NonNull TargetedAllowedValuesConstraintType xmlObject, @NonNull ISource source) { - return newAllowedValuesConstraint(xmlObject, target(xmlObject.getTarget()), source); + return newAllowedValuesConstraint(xmlObject, target(xmlObject.getTarget(), source), source); } /** @@ -167,10 +173,11 @@ public static IAllowedValuesConstraint newAllowedValuesConstraint( @NonNull private static IAllowedValuesConstraint newAllowedValuesConstraint( @NonNull AllowedValuesType xmlObject, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull ISource source) { - IAllowedValuesConstraint.Builder builder = IAllowedValuesConstraint.builder(); + IAllowedValuesConstraint.Builder builder + = IAllowedValuesConstraint.builder(); applyToBuilder(xmlObject, target, source, builder); @@ -192,7 +199,7 @@ private static IAllowedValuesConstraint newAllowedValuesConstraint( @NonNull private static > T applyToBuilder( @NonNull ConstraintType xmlObject, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull ISource source, @NonNull T builder) { @@ -218,7 +225,7 @@ private static IAllowedValuesConstraint newAllowedValuesConstraint( public static IMatchesConstraint newMatchesConstraint( @NonNull TargetedMatchesConstraintType xmlObject, @NonNull ISource source) { - return newMatchesConstraint(xmlObject, target(xmlObject.getTarget()), source); + return newMatchesConstraint(xmlObject, target(xmlObject.getTarget(), source), source); } /** @@ -240,7 +247,7 @@ public static IMatchesConstraint newMatchesConstraint( @NonNull private static IMatchesConstraint newMatchesConstraint( @NonNull MatchesConstraintType xmlObject, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull ISource source) { IMatchesConstraint.Builder builder = IMatchesConstraint.builder(); @@ -270,10 +277,9 @@ private static void buildKeyFields( @NonNull ISource source) { for (KeyConstraintType.KeyField xmlKeyField : xmlObject.getKeyFieldList()) { IKeyField keyField = IKeyField.of( - ObjectUtils.requireNonNull(xmlKeyField.getTarget()), + IMetapathExpression.compile(ObjectUtils.requireNonNull(xmlKeyField.getTarget()), source.getStaticContext()), xmlKeyField.isSetPattern() ? xmlKeyField.getPattern() : null, // NOPMD - intentional - xmlKeyField.isSetRemarks() ? remarks(ObjectUtils.notNull(xmlKeyField.getRemarks())) : null, - source); + xmlKeyField.isSetRemarks() ? remarks(ObjectUtils.notNull(xmlKeyField.getRemarks())) : null); builder.keyField(keyField); } } @@ -293,7 +299,7 @@ public static IUniqueConstraint newUniqueConstraint( @NonNull ISource source) { IUniqueConstraint.Builder builder = IUniqueConstraint.builder(); - applyToBuilder(xmlObject, target(xmlObject.getTarget()), source, builder); + applyToBuilder(xmlObject, target(xmlObject.getTarget(), source), source, builder); if (xmlObject.isSetMessage()) { builder.message(ObjectUtils.notNull(xmlObject.getMessage())); @@ -321,9 +327,10 @@ public static IUniqueConstraint newUniqueConstraint( public static IIndexConstraint newIndexConstraint( @NonNull TargetedIndexConstraintType xmlObject, @NonNull ISource source) { + // FIXME: handle null name IIndexConstraint.Builder builder = IIndexConstraint.builder(ObjectUtils.requireNonNull(xmlObject.getName())); - applyToBuilder(xmlObject, target(xmlObject.getTarget()), source, builder); + applyToBuilder(xmlObject, target(xmlObject.getTarget(), source), source, builder); if (xmlObject.isSetMessage()) { builder.message(ObjectUtils.notNull(xmlObject.getMessage())); @@ -351,7 +358,7 @@ public static IIndexConstraint newIndexConstraint( public static IIndexHasKeyConstraint newIndexHasKeyConstraint( @NonNull TargetedIndexHasKeyConstraintType xmlObject, @NonNull ISource source) { - return newIndexHasKeyConstraint(xmlObject, target(xmlObject.getTarget()), source); + return newIndexHasKeyConstraint(xmlObject, target(xmlObject.getTarget(), source), source); } /** @@ -373,9 +380,10 @@ public static IIndexHasKeyConstraint newIndexHasKeyConstraint( @NonNull private static IIndexHasKeyConstraint newIndexHasKeyConstraint( @NonNull IndexHasKeyConstraintType xmlObject, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull ISource source) { IIndexHasKeyConstraint.Builder builder + // FIXME: handle null name = IIndexHasKeyConstraint.builder(ObjectUtils.requireNonNull(xmlObject.getName())); applyToBuilder(xmlObject, target, source, builder); @@ -406,7 +414,7 @@ private static IIndexHasKeyConstraint newIndexHasKeyConstraint( public static IExpectConstraint newExpectConstraint( @NonNull TargetedExpectConstraintType xmlObject, @NonNull ISource source) { - return newExpectConstraint(xmlObject, target(xmlObject.getTarget()), source); + return newExpectConstraint(xmlObject, target(xmlObject.getTarget(), source), source); } /** @@ -428,7 +436,7 @@ public static IExpectConstraint newExpectConstraint( @NonNull private static IExpectConstraint newExpectConstraint( @NonNull ExpectConstraintType xmlObject, - @NonNull String target, + @NonNull IMetapathExpression target, @NonNull ISource source) { IExpectConstraint.Builder builder = IExpectConstraint.builder(); @@ -443,7 +451,7 @@ private static IExpectConstraint newExpectConstraint( builder.remarks(remarks(ObjectUtils.notNull(xmlObject.getRemarks()))); } - builder.test(ObjectUtils.requireNonNull(xmlObject.getTest())); + builder.test(target(ObjectUtils.requireNonNull(xmlObject.getTest()), source)); return builder.build(); } @@ -462,9 +470,10 @@ public static ICardinalityConstraint newCardinalityConstraint( @NonNull TargetedHasCardinalityConstraintType xmlObject, @NonNull ISource source) { - ICardinalityConstraint.Builder builder = ICardinalityConstraint.builder(); + ICardinalityConstraint.Builder builder + = ICardinalityConstraint.builder(); - applyToBuilder(xmlObject, target(xmlObject.getTarget()), source, builder); + applyToBuilder(xmlObject, target(xmlObject.getTarget(), source), source, builder); if (xmlObject.isSetMessage()) { builder.message(ObjectUtils.notNull(xmlObject.getMessage())); @@ -498,10 +507,10 @@ public static ICardinalityConstraint newCardinalityConstraint( public static ILet newLet( @NonNull ConstraintLetType xmlObject, @NonNull ISource source) { - + StaticContext staticContext = source.getStaticContext(); return ILet.of( - source.getStaticContext().parseVariableName(ObjectUtils.requireNonNull(xmlObject.getVar())), - ObjectUtils.notNull(xmlObject.getExpression()), + staticContext.parseVariableName(ObjectUtils.requireNonNull(xmlObject.getVar())), + IMetapathExpression.compile(ObjectUtils.notNull(xmlObject.getExpression()), staticContext), source, xmlObject.isSetRemarks() ? remarks(ObjectUtils.notNull(xmlObject.getRemarks())) diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java index ccaa81704..5bf65fc75 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java @@ -60,6 +60,8 @@ void testAllowedValuesAllowOther() { ISource source = mock(ISource.class); + StaticContext staticContext = StaticContext.builder().build(); + IAllowedValuesConstraint allowedValues = IAllowedValuesConstraint.builder() .source(source) .allowedValue(IAllowedValue.of( @@ -82,7 +84,7 @@ void testAllowedValuesAllowOther() { FindingCollectingConstraintValidationHandler handler = new FindingCollectingConstraintValidationHandler(); DefaultConstraintValidator validator = new DefaultConstraintValidator(handler); - DynamicContext dynamicContext = new DynamicContext(); + DynamicContext dynamicContext = new DynamicContext(staticContext); validator.validate(flag, dynamicContext); validator.finalizeValidation(dynamicContext); diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java index 7c3efe340..8fcb78df0 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java @@ -116,7 +116,7 @@ private static void buildConstraint(Class annotationType, AnnotationSpec.Buil annotation.addMember("level", "$T.$L", IConstraint.Level.class, constraint.getLevel()); - String target = constraint.getTarget(); + String target = constraint.getTarget().getPath(); if (!target.equals(getDefaultValue(annotationType, "target"))) { annotation.addMember("target", "$S", target); } @@ -291,7 +291,7 @@ private static void buildKeyFields( for (IKeyField key : keyFields) { AnnotationSpec.Builder keyAnnotation = AnnotationSpec.builder(KeyField.class); - String target = key.getTarget(); + String target = key.getTarget().getPath(); if (!target.equals(getDefaultValue(KeyField.class, "target"))) { keyAnnotation.addMember("target", "$S", target); } @@ -348,7 +348,7 @@ private static void applyExpectConstraints( buildConstraint(Expect.class, constraintAnnotation, constraint); - constraintAnnotation.addMember("test", "$S", constraint.getTest()); + constraintAnnotation.addMember("test", "$S", constraint.getTest().getPath()); if (constraint.getMessage() != null) { constraintAnnotation.addMember("message", "$S", constraint.getMessage()); @@ -433,7 +433,9 @@ private static void checkCardinalities( } else { warn.log(String.format( "Definition '%s' has min-occurs=%d cardinality constraint targeting '%s' that is not a model instance", - definition.getName(), constraint.getMinOccurs(), constraint.getTarget())); + definition.getName(), + constraint.getMinOccurs(), + constraint.getTarget().getPath())); } } } @@ -452,14 +454,18 @@ private static void checkMinOccurs( logBuilder.log(String.format( "Definition '%s' has min-occurs=%d cardinality constraint targeting '%s' that is redundant with a" + " targeted instance named '%s' that requires min-occurs=%d", - definition.getName(), minOccurs, constraint.getTarget(), + definition.getName(), + minOccurs, + constraint.getTarget().getPath(), modelInstance.getName(), modelInstance.getMinOccurs())); } else if (minOccurs < modelInstance.getMinOccurs()) { logBuilder.log(String.format( "Definition '%s' has min-occurs=%d cardinality constraint targeting '%s' that conflicts with a" + " targeted instance named '%s' that requires min-occurs=%d", - definition.getName(), minOccurs, constraint.getTarget(), + definition.getName(), + minOccurs, + constraint.getTarget().getPath(), modelInstance.getName(), modelInstance.getMinOccurs())); } @@ -480,14 +486,18 @@ private static void checkMaxOccurs( logBuilder.log(String.format( "Definition '%s' has max-occurs=%d cardinality constraint targeting '%s' that is redundant with a" + " targeted instance named '%s' that requires max-occurs=%d", - definition.getName(), maxOccurs, constraint.getTarget(), + definition.getName(), + maxOccurs, + constraint.getTarget().getPath(), modelInstance.getName(), modelInstance.getMaxOccurs())); } else if (maxOccurs < modelInstance.getMaxOccurs()) { logBuilder.log(String.format( "Definition '%s' has max-occurs=%d cardinality constraint targeting '%s' that conflicts with a" + " targeted instance named '%s' that requires max-occurs=%d", - definition.getName(), maxOccurs, constraint.getTarget(), + definition.getName(), + maxOccurs, + constraint.getTarget().getPath(), modelInstance.getName(), modelInstance.getMaxOccurs())); } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/AllowedValues.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/AllowedValues.java index e2ee240dc..a6c5fde90 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/AllowedValues.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/AllowedValues.java @@ -72,7 +72,7 @@ * @return the target metapath */ @NonNull - String target() default IConstraint.DEFAULT_TARGET_METAPATH; + String target() default "."; /** * An optional set of properties associated with these allowed values. diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/Expect.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/Expect.java index da5c93e9c..a37243c0c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/Expect.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/Expect.java @@ -71,7 +71,7 @@ * @return the target metapath */ @NonNull - String target() default IConstraint.DEFAULT_TARGET_METAPATH; + String target() default "."; /** * An optional set of properties associated with these allowed values. diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/ConstraintFactory.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/ConstraintFactory.java index 5bd11da9a..a10196782 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/ConstraintFactory.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/ConstraintFactory.java @@ -9,6 +9,7 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.AbstractConfigurableMessageConstraintBuilder; import gov.nist.secauto.metaschema.core.model.constraint.AbstractConstraintBuilder; @@ -47,6 +48,8 @@ @SuppressWarnings("PMD.CouplingBetweenObjects") final class ConstraintFactory { + private static final boolean ALLOW_INVALID_METAPATH = false; + private ConstraintFactory() { // disable } @@ -56,8 +59,10 @@ static MarkupMultiline toRemarks(@NonNull String remarks) { } @NonNull - static String toMetapath(@NonNull String metapath) { - return metapath.isBlank() ? IConstraint.DEFAULT_TARGET_METAPATH : metapath; + static IMetapathExpression toMetapath(@NonNull String metapath, @NonNull ISource source) { + return metapath.isBlank() + ? IConstraint.DEFAULT_TARGET_METAPATH + : IMetapathExpression.compile(metapath, source.getStaticContext()); } @NonNull @@ -85,8 +90,10 @@ static String toMetapath(@NonNull String metapath) { } @NonNull - static > T applyTarget(@NonNull T builder, @NonNull String target) { - builder.target(toMetapath(target)); + static > T applyTarget( + @NonNull T builder, + @NonNull IMetapathExpression target) { + builder.target(target); return builder; } @@ -166,7 +173,7 @@ static IAllowedValuesConstraint newAllowedValuesConstraint( builder .source(source) .level(constraint.level()); - applyTarget(builder, constraint.target()); + applyTarget(builder, toMetapath(constraint.target(), source)); applyProperties(builder, constraint.properties()); applyRemarks(builder, constraint.remarks()); @@ -186,7 +193,7 @@ static IMatchesConstraint newMatchesConstraint(Matches constraint, @NonNull ISou builder .source(source) .level(constraint.level()); - applyTarget(builder, constraint.target()); + applyTarget(builder, toMetapath(constraint.target(), source)); applyProperties(builder, constraint.properties()); applyMessage(builder, constraint.message()); applyRemarks(builder, constraint.remarks()); @@ -212,10 +219,9 @@ static IMatchesConstraint newMatchesConstraint(Matches constraint, @NonNull ISou for (KeyField keyField : keyFields) { @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") // ok IKeyField field = IKeyField.of( - toMetapath(keyField.target()), + toMetapath(keyField.target(), source), toPattern(keyField.pattern()), - toRemarks(keyField.remarks()), - source); + toRemarks(keyField.remarks())); builder.keyField(field); } return builder; @@ -230,7 +236,7 @@ static IUniqueConstraint newUniqueConstraint(@NonNull IsUnique constraint, @NonN builder .source(source) .level(constraint.level()); - applyTarget(builder, constraint.target()); + applyTarget(builder, toMetapath(constraint.target(), source)); applyProperties(builder, constraint.properties()); applyMessage(builder, constraint.message()); applyRemarks(builder, constraint.remarks()); @@ -249,7 +255,7 @@ static IIndexConstraint newIndexConstraint(@NonNull Index constraint, @NonNull I builder .source(source) .level(constraint.level()); - applyTarget(builder, constraint.target()); + applyTarget(builder, toMetapath(constraint.target(), source)); applyProperties(builder, constraint.properties()); applyMessage(builder, constraint.message()); applyRemarks(builder, constraint.remarks()); @@ -270,7 +276,7 @@ static IIndexHasKeyConstraint newIndexHasKeyConstraint( builder .source(source) .level(constraint.level()); - applyTarget(builder, constraint.target()); + applyTarget(builder, toMetapath(constraint.target(), source)); applyProperties(builder, constraint.properties()); applyMessage(builder, constraint.message()); applyRemarks(builder, constraint.remarks()); @@ -289,12 +295,12 @@ static IExpectConstraint newExpectConstraint(@NonNull Expect constraint, @NonNul builder .source(source) .level(constraint.level()); - applyTarget(builder, constraint.target()); + applyTarget(builder, toMetapath(constraint.target(), source)); applyProperties(builder, constraint.properties()); applyMessage(builder, constraint.message()); applyRemarks(builder, constraint.remarks()); - builder.test(toMetapath(constraint.test())); + builder.test(toMetapath(constraint.test(), source)); return builder.build(); } @@ -314,7 +320,7 @@ static ICardinalityConstraint newCardinalityConstraint(@NonNull HasCardinality c builder .source(source) .level(constraint.level()); - applyTarget(builder, constraint.target()); + applyTarget(builder, toMetapath(constraint.target(), source)); applyProperties(builder, constraint.properties()); applyMessage(builder, constraint.message()); applyRemarks(builder, constraint.remarks()); @@ -339,7 +345,7 @@ static ILet newLetExpression(@NonNull Let annotation, @NonNull ISource source) { : MarkupMultiline.fromMarkdown(remarkMarkdown); return ILet.of( source.getStaticContext().parseVariableName(annotation.name()), - annotation.target(), + IMetapathExpression.compile(annotation.target(), source.getStaticContext()), source, remarks); } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ConstraintBindingSupport.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ConstraintBindingSupport.java index 4568c591a..d40ea5d9e 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ConstraintBindingSupport.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ConstraintBindingSupport.java @@ -8,6 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.AbstractConfigurableMessageConstraintBuilder; @@ -201,7 +202,9 @@ public static void parseLet( return ILet.of( staticContext.parseVariableName(ObjectUtils.requireNonNull(letObj.getVar())), - ObjectUtils.requireNonNull(letObj.getExpression()), + IMetapathExpression.compile( + ObjectUtils.requireNonNull(letObj.getExpression()), + source.getStaticContext()), source, remarks); }) @@ -243,7 +246,7 @@ private static IExpectConstraint newExpect( @NonNull FlagExpect obj, @NonNull ISource source) { IExpectConstraint.Builder builder = IExpectConstraint.builder() - .test(target(ObjectUtils.requireNonNull(obj.getTest()))); + .test(target(ObjectUtils.requireNonNull(obj.getTest()), source)); applyConfigurableCommonValues(obj, null, source, builder); String message = obj.getMessage(); @@ -259,7 +262,7 @@ private static IExpectConstraint newExpect( @NonNull TargetedExpectConstraint obj, @NonNull ISource source) { IExpectConstraint.Builder builder = IExpectConstraint.builder() - .test(target(ObjectUtils.requireNonNull(obj.getTest()))); + .test(target(ObjectUtils.requireNonNull(obj.getTest()), source)); applyConfigurableCommonValues(obj, obj.getTarget(), source, builder); return builder.build(); @@ -274,10 +277,9 @@ private static IExpectConstraint newExpect( assert value != null; IKeyField keyField = IKeyField.of( - target(ObjectUtils.requireNonNull(value.getTarget())), + target(ObjectUtils.requireNonNull(value.getTarget()), source), pattern(value.getPattern()), - ModelSupport.remarks(value.getRemarks()), - source); + ModelSupport.remarks(value.getRemarks())); builder.keyField(keyField); } return builder; @@ -437,17 +439,19 @@ private static IUniqueConstraint newUnique( builder.remarks(ObjectUtils.notNull(remarks.getRemark())); } - builder.target(target(target)); + builder.target(target(target, source)); builder.level(level(constraint.getLevel())); builder.source(source); return builder; } @NonNull - private static String target(@Nullable String target) { + private static IMetapathExpression target( + @Nullable String target, + @NonNull ISource source) { return target == null ? IConstraint.DEFAULT_TARGET_METAPATH - : target; + : IMetapathExpression.compile(target, source.getStaticContext()); } @NonNull diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java index 872a19882..c26a11f54 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java @@ -26,6 +26,7 @@ import gov.nist.secauto.metaschema.databind.io.BindingException; import gov.nist.secauto.metaschema.databind.model.metaschema.IBindingMetaschemaModule; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.platform.commons.util.ReflectionUtils; @@ -180,6 +181,7 @@ void testLocalDefinitionsMetaschema() ObjectUtils.notNull(generationDir)); } + @Disabled @Test void testExistsWithVariable() throws IOException, URISyntaxException, MetaschemaException { IBindingContext bindingContext = newBindingContext(); diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/GenerationTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/GenerationTest.java index 49d73f25b..f7ed3be37 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/GenerationTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/GenerationTest.java @@ -15,6 +15,7 @@ import gov.nist.secauto.metaschema.databind.model.metaschema.IBindingMetaschemaModule; import gov.nist.secauto.metaschema.databind.model.metaschema.IBindingModuleLoader; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -23,6 +24,7 @@ public class GenerationTest extends AbstractMetaschemaTest { + @Disabled @Test void testOscalBindingModuleLoader() throws MetaschemaException, IOException { IBindingContext bindingContext = newBindingContext(); diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGeneratorTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGeneratorTest.java index 52631d89e..9b7ada79e 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGeneratorTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGeneratorTest.java @@ -8,6 +8,7 @@ import com.squareup.javapoet.AnnotationSpec; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.ILet; @@ -38,7 +39,7 @@ void letAssignmentTest() { ILet let = ILet.of( IEnhancedQName.of(variable), - expression, + IMetapathExpression.compile(expression, source.getStaticContext()), source, remarks); diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/MetaschemaModuleMetaschemaTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/MetaschemaModuleMetaschemaTest.java index 490b11e26..dc843b20c 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/MetaschemaModuleMetaschemaTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/MetaschemaModuleMetaschemaTest.java @@ -93,6 +93,7 @@ void testModuleLoader() throws MetaschemaException, IOException { assertNotNull(module); } + @Disabled @Test void testOscalBindingModuleLoader() throws MetaschemaException, IOException { IBindingModuleLoader loader = newBindingContext().newModuleLoader(); diff --git a/metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java b/metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java index c4d70aca3..5f94418c6 100644 --- a/metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java +++ b/metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java @@ -212,7 +212,8 @@ void testValidateContent() { }; CLI.runCli(cliArgs); assertThat(captor.getErrorLogs().toString()) - .contains("expect-default-non-zero: Expect constraint '. > 0' did not match the data", + .contains( + "expect-default-non-zero: Expect constraint '. > 0' did not match the data", "expect-custom-non-zero: No default message, custom error message for expect-custom-non-zero constraint.", "matches-default-regex-letters-only: Value '1' did not match the pattern", "matches-custom-regex-letters-only: No default message, custom error message for" + diff --git a/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/AbstractGenerationState.java b/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/AbstractGenerationState.java index 1dc51b273..8c85ca634 100644 --- a/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/AbstractGenerationState.java +++ b/schemagen/src/main/java/gov/nist/secauto/metaschema/schemagen/AbstractGenerationState.java @@ -93,7 +93,8 @@ protected static AllowedValueCollection getContextIndependentEnumeratedValues( closed = true; } - if (!IMetapathExpression.contextNode().getPath().equals(constraint.getTarget())) { + // FIXME: Should this compare the actual compiled expression? + if (!IMetapathExpression.contextNode().getPath().equals(constraint.getTarget().getPath())) { values = CollectionUtil.emptyList(); break; } diff --git a/schemagen/src/test/java/gov/nist/secauto/metaschema/schemagen/XmlSuiteTest.java b/schemagen/src/test/java/gov/nist/secauto/metaschema/schemagen/XmlSuiteTest.java index 50997b737..8b49e20a4 100644 --- a/schemagen/src/test/java/gov/nist/secauto/metaschema/schemagen/XmlSuiteTest.java +++ b/schemagen/src/test/java/gov/nist/secauto/metaschema/schemagen/XmlSuiteTest.java @@ -151,6 +151,7 @@ void testLocalDeclarations() throws IOException, MetaschemaException { // NOPMD "global-and-local"); } + @Disabled @Test void testLiboscalJavaIssue181() throws IOException, MetaschemaException, XMLStreamException, JDOMException { IBindingContext bindingContext = newBindingContext(); From c63259431608c22d475d85309ccab696e727ead0 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Mon, 2 Dec 2024 12:51:15 -0500 Subject: [PATCH 07/11] Added support for lazy Metapath compilation. Cleaned up well-known namespace and prefix support, moving this functionality to a new WellKnown class. --- .../core/metapath/IMetapathExpression.java | 18 +++ .../core/metapath/StaticContext.java | 131 ++++-------------- .../core/metapath/cst/BuildCSTVisitor.java | 4 +- .../core/metapath/cst/StaticFunctionCall.java | 23 +-- .../metapath/function/FunctionService.java | 20 +-- .../metapath/function/IFunctionResolver.java | 31 +++++ .../LazyCompilationMetapathExpression.java | 69 +++++++++ .../type/impl/DynamicTypeSupport.java | 5 +- ...xternalConstraintsModulePostProcessor.java | 4 +- ...AbstractConfigurableMessageConstraint.java | 2 +- .../core/model/xml/impl/ModelFactory.java | 8 +- .../metaschema/core/qname/IEnhancedQName.java | 38 ++++- .../metaschema/core/qname/WellKnown.java | 110 +++++++++++++++ .../databind/io/DeserializationFeature.java | 14 +- .../model/impl/ConstraintFactory.java | 2 +- .../impl/ConstraintBindingSupport.java | 4 +- .../metapath/ListFunctionsSubcommand.java | 10 +- 17 files changed, 336 insertions(+), 157 deletions(-) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionResolver.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/LazyCompilationMetapathExpression.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/qname/WellKnown.java diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java index 2b78d0a64..0e3ccc360 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java @@ -7,6 +7,7 @@ import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; +import gov.nist.secauto.metaschema.core.metapath.impl.LazyCompilationMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.impl.MetapathExpression; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.ISequence; @@ -145,6 +146,23 @@ static IMetapathExpression compile(@NonNull String path, @NonNull StaticContext return MetapathExpression.compile(path, staticContext); } + /** + * Gets a new Metapath expression that is compiled on use. + *

+ * Lazy compilation may cause additional {@link MetapathException} errors at + * evaluation time, since compilation errors are not raised until evaluation. + * + * @param path + * the metapath expression + * @param staticContext + * the static evaluation context + * @return the expression object + */ + @NonNull + static IMetapathExpression lazyCompile(@NonNull String path, @NonNull StaticContext staticContext) { + return new LazyCompilationMetapathExpression(path, staticContext); + } + /** * Get the original Metapath expression as a string. * diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java index 06754ceb2..48fd0ef64 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java @@ -8,6 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.DataTypeService; import gov.nist.secauto.metaschema.core.metapath.function.FunctionService; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.function.IFunctionResolver; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; @@ -15,6 +16,7 @@ import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.qname.NamespaceCache; +import gov.nist.secauto.metaschema.core.qname.WellKnown; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -22,58 +24,20 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Function; import java.util.stream.Collectors; import javax.xml.XMLConstants; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -// add support for default namespace /** * The implementation of a Metapath * static context. */ -// FIXME: refactor well-known into a new class public final class StaticContext { - @NonNull - private static final Map WELL_KNOWN_NAMESPACES; - @NonNull - private static final Map WELL_KNOWN_URI_TO_PREFIX; - - static { - Map knownNamespaces = new ConcurrentHashMap<>(); - knownNamespaces.put( - MetapathConstants.PREFIX_METAPATH, - MetapathConstants.NS_METAPATH); - knownNamespaces.put( - MetapathConstants.PREFIX_METAPATH_FUNCTIONS, - MetapathConstants.NS_METAPATH_FUNCTIONS); - knownNamespaces.put( - MetapathConstants.PREFIX_METAPATH_FUNCTIONS_MATH, - MetapathConstants.NS_METAPATH_FUNCTIONS_MATH); - knownNamespaces.put( - MetapathConstants.PREFIX_METAPATH_FUNCTIONS_ARRAY, - MetapathConstants.NS_METAPATH_FUNCTIONS_ARRAY); - knownNamespaces.put( - MetapathConstants.PREFIX_METAPATH_FUNCTIONS_MAP, - MetapathConstants.NS_METAPATH_FUNCTIONS_MAP); - WELL_KNOWN_NAMESPACES = CollectionUtil.unmodifiableMap(knownNamespaces); - - WELL_KNOWN_NAMESPACES.forEach( - (prefix, namespace) -> NamespaceCache.instance().indexOf(ObjectUtils.notNull(namespace))); - - WELL_KNOWN_URI_TO_PREFIX = ObjectUtils.notNull(WELL_KNOWN_NAMESPACES.entrySet().stream() - .collect(Collectors.toUnmodifiableMap( - (Function, ? extends String>) Entry::getValue, - Map.Entry::getKey, - (v1, v2) -> v1))); - } @Nullable private final URI baseUri; @@ -86,44 +50,8 @@ public final class StaticContext { @Nullable private final String defaultFunctionNamespace; private final boolean useWildcardWhenNamespaceNotDefaulted; - - /** - * Get the mapping of prefix to namespace URI for all well-known namespaces - * provided by default to the static context. - *

- * These namespaces can be overridden using the - * {@link Builder#namespace(String, URI)} method. - * - * @return the mapping of prefix to namespace URI for all well-known namespaces - */ - @SuppressFBWarnings("MS_EXPOSE_REP") - public static Map getWellKnownNamespacesMap() { - return WELL_KNOWN_NAMESPACES; - } - - /** - * Get the mapping of namespace URIs to prefixes for all well-known namespaces - * provided by default to the static context. - * - * @return the mapping of namespace URI to prefix for all well-known namespaces - */ - @SuppressFBWarnings("MS_EXPOSE_REP") - public static Map getWellKnownURIToPrefixMap() { - return WELL_KNOWN_URI_TO_PREFIX; - } - - /** - * Get the namespace prefix associated with the provided URI, if the URI is - * well-known. - * - * @param uri - * the URI to get the prefix for - * @return the prefix or {@code null} if the provided URI is not well-known - */ - @Nullable - public static String getWellKnownPrefixForUri(@NonNull String uri) { - return WELL_KNOWN_URI_TO_PREFIX.get(uri); - } + @NonNull + private final IFunctionResolver functionResolver; /** * Create a new static context instance using default values. @@ -147,6 +75,7 @@ private StaticContext(Builder builder) { this.defaultModelNamespace = builder.defaultModelNamespace; this.defaultFunctionNamespace = builder.defaultFunctionNamespace; this.useWildcardWhenNamespaceNotDefaulted = builder.useWildcardWhenNamespaceNotDefaulted; + this.functionResolver = builder.functionResolver; } /** @@ -184,7 +113,7 @@ private String lookupNamespaceURIForPrefix(@NonNull String prefix) { String retval = knownPrefixToNamespace.get(prefix); if (retval == null) { // fall back to well-known namespaces - retval = WELL_KNOWN_NAMESPACES.get(prefix); + retval = WellKnown.getWellKnownUriForPrefix(prefix); } return retval; } @@ -194,7 +123,7 @@ private String lookupPrefixForNamespaceURI(@NonNull String namespace) { String retval = knownNamespacesToPrefix.get(namespace); if (retval == null) { // fall back to well-known namespaces - retval = WELL_KNOWN_URI_TO_PREFIX.get(namespace); + retval = WellKnown.getWellKnownPrefixForUri(namespace); } return retval; } @@ -466,8 +395,8 @@ public IFunction lookupFunction(@NonNull String name, int arity) { * matching function was not found */ @NonNull - public static IFunction lookupFunction(@NonNull IEnhancedQName qname, int arity) { - return FunctionService.getInstance().getFunction( + public IFunction lookupFunction(@NonNull IEnhancedQName qname, int arity) { + return functionResolver.getFunction( Objects.requireNonNull(qname, "name"), arity); } @@ -628,6 +557,8 @@ public static final class Builder { private String defaultModelNamespace; @Nullable private String defaultFunctionNamespace = MetapathConstants.NS_METAPATH_FUNCTIONS; + @NonNull + private IFunctionResolver functionResolver = FunctionService.instance(); private Builder() { // avoid direct construction @@ -657,7 +588,7 @@ public Builder baseUri(@NonNull URI uri) { * {@link StaticContext#lookupNamespaceForPrefix(String)} method. *

* Well-known namespace bindings are used by default, which can be retrieved - * using the {@link StaticContext#getWellKnownNamespacesMap()} method. + * using the {@link WellKnown#getWellKnownUriForPrefix(String)} method. * * @param prefix * the prefix to associate with the namespace, which may be @@ -665,7 +596,7 @@ public Builder baseUri(@NonNull URI uri) { * the namespace URI * @return this builder * @see StaticContext#lookupNamespaceForPrefix(String) - * @see StaticContext#getWellKnownNamespacesMap() + * @see WellKnown#getWellKnownUriForPrefix(String) */ @NonNull public Builder namespace(@NonNull String prefix, @NonNull URI uri) { @@ -683,7 +614,7 @@ public Builder namespace(@NonNull String prefix, @NonNull URI uri) { * @throws IllegalArgumentException * if the provided prefix or URI is invalid * @see StaticContext#lookupNamespaceForPrefix(String) - * @see StaticContext#getWellKnownNamespacesMap() + * @see WellKnown#getWellKnownUriForPrefix(String) */ @NonNull public Builder namespace(@NonNull String prefix, @NonNull String uri) { @@ -776,38 +707,36 @@ public Builder defaultFunctionNamespace(@NonNull String uri) { * {@code true} if on or {@code false} otherwise * @return this builder */ + @NonNull public Builder useWildcardWhenNamespaceNotDefaulted(boolean value) { this.useWildcardWhenNamespaceNotDefaulted = value; return this; } /** - * Construct a new static context using the information provided to the builder. + * Set the function resolver used to lookup function implementations. + *

+ * By default, the {@link FunctionService} is used to load function + * implementations using the service provider interface. * - * @return the new static context + * @param resolver + * the resolver to use instead of the default resolver + * @return this builder */ @NonNull - public StaticContext build() { - return new StaticContext(this); + public Builder functionResolver(@NonNull IFunctionResolver resolver) { + this.functionResolver = resolver; + return this; } - } - /** - * Provides a callback for resolving namespace prefixes. - */ - @FunctionalInterface - public interface EQNameResolver { /** - * Get the URI string for the provided namespace prefix. + * Construct a new static context using the information provided to the builder. * - * @param name - * the name to resolve - * @return the URI string or {@code null} if the prefix is unbound - * @throws StaticMetapathError - * with the code {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if - * a non-empty prefix is provided + * @return the new static context */ @NonNull - IEnhancedQName resolve(@NonNull String name); + public StaticContext build() { + return new StaticContext(this); + } } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java index 667308805..1cf08b05a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java @@ -381,7 +381,7 @@ protected IExpression handleFunctioncall(Metapath10.FunctioncallContext ctx) { .collect(Collectors.toUnmodifiableList())); return new StaticFunctionCall( - () -> getContext().lookupFunction( + getContext().lookupFunction( ObjectUtils.notNull(ctx.eqname().getText()), arguments.size()), arguments); @@ -1230,7 +1230,7 @@ protected IExpression handleArrowexpr(Metapath10.ArrowexprContext context) { if (arrowCtx.eqname() != null) { // named function return new StaticFunctionCall( - () -> getContext().lookupFunction(ObjectUtils.notNull(arrowCtx.eqname().getText()), arguments.size()), + getContext().lookupFunction(ObjectUtils.notNull(arrowCtx.eqname().getText()), arguments.size()), arguments); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java index 24348fc9a..f9661979e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java @@ -13,11 +13,9 @@ import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; -import java.util.function.Supplier; import java.util.stream.Collectors; import edu.umd.cs.findbugs.annotations.NonNull; -import nl.talsmasoftware.lazy4j.Lazy; /** * Executes a function call based on the provided function and multiple argument @@ -31,26 +29,22 @@ * Static functions are resolved during the parsing phase and must exist in the * function registry. */ -// FIXME: Change compilation to error when a non-existant function is called. -// Manage this error where the compilation is requested public class StaticFunctionCall implements IExpression { @NonNull - private final Lazy functionSupplier; + private final IFunction function; @NonNull private final List arguments; /** * Construct a new function call expression. * - * @param functionSupplier - * the function supplier, which is used to lazy fetch the function - * allowing the containing Metapaths to parse even if a function does - * not exist during the parsing phase. + * @param function + * the function implementation * @param arguments * the expressions used to provide arguments to the function call */ - public StaticFunctionCall(@NonNull Supplier functionSupplier, @NonNull List arguments) { - this.functionSupplier = ObjectUtils.notNull(Lazy.lazy(functionSupplier)); + public StaticFunctionCall(@NonNull IFunction function, @NonNull List arguments) { + this.function = function; this.arguments = arguments; } @@ -64,13 +58,6 @@ public StaticFunctionCall(@NonNull Supplier functionSupplier, @NonNul */ @NonNull public IFunction getFunction() { - IFunction function = functionSupplier.get(); - if (function == null) { - throw new StaticMetapathError( - StaticMetapathError.NO_FUNCTION_MATCH, - String.format( - "No matching function found for the given name and arguments")); - } return function; } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java index 3e32bf474..644856031 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java @@ -16,7 +16,7 @@ import edu.umd.cs.findbugs.annotations.NonNull; import nl.talsmasoftware.lazy4j.Lazy; -public final class FunctionService { +public final class FunctionService implements IFunctionResolver { private static final Lazy INSTANCE = Lazy.lazy(FunctionService::new); @NonNull private final ServiceLoader loader; @@ -28,7 +28,8 @@ public final class FunctionService { * * @return the service instance */ - public static FunctionService getInstance() { + @NonNull + public static FunctionService instance() { return INSTANCE.get(); } @@ -75,20 +76,7 @@ public Stream stream() { return getLibrary().stream(); } - /** - * Retrieve the function with the provided name that supports the signature of - * the provided methods, if such a function exists. - * - * @param name - * the name of a group of functions - * @param arity - * the count of arguments for use in determining an argument signature - * match - * @return the matching function or {@code null} if no match exists - * @throws StaticMetapathError - * with the code {@link StaticMetapathError#NO_FUNCTION_MATCH} if a - * matching function was not found - */ + @Override @NonNull public IFunction getFunction(@NonNull IEnhancedQName name, int arity) { IFunction retval = getLibrary().getFunction(name, arity); diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionResolver.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionResolver.java new file mode 100644 index 000000000..c0e6c0efa --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionResolver.java @@ -0,0 +1,31 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.function; + +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; +import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; + +import edu.umd.cs.findbugs.annotations.NonNull; + +@FunctionalInterface +public interface IFunctionResolver { + /** + * Retrieve the function with the provided name that supports the signature of + * the provided methods, if such a function exists. + * + * @param name + * the name of a group of functions + * @param arity + * the count of arguments for use in determining an argument signature + * match + * @return the matching function or {@code null} if no match exists + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#NO_FUNCTION_MATCH} if a + * matching function was not found + */ + @NonNull + IFunction getFunction(@NonNull IEnhancedQName name, int arity); +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/LazyCompilationMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/LazyCompilationMetapathExpression.java new file mode 100644 index 000000000..0336f215b --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/LazyCompilationMetapathExpression.java @@ -0,0 +1,69 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.impl; + +import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; + +import edu.umd.cs.findbugs.annotations.NonNull; +import nl.talsmasoftware.lazy4j.Lazy; + +/** + * An implementation of a Metapath expression that is compiled when evaluated. + *

+ * Lazy compilation may cause additional {@link MetapathException} errors at + * evaluation time, since compilation errors are not raised until evaluation. + */ +public class LazyCompilationMetapathExpression implements IMetapathExpression { + @NonNull + private final String path; + @NonNull + private final StaticContext staticContext; + @NonNull + private final Lazy compiledMetapath; + + /** + * Construct a new lazy-compiled Metapath expression. + * + * @param path + * the metapath expression + * @param staticContext + * the static evaluation context + */ + public LazyCompilationMetapathExpression( + @NonNull String path, + @NonNull StaticContext staticContext) { + this.path = path; + this.staticContext = staticContext; + this.compiledMetapath = ObjectUtils.notNull(Lazy.lazy(() -> IMetapathExpression.compile(path, staticContext))); + } + + @Override + public String getPath() { + return path; + } + + @Override + public StaticContext getStaticContext() { + return staticContext; + } + + @NonNull + private IMetapathExpression getCompiledMetapath() { + return ObjectUtils.notNull(compiledMetapath.get()); + } + + @Override + public ISequence evaluate(IItem focus, DynamicContext dynamicContext) { + return getCompiledMetapath().evaluate(focus, dynamicContext); + } + +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java index 064fef29d..4ce05df08 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java @@ -6,7 +6,6 @@ package gov.nist.secauto.metaschema.core.metapath.type.impl; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.StaticContext.EQNameResolver; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; @@ -18,6 +17,7 @@ import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; +import gov.nist.secauto.metaschema.core.qname.IEnhancedQName.PrefixToNamespaceResolver; import edu.umd.cs.findbugs.annotations.NonNull; @@ -100,7 +100,7 @@ public static boolean derivesFrom( private static boolean compareDefinition( @NonNull IDefinition definition, @NonNull String expected, - @NonNull EQNameResolver nameResolver) { + @NonNull PrefixToNamespaceResolver nameResolver) { boolean retval; try { IEnhancedQName expectedName = nameResolver.resolve(expected); @@ -135,5 +135,4 @@ private static boolean compareAtomicTypes( private DynamicTypeSupport() { // disable construction } - } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java index acd3a89ff..9323a9a23 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java @@ -93,7 +93,9 @@ private static void applyConstraints( for (ITargetedConstraints targeted : set.getTargetedConstraintsForModule(module)) { // apply targeted constraints String targetExpression = targeted.getTargetExpression(); - IMetapathExpression metapath = IMetapathExpression.compile(targetExpression, dynamicContext.getStaticContext()); + IMetapathExpression metapath = IMetapathExpression.lazyCompile( + targetExpression, + dynamicContext.getStaticContext()); ISequence items = metapath.evaluate(moduleItem, dynamicContext); assert items != null; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java index 45301770e..b424d021b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java @@ -95,7 +95,7 @@ public String generateMessage(@NonNull INodeItem item, @NonNull DynamicContext c return ObjectUtils.notNull(ReplacementScanner.replaceTokens(message, METAPATH_VALUE_TEMPLATE_PATTERN, match -> { String metapath = ObjectUtils.notNull(match.group(2)); - IMetapathExpression expr = IMetapathExpression.compile(metapath, context.getStaticContext()); + IMetapathExpression expr = IMetapathExpression.lazyCompile(metapath, context.getStaticContext()); return expr.evaluateAs(item, IMetapathExpression.ResultType.STRING, context); }).toString()); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ModelFactory.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ModelFactory.java index 73d0b9c05..b7eb4a81a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ModelFactory.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/ModelFactory.java @@ -70,7 +70,7 @@ private static IMetapathExpression target( @NonNull ISource source) { return target == null ? IConstraint.DEFAULT_TARGET_METAPATH - : IMetapathExpression.compile(target, source.getStaticContext()); + : IMetapathExpression.lazyCompile(target, source.getStaticContext()); } @NonNull @@ -277,7 +277,9 @@ private static void buildKeyFields( @NonNull ISource source) { for (KeyConstraintType.KeyField xmlKeyField : xmlObject.getKeyFieldList()) { IKeyField keyField = IKeyField.of( - IMetapathExpression.compile(ObjectUtils.requireNonNull(xmlKeyField.getTarget()), source.getStaticContext()), + IMetapathExpression.lazyCompile( + ObjectUtils.requireNonNull(xmlKeyField.getTarget()), + source.getStaticContext()), xmlKeyField.isSetPattern() ? xmlKeyField.getPattern() : null, // NOPMD - intentional xmlKeyField.isSetRemarks() ? remarks(ObjectUtils.notNull(xmlKeyField.getRemarks())) : null); builder.keyField(keyField); @@ -510,7 +512,7 @@ public static ILet newLet( StaticContext staticContext = source.getStaticContext(); return ILet.of( staticContext.parseVariableName(ObjectUtils.requireNonNull(xmlObject.getVar())), - IMetapathExpression.compile(ObjectUtils.notNull(xmlObject.getExpression()), staticContext), + IMetapathExpression.lazyCompile(ObjectUtils.notNull(xmlObject.getExpression()), staticContext), source, xmlObject.isSetRemarks() ? remarks(ObjectUtils.notNull(xmlObject.getRemarks())) diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/IEnhancedQName.java b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/IEnhancedQName.java index 968749035..34a147215 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/IEnhancedQName.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/IEnhancedQName.java @@ -6,6 +6,7 @@ package gov.nist.secauto.metaschema.core.qname; import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.net.URI; @@ -131,6 +132,14 @@ static IEnhancedQName of(@NonNull String namespace, @NonNull String localName) { return EQNameFactory.instance().newQName(namespace, localName); } + /** + * Generate a qualified name for this QName, use a well-known prefix, or by + * prepending the namespace if no prefix can be resolved. + * + * @param resolver + * the resolver to use to lookup the prefix + * @return the extended qualified-name + */ @NonNull default String toEQName() { return toEQName((NamespaceToPrefixResolver) null); @@ -147,13 +156,21 @@ default String toEQName() { @NonNull default String toEQName(@Nullable NamespaceToPrefixResolver resolver) { String namespace = getNamespace(); - String prefix = namespace.isEmpty() ? null : StaticContext.getWellKnownPrefixForUri(namespace); + String prefix = namespace.isEmpty() ? null : WellKnown.getWellKnownPrefixForUri(namespace); if (prefix == null && resolver != null) { prefix = resolver.resolve(namespace); } return toEQName(namespace, getLocalName(), prefix); } + /** + * Generate a qualified name for this QName, use a prefix provided by the static + * context, or by prepending the namespace if no prefix can be resolved. + * + * @param staticContext + * the static context to use to lookup the prefix + * @return the extended qualified-name + */ @NonNull default String toEQName(@NonNull StaticContext staticContext) { String namespace = getNamespace(); @@ -219,4 +236,23 @@ interface NamespaceToPrefixResolver { @Nullable String resolve(@NonNull String namespace); } + + /** + * Provides a callback for resolving namespace prefixes. + */ + @FunctionalInterface + public interface PrefixToNamespaceResolver { + /** + * Get the URI string for the provided namespace prefix. + * + * @param name + * the name to resolve + * @return the URI string or {@code null} if the prefix is unbound + * @throws StaticMetapathError + * with the code {@link StaticMetapathError#PREFIX_NOT_EXPANDABLE} if + * a non-empty prefix is provided + */ + @NonNull + IEnhancedQName resolve(@NonNull String name); + } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/WellKnown.java b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/WellKnown.java new file mode 100644 index 000000000..5c8df97f1 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/WellKnown.java @@ -0,0 +1,110 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.qname; + +import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.util.CollectionUtil; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; + +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; +import java.util.stream.Collectors; + +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; + +public final class WellKnown { + @NonNull + private static final Map WELL_KNOWN_NAMESPACES; + @NonNull + private static final Map WELL_KNOWN_URI_TO_PREFIX; + + static { + Map knownNamespaces = new ConcurrentHashMap<>(); + knownNamespaces.put( + MetapathConstants.PREFIX_METAPATH, + MetapathConstants.NS_METAPATH); + knownNamespaces.put( + MetapathConstants.PREFIX_METAPATH_FUNCTIONS, + MetapathConstants.NS_METAPATH_FUNCTIONS); + knownNamespaces.put( + MetapathConstants.PREFIX_METAPATH_FUNCTIONS_MATH, + MetapathConstants.NS_METAPATH_FUNCTIONS_MATH); + knownNamespaces.put( + MetapathConstants.PREFIX_METAPATH_FUNCTIONS_ARRAY, + MetapathConstants.NS_METAPATH_FUNCTIONS_ARRAY); + knownNamespaces.put( + MetapathConstants.PREFIX_METAPATH_FUNCTIONS_MAP, + MetapathConstants.NS_METAPATH_FUNCTIONS_MAP); + WELL_KNOWN_NAMESPACES = CollectionUtil.unmodifiableMap(knownNamespaces); + + WELL_KNOWN_NAMESPACES.forEach( + (prefix, namespace) -> NamespaceCache.instance().indexOf(ObjectUtils.notNull(namespace))); + + WELL_KNOWN_URI_TO_PREFIX = ObjectUtils.notNull(WELL_KNOWN_NAMESPACES.entrySet().stream() + .collect(Collectors.toUnmodifiableMap( + (Function, ? extends String>) Entry::getValue, + Map.Entry::getKey, + (v1, v2) -> v1))); + } + + // /** + // * Get the mapping of prefix to namespace URI for all well-known namespaces + // * provided by default to the static context. + // * + // * @return the mapping of prefix to namespace URI for all well-known + // namespaces + // */ + // @SuppressFBWarnings("MS_EXPOSE_REP") + // public static Map getWellKnownNamespacesMap() { + // return WELL_KNOWN_NAMESPACES; + // } + // + // /** + // * Get the mapping of namespace URIs to prefixes for all well-known namespaces + // * provided by default to the static context. + // * + // * @return the mapping of namespace URI to prefix for all well-known + // namespaces + // */ + // @SuppressFBWarnings("MS_EXPOSE_REP") + // public static Map getWellKnownURIToPrefixMap() { + // return WELL_KNOWN_URI_TO_PREFIX; + // } + + /** + * Get the namespace prefix associated with the provided URI, if the URI is + * well-known. + * + * @param uri + * the URI to get the prefix for + * @return the prefix or {@code null} if the provided URI is not well-known + */ + @Nullable + public static String getWellKnownPrefixForUri(@NonNull String uri) { + return WELL_KNOWN_URI_TO_PREFIX.get(uri); + } + + /** + * Get the namespace associated with the provided prefix, if the prefix is + * well-known. + * + * @param prefix + * the prefix + * @return the URI associated with the prefix or {@code null} if the provided + * prefix is not well-known + */ + @Nullable + public static String getWellKnownUriForPrefix(@NonNull String prefix) { + return WELL_KNOWN_NAMESPACES.get(prefix); + } + + private WellKnown() { + // disable construction + } +} diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DeserializationFeature.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DeserializationFeature.java index c01766b92..e2a989bef 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DeserializationFeature.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DeserializationFeature.java @@ -11,7 +11,7 @@ import edu.umd.cs.findbugs.annotations.NonNull; @SuppressWarnings("PMD.DataClass") // not a data class -public final class DeserializationFeature +public class DeserializationFeature extends AbstractConfigurationFeature { public static final int YAML_CODEPOINT_LIMIT_DEFAULT = Integer.MAX_VALUE - 1; // 2 GB public static final int FORMAT_DETECTION_LOOKAHEAD = 32_768; // 2 GB @@ -55,7 +55,17 @@ public final class DeserializationFeature public static final DeserializationFeature FORMAT_DETECTION_LOOKAHEAD_LIMIT = new DeserializationFeature<>("format-detection-lookahead-limit", Integer.class, FORMAT_DETECTION_LOOKAHEAD); - private DeserializationFeature( + /** + * Construct a new deserialization feature. + * + * @param name + * the name of the feature + * @param valueClass + * the Java class of the feature's value + * @param defaultValue + * the default value for the feature + */ + protected DeserializationFeature( @NonNull String name, @NonNull Class valueClass, @NonNull V defaultValue) { diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/ConstraintFactory.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/ConstraintFactory.java index a10196782..26ebdc06f 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/ConstraintFactory.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/ConstraintFactory.java @@ -345,7 +345,7 @@ static ILet newLetExpression(@NonNull Let annotation, @NonNull ISource source) { : MarkupMultiline.fromMarkdown(remarkMarkdown); return ILet.of( source.getStaticContext().parseVariableName(annotation.name()), - IMetapathExpression.compile(annotation.target(), source.getStaticContext()), + IMetapathExpression.lazyCompile(annotation.target(), source.getStaticContext()), source, remarks); } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ConstraintBindingSupport.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ConstraintBindingSupport.java index d40ea5d9e..bcb096b6c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ConstraintBindingSupport.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ConstraintBindingSupport.java @@ -202,7 +202,7 @@ public static void parseLet( return ILet.of( staticContext.parseVariableName(ObjectUtils.requireNonNull(letObj.getVar())), - IMetapathExpression.compile( + IMetapathExpression.lazyCompile( ObjectUtils.requireNonNull(letObj.getExpression()), source.getStaticContext()), source, @@ -451,7 +451,7 @@ private static IMetapathExpression target( @NonNull ISource source) { return target == null ? IConstraint.DEFAULT_TARGET_METAPATH - : IMetapathExpression.compile(target, source.getStaticContext()); + : IMetapathExpression.lazyCompile(target, source.getStaticContext()); } @NonNull diff --git a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java index 754fd37a3..d03c42adc 100644 --- a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java +++ b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java @@ -10,10 +10,10 @@ import gov.nist.secauto.metaschema.cli.processor.ExitStatus; import gov.nist.secauto.metaschema.cli.processor.command.AbstractTerminalCommand; import gov.nist.secauto.metaschema.cli.processor.command.ICommandExecutor; -import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.function.FunctionService; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.qname.WellKnown; import org.apache.commons.cli.CommandLine; import org.apache.logging.log4j.LogManager; @@ -72,22 +72,20 @@ protected ExitStatus executeCommand( @NonNull CallingContext callingContext, @NonNull CommandLine cmdLine) { - Map>> namespaceToNameToFunctionMap = FunctionService.getInstance().stream() + Map>> namespaceToNameToFunctionMap = FunctionService.instance().stream() .collect(Collectors.groupingBy( function -> function.getQName().getNamespace(), Collectors.groupingBy( IFunction::getName, Collectors.toList()))); - Map namespaceToPrefixMap = StaticContext.getWellKnownNamespacesMap().entrySet().stream() - .collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)); - List namespaces = new ArrayList<>(namespaceToNameToFunctionMap.keySet()); Collections.sort(namespaces); for (String namespace : namespaces) { - String prefix = namespaceToPrefixMap.get(namespace); + assert namespace != null; + String prefix = WellKnown.getWellKnownPrefixForUri(namespace); if (prefix == null) { LOGGER.atInfo().log("In namespace '{}':", namespace); From 2b3f9f69e7dce658991fa74178215ade35e8242a Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Mon, 2 Dec 2024 13:41:25 -0500 Subject: [PATCH 08/11] Enabled tests that now work with lazy Metapath compilation. --- .../metaschema/databind/codegen/BasicMetaschemaTest.java | 2 -- .../secauto/metaschema/databind/codegen/GenerationTest.java | 2 -- .../metaschema/databind/io/MetaschemaModuleMetaschemaTest.java | 1 - .../gov/nist/secauto/metaschema/schemagen/XmlSuiteTest.java | 1 - 4 files changed, 6 deletions(-) diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java index c26a11f54..872a19882 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java @@ -26,7 +26,6 @@ import gov.nist.secauto.metaschema.databind.io.BindingException; import gov.nist.secauto.metaschema.databind.model.metaschema.IBindingMetaschemaModule; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.platform.commons.util.ReflectionUtils; @@ -181,7 +180,6 @@ void testLocalDefinitionsMetaschema() ObjectUtils.notNull(generationDir)); } - @Disabled @Test void testExistsWithVariable() throws IOException, URISyntaxException, MetaschemaException { IBindingContext bindingContext = newBindingContext(); diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/GenerationTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/GenerationTest.java index f7ed3be37..49d73f25b 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/GenerationTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/GenerationTest.java @@ -15,7 +15,6 @@ import gov.nist.secauto.metaschema.databind.model.metaschema.IBindingMetaschemaModule; import gov.nist.secauto.metaschema.databind.model.metaschema.IBindingModuleLoader; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -24,7 +23,6 @@ public class GenerationTest extends AbstractMetaschemaTest { - @Disabled @Test void testOscalBindingModuleLoader() throws MetaschemaException, IOException { IBindingContext bindingContext = newBindingContext(); diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/MetaschemaModuleMetaschemaTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/MetaschemaModuleMetaschemaTest.java index dc843b20c..490b11e26 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/MetaschemaModuleMetaschemaTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/MetaschemaModuleMetaschemaTest.java @@ -93,7 +93,6 @@ void testModuleLoader() throws MetaschemaException, IOException { assertNotNull(module); } - @Disabled @Test void testOscalBindingModuleLoader() throws MetaschemaException, IOException { IBindingModuleLoader loader = newBindingContext().newModuleLoader(); diff --git a/schemagen/src/test/java/gov/nist/secauto/metaschema/schemagen/XmlSuiteTest.java b/schemagen/src/test/java/gov/nist/secauto/metaschema/schemagen/XmlSuiteTest.java index 8b49e20a4..50997b737 100644 --- a/schemagen/src/test/java/gov/nist/secauto/metaschema/schemagen/XmlSuiteTest.java +++ b/schemagen/src/test/java/gov/nist/secauto/metaschema/schemagen/XmlSuiteTest.java @@ -151,7 +151,6 @@ void testLocalDeclarations() throws IOException, MetaschemaException { // NOPMD "global-and-local"); } - @Disabled @Test void testLiboscalJavaIssue181() throws IOException, MetaschemaException, XMLStreamException, JDOMException { IBindingContext bindingContext = newBindingContext(); From f138ecbdc611e804d8810db607f5886a898e2fdd Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Mon, 2 Dec 2024 21:31:47 -0500 Subject: [PATCH 09/11] Continued to refactor the Metapath runtime exception hierarchy. Created a RuntimeMetapathError exception class that all runtime exceptions are now children of. Moved function-related exceptions to their own branch in the Metapath runtime error tree. --- .../core/metapath/DynamicMetapathError.java | 42 +-------- .../core/metapath/IMetapathExpression.java | 10 +- .../core/metapath/RuntimeMetapathError.java | 92 +++++++++++++++++++ .../core/metapath/StaticMetapathError.java | 58 +----------- .../core/metapath/cst/AbstractExpression.java | 8 +- .../function/ArithmeticFunctionException.java | 3 +- .../function/DateTimeFunctionException.java | 3 +- .../function/DocumentFunctionException.java | 3 +- .../function/FunctionMetapathError.java | 62 +++++++++++++ .../metapath/function/FunctionService.java | 2 +- .../core/metapath/function/FunctionUtils.java | 14 +-- .../InvalidArgumentFunctionException.java | 3 +- .../InvalidTypeFunctionException.java | 3 +- .../function/JsonFunctionException.java | 3 +- .../function/UriFunctionException.java | 3 +- .../metapath/impl/MetapathExpression.java | 2 +- .../core/metapath/item/ISequence.java | 26 +++--- .../core/metapath/item/ItemUtils.java | 12 +-- .../function/impl/ArrayMetapathException.java | 4 +- .../metapath/type/IAtomicOrUnionType.java | 2 +- .../type/InvalidTypeMetapathException.java | 4 +- ...hException.java => TypeMetapathError.java} | 15 +-- .../metaschema/core/qname/IEnhancedQName.java | 2 +- 23 files changed, 220 insertions(+), 156 deletions(-) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/RuntimeMetapathError.java create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionMetapathError.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/{TypeMetapathException.java => TypeMetapathError.java} (85%) diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathError.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathError.java index bbfb3c8c3..e19791f3c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathError.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicMetapathError.java @@ -6,24 +6,18 @@ package gov.nist.secauto.metaschema.core.metapath; import edu.umd.cs.findbugs.annotations.NonNull; -import edu.umd.cs.findbugs.annotations.Nullable; /** * This Metapath exception base class is used for all exceptions that have a * defined error code family and value. */ public class DynamicMetapathError - extends MetapathException { + extends RuntimeMetapathError { /** * the serial version UID. */ private static final long serialVersionUID = 1L; - /** - * The error prefix which identifies what kind of error it is. - */ - @NonNull - private final IErrorCode errorCode; /** * Constructs a new Metapath exception with the provided {@code code}, @@ -35,8 +29,7 @@ public class DynamicMetapathError * the exception message */ public DynamicMetapathError(@NonNull IErrorCode errorCode, String message) { - super(message); - this.errorCode = errorCode; + super(errorCode, message); } /** @@ -51,8 +44,7 @@ public DynamicMetapathError(@NonNull IErrorCode errorCode, String message) { * the original exception cause */ protected DynamicMetapathError(@NonNull IErrorCode errorCode, String message, Throwable cause) { - super(message, cause); - this.errorCode = errorCode; + super(errorCode, message, cause); } /** @@ -65,32 +57,6 @@ protected DynamicMetapathError(@NonNull IErrorCode errorCode, String message, Th * the original exception cause */ public DynamicMetapathError(@NonNull IErrorCode errorCode, Throwable cause) { - super(cause); - this.errorCode = errorCode; - } - - @Override - public final String getMessage() { - String message = getMessageText(); - return String.format("%s%s", getErrorCode().toString(), message == null ? "" : ": " + message); - } - - /** - * Get the message text without the error code prefix. - * - * @return the message text or {@code null} - */ - @Nullable - public final String getMessageText() { - return super.getMessage(); - } - - /** - * Get the error code, which indicates what type of error it is. - * - * @return the error code - */ - public final IErrorCode getErrorCode() { - return errorCode; + super(errorCode, cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java index 0e3ccc360..d51e756ac 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java @@ -14,7 +14,7 @@ import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigDecimal; @@ -82,7 +82,7 @@ public Class expectedClass() { * @param sequence * the Metapath result sequence to convert * @return the converted sequence as the expected type - * @throws TypeMetapathException + * @throws TypeMetapathError * if the provided sequence is incompatible with the expected result * type */ @@ -188,7 +188,7 @@ static IMetapathExpression lazyCompile(@NonNull String path, @NonNull StaticCont * @param resultType * the type of result to produce * @return the converted result - * @throws TypeMetapathException + * @throws TypeMetapathError * if the provided sequence is incompatible with the requested result * type * @throws MetapathException @@ -212,7 +212,7 @@ default T evaluateAs(@NonNull ResultType resultType) { * @param resultType * the type of result to produce * @return the converted result - * @throws TypeMetapathException + * @throws TypeMetapathError * if the provided sequence is incompatible with the requested result * type * @throws MetapathException @@ -243,7 +243,7 @@ default T evaluateAs( * @param dynamicContext * the dynamic context to use for evaluation * @return the converted result - * @throws TypeMetapathException + * @throws TypeMetapathError * if the provided sequence is incompatible with the requested result * type * @throws MetapathException diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/RuntimeMetapathError.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/RuntimeMetapathError.java new file mode 100644 index 000000000..28aac62b9 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/RuntimeMetapathError.java @@ -0,0 +1,92 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath; + +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; + +public class RuntimeMetapathError + extends MetapathException { + + /** + * the serial version UID. + */ + private static final long serialVersionUID = 1L; + /** + * The error prefix which identifies what kind of error it is. + */ + @NonNull + private final IErrorCode errorCode; + + /** + * Constructs a new Metapath exception with the provided {@code code}, + * {@code message}, and no cause. + * + * @param errorCode + * the error code that identifies the type of error + * @param message + * the exception message + */ + public RuntimeMetapathError(@NonNull IErrorCode errorCode, String message) { + super(message); + this.errorCode = errorCode; + } + + /** + * Constructs a new Metapath exception with the provided {@code code}, + * {@code message}, and {@code cause}. + * + * @param errorCode + * the error code that identifies the type of error + * @param message + * the exception message + * @param cause + * the original exception cause + */ + public RuntimeMetapathError(@NonNull IErrorCode errorCode, String message, Throwable cause) { + super(message, cause); + this.errorCode = errorCode; + } + + /** + * Constructs a new Metapath exception with a {@code null} message and the + * provided {@code cause}. + * + * @param errorCode + * the error code that identifies the type of error + * @param cause + * the original exception cause + */ + public RuntimeMetapathError(@NonNull IErrorCode errorCode, Throwable cause) { + super(cause); + this.errorCode = errorCode; + } + + @Override + public final String getMessage() { + String message = getMessageText(); + return String.format("%s%s", getErrorCode().toString(), message == null ? "" : ": " + message); + } + + /** + * Get the message text without the error code prefix. + * + * @return the message text or {@code null} + */ + @Nullable + public final String getMessageText() { + return super.getMessage(); + } + + /** + * Get the error code, which indicates what type of error it is. + * + * @return the error code + */ + public final IErrorCode getErrorCode() { + return errorCode; + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java index 867251b7b..0de775cb7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticMetapathError.java @@ -6,7 +6,6 @@ package gov.nist.secauto.metaschema.core.metapath; import edu.umd.cs.findbugs.annotations.NonNull; -import edu.umd.cs.findbugs.annotations.Nullable; /** * MPST: Exceptions related to the Metapath static context and static @@ -14,7 +13,7 @@ */ @SuppressWarnings("PMD.DataClass") public class StaticMetapathError - extends MetapathException { + extends RuntimeMetapathError { @NonNull private static final String PREFIX = "MPST"; /** @@ -125,11 +124,6 @@ public class StaticMetapathError * the serial version UID. */ private static final long serialVersionUID = 2L; - /** - * The error prefix which identifies what kind of error it is. - */ - @NonNull - private final IErrorCode errorCode; /** * Constructs a new exception with the provided {@code code}, {@code message}, @@ -143,23 +137,7 @@ public class StaticMetapathError * the original exception cause */ public StaticMetapathError(int code, String message, Throwable cause) { - this(IErrorCode.of(PREFIX, code), message, cause); - } - - /** - * Constructs a new exception with the provided {@code code}, {@code message}, - * and {@code cause}. - * - * @param errorCode - * the error code - * @param message - * the exception message - * @param cause - * the original exception cause - */ - public StaticMetapathError(@NonNull IErrorCode errorCode, String message, Throwable cause) { - super(message, cause); - this.errorCode = errorCode; + super(IErrorCode.of(PREFIX, code), message, cause); } /** @@ -172,8 +150,7 @@ public StaticMetapathError(@NonNull IErrorCode errorCode, String message, Throwa * the exception message */ public StaticMetapathError(int code, String message) { - super(message); - this.errorCode = IErrorCode.of(PREFIX, code); + super(IErrorCode.of(PREFIX, code), message); } /** @@ -186,33 +163,6 @@ public StaticMetapathError(int code, String message) { * the original exception cause */ public StaticMetapathError(int code, Throwable cause) { - super(cause); - this.errorCode = IErrorCode.of(PREFIX, code); - } - - @Override - public final String getMessage() { - String message = getMessageText(); - return String.format("%s%s", getErrorCode().toString(), message == null ? "" : ": " + message); - } - - /** - * Get the message text without the error code prefix. - * - * @return the message text or {@code null} - */ - @Nullable - public final String getMessageText() { - return super.getMessage(); - } - - /** - * Get the error code, which indicates what type of error it is. - * - * @return the error code - */ - @NonNull - public final IErrorCode getErrorCode() { - return errorCode; + super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java index c1cce8dc6..945c6da3b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; @@ -20,10 +20,10 @@ public abstract class AbstractExpression implements IExpression { * @param sequence * the sequence to get the data item from * @param requireSingleton - * if {@code true} then a {@link TypeMetapathException} is thrown if - * the sequence contains more than one item + * if {@code true} then a {@link TypeMetapathError} is thrown if the + * sequence contains more than one item * @return {@code null} if the sequence is empty, or the item otherwise - * @throws TypeMetapathException + * @throws TypeMetapathError * if the sequence contains more than one item and requireSingleton is * {@code true}, or if the data item cannot be cast */ diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java index b9a3590cd..ce03473f0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArithmeticFunctionException.java @@ -5,7 +5,6 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; @@ -14,7 +13,7 @@ * Represents an error that occurred while performing mathematical operations. */ public class ArithmeticFunctionException - extends DynamicMetapathError { + extends FunctionMetapathError { @NonNull private static final String PREFIX = "FOAR"; /** diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java index cfd470895..a39b9a4b9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DateTimeFunctionException.java @@ -5,7 +5,6 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; @@ -14,7 +13,7 @@ * FODT: Exceptions related to Date/Time/Duration errors. */ public class DateTimeFunctionException - extends DynamicMetapathError { + extends FunctionMetapathError { @NonNull private static final String PREFIX = "FODT"; /** diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java index 6f1eb3311..c473d47b2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DocumentFunctionException.java @@ -5,7 +5,6 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import gov.nist.secauto.metaschema.core.metapath.function.library.FnDoc; @@ -15,7 +14,7 @@ * FODC: Exceptions representing document related errors. */ public class DocumentFunctionException - extends DynamicMetapathError { + extends FunctionMetapathError { @NonNull private static final String PREFIX = "FODC"; /** diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionMetapathError.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionMetapathError.java new file mode 100644 index 000000000..a69be92b9 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionMetapathError.java @@ -0,0 +1,62 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.function; + +import gov.nist.secauto.metaschema.core.metapath.IErrorCode; +import gov.nist.secauto.metaschema.core.metapath.RuntimeMetapathError; + +import edu.umd.cs.findbugs.annotations.NonNull; + +public class FunctionMetapathError + extends RuntimeMetapathError { + + /** + * the serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * Constructs a new Metapath exception with the provided {@code code}, + * {@code message}, and no cause. + * + * @param errorCode + * the error code that identifies the type of error + * @param message + * the exception message + */ + public FunctionMetapathError(@NonNull IErrorCode errorCode, String message) { + super(errorCode, message); + } + + /** + * Constructs a new Metapath exception with the provided {@code code}, + * {@code message}, and {@code cause}. + * + * @param errorCode + * the error code that identifies the type of error + * @param message + * the exception message + * @param cause + * the original exception cause + */ + protected FunctionMetapathError(@NonNull IErrorCode errorCode, String message, Throwable cause) { + super(errorCode, message, cause); + } + + /** + * Constructs a new Metapath exception with a {@code null} message and the + * provided {@code cause}. + * + * @param errorCode + * the error code that identifies the type of error + * @param cause + * the original exception cause + */ + public FunctionMetapathError(@NonNull IErrorCode errorCode, Throwable cause) { + super(errorCode, cause); + } + +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java index 644856031..b96c76f81 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java @@ -30,7 +30,7 @@ public final class FunctionService implements IFunctionResolver { */ @NonNull public static FunctionService instance() { - return INSTANCE.get(); + return ObjectUtils.notNull(INSTANCE.get()); } /** diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java index ae6851155..aedcc2886 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java @@ -11,7 +11,7 @@ import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigInteger; @@ -97,11 +97,11 @@ public static long asLong(@NonNull BigInteger value) { * @param sequence * a Metapath sequence containing the value to convert * @param requireSingleton - * if {@code true} then a {@link TypeMetapathException} is thrown if - * the sequence contains more than one item + * if {@code true} then a {@link TypeMetapathError} is thrown if the + * sequence contains more than one item * @return the numeric item value, or {@code null} if the result is an empty * sequence - * @throws TypeMetapathException + * @throws TypeMetapathError * if the sequence contains more than one item, or the item cannot be * cast to a numeric value * @@ -118,7 +118,7 @@ public static INumericItem toNumeric(@NonNull ISequence sequence, boolean req * @param item * the value to convert * @return the numeric item value - * @throws TypeMetapathException + * @throws TypeMetapathError * if the sequence contains more than one item, or the item cannot be * cast to a numeric value */ @@ -138,7 +138,7 @@ public static INumericItem toNumeric(@NonNull IItem item) { * @param item * the value to convert * @return the numeric item value - * @throws TypeMetapathException + * @throws TypeMetapathError * if the item cannot be cast to a numeric value */ @NonNull @@ -157,7 +157,7 @@ public static INumericItem toNumeric(@NonNull IAnyAtomicItem item) { * @param item * the value to convert * @return the numeric item value - * @throws TypeMetapathException + * @throws TypeMetapathError * if the item cannot be cast to a numeric value */ @Nullable diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java index 324e4965e..8c7fab799 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidArgumentFunctionException.java @@ -5,7 +5,6 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; @@ -14,7 +13,7 @@ * FORG: Exceptions related to argument types. */ public class InvalidArgumentFunctionException - extends DynamicMetapathError { + extends FunctionMetapathError { @NonNull private static final String PREFIX = "FORG"; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java index 8f5ecd53e..bf35f11e5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java @@ -5,7 +5,6 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import gov.nist.secauto.metaschema.core.metapath.item.IItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; @@ -18,7 +17,7 @@ * FOTY: Exceptions related to type errors. */ public class InvalidTypeFunctionException - extends DynamicMetapathError { + extends FunctionMetapathError { @NonNull private static final String PREFIX = "FOTY"; /** diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java index bd99030bb..3f9481ba0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/JsonFunctionException.java @@ -5,13 +5,12 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import edu.umd.cs.findbugs.annotations.NonNull; public class JsonFunctionException - extends DynamicMetapathError { + extends FunctionMetapathError { @NonNull private static final String PREFIX = "FOJS"; /** diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java index a979b2503..d0d993796 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/UriFunctionException.java @@ -5,7 +5,6 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import gov.nist.secauto.metaschema.core.metapath.function.library.FnResolveUri; @@ -15,7 +14,7 @@ * FONS: Exceptions related to function namespaces. */ public class UriFunctionException - extends DynamicMetapathError { + extends FunctionMetapathError { @NonNull private static final String PREFIX = "FONS"; /** diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java index 45cf3f2be..6ed842c60 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java @@ -91,7 +91,7 @@ public static MetapathExpression compile(@NonNull String path, @NonNull StaticCo } catch (StaticMetapathError ex) { String message = ex.getMessageText(); throw new StaticMetapathError( - ex.getErrorCode(), + ex.getErrorCode().getCode(), String.format("Unable to compile path '%s'.%s", path, message == null ? "" : " " + message), ex); } catch (MetapathException | ParseCancellationException ex) { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java index feb413e74..7e3a3e5d5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java @@ -12,7 +12,7 @@ import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -77,17 +77,17 @@ default Iterator iterator() { *

* If the sequence is empty, a {@code null} result is returned. If * requireSingleton is {@code true} and the sequence contains more than one - * item, a {@link TypeMetapathException} is thrown. + * item, a {@link TypeMetapathError} is thrown. * * @param * the item type to return derived from the provided sequence * @param items * the sequence to retrieve the first item from * @param requireSingleton - * if {@code true} then a {@link TypeMetapathException} is thrown if - * the sequence contains more than one item + * if {@code true} then a {@link TypeMetapathError} is thrown if the + * sequence contains more than one item * @return {@code null} if the sequence is empty, or the item otherwise - * @throws TypeMetapathException + * @throws TypeMetapathError * if the sequence contains more than one item and requireSingleton is * {@code true} */ @@ -100,17 +100,17 @@ static T getFirstItem(@NonNull ISequence items, boolean req *

* If the sequence is empty, a {@code null} result is returned. If * requireSingleton is {@code true} and the sequence contains more than one - * item, a {@link TypeMetapathException} is thrown. + * item, a {@link TypeMetapathError} is thrown. * * @param * the item type to return derived from the provided sequence * @param items * the sequence to retrieve the first item from * @param requireSingleton - * if {@code true} then a {@link TypeMetapathException} is thrown if - * the sequence contains more than one item + * if {@code true} then a {@link TypeMetapathError} is thrown if the + * sequence contains more than one item * @return {@code null} if the sequence is empty, or the item otherwise - * @throws TypeMetapathException + * @throws TypeMetapathError * if the sequence contains more than one item and requireSingleton is * {@code true} */ @@ -131,13 +131,13 @@ static T getFirstItem(@NonNull Stream items, boolean requir *

* If the sequence is empty, a {@code null} result is returned. If * requireSingleton is {@code true} and the sequence contains more than one - * item, a {@link TypeMetapathException} is thrown. + * item, a {@link TypeMetapathError} is thrown. * * @param requireSingleton - * if {@code true} then a {@link TypeMetapathException} is thrown if - * the sequence contains more than one item + * if {@code true} then a {@link TypeMetapathError} is thrown if the + * sequence contains more than one item * @return {@code null} if the sequence is empty, or the item otherwise - * @throws TypeMetapathException + * @throws TypeMetapathError * if the sequence contains more than one item and requireSingleton is * {@code true} */ diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java index de9e60155..cf9fc5b82 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java @@ -9,7 +9,7 @@ import gov.nist.secauto.metaschema.core.metapath.cst.path.Axis; import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentBasedNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; @@ -30,7 +30,7 @@ private ItemUtils() { * @param item * the item to check * @return the item cast to a {@link INodeItem} - * @throws TypeMetapathException + * @throws TypeMetapathError * if the item is {@code null} or not an {@link INodeItem} */ @NonNull @@ -45,11 +45,11 @@ private static T checkItemIsType(@Nullable IItem item, @NonNul } if (item == null) { - throw new TypeMetapathException(TypeMetapathException.NOT_A_NODE_ITEM_FOR_STEP, + throw new TypeMetapathError(TypeMetapathError.NOT_A_NODE_ITEM_FOR_STEP, "Item is null."); } - throw new TypeMetapathException(TypeMetapathException.NOT_A_NODE_ITEM_FOR_STEP, + throw new TypeMetapathError(TypeMetapathError.NOT_A_NODE_ITEM_FOR_STEP, String.format( "The item of type '%s' is not of the type '%s'.", item.getClass().getName(), @@ -78,7 +78,7 @@ public static ISequence getDocumentNodeItems(@NonNull IS * @param clazz * the Java class to check the item against * @return the item cast to the required class value - * @throws TypeMetapathException + * @throws TypeMetapathError * if the item is {@code null} or does not match the type specified by * {@code clazz} */ @@ -89,7 +89,7 @@ public static TYPE checkItemType(@NonNull IItem item, @NonNull Class other) { * cast to this type * @throws InvalidValueForCastFunctionException * if the provided {@code item} cannot be cast to this type - * @throws TypeMetapathException + * @throws TypeMetapathError * if the sequence contains more than one item */ @Nullable diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/InvalidTypeMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/InvalidTypeMetapathException.java index 96a61f4e3..56d273d44 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/InvalidTypeMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/InvalidTypeMetapathException.java @@ -12,10 +12,10 @@ /** * Provides a convenient way to raise a - * {@link TypeMetapathException#INVALID_TYPE_ERROR}. + * {@link TypeMetapathError#INVALID_TYPE_ERROR}. */ public class InvalidTypeMetapathException - extends TypeMetapathException { + extends TypeMetapathError { /** * the serial version UID. diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathError.java similarity index 85% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathError.java index 1203fe1da..83f6ded85 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathError.java @@ -5,16 +5,16 @@ package gov.nist.secauto.metaschema.core.metapath.type; -import gov.nist.secauto.metaschema.core.metapath.DynamicMetapathError; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; +import gov.nist.secauto.metaschema.core.metapath.RuntimeMetapathError; import edu.umd.cs.findbugs.annotations.NonNull; /** * MPTY: Exceptions related to Metapath type errors. */ -public class TypeMetapathException - extends DynamicMetapathError { +public class TypeMetapathError + extends RuntimeMetapathError { @NonNull private static final String PREFIX = "MPTY"; /** @@ -42,7 +42,8 @@ public class TypeMetapathException */ public static final int BASE_PATH_NOT_A_SEQUENCE = 19; /** - * The context item is not a node when evaluating an axis step. + * err:MPTY0020: The + * context item is not a node when evaluating an axis step. */ public static final int NOT_A_NODE_ITEM_FOR_STEP = 20; @@ -62,7 +63,7 @@ public class TypeMetapathException * @param cause * the original exception cause */ - public TypeMetapathException(int code, String message, Throwable cause) { + public TypeMetapathError(int code, String message, Throwable cause) { super(IErrorCode.of(PREFIX, code), message, cause); } @@ -75,7 +76,7 @@ public TypeMetapathException(int code, String message, Throwable cause) { * @param message * the exception message */ - public TypeMetapathException(int code, String message) { + public TypeMetapathError(int code, String message) { super(IErrorCode.of(PREFIX, code), message); } @@ -88,7 +89,7 @@ public TypeMetapathException(int code, String message) { * @param cause * the original exception cause */ - public TypeMetapathException(int code, Throwable cause) { + public TypeMetapathError(int code, Throwable cause) { super(IErrorCode.of(PREFIX, code), cause); } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/IEnhancedQName.java b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/IEnhancedQName.java index 34a147215..1169fa737 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/IEnhancedQName.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/IEnhancedQName.java @@ -241,7 +241,7 @@ interface NamespaceToPrefixResolver { * Provides a callback for resolving namespace prefixes. */ @FunctionalInterface - public interface PrefixToNamespaceResolver { + interface PrefixToNamespaceResolver { /** * Get the URI string for the provided namespace prefix. * From 8bc977aeb80188b3b5c8d4aab11fdf368361dfe9 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Mon, 2 Dec 2024 23:02:26 -0500 Subject: [PATCH 10/11] Package reorganization to align all item related classes in the same package hierarchy. Similar with XML and JSON related classes. --- .../AbstractCustomJavaDataTypeAdapter.java | 4 +- .../datatype/AbstractDataTypeAdapter.java | 12 ++-- .../datatype/AbstractDataTypeProvider.java | 3 +- .../{adapter => }/AbstractIntegerAdapter.java | 7 +- .../{adapter => }/AbstractStringAdapter.java | 7 +- .../datatype/{adapter => }/Base64Adapter.java | 5 +- .../{adapter => }/BooleanAdapter.java | 5 +- .../core/datatype/DataTypeService.java | 8 +-- .../datatype/{adapter => }/DateAdapter.java | 5 +- .../datatype/{adapter => }/DateFormats.java | 2 +- .../{adapter => }/DateTimeAdapter.java | 5 +- .../{adapter => }/DateTimeWithTZAdapter.java | 5 +- .../{adapter => }/DateWithTZAdapter.java | 5 +- .../{adapter => }/DayTimeAdapter.java | 5 +- .../{adapter => }/DecimalAdapter.java | 5 +- .../{adapter => }/EmailAddressAdapter.java | 4 +- .../{adapter => }/HostnameAdapter.java | 4 +- .../core/datatype/IDataTypeAdapter.java | 4 +- .../core/datatype/IDataTypeProvider.java | 2 +- .../{adapter => }/IPv4AddressAdapter.java | 5 +- .../{adapter => }/IPv6AddressAdapter.java | 5 +- .../{adapter => }/IntegerAdapter.java | 4 +- .../MetaschemaDataTypeProvider.java | 5 +- .../datatype/{adapter => }/NcNameAdapter.java | 4 +- .../NonNegativeIntegerAdapter.java | 4 +- .../{adapter => }/PositiveIntegerAdapter.java | 4 +- .../datatype/{adapter => }/StringAdapter.java | 4 +- .../datatype/{adapter => }/TimeAdapter.java | 9 +-- .../{adapter => }/TimeWithTZAdapter.java | 9 +-- .../datatype/{adapter => }/TokenAdapter.java | 4 +- .../datatype/{adapter => }/UriAdapter.java | 5 +- .../{adapter => }/UriReferenceAdapter.java | 5 +- .../datatype/{adapter => }/UuidAdapter.java | 5 +- .../{adapter => }/YearMonthAdapter.java | 5 +- .../core/datatype/adapter/package-info.java | 16 ----- .../markup/AbstractMarkupAdapter.java | 4 +- .../markup/MarkupDataTypeProvider.java | 4 +- .../datatype/markup/MarkupLineAdapter.java | 3 +- .../markup/MarkupMultilineAdapter.java | 3 +- .../markup/{ => impl}/XmlMarkupParser.java | 6 +- .../core/datatype/package-info.java | 9 ++- .../{item => }/DefaultItemWriter.java | 12 ++-- .../core/metapath/DynamicContext.java | 3 +- .../metapath/{item => }/ICollectionValue.java | 8 +-- .../core/metapath/IDocumentLoader.java | 2 +- .../core/metapath/{item => }/IItem.java | 5 +- .../core/metapath/{type => }/IItemType.java | 39 +++++------ .../metapath/{item => }/IItemVisitor.java | 10 +-- .../core/metapath/{item => }/IItemWriter.java | 10 +-- .../core/metapath/IMetapathExpression.java | 8 +-- .../core/metapath/{item => }/ISequence.java | 8 +-- .../metapath/{type => }/ISequenceType.java | 5 +- .../InvalidTypeMetapathException.java | 4 +- .../core/metapath/{item => }/ItemUtils.java | 8 +-- .../core/metapath/{type => }/Occurrence.java | 5 +- .../core/metapath/StaticContext.java | 10 ++- .../{type => }/TypeMetapathError.java | 5 +- .../atomic/AbstractAnyAtomicItem.java | 2 +- .../atomic/AbstractAtomicItemBase.java | 2 +- .../AbstractAtomicOrUnionType.java | 5 +- .../atomic/AbstractUntypedAtomicItem.java | 6 +- .../{type => atomic}/DataTypeItemType.java | 3 +- .../{item => }/atomic/IAnyAtomicItem.java | 11 ++- .../{item => }/atomic/IAnyUriItem.java | 9 ++- .../{type => atomic}/IAtomicOrUnionType.java | 9 +-- .../{item => }/atomic/IAtomicValuedItem.java | 4 +- .../{item => }/atomic/IBase64BinaryItem.java | 9 ++- .../{item => }/atomic/IBooleanItem.java | 9 ++- .../metapath/{item => }/atomic/IDateItem.java | 9 ++- .../{item => }/atomic/IDateTimeItem.java | 9 ++- .../atomic/IDateTimeWithTimeZoneItem.java | 9 ++- .../atomic/IDateWithTimeZoneItem.java | 9 ++- .../atomic/IDayTimeDurationItem.java | 9 ++- .../{item => }/atomic/IDecimalItem.java | 9 ++- .../{item => }/atomic/IDurationItem.java | 5 +- .../{item => }/atomic/IEmailAddressItem.java | 9 ++- .../{item => }/atomic/IHostnameItem.java | 9 ++- .../{item => }/atomic/IIPAddressItem.java | 7 +- .../{item => }/atomic/IIPv4AddressItem.java | 9 ++- .../{item => }/atomic/IIPv6AddressItem.java | 9 ++- .../{item => }/atomic/IIntegerItem.java | 9 ++- .../{item => }/atomic/IMarkupItem.java | 5 +- .../{item => }/atomic/IMarkupLineItem.java | 7 +- .../atomic/IMarkupMultilineItem.java | 7 +- .../{item => }/atomic/INcNameItem.java | 9 ++- .../atomic/INonNegativeIntegerItem.java | 9 ++- .../{item => }/atomic/INumericItem.java | 7 +- .../atomic/IPositiveIntegerItem.java | 9 ++- .../{item => }/atomic/IStringItem.java | 9 ++- .../{item => }/atomic/ITemporalItem.java | 5 +- .../metapath/{item => }/atomic/ITimeItem.java | 9 ++- .../atomic/ITimeWithTimeZoneItem.java | 9 ++- .../{item => }/atomic/ITokenItem.java | 9 ++- .../{item => }/atomic/IUntypedAtomicItem.java | 2 +- .../{item => }/atomic/IUriReferenceItem.java | 9 ++- .../metapath/{item => }/atomic/IUuidItem.java | 9 ++- .../atomic/IYearMonthDurationItem.java | 9 ++- .../atomic/impl/AbstractDateItem.java | 4 +- .../atomic/impl/AbstractDateTimeItem.java | 4 +- .../atomic/impl/AbstractDecimalItem.java | 8 +-- .../atomic/impl/AbstractIPAddressItem.java | 8 +-- .../atomic/impl/AbstractIntegerItem.java | 4 +- .../atomic/impl/AbstractMarkupItem.java | 8 +-- .../atomic/impl/AbstractStringItem.java | 10 +-- .../atomic/impl/AbstractTemporalItem.java | 8 +-- .../atomic/impl/AbstractTimeItem.java | 8 +-- .../atomic/impl/AbstractUriItem.java | 10 +-- .../atomic/impl/AnyUriItemImpl.java | 6 +- .../atomic/impl/Base64BinaryItemImpl.java | 12 ++-- .../atomic/impl/BooleanItemImpl.java | 12 ++-- .../impl/DateTimeWithTimeZoneItemImpl.java | 8 +-- .../impl/DateTimeWithoutTimeZoneItemImpl.java | 6 +- .../atomic/impl/DateWithTimeZoneItemImpl.java | 8 +-- .../impl/DateWithoutTimeZoneItemImpl.java | 6 +- .../atomic/impl/DayTimeDurationItemImpl.java | 12 ++-- .../atomic/impl/DecimalItemImpl.java | 8 +-- .../atomic/impl/EmailAddressItemImpl.java | 8 +-- .../atomic/impl/HostnameItemImpl.java | 8 +-- .../atomic/impl/IPv4AddressItemImpl.java | 8 +-- .../atomic/impl/IPv6AddressItemImpl.java | 8 +-- .../atomic/impl/IntegerItemImpl.java | 6 +- .../atomic/impl/MarkupLineItemImpl.java | 4 +- .../atomic/impl/MarkupMultiLineItemImpl.java | 4 +- .../atomic/impl/NcNameItemImpl.java | 8 +-- .../impl/NonAdapterAtomicItemType.java | 6 +- .../impl/NonNegativeIntegerItemImpl.java | 8 +-- .../atomic/impl/PositiveIntegerItemImpl.java | 8 +-- .../atomic/impl/StringItemImpl.java | 6 +- .../atomic/impl/TimeWithTimeZoneItemImpl.java | 8 +-- .../impl/TimeWithoutTimeZoneItemImpl.java | 6 +- .../{item => }/atomic/impl/TokenItemImpl.java | 8 +-- .../{type => atomic}/impl/TypeConstants.java | 14 ++-- .../atomic/impl/UriReferenceItemImpl.java | 8 +-- .../{item => }/atomic/impl/UuidItemImpl.java | 16 ++--- .../impl/YearMonthDurationItemImpl.java | 12 ++-- .../{item => }/atomic/package-info.java | 2 +- .../core/metapath/cst/AbstractExpression.java | 6 +- .../cst/AbstractNamedInstanceExpression.java | 2 +- .../metapath/cst/AnonymousFunctionCall.java | 6 +- .../core/metapath/cst/BuildCSTVisitor.java | 17 +++-- .../metapath/cst/DynamicFunctionCall.java | 4 +- .../metaschema/core/metapath/cst/For.java | 4 +- .../metapath/cst/FunctionCallAccessor.java | 14 ++-- .../metapath/cst/ICstExpressionFactory.java | 2 +- .../core/metapath/cst/IExpression.java | 4 +- .../metaschema/core/metapath/cst/Let.java | 4 +- .../core/metapath/cst/Metapath.java | 4 +- .../core/metapath/cst/StaticFunctionCall.java | 4 +- .../core/metapath/cst/VariableReference.java | 4 +- .../cst/items/AbstractLiteralExpression.java | 2 +- .../metapath/cst/items/AbstractLookup.java | 6 +- .../cst/items/ArraySequenceConstructor.java | 4 +- .../cst/items/ArraySquareConstructor.java | 6 +- .../metapath/cst/items/DecimalLiteral.java | 4 +- .../metapath/cst/items/EmptySequence.java | 4 +- .../cst/items/ILiteralExpression.java | 2 +- .../metapath/cst/items/IntegerLiteral.java | 4 +- .../core/metapath/cst/items/Intersect.java | 4 +- .../metapath/cst/items/MapConstructor.java | 12 ++-- .../metapath/cst/items/PostfixLookup.java | 12 ++-- .../core/metapath/cst/items/Quantified.java | 6 +- .../core/metapath/cst/items/Range.java | 6 +- .../core/metapath/cst/items/SimpleMap.java | 2 +- .../core/metapath/cst/items/StringConcat.java | 4 +- .../metapath/cst/items/StringLiteral.java | 4 +- .../core/metapath/cst/items/UnaryLookup.java | 12 ++-- .../core/metapath/cst/items/Union.java | 4 +- .../cst/logic/AbstractFilterExpression.java | 4 +- .../core/metapath/cst/logic/And.java | 4 +- .../core/metapath/cst/logic/Except.java | 4 +- .../metapath/cst/logic/GeneralComparison.java | 6 +- .../cst/logic/IBooleanLogicExpression.java | 2 +- .../core/metapath/cst/logic/If.java | 4 +- .../core/metapath/cst/logic/Negate.java | 4 +- .../core/metapath/cst/logic/Or.java | 4 +- .../cst/logic/PredicateExpression.java | 4 +- .../metapath/cst/logic/ValueComparison.java | 6 +- .../math/AbstractArithmeticExpression.java | 2 +- .../AbstractBasicArithmeticExpression.java | 4 +- .../core/metapath/cst/math/Addition.java | 14 ++-- .../core/metapath/cst/math/Division.java | 12 ++-- .../metapath/cst/math/IntegerDivision.java | 6 +- .../core/metapath/cst/math/Modulo.java | 4 +- .../metapath/cst/math/Multiplication.java | 12 ++-- .../core/metapath/cst/math/Subtraction.java | 16 ++--- .../cst/path/AbstractPathExpression.java | 10 +-- .../path/AbstractRelativePathExpression.java | 2 +- .../cst/path/AbstractRootPathExpression.java | 2 +- .../core/metapath/cst/path/Axis.java | 6 +- .../core/metapath/cst/path/ContextItem.java | 4 +- .../core/metapath/cst/path/Flag.java | 8 +-- .../cst/path/INameTestExpression.java | 2 +- .../metapath/cst/path/IPathExpression.java | 2 +- .../metapath/cst/path/IWildcardMatcher.java | 2 +- .../core/metapath/cst/path/ModelInstance.java | 8 +-- .../core/metapath/cst/path/NameTest.java | 8 +-- .../cst/path/RelativeDoubleSlashPath.java | 4 +- .../metapath/cst/path/RelativeSlashPath.java | 2 +- .../cst/path/RootDoubleSlashPath.java | 4 +- .../metapath/cst/path/RootSlashOnlyPath.java | 8 +-- .../core/metapath/cst/path/RootSlashPath.java | 4 +- .../core/metapath/cst/path/Step.java | 6 +- .../core/metapath/cst/path/Wildcard.java | 8 +-- .../cst/type/AbstractCastingExpression.java | 8 +-- .../core/metapath/cst/type/Cast.java | 6 +- .../core/metapath/cst/type/Castable.java | 8 +-- .../core/metapath/cst/type/InstanceOf.java | 8 +-- .../metapath/cst/type/MatchAnyLocalName.java | 2 +- .../metapath/cst/type/MatchAnyNamespace.java | 2 +- .../core/metapath/cst/type/Treat.java | 6 +- .../metapath/cst/type/TypeTestSupport.java | 20 +++--- .../core/metapath/format/IPathFormatter.java | 14 ++-- .../core/metapath/format/IPathSegment.java | 2 +- .../metapath/format/MetapathFormatter.java | 18 ++--- .../core/metapath/function/ArgumentImpl.java | 2 +- .../core/metapath/function/CalledContext.java | 4 +- .../function/ComparisonFunctions.java | 30 ++++----- .../metapath/function/DefaultFunction.java | 6 +- .../core/metapath/function/FunctionUtils.java | 14 ++-- .../core/metapath/function/IArgument.java | 8 +-- .../{item => }/function/IArrayItem.java | 21 +++--- .../{type => function}/IArrayTest.java | 7 +- .../core/metapath/function/IFunction.java | 12 ++-- .../metapath/function/IFunctionExecutor.java | 4 +- .../{item => }/function/IKeySpecifier.java | 8 +-- .../{item => }/function/IMapItem.java | 19 +++--- .../metapath/{item => }/function/IMapKey.java | 4 +- .../metapath/{type => function}/IMapTest.java | 8 ++- ...ndexOutOfBoundsArrayMetapathException.java | 4 +- .../InvalidTypeFunctionException.java | 4 +- .../NegativeLengthArrayMetapathException.java | 4 +- .../function/impl/AbstractArrayItem.java | 58 ++-------------- .../function/impl/AbstractFunction.java | 16 ++--- .../function/impl/AbstractKeySpecifier.java | 22 +++--- .../function/impl/AbstractMapItem.java | 64 +++--------------- .../function/impl/AbstractStringMapKey.java | 4 +- .../impl/AnyFunctionItemType.java | 9 +-- .../{item => }/function/impl/ArrayItemN.java | 5 +- .../function/impl/ArrayMetapathException.java | 4 +- .../impl/ArrayTestImpl.java | 8 +-- .../impl/IFeatureCollectionFunctionItem.java | 67 +++++++++++++++++++ .../function/impl/ImmutableCollections.java | 2 +- .../{item => }/function/impl/MapItemN.java | 6 +- .../{type => function}/impl/MapTestImpl.java | 10 +-- .../function/impl/OperationFunctions.java | 28 ++++---- .../function/library/ArrayAppend.java | 8 +-- .../function/library/ArrayFlatten.java | 6 +- .../metapath/function/library/ArrayGet.java | 12 ++-- .../metapath/function/library/ArrayHead.java | 8 +-- .../function/library/ArrayInsertBefore.java | 14 ++-- .../metapath/function/library/ArrayJoin.java | 8 +-- .../metapath/function/library/ArrayPut.java | 14 ++-- .../function/library/ArrayRemove.java | 12 ++-- .../function/library/ArrayReverse.java | 8 +-- .../metapath/function/library/ArraySize.java | 8 +-- .../function/library/ArraySubarray.java | 14 ++-- .../metapath/function/library/ArrayTail.java | 6 +- .../function/library/CastFunction.java | 10 +-- .../library/DefaultFunctionLibrary.java | 2 +- .../core/metapath/function/library/FnAbs.java | 6 +- .../core/metapath/function/library/FnAvg.java | 16 ++--- .../metapath/function/library/FnBaseUri.java | 8 +-- .../metapath/function/library/FnBoolean.java | 18 ++--- .../metapath/function/library/FnCeiling.java | 6 +- .../metapath/function/library/FnCompare.java | 8 +-- .../metapath/function/library/FnConcat.java | 8 +-- .../metapath/function/library/FnContains.java | 8 +-- .../metapath/function/library/FnCount.java | 6 +- .../function/library/FnCurrentDateTime.java | 8 +-- .../function/library/FnCurrentTime.java | 8 +-- .../metapath/function/library/FnData.java | 8 +-- .../core/metapath/function/library/FnDoc.java | 10 +-- .../function/library/FnDocumentAvailable.java | 10 +-- .../function/library/FnDocumentUri.java | 10 +-- .../metapath/function/library/FnEmpty.java | 6 +- .../metapath/function/library/FnEndsWith.java | 8 +-- .../metapath/function/library/FnExists.java | 6 +- .../metapath/function/library/FnFalse.java | 6 +- .../metapath/function/library/FnHead.java | 4 +- .../function/library/FnImplicitTimezone.java | 6 +- .../function/library/FnInsertBefore.java | 6 +- .../function/library/FnLowerCase.java | 6 +- .../metapath/function/library/FnMatches.java | 8 +-- .../metapath/function/library/FnMinMax.java | 24 +++---- .../function/library/FnNormalizeSpace.java | 6 +- .../core/metapath/function/library/FnNot.java | 6 +- .../metapath/function/library/FnPath.java | 10 +-- .../metapath/function/library/FnRemove.java | 6 +- .../function/library/FnResolveUri.java | 8 +-- .../metapath/function/library/FnReverse.java | 4 +- .../metapath/function/library/FnRound.java | 8 +-- .../function/library/FnStartsWith.java | 8 +-- .../function/library/FnStaticBaseUri.java | 8 +-- .../metapath/function/library/FnString.java | 12 ++-- .../function/library/FnStringLength.java | 8 +-- .../function/library/FnSubstring.java | 8 +-- .../function/library/FnSubstringAfter.java | 6 +- .../function/library/FnSubstringBefore.java | 6 +- .../core/metapath/function/library/FnSum.java | 14 ++-- .../metapath/function/library/FnTail.java | 4 +- .../metapath/function/library/FnTokenize.java | 6 +- .../metapath/function/library/FnTrue.java | 6 +- .../function/library/FnUpperCase.java | 6 +- .../function/library/MapContains.java | 12 ++-- .../metapath/function/library/MapEntry.java | 10 +-- .../metapath/function/library/MapFind.java | 12 ++-- .../metapath/function/library/MapGet.java | 10 +-- .../metapath/function/library/MapKeys.java | 10 +-- .../metapath/function/library/MapMerge.java | 14 ++-- .../metapath/function/library/MapPut.java | 12 ++-- .../metapath/function/library/MapRemove.java | 12 ++-- .../metapath/function/library/MapSize.java | 8 +-- .../function/library/MpRecurseDepth.java | 8 +-- .../function/library/NumericFunction.java | 6 +- .../{type => }/impl/AbstractItemType.java | 6 +- .../core/metapath/impl/AbstractSequence.java | 6 +- .../metapath/{type => }/impl/AnyItemType.java | 6 +- .../impl/ErroniousMetapathExpression.java | 4 +- .../LazyCompilationMetapathExpression.java | 4 +- .../metapath/impl/MetapathExpression.java | 4 +- .../core/metapath/impl/SequenceN.java | 2 +- .../{type => }/impl/SequenceTypeImpl.java | 16 ++--- .../core/metapath/impl/SingletonSequence.java | 2 +- .../core/metapath/impl/StreamSequence.java | 2 +- .../core/metapath/item/package-info.java | 11 --- .../node/AbstractDefinitionNodeItem.java | 2 +- .../node/AbstractFlagInstanceNodeItem.java | 2 +- .../AbstractGlobalDefinitionNodeItem.java | 2 +- .../node/AbstractInstanceNodeItem.java | 2 +- .../{item => }/node/AbstractNodeItem.java | 2 +- .../node/AbstractNodeItemFactory.java | 2 +- .../node/AbstractNodeItemVisitor.java | 2 +- .../AbstractOrphanedDefinitionNodeItem.java | 2 +- ...actRecursionPreventingNodeItemVisitor.java | 2 +- .../AssemblyGlobalDefinitionNodeItemImpl.java | 2 +- .../AssemblyInstanceNoValueNodeItemImpl.java | 2 +- .../node/AssemblyInstanceNodeItemImpl.java | 2 +- ...blyOrphanedDefinitionDataNodeItemImpl.java | 2 +- ...ssemblyOrphanedDefinitionNodeItemImpl.java | 2 +- .../CycledAssemblyInstanceNodeItemImpl.java | 2 +- .../node/DefaultNodeItemFactory.java | 6 +- .../{item => }/node/DocumentNodeItemImpl.java | 2 +- .../FieldGlobalDefinitionNodeItemImpl.java | 2 +- .../FieldInstanceNoValueNodeItemImpl.java | 2 +- .../node/FieldInstanceNodeItemImpl.java | 4 +- .../FieldOrphanedDefinitionNodeItemImpl.java | 2 +- .../FlagGlobalDefinitionNodeItemImpl.java | 2 +- .../node/FlagInstanceNoValueNodeItemImpl.java | 2 +- .../node/FlagInstanceNodeItemImpl.java | 4 +- .../IAssemblyInstanceGroupedNodeItem.java | 2 +- .../{item => }/node/IAssemblyNodeItem.java | 7 +- .../node/ICycledAssemblyNodeItem.java | 2 +- .../{item => }/node/IDefinitionNodeItem.java | 2 +- .../node/IDocumentBasedNodeItem.java | 4 +- .../{item => }/node/IDocumentNodeItem.java | 5 +- .../node/IFeatureAtomicValuedItem.java | 6 +- .../node/IFeatureChildNodeItem.java | 2 +- .../node/IFeatureFlagContainerItem.java | 2 +- .../node/IFeatureModelContainerItem.java | 2 +- .../node/IFeatureNoDataAtomicValuedItem.java | 6 +- .../node/IFeatureNoDataValuedItem.java | 4 +- ...eatureOrhpanedDefinitionModelNodeItem.java | 2 +- .../IFeatureOrhpanedDefinitionNodeItem.java | 2 +- .../node/IFeatureRequiredDataItem.java | 4 +- .../{item => }/node/IFieldNodeItem.java | 7 +- .../{item => }/node/IFlagNodeItem.java | 7 +- .../metapath/{type => node}/IKindTest.java | 4 +- .../{item => }/node/IModelNodeItem.java | 2 +- .../{item => }/node/IModuleNodeItem.java | 4 +- .../metapath/{item => }/node/INodeItem.java | 8 +-- .../{item => }/node/INodeItemFactory.java | 2 +- .../{item => }/node/INodeItemGenerator.java | 6 +- .../{item => }/node/INodeItemVisitable.java | 2 +- .../{item => }/node/INodeItemVisitor.java | 2 +- .../node/IRootAssemblyNodeItem.java | 2 +- .../{item => }/node/ModuleNodeItemImpl.java | 2 +- .../{item => }/node/NodeItemKind.java | 2 +- .../RecursionCollectingNodeItemVisitor.java | 2 +- .../node/RootAssemblyValuedNodeItemImpl.java | 2 +- .../impl/AbstractDefinitionTest.java | 8 +-- .../{type => node}/impl/AnyKindTest.java | 17 ++--- .../impl/DynamicTypeSupport.java | 12 ++-- .../impl/KindAssemblyTestImpl.java | 6 +- .../impl/KindDocumentTestImpl.java | 12 ++-- .../impl/KindFieldTestImpl.java | 6 +- .../{type => node}/impl/KindFlagTestImpl.java | 6 +- .../{item => }/node/package-info.java | 4 +- .../core/model/IMetapathQueryable.java | 2 +- .../AbstractConstraintValidationHandler.java | 4 +- .../ConstraintValidationFinding.java | 2 +- .../DefaultConstraintValidator.java | 16 ++--- ...xternalConstraintsModulePostProcessor.java | 10 +-- ...CollectingConstraintValidationHandler.java | 4 +- .../IConfigurableMessageConstraint.java | 2 +- .../core/model/constraint/IConstraint.java | 4 +- .../IConstraintValidationHandler.java | 4 +- .../constraint/IConstraintValidator.java | 2 +- .../core/model/constraint/IIndex.java | 6 +- .../LoggingConstraintValidationHandler.java | 4 +- ...AbstractConfigurableMessageConstraint.java | 2 +- .../constraint/impl/AbstractConstraint.java | 4 +- .../impl/ConstraintComposingVisitor.java | 16 ++--- .../impl/DefaultExpectConstraint.java | 2 +- .../model/constraint/impl/DefaultIndex.java | 2 +- .../core/model/{util => json}/JsonUtil.java | 2 +- .../core/model/json/package-info.java | 10 +++ .../model/validation/IContentValidator.java | 2 +- .../model/{util => xml}/XmlEventUtil.java | 2 +- .../core/model/{util => xml}/XmlUtil.java | 2 +- .../xml/impl/XmlGlobalFieldDefinition.java | 2 +- .../xml/impl/XmlGlobalFlagDefinition.java | 2 +- .../impl/XmlGroupedInlineFieldDefinition.java | 2 +- .../xml/impl/XmlInlineFieldDefinition.java | 2 +- .../xml/impl/XmlInlineFlagDefinition.java | 2 +- .../xmlbeans/handler/DatatypesHandler.java | 2 +- .../metaschema/core/qname/EQNameFactory.java | 1 + .../metaschema/core/qname/WellKnown.java | 1 + .../core/qname/{ => impl}/NamespaceCache.java | 2 +- .../core/qname/{ => impl}/QNameCache.java | 11 +-- .../metaschema/core/qname/package-info.java | 10 +++ .../core/util/CustomCollectors.java | 4 +- core/src/main/java/module-info.java | 11 ++- ...metaschema.core.datatype.IDataTypeProvider | 2 +- .../{adapter => }/BooleanAdapterTest.java | 4 +- .../{adapter => }/DateAdapterTest.java | 8 +-- .../{adapter => }/DateTimeAdapterTest.java | 6 +- .../DateTimeWithTZAdapterTest.java | 6 +- .../{adapter => }/IPv6AddressAdapterTest.java | 6 +- .../MetaschemaDataTypeProviderTest.java | 3 +- .../markup/CommonmarkConformanceTest.java | 1 + .../markup/flexmark/MarkupParserTest.java | 4 +- .../core/metapath/ExpressionTestBase.java | 4 +- .../core/metapath/ExpressionUtilsTest.java | 12 ++-- .../core/metapath/ISequenceTest.java | 3 - .../core/metapath/MetapathExpressionTest.java | 3 +- .../core/metapath/OperationFunctionsTest.java | 4 +- .../metaschema/core/metapath/TestUtils.java | 31 ++++----- .../atomic/IBase64BinaryItemTest.java | 2 +- .../{item => }/atomic/IBooleanItemTest.java | 2 +- .../{item => }/atomic/INumericItemTest.java | 2 +- .../{item => }/atomic/IStringItemTest.java | 2 +- .../{item => }/atomic/IUuidItemTest.java | 2 +- .../metapath/cst/ArrowExpressionTest.java | 2 +- .../metapath/cst/BuildCstVisitorTest.java | 20 +++--- .../core/metapath/cst/items/RangeTest.java | 2 +- .../cst/logic/CSTLogicalExpressionsTest.java | 4 +- .../cst/logic/PredicateExpressionTest.java | 4 +- .../cst/logic/ValueComparisonTest.java | 8 +-- .../core/metapath/cst/path/FlagTest.java | 8 +-- .../metapath/cst/path/RootSlashOnlyTest.java | 6 +- .../core/metapath/cst/path/StepTest.java | 12 ++-- .../core/metapath/cst/type/CastTest.java | 4 +- .../core/metapath/cst/type/CastableTest.java | 2 +- .../metapath/cst/type/InstanceOfTest.java | 10 +-- .../{item => }/function/IArrayItemTest.java | 2 +- .../{item => }/function/LookupTest.java | 4 +- .../function/OperationFunctionsTest.java | 2 +- .../function/library/ArrayAppendTest.java | 2 +- .../function/library/ArrayFlattenTest.java | 2 +- .../function/library/ArrayGetTest.java | 2 +- .../function/library/ArrayHeadTest.java | 2 +- .../library/ArrayInsertBeforeTest.java | 2 +- .../function/library/ArrayJoinTest.java | 2 +- .../function/library/ArrayPutTest.java | 2 +- .../function/library/ArrayRemoveTest.java | 2 +- .../function/library/ArrayReverseTest.java | 2 +- .../function/library/ArraySizeTest.java | 4 +- .../function/library/ArraySubarrayTest.java | 2 +- .../function/library/ArrayTailTest.java | 2 +- .../function/library/CastFunctionTest.java | 10 +-- .../metapath/function/library/FnAbsTest.java | 4 +- .../metapath/function/library/FnAvgTest.java | 8 +-- .../function/library/FnBooleanTest.java | 10 +-- .../function/library/FnCeilingTest.java | 4 +- .../function/library/FnConcatTest.java | 2 +- .../function/library/FnContainsTest.java | 2 +- .../function/library/FnCountTest.java | 6 +- .../library/FnDocumentAvailableTest.java | 2 +- .../function/library/FnEmptyTest.java | 2 +- .../function/library/FnEndsWithTest.java | 2 +- .../function/library/FnExistsTest.java | 6 +- .../function/library/FnFalseTest.java | 4 +- .../metapath/function/library/FnHeadTest.java | 2 +- .../library/FnImplicitTimezoneTest.java | 2 +- .../function/library/FnInsertBeforeTest.java | 2 +- .../function/library/FnLowerCaseTest.java | 2 +- .../function/library/FnMatchesTest.java | 6 +- .../function/library/FnMinMaxTest.java | 4 +- .../library/FnNormalizeSpaceTest.java | 2 +- .../metapath/function/library/FnNotTest.java | 10 +-- .../function/library/FnRemoveTest.java | 2 +- .../function/library/FnReverseTest.java | 2 +- .../function/library/FnRoundTest.java | 6 +- .../function/library/FnStartsWithTest.java | 6 +- .../function/library/FnStringLengthTest.java | 6 +- .../function/library/FnStringTest.java | 6 +- .../library/FnSubstringAfterTest.java | 2 +- .../library/FnSubstringBeforeTest.java | 2 +- .../function/library/FnSubstringTest.java | 2 +- .../metapath/function/library/FnSumTest.java | 8 +-- .../metapath/function/library/FnTailTest.java | 2 +- .../function/library/FnTokenizeTest.java | 2 +- .../metapath/function/library/FnTrueTest.java | 4 +- .../function/library/FnUpperCaseTest.java | 2 +- .../function/library/FunctionTestBase.java | 6 +- .../function/library/MapContainsTest.java | 4 +- .../function/library/MapEntryTest.java | 4 +- .../function/library/MapFindTest.java | 2 +- .../metapath/function/library/MapGetTest.java | 4 +- .../function/library/MapKeysTest.java | 4 +- .../function/library/MapMergeTest.java | 4 +- .../metapath/function/library/MapPutTest.java | 6 +- .../function/library/MapRemoveTest.java | 6 +- .../function/library/MapSizeTest.java | 4 +- ...ecursionPreventingNodeItemVisitorTest.java | 2 +- .../node/DefaultNodeItemFactoryTest.java | 2 +- ...ecursionCollectingNodeItemVisitorTest.java | 4 +- .../DefaultConstraintValidatorTest.java | 6 +- .../model/xml/MetaConstraintLoaderTest.java | 10 +-- .../{util => xml}/XmlObjectParserTest.java | 2 +- .../metaschema/core/qname/QNameCacheTest.java | 2 + .../metaschema/core/testing/FieldBuilder.java | 2 +- .../metaschema/core/testing/FlagBuilder.java | 2 +- .../testing/node/MockNodeItemFactory.java | 18 ++--- .../sarif/SarifValidationHandlerTest.java | 2 +- .../metaschema/databind/IBindingContext.java | 6 +- .../codegen/impl/AnnotationGenerator.java | 8 +-- .../typeinfo/FieldInstanceTypeInfoImpl.java | 2 +- .../typeinfo/FieldValueTypeInfoImpl.java | 2 +- .../databind/io/AbstractDeserializer.java | 6 +- .../databind/io/DefaultBoundLoader.java | 2 +- .../metaschema/databind/io/IBoundLoader.java | 2 +- .../metaschema/databind/io/IDeserializer.java | 2 +- .../metaschema/databind/io/ModelDetector.java | 4 +- .../io/json/DefaultJsonDeserializer.java | 4 +- .../io/json/DefaultJsonProblemHandler.java | 2 +- .../io/json/MetaschemaJsonReader.java | 2 +- .../io/xml/DefaultXmlDeserializer.java | 4 +- .../io/xml/DefaultXmlProblemHandler.java | 2 +- .../databind/io/xml/MetaschemaXmlReader.java | 2 +- .../databind/metapath/function/Model.java | 8 +-- .../databind/model/annotations/ModelUtil.java | 2 +- .../annotations/NullJavaTypeAdapter.java | 6 +- .../metaschema/IBindingMetaschemaModule.java | 4 +- .../metaschema/IBindingModelElement.java | 2 +- .../metaschema/binding/AssemblyModel.java | 8 +-- .../metaschema/binding/AssemblyReference.java | 8 +-- .../binding/ConstraintLetExpression.java | 4 +- .../binding/ConstraintValueEnum.java | 2 +- .../model/metaschema/binding/Example.java | 4 +- .../metaschema/binding/FieldReference.java | 8 +-- .../metaschema/binding/FlagAllowedValues.java | 2 +- .../model/metaschema/binding/FlagExpect.java | 4 +- .../metaschema/binding/FlagIndexHasKey.java | 2 +- .../model/metaschema/binding/FlagMatches.java | 4 +- .../metaschema/binding/FlagReference.java | 6 +- .../model/metaschema/binding/GroupingAs.java | 2 +- .../binding/InlineDefineAssembly.java | 8 +-- .../metaschema/binding/InlineDefineField.java | 8 +-- .../metaschema/binding/InlineDefineFlag.java | 6 +- .../model/metaschema/binding/JsonKey.java | 2 +- .../metaschema/binding/JsonValueKeyFlag.java | 2 +- .../binding/KeyConstraintField.java | 2 +- .../model/metaschema/binding/METASCHEMA.java | 12 ++-- .../metaschema/binding/MetapathNamespace.java | 4 +- .../binding/MetaschemaMetaConstraints.java | 6 +- .../binding/MetaschemaMetapath.java | 2 +- .../binding/MetaschemaModuleConstraints.java | 8 +-- .../model/metaschema/binding/Property.java | 6 +- .../model/metaschema/binding/Remarks.java | 2 +- .../TargetedAllowedValuesConstraint.java | 4 +- .../binding/TargetedExpectConstraint.java | 4 +- .../TargetedHasCardinalityConstraint.java | 6 +- .../binding/TargetedIndexConstraint.java | 4 +- .../TargetedIndexHasKeyConstraint.java | 4 +- .../binding/TargetedIsUniqueConstraint.java | 4 +- .../binding/TargetedMatchesConstraint.java | 4 +- .../model/metaschema/binding/UseName.java | 4 +- .../impl/AbstractAbsoluteModelGenerator.java | 2 +- .../impl/AssemblyModelGenerator.java | 2 +- .../model/metaschema/impl/BindingModule.java | 6 +- .../impl/ChoiceGroupModelGenerator.java | 2 +- .../metaschema/impl/ChoiceModelGenerator.java | 2 +- .../impl/DefinitionAssemblyGlobal.java | 4 +- .../impl/DefinitionFieldGlobal.java | 2 +- .../metaschema/impl/DefinitionFlagGlobal.java | 4 +- .../metaschema/impl/InstanceFlagInline.java | 2 +- .../impl/InstanceFlagReference.java | 2 +- .../impl/InstanceModelAssemblyInline.java | 4 +- .../impl/InstanceModelAssemblyReference.java | 2 +- .../metaschema/impl/InstanceModelChoice.java | 4 +- .../impl/InstanceModelChoiceGroup.java | 4 +- .../impl/InstanceModelFieldInline.java | 2 +- .../impl/InstanceModelFieldReference.java | 2 +- .../InstanceModelGroupedAssemblyInline.java | 4 +- ...InstanceModelGroupedAssemblyReference.java | 2 +- .../impl/InstanceModelGroupedFieldInline.java | 2 +- .../InstanceModelGroupedFieldReference.java | 2 +- .../model/metaschema/impl/ModelSupport.java | 8 +-- .../databind/codegen/BasicMetaschemaTest.java | 4 +- .../databind/io/DefaultBoundLoaderTest.java | 2 +- .../databind/model/test/FlaggedAssembly.java | 2 +- .../model/test/FlaggedBoundAssembly.java | 2 +- .../model/test/FlaggedBoundField.java | 4 +- .../model/test/RootBoundAssembly.java | 2 +- .../databind/model/test/SimpleAssembly.java | 2 +- .../testing/model/RootAssemblyWithFlags.java | 2 +- .../cli/commands/ValidateModuleCommand.java | 2 +- .../metapath/EvaluateMetapathCommand.java | 10 +-- 609 files changed, 1814 insertions(+), 1928 deletions(-) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/AbstractIntegerAdapter.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/AbstractStringAdapter.java (81%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/Base64Adapter.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/BooleanAdapter.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DateAdapter.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DateFormats.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DateTimeAdapter.java (93%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DateTimeWithTZAdapter.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DateWithTZAdapter.java (93%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DayTimeAdapter.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DecimalAdapter.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/EmailAddressAdapter.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/HostnameAdapter.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/IPv4AddressAdapter.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/IPv6AddressAdapter.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/IntegerAdapter.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/MetaschemaDataTypeProvider.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/NcNameAdapter.java (93%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/NonNegativeIntegerAdapter.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/PositiveIntegerAdapter.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/StringAdapter.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/TimeAdapter.java (88%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/TimeWithTZAdapter.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/TokenAdapter.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/UriAdapter.java (87%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/UriReferenceAdapter.java (88%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/UuidAdapter.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/YearMonthAdapter.java (89%) delete mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/package-info.java rename core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/{ => impl}/XmlMarkupParser.java (96%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/DefaultItemWriter.java (88%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/ICollectionValue.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/IItem.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => }/IItemType.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/IItemVisitor.java (75%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/IItemWriter.java (79%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/ISequence.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => }/ISequenceType.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => }/InvalidTypeMetapathException.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/ItemUtils.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => }/Occurrence.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => }/TypeMetapathError.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/AbstractAnyAtomicItem.java (93%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/AbstractAtomicItemBase.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => atomic}/AbstractAtomicOrUnionType.java (82%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/AbstractUntypedAtomicItem.java (78%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => atomic}/DataTypeItemType.java (93%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IAnyAtomicItem.java (88%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IAnyUriItem.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => atomic}/IAtomicOrUnionType.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IAtomicValuedItem.java (69%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IBase64BinaryItem.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IBooleanItem.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IDateItem.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IDateTimeItem.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IDateTimeWithTimeZoneItem.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IDateWithTimeZoneItem.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IDayTimeDurationItem.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IDecimalItem.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IDurationItem.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IEmailAddressItem.java (85%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IHostnameItem.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IIPAddressItem.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IIPv4AddressItem.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IIPv6AddressItem.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IIntegerItem.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IMarkupItem.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IMarkupLineItem.java (88%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IMarkupMultilineItem.java (88%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/INcNameItem.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/INonNegativeIntegerItem.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/INumericItem.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IPositiveIntegerItem.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IStringItem.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/ITemporalItem.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/ITimeItem.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/ITimeWithTimeZoneItem.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/ITokenItem.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IUntypedAtomicItem.java (79%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IUriReferenceItem.java (87%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IUuidItem.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IYearMonthDurationItem.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractDateItem.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractDateTimeItem.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractDecimalItem.java (80%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractIPAddressItem.java (85%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractIntegerItem.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractMarkupItem.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractStringItem.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractTemporalItem.java (81%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractTimeItem.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AbstractUriItem.java (75%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/AnyUriItemImpl.java (72%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/Base64BinaryItemImpl.java (78%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/BooleanItemImpl.java (83%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/DateTimeWithTimeZoneItemImpl.java (74%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/DateTimeWithoutTimeZoneItemImpl.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/DateWithTimeZoneItemImpl.java (73%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/DateWithoutTimeZoneItemImpl.java (81%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/DayTimeDurationItemImpl.java (78%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/DecimalItemImpl.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/EmailAddressItemImpl.java (67%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/HostnameItemImpl.java (67%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/IPv4AddressItemImpl.java (71%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/IPv6AddressItemImpl.java (71%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/IntegerItemImpl.java (73%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/MarkupLineItemImpl.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/MarkupMultiLineItemImpl.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/NcNameItemImpl.java (69%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => atomic}/impl/NonAdapterAtomicItemType.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/NonNegativeIntegerItemImpl.java (69%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/PositiveIntegerItemImpl.java (69%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/StringItemImpl.java (72%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/TimeWithTimeZoneItemImpl.java (73%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/TimeWithoutTimeZoneItemImpl.java (83%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/TokenItemImpl.java (67%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => atomic}/impl/TypeConstants.java (81%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/UriReferenceItemImpl.java (68%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/UuidItemImpl.java (75%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/impl/YearMonthDurationItemImpl.java (78%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/package-info.java (70%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/IArrayItem.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => function}/IArrayTest.java (82%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/IKeySpecifier.java (76%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/IMapItem.java (96%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/IMapKey.java (70%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => function}/IMapTest.java (83%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/IndexOutOfBoundsArrayMetapathException.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/NegativeLengthArrayMetapathException.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/impl/AbstractArrayItem.java (65%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/impl/AbstractKeySpecifier.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/impl/AbstractMapItem.java (65%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/impl/AbstractStringMapKey.java (79%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => function}/impl/AnyFunctionItemType.java (79%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/impl/ArrayItemN.java (88%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/impl/ArrayMetapathException.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => function}/impl/ArrayTestImpl.java (72%) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/IFeatureCollectionFunctionItem.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/impl/ImmutableCollections.java (98%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/impl/MapItemN.java (85%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => function}/impl/MapTestImpl.java (74%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => }/impl/AbstractItemType.java (80%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => }/impl/AnyItemType.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => }/impl/SequenceTypeImpl.java (88%) delete mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/package-info.java rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractDefinitionNodeItem.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractFlagInstanceNodeItem.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractGlobalDefinitionNodeItem.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractInstanceNodeItem.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractNodeItem.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractNodeItemFactory.java (99%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractNodeItemVisitor.java (98%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractOrphanedDefinitionNodeItem.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractRecursionPreventingNodeItemVisitor.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AssemblyGlobalDefinitionNodeItemImpl.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AssemblyInstanceNoValueNodeItemImpl.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AssemblyInstanceNodeItemImpl.java (96%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AssemblyOrphanedDefinitionDataNodeItemImpl.java (96%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AssemblyOrphanedDefinitionNodeItemImpl.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/CycledAssemblyInstanceNodeItemImpl.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/DefaultNodeItemFactory.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/DocumentNodeItemImpl.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/FieldGlobalDefinitionNodeItemImpl.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/FieldInstanceNoValueNodeItemImpl.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/FieldInstanceNodeItemImpl.java (93%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/FieldOrphanedDefinitionNodeItemImpl.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/FlagGlobalDefinitionNodeItemImpl.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/FlagInstanceNoValueNodeItemImpl.java (88%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/FlagInstanceNodeItemImpl.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IAssemblyInstanceGroupedNodeItem.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IAssemblyNodeItem.java (87%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/ICycledAssemblyNodeItem.java (89%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IDefinitionNodeItem.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IDocumentBasedNodeItem.java (86%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IDocumentNodeItem.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFeatureAtomicValuedItem.java (74%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFeatureChildNodeItem.java (88%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFeatureFlagContainerItem.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFeatureModelContainerItem.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFeatureNoDataAtomicValuedItem.java (54%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFeatureNoDataValuedItem.java (83%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFeatureOrhpanedDefinitionModelNodeItem.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFeatureOrhpanedDefinitionNodeItem.java (93%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFeatureRequiredDataItem.java (66%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFieldNodeItem.java (84%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IFlagNodeItem.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => node}/IKindTest.java (76%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IModelNodeItem.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IModuleNodeItem.java (92%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/INodeItem.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/INodeItemFactory.java (99%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/INodeItemGenerator.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/INodeItemVisitable.java (90%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/INodeItemVisitor.java (97%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/IRootAssemblyNodeItem.java (96%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/ModuleNodeItemImpl.java (95%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/NodeItemKind.java (87%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/RecursionCollectingNodeItemVisitor.java (98%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/RootAssemblyValuedNodeItemImpl.java (96%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => node}/impl/AbstractDefinitionTest.java (93%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => node}/impl/AnyKindTest.java (77%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => node}/impl/DynamicTypeSupport.java (91%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => node}/impl/KindAssemblyTestImpl.java (87%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => node}/impl/KindDocumentTestImpl.java (77%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => node}/impl/KindFieldTestImpl.java (87%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{type => node}/impl/KindFlagTestImpl.java (87%) rename core/src/main/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/package-info.java (67%) rename core/src/main/java/gov/nist/secauto/metaschema/core/model/{util => json}/JsonUtil.java (99%) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/model/json/package-info.java rename core/src/main/java/gov/nist/secauto/metaschema/core/model/{util => xml}/XmlEventUtil.java (99%) rename core/src/main/java/gov/nist/secauto/metaschema/core/model/{util => xml}/XmlUtil.java (94%) rename core/src/main/java/gov/nist/secauto/metaschema/core/qname/{ => impl}/NamespaceCache.java (98%) rename core/src/main/java/gov/nist/secauto/metaschema/core/qname/{ => impl}/QNameCache.java (92%) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/qname/package-info.java rename core/src/test/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/BooleanAdapterTest.java (90%) rename core/src/test/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DateAdapterTest.java (91%) rename core/src/test/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DateTimeAdapterTest.java (94%) rename core/src/test/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/DateTimeWithTZAdapterTest.java (77%) rename core/src/test/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/IPv6AddressAdapterTest.java (89%) rename core/src/test/java/gov/nist/secauto/metaschema/core/datatype/{adapter => }/MetaschemaDataTypeProviderTest.java (81%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IBase64BinaryItemTest.java (96%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IBooleanItemTest.java (97%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/INumericItemTest.java (98%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IStringItemTest.java (93%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/atomic/IUuidItemTest.java (96%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/IArrayItemTest.java (97%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/function/LookupTest.java (97%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/AbstractRecursionPreventingNodeItemVisitorTest.java (94%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/DefaultNodeItemFactoryTest.java (98%) rename core/src/test/java/gov/nist/secauto/metaschema/core/metapath/{item => }/node/RecursionCollectingNodeItemVisitorTest.java (93%) rename core/src/test/java/gov/nist/secauto/metaschema/core/model/{util => xml}/XmlObjectParserTest.java (98%) diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractCustomJavaDataTypeAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractCustomJavaDataTypeAdapter.java index 152e3f2cd..66adb60de 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractCustomJavaDataTypeAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractCustomJavaDataTypeAdapter.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.datatype; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractDataTypeAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractDataTypeAdapter.java index 59bb5a0f0..eea7e5d5c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractDataTypeAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractDataTypeAdapter.java @@ -8,12 +8,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.AbstractAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.DataTypeItemType; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.model.util.JsonUtil; -import gov.nist.secauto.metaschema.core.model.util.XmlEventUtil; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.DataTypeItemType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.model.json.JsonUtil; +import gov.nist.secauto.metaschema.core.model.xml.XmlEventUtil; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractDataTypeProvider.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractDataTypeProvider.java index 7128ea1d7..1ffb9a2c5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractDataTypeProvider.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractDataTypeProvider.java @@ -5,8 +5,7 @@ package gov.nist.secauto.metaschema.core.datatype; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/AbstractIntegerAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractIntegerAdapter.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/AbstractIntegerAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractIntegerAdapter.java index 41176aa97..1a97608d2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/AbstractIntegerAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractIntegerAdapter.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import java.io.IOException; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/AbstractStringAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractStringAdapter.java similarity index 81% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/AbstractStringAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractStringAdapter.java index 35a46f420..e134ab8c5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/AbstractStringAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/AbstractStringAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/Base64Adapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/Base64Adapter.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/Base64Adapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/Base64Adapter.java index c0ac0e427..6565248bf 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/Base64Adapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/Base64Adapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBase64BinaryItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/BooleanAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/BooleanAdapter.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/BooleanAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/BooleanAdapter.java index 4625ec2a3..463ebf93e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/BooleanAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/BooleanAdapter.java @@ -3,15 +3,14 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DataTypeService.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DataTypeService.java index de0db3d2f..73aea81f3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DataTypeService.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DataTypeService.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.core.datatype; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateAdapter.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateAdapter.java index 2a3e4e7cf..176a83346 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateAdapter.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractCustomJavaDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousDate; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateFormats.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateFormats.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateFormats.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateFormats.java index aabcabc8c..25b63bb82 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateFormats.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateFormats.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateTimeAdapter.java similarity index 93% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateTimeAdapter.java index ece84c111..b36712d4f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateTimeAdapter.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractCustomJavaDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousDateTime; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeWithTZAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateTimeWithTZAdapter.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeWithTZAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateTimeWithTZAdapter.java index de1da99e7..f0601c910 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeWithTZAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateTimeWithTZAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeWithTimeZoneItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeWithTimeZoneItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateWithTZAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateWithTZAdapter.java similarity index 93% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateWithTZAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateWithTZAdapter.java index 4f02122d4..b9d704824 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateWithTZAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DateWithTZAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateWithTimeZoneItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateWithTimeZoneItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DayTimeAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DayTimeAdapter.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DayTimeAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DayTimeAdapter.java index e0cebaa51..c152eca0c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DayTimeAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DayTimeAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DecimalAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DecimalAdapter.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DecimalAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DecimalAdapter.java index f4e5247e0..02601e3d7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/DecimalAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/DecimalAdapter.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/EmailAddressAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/EmailAddressAdapter.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/EmailAddressAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/EmailAddressAdapter.java index aedd28b02..a6b845731 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/EmailAddressAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/EmailAddressAdapter.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IEmailAddressItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IEmailAddressItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/HostnameAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/HostnameAdapter.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/HostnameAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/HostnameAdapter.java index 68fd877cd..a8460cae1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/HostnameAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/HostnameAdapter.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IHostnameItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IHostnameItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IDataTypeAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IDataTypeAdapter.java index 4a8c714f5..619e1d3c4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IDataTypeAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IDataTypeAdapter.java @@ -9,8 +9,8 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IDataTypeProvider.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IDataTypeProvider.java index cc8e276e8..d4ee9c16f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IDataTypeProvider.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IDataTypeProvider.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.datatype; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/IPv4AddressAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IPv4AddressAdapter.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/IPv4AddressAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IPv4AddressAdapter.java index 12bc8b126..8278c33b2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/IPv4AddressAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IPv4AddressAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIPv4AddressItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIPv4AddressItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/IPv6AddressAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IPv6AddressAdapter.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/IPv6AddressAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IPv6AddressAdapter.java index 7b16256e9..341257bf4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/IPv6AddressAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IPv6AddressAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIPv6AddressItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIPv6AddressItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/IntegerAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IntegerAdapter.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/IntegerAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IntegerAdapter.java index 78b075792..4d82afe50 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/IntegerAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/IntegerAdapter.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/MetaschemaDataTypeProvider.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/MetaschemaDataTypeProvider.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/MetaschemaDataTypeProvider.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/MetaschemaDataTypeProvider.java index 1194e8607..0ef768722 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/MetaschemaDataTypeProvider.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/MetaschemaDataTypeProvider.java @@ -3,10 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.type.impl.TypeConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.TypeConstants; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/NcNameAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/NcNameAdapter.java similarity index 93% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/NcNameAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/NcNameAdapter.java index fe15f2a50..9c5f5ab6c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/NcNameAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/NcNameAdapter.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INcNameItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INcNameItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/NonNegativeIntegerAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/NonNegativeIntegerAdapter.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/NonNegativeIntegerAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/NonNegativeIntegerAdapter.java index c8d0bfa2e..bfef1c408 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/NonNegativeIntegerAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/NonNegativeIntegerAdapter.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INonNegativeIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INonNegativeIntegerItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/PositiveIntegerAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/PositiveIntegerAdapter.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/PositiveIntegerAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/PositiveIntegerAdapter.java index a0ec219fe..e8f8f8e3b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/PositiveIntegerAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/PositiveIntegerAdapter.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IPositiveIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IPositiveIntegerItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/StringAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/StringAdapter.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/StringAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/StringAdapter.java index ab657ad70..f2be39801 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/StringAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/StringAdapter.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/TimeAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/TimeAdapter.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/TimeAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/TimeAdapter.java index fc4d78efe..6f91a6b3b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/TimeAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/TimeAdapter.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractCustomJavaDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousTime; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITimeItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -24,9 +23,7 @@ import edu.umd.cs.findbugs.annotations.NonNull; /** - * Support for the Metaschema date - * data type. + * Support for the Metaschema time data type. */ public class TimeAdapter extends AbstractCustomJavaDataTypeAdapter { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/TimeWithTZAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/TimeWithTZAdapter.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/TimeWithTZAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/TimeWithTZAdapter.java index 65063309b..d5ce062b5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/TimeWithTZAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/TimeWithTZAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITimeWithTimeZoneItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITimeWithTimeZoneItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -22,9 +21,7 @@ import edu.umd.cs.findbugs.annotations.NonNull; /** - * Support for the Metaschema date-time-with-timezone - * data type. + * Support for the Metaschema time-with-timezone data type. */ public class TimeWithTZAdapter extends AbstractDataTypeAdapter { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/TokenAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/TokenAdapter.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/TokenAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/TokenAdapter.java index fc83bae97..b832d6cce 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/TokenAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/TokenAdapter.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITokenItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITokenItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/UriAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/UriAdapter.java similarity index 87% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/UriAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/UriAdapter.java index 29232cd00..44f470068 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/UriAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/UriAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/UriReferenceAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/UriReferenceAdapter.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/UriReferenceAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/UriReferenceAdapter.java index 5931557f9..28bab0bad 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/UriReferenceAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/UriReferenceAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUriReferenceItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUriReferenceItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/UuidAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/UuidAdapter.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/UuidAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/UuidAdapter.java index c45c98b9f..39a559a5f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/UuidAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/UuidAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUuidItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUuidItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/YearMonthAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/YearMonthAdapter.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/YearMonthAdapter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/YearMonthAdapter.java index 137301b84..4fa2973af 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/YearMonthAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/YearMonthAdapter.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; -import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/package-info.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/package-info.java deleted file mode 100644 index 2d7f8764e..000000000 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/adapter/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: none - * SPDX-License-Identifier: CC0-1.0 - */ - -/** - * Built-in Metaschema data types. - *

- * These built-in data types align with the data types defined by Metaschema. - *

- * This package provides abstract implementation classes for different kinds of - * {@link gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter}, which - * must be implemented by a new date type to be used in this API. - */ - -package gov.nist.secauto.metaschema.core.datatype.adapter; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/AbstractMarkupAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/AbstractMarkupAdapter.java index 24e39905c..28705be98 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/AbstractMarkupAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/AbstractMarkupAdapter.java @@ -9,8 +9,8 @@ import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; import gov.nist.secauto.metaschema.core.datatype.AbstractCustomJavaDataTypeAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IMarkupItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IMarkupItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupDataTypeProvider.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupDataTypeProvider.java index c4c0bb2ee..86432bf7c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupDataTypeProvider.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupDataTypeProvider.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeProvider; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IMarkupItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IMarkupItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupLineAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupLineAdapter.java index e24134c86..fc5ddedde 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupLineAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupLineAdapter.java @@ -7,8 +7,9 @@ import com.fasterxml.jackson.core.JsonParser; +import gov.nist.secauto.metaschema.core.datatype.markup.impl.XmlMarkupParser; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IMarkupLineItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IMarkupLineItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupMultilineAdapter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupMultilineAdapter.java index 0e7ddfdc9..07edd14bc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupMultilineAdapter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/MarkupMultilineAdapter.java @@ -7,8 +7,9 @@ import com.fasterxml.jackson.core.JsonParser; +import gov.nist.secauto.metaschema.core.datatype.markup.impl.XmlMarkupParser; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IMarkupMultilineItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IMarkupMultilineItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/XmlMarkupParser.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/impl/XmlMarkupParser.java similarity index 96% rename from core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/XmlMarkupParser.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/impl/XmlMarkupParser.java index b11747b8e..b9d4c9e8c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/XmlMarkupParser.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/markup/impl/XmlMarkupParser.java @@ -3,11 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.markup; +package gov.nist.secauto.metaschema.core.datatype.markup.impl; import com.vladsch.flexmark.util.sequence.Escaping; -import gov.nist.secauto.metaschema.core.model.util.XmlEventUtil; +import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; +import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.model.xml.XmlEventUtil; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/package-info.java b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/package-info.java index 1aacc456b..a78c64c0c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/package-info.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/datatype/package-info.java @@ -4,7 +4,14 @@ */ /** - * The Metaschema and Metapath data type system API. + * The built-in Metaschema data types and APIs for defining new data types. + *

+ * These built-in data types align with the data types defined by Metaschema. + *

+ * To support new data types, this package provides abstract implementation + * classes for different kinds of + * {@link gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter}, which can + * be implemented by a new date type to be used with this API. */ package gov.nist.secauto.metaschema.core.datatype; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/DefaultItemWriter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DefaultItemWriter.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/DefaultItemWriter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DefaultItemWriter.java index 96dba299e..8d96caf73 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/DefaultItemWriter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DefaultItemWriter.java @@ -3,14 +3,14 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item; +package gov.nist.secauto.metaschema.core.metapath; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicValuedItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAtomicValuedItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import org.eclipse.jdt.annotation.Owning; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java index 3da9228da..971fdb018 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/DynamicContext.java @@ -12,8 +12,7 @@ import gov.nist.secauto.metaschema.core.configuration.IMutableConfiguration; import gov.nist.secauto.metaschema.core.metapath.function.CalledContext; import gov.nist.secauto.metaschema.core.metapath.function.IFunction.FunctionProperty; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.IUriResolver; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ICollectionValue.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ICollectionValue.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ICollectionValue.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ICollectionValue.java index afa063800..1d33ad945 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ICollectionValue.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ICollectionValue.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item; +package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.stream.Stream; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IDocumentLoader.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IDocumentLoader.java index ee4bbf600..e7c550ab9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IDocumentLoader.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IDocumentLoader.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.IResourceResolver; import gov.nist.secauto.metaschema.core.model.IUriResolver; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItem.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItem.java index 900cbdab6..8c4e48506 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItem.java @@ -3,12 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item; +package gov.nist.secauto.metaschema.core.metapath; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.InvalidTypeFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.stream.Stream; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IItemType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItemType.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IItemType.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItemType.java index 6798f5552..7e3a89084 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IItemType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItemType.java @@ -3,26 +3,27 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; +package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.impl.AnyFunctionItemType; -import gov.nist.secauto.metaschema.core.metapath.type.impl.AnyItemType; -import gov.nist.secauto.metaschema.core.metapath.type.impl.AnyKindTest; -import gov.nist.secauto.metaschema.core.metapath.type.impl.ArrayTestImpl; -import gov.nist.secauto.metaschema.core.metapath.type.impl.KindAssemblyTestImpl; -import gov.nist.secauto.metaschema.core.metapath.type.impl.KindDocumentTestImpl; -import gov.nist.secauto.metaschema.core.metapath.type.impl.KindFieldTestImpl; -import gov.nist.secauto.metaschema.core.metapath.type.impl.KindFlagTestImpl; -import gov.nist.secauto.metaschema.core.metapath.type.impl.MapTestImpl; -import gov.nist.secauto.metaschema.core.metapath.type.impl.TypeConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.TypeConstants; +import gov.nist.secauto.metaschema.core.metapath.function.IMapTest; +import gov.nist.secauto.metaschema.core.metapath.function.impl.AnyFunctionItemType; +import gov.nist.secauto.metaschema.core.metapath.function.impl.ArrayTestImpl; +import gov.nist.secauto.metaschema.core.metapath.function.impl.MapTestImpl; +import gov.nist.secauto.metaschema.core.metapath.impl.AnyItemType; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.impl.AnyKindTest; +import gov.nist.secauto.metaschema.core.metapath.node.impl.KindAssemblyTestImpl; +import gov.nist.secauto.metaschema.core.metapath.node.impl.KindDocumentTestImpl; +import gov.nist.secauto.metaschema.core.metapath.node.impl.KindFieldTestImpl; +import gov.nist.secauto.metaschema.core.metapath.node.impl.KindFlagTestImpl; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItemVisitor.java similarity index 75% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemVisitor.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItemVisitor.java index 3e626b8c3..0d6738c7e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItemVisitor.java @@ -3,13 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item; +package gov.nist.secauto.metaschema.core.metapath; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemWriter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItemWriter.java similarity index 79% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemWriter.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItemWriter.java index a4c380dad..4013302c7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/IItemWriter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IItemWriter.java @@ -3,13 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item; +package gov.nist.secauto.metaschema.core.metapath; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java index d51e756ac..6a2b1e16f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/IMetapathExpression.java @@ -5,16 +5,12 @@ package gov.nist.secauto.metaschema.core.metapath; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; import gov.nist.secauto.metaschema.core.metapath.impl.LazyCompilationMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.impl.MetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigDecimal; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ISequence.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ISequence.java index 7e3a3e5d5..74abeecba 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ISequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ISequence.java @@ -3,16 +3,14 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item; +package gov.nist.secauto.metaschema.core.metapath; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.impl.AbstractSequence; import gov.nist.secauto.metaschema.core.metapath.impl.SequenceN; import gov.nist.secauto.metaschema.core.metapath.impl.SingletonSequence; import gov.nist.secauto.metaschema.core.metapath.impl.StreamSequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/ISequenceType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ISequenceType.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/ISequenceType.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ISequenceType.java index a68c6798d..759add638 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/ISequenceType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ISequenceType.java @@ -3,10 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; +package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.type.impl.SequenceTypeImpl; +import gov.nist.secauto.metaschema.core.metapath.impl.SequenceTypeImpl; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/InvalidTypeMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTypeMetapathException.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/InvalidTypeMetapathException.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTypeMetapathException.java index 56d273d44..455acbb0d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/InvalidTypeMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/InvalidTypeMetapathException.java @@ -3,9 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; - -import gov.nist.secauto.metaschema.core.metapath.item.IItem; +package gov.nist.secauto.metaschema.core.metapath; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ItemUtils.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ItemUtils.java index cf9fc5b82..2b9923c17 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/ItemUtils.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/ItemUtils.java @@ -3,13 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item; +package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.InvalidTreatTypeDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.cst.path.Axis; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentBasedNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentBasedNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/Occurrence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/Occurrence.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/Occurrence.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/Occurrence.java index a62481feb..36d8f8789 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/Occurrence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/Occurrence.java @@ -3,10 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; - -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +package gov.nist.secauto.metaschema.core.metapath; import java.util.Objects; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java index 48fd0ef64..72b537af2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/StaticContext.java @@ -6,17 +6,15 @@ package gov.nist.secauto.metaschema.core.metapath; import gov.nist.secauto.metaschema.core.datatype.DataTypeService; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.metapath.function.FunctionService; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.IFunctionResolver; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; -import gov.nist.secauto.metaschema.core.qname.NamespaceCache; import gov.nist.secauto.metaschema.core.qname.WellKnown; +import gov.nist.secauto.metaschema.core.qname.impl.NamespaceCache; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -34,7 +32,7 @@ import edu.umd.cs.findbugs.annotations.Nullable; /** - * The implementation of a Metapath + * An implementation of the Metapath * static context. */ public final class StaticContext { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathError.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/TypeMetapathError.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathError.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/TypeMetapathError.java index 83f6ded85..cd5afb962 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/TypeMetapathError.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/TypeMetapathError.java @@ -3,10 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; - -import gov.nist.secauto.metaschema.core.metapath.IErrorCode; -import gov.nist.secauto.metaschema.core.metapath.RuntimeMetapathError; +package gov.nist.secauto.metaschema.core.metapath; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAnyAtomicItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractAnyAtomicItem.java similarity index 93% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAnyAtomicItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractAnyAtomicItem.java index 56b71a24a..cda1a45d0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAnyAtomicItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractAnyAtomicItem.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAtomicItemBase.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractAtomicItemBase.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAtomicItemBase.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractAtomicItemBase.java index ff9f9c7cc..a2549f6b8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractAtomicItemBase.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractAtomicItemBase.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/AbstractAtomicOrUnionType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractAtomicOrUnionType.java similarity index 82% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/AbstractAtomicOrUnionType.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractAtomicOrUnionType.java index 0a92b4ed8..7458ac368 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/AbstractAtomicOrUnionType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractAtomicOrUnionType.java @@ -3,10 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.impl.AbstractItemType; +import gov.nist.secauto.metaschema.core.metapath.impl.AbstractItemType; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractUntypedAtomicItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractUntypedAtomicItem.java similarity index 78% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractUntypedAtomicItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractUntypedAtomicItem.java index c3539fa6b..e0e333d50 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/AbstractUntypedAtomicItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/AbstractUntypedAtomicItem.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractStringMapKey; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractStringMapKey; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/DataTypeItemType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/DataTypeItemType.java similarity index 93% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/DataTypeItemType.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/DataTypeItemType.java index 1664d8dfa..c1c34ee75 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/DataTypeItemType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/DataTypeItemType.java @@ -3,10 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; +package gov.nist.secauto.metaschema.core.metapath.atomic; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import java.util.Objects; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyAtomicItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAnyAtomicItem.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyAtomicItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAnyAtomicItem.java index 73be4d6ba..4c63a35d5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyAtomicItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAnyAtomicItem.java @@ -3,15 +3,14 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.IItemVisitor; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.stream.Stream; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyUriItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAnyUriItem.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyUriItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAnyUriItem.java index 5ad81642b..d36eff0b4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAnyUriItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAnyUriItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.AnyUriItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.AnyUriItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IAtomicOrUnionType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAtomicOrUnionType.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IAtomicOrUnionType.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAtomicOrUnionType.java index ed7270215..a8e96faab 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IAtomicOrUnionType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAtomicOrUnionType.java @@ -3,13 +3,14 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; +package gov.nist.secauto.metaschema.core.metapath.atomic; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.TypeMetapathError; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.NonAdapterAtomicItemType; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.impl.NonAdapterAtomicItemType; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAtomicValuedItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAtomicValuedItem.java similarity index 69% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAtomicValuedItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAtomicValuedItem.java index 848afbb8c..485f6208a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IAtomicValuedItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IAtomicValuedItem.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; /** * This marker interface identifies a valued {@link IItem} type that has an diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBase64BinaryItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBase64BinaryItem.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBase64BinaryItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBase64BinaryItem.java index 29c050ef1..15cc4fe1f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBase64BinaryItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBase64BinaryItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.Base64BinaryItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.Base64BinaryItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import java.nio.ByteBuffer; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBooleanItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBooleanItem.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBooleanItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBooleanItem.java index db37c7ab9..fef7f1bc2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBooleanItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBooleanItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.BooleanItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.BooleanItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateItem.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateItem.java index 8668ec4c1..0e634d89a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateItem.java @@ -3,15 +3,14 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousDate; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousDateTime; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.DateWithoutTimeZoneItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.DateWithoutTimeZoneItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.time.LocalDate; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateTimeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateTimeItem.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateTimeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateTimeItem.java index 307d99c1b..77f1bed4e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateTimeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateTimeItem.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousDateTime; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.DateTimeWithoutTimeZoneItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.DateTimeWithoutTimeZoneItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.time.ZonedDateTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateTimeWithTimeZoneItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateTimeWithTimeZoneItem.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateTimeWithTimeZoneItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateTimeWithTimeZoneItem.java index ddfe164a7..c0a750e7b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateTimeWithTimeZoneItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateTimeWithTimeZoneItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.DateTimeWithTimeZoneItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.DateTimeWithTimeZoneItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import java.time.ZonedDateTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateWithTimeZoneItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateWithTimeZoneItem.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateWithTimeZoneItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateWithTimeZoneItem.java index 5d12eca2b..065b8d0e7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDateWithTimeZoneItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDateWithTimeZoneItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.DateWithTimeZoneItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.DateWithTimeZoneItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.time.ZonedDateTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDayTimeDurationItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDayTimeDurationItem.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDayTimeDurationItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDayTimeDurationItem.java index a4791548e..1a09bfbc3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDayTimeDurationItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDayTimeDurationItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.DayTimeDurationItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.DayTimeDurationItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import java.time.Duration; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDecimalItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDecimalItem.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDecimalItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDecimalItem.java index f1c9c652f..87bcc2907 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDecimalItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDecimalItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.DecimalItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.DecimalItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigDecimal; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDurationItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDurationItem.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDurationItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDurationItem.java index 370bd274d..9ee6913b5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IDurationItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IDurationItem.java @@ -3,11 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.TypeConstants; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.impl.TypeConstants; import java.time.temporal.TemporalAmount; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IEmailAddressItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IEmailAddressItem.java similarity index 85% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IEmailAddressItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IEmailAddressItem.java index 66f99007f..a7392a89d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IEmailAddressItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IEmailAddressItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.EmailAddressItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.EmailAddressItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IHostnameItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IHostnameItem.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IHostnameItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IHostnameItem.java index 51b1aa1cf..372c67c84 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IHostnameItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IHostnameItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.HostnameItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.HostnameItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIPAddressItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIPAddressItem.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIPAddressItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIPAddressItem.java index e11550ffa..c8ad59371 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIPAddressItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIPAddressItem.java @@ -3,12 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.TypeConstants; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.impl.TypeConstants; import edu.umd.cs.findbugs.annotations.NonNull; import inet.ipaddr.IPAddress; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIPv4AddressItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIPv4AddressItem.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIPv4AddressItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIPv4AddressItem.java index 251423e29..a9862b443 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIPv4AddressItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIPv4AddressItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.IPv4AddressItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.IPv4AddressItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; import inet.ipaddr.ipv4.IPv4Address; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIPv6AddressItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIPv6AddressItem.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIPv6AddressItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIPv6AddressItem.java index 85f155541..40221106a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIPv6AddressItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIPv6AddressItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.IPv6AddressItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.IPv6AddressItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; import inet.ipaddr.ipv6.IPv6Address; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIntegerItem.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIntegerItem.java index 4fc93dd53..934f8f101 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IIntegerItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.IntegerItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.IntegerItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IMarkupItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IMarkupItem.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IMarkupItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IMarkupItem.java index 521fadfc6..9636affc1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IMarkupItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IMarkupItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import gov.nist.secauto.metaschema.core.datatype.markup.IMarkupString; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IMarkupLineItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IMarkupLineItem.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IMarkupLineItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IMarkupLineItem.java index 587aac901..d07c64df4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IMarkupLineItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IMarkupLineItem.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.MarkupLineItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.MarkupLineItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IMarkupMultilineItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IMarkupMultilineItem.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IMarkupMultilineItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IMarkupMultilineItem.java index 0d39b4b58..7cf296fad 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IMarkupMultilineItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IMarkupMultilineItem.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.MarkupMultiLineItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.MarkupMultiLineItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INcNameItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/INcNameItem.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INcNameItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/INcNameItem.java index 0bf70c40c..3ce73477d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INcNameItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/INcNameItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.NcNameItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.NcNameItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INonNegativeIntegerItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/INonNegativeIntegerItem.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INonNegativeIntegerItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/INonNegativeIntegerItem.java index 6ca793ad9..47de20c64 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INonNegativeIntegerItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/INonNegativeIntegerItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.NonNegativeIntegerItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.NonNegativeIntegerItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INumericItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/INumericItem.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INumericItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/INumericItem.java index c7050104b..d5739227d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INumericItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/INumericItem.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.TypeConstants; import gov.nist.secauto.metaschema.core.metapath.function.ArithmeticFunctionException; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.impl.TypeConstants; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigDecimal; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IPositiveIntegerItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IPositiveIntegerItem.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IPositiveIntegerItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IPositiveIntegerItem.java index 204f427cc..d0468cfdd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IPositiveIntegerItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IPositiveIntegerItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.PositiveIntegerItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.PositiveIntegerItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IStringItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IStringItem.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IStringItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IStringItem.java index e6a67866e..39b09885f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IStringItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IStringItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.StringItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.StringItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITemporalItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITemporalItem.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITemporalItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITemporalItem.java index a46116ecb..28aa6b8fe 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITemporalItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITemporalItem.java @@ -3,11 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.TypeConstants; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.impl.TypeConstants; import java.time.ZonedDateTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITimeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITimeItem.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITimeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITimeItem.java index 254fd02bb..f6e6a896e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITimeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITimeItem.java @@ -3,14 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousTime; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.TimeWithoutTimeZoneItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.TimeWithoutTimeZoneItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import java.time.OffsetTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITimeWithTimeZoneItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITimeWithTimeZoneItem.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITimeWithTimeZoneItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITimeWithTimeZoneItem.java index a29484b53..148696da9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITimeWithTimeZoneItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITimeWithTimeZoneItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.TimeWithTimeZoneItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.TimeWithTimeZoneItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.time.OffsetTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITokenItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITokenItem.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITokenItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITokenItem.java index 79fb74651..bdd22e6a3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/ITokenItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/ITokenItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.TokenItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.TokenItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUntypedAtomicItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUntypedAtomicItem.java similarity index 79% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUntypedAtomicItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUntypedAtomicItem.java index 35aacf25d..e5def54d8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUntypedAtomicItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUntypedAtomicItem.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; /** * An atomic Metapath item containing an untyped atomic data value. diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUriReferenceItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUriReferenceItem.java similarity index 87% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUriReferenceItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUriReferenceItem.java index c0a5a160f..a31813b86 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUriReferenceItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUriReferenceItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.UriReferenceItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.UriReferenceItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUuidItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUuidItem.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUuidItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUuidItem.java index 5e588e396..1f1b0ac8f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUuidItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUuidItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.UuidItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.UuidItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import java.util.UUID; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IYearMonthDurationItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IYearMonthDurationItem.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IYearMonthDurationItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IYearMonthDurationItem.java index aa56b3315..fbf7a1dec 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IYearMonthDurationItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/IYearMonthDurationItem.java @@ -3,13 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.impl.YearMonthDurationItemImpl; import gov.nist.secauto.metaschema.core.metapath.function.InvalidValueForCastFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.impl.YearMonthDurationItemImpl; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.time.Period; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractDateItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractDateItem.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractDateItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractDateItem.java index a071c20db..f52ab4469 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractDateItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractDateItem.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractDateTimeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractDateTimeItem.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractDateTimeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractDateTimeItem.java index 790cfe4d8..17acd3366 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractDateTimeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractDateTimeItem.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractDecimalItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractDecimalItem.java similarity index 80% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractDecimalItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractDecimalItem.java index f7823aa2e..017134273 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractDecimalItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractDecimalItem.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractIPAddressItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractIPAddressItem.java similarity index 85% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractIPAddressItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractIPAddressItem.java index 6ae06e009..2905e8bc9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractIPAddressItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractIPAddressItem.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIPAddressItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIPAddressItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import edu.umd.cs.findbugs.annotations.NonNull; import inet.ipaddr.IPAddress; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractIntegerItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractIntegerItem.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractIntegerItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractIntegerItem.java index a408137a4..09b966d28 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractIntegerItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractIntegerItem.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import java.math.BigDecimal; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractMarkupItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractMarkupItem.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractMarkupItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractMarkupItem.java index ecf5daea2..412f67bc2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractMarkupItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractMarkupItem.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; import gov.nist.secauto.metaschema.core.datatype.markup.IMarkupString; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IMarkupItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IMarkupItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractStringItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractStringItem.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractStringItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractStringItem.java index 2c2d0e069..fb3c99d82 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractStringItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractStringItem.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractStringMapKey; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractStringMapKey; import java.util.regex.Pattern; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractTemporalItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractTemporalItem.java similarity index 81% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractTemporalItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractTemporalItem.java index 19f9fabf7..31bace6c2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractTemporalItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractTemporalItem.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITemporalItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITemporalItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractTimeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractTimeItem.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractTimeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractTimeItem.java index f58f125f7..8bb419431 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractTimeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractTimeItem.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITimeItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractUriItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractUriItem.java similarity index 75% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractUriItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractUriItem.java index a7a8b415a..df2aebd51 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AbstractUriItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AbstractUriItem.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractStringMapKey; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractStringMapKey; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AnyUriItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AnyUriItemImpl.java similarity index 72% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AnyUriItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AnyUriItemImpl.java index 5e24ee30e..e6a588920 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/AnyUriItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/AnyUriItemImpl.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.UriAdapter; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/Base64BinaryItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/Base64BinaryItemImpl.java similarity index 78% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/Base64BinaryItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/Base64BinaryItemImpl.java index 8191c74af..ec8da9d18 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/Base64BinaryItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/Base64BinaryItemImpl.java @@ -3,13 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.Base64Adapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.datatype.Base64Adapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBase64BinaryItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import java.nio.ByteBuffer; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/BooleanItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/BooleanItemImpl.java similarity index 83% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/BooleanItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/BooleanItemImpl.java index ec5b184a1..ec6bc5eff 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/BooleanItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/BooleanItemImpl.java @@ -3,14 +3,14 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAtomicItemBase; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAtomicItemBase; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateTimeWithTimeZoneItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateTimeWithTimeZoneItemImpl.java similarity index 74% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateTimeWithTimeZoneItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateTimeWithTimeZoneItemImpl.java index 4b3d4e4ed..74f4602ff 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateTimeWithTimeZoneItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateTimeWithTimeZoneItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.DateTimeWithTZAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeWithTimeZoneItem; +import gov.nist.secauto.metaschema.core.datatype.DateTimeWithTZAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeWithTimeZoneItem; import java.time.ZonedDateTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateTimeWithoutTimeZoneItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateTimeWithoutTimeZoneItemImpl.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateTimeWithoutTimeZoneItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateTimeWithoutTimeZoneItemImpl.java index ae8f317b0..54e44dadb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateTimeWithoutTimeZoneItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateTimeWithoutTimeZoneItemImpl.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.DateTimeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.DateTimeAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousDateTime; import java.time.ZonedDateTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateWithTimeZoneItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateWithTimeZoneItemImpl.java similarity index 73% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateWithTimeZoneItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateWithTimeZoneItemImpl.java index 9822fd0bf..5b664bcfb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateWithTimeZoneItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateWithTimeZoneItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.DateWithTZAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateWithTimeZoneItem; +import gov.nist.secauto.metaschema.core.datatype.DateWithTZAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateWithTimeZoneItem; import java.time.ZonedDateTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateWithoutTimeZoneItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateWithoutTimeZoneItemImpl.java similarity index 81% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateWithoutTimeZoneItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateWithoutTimeZoneItemImpl.java index bc698bc0a..630842780 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DateWithoutTimeZoneItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DateWithoutTimeZoneItemImpl.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.DateAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.DateAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousDate; import java.time.ZonedDateTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DayTimeDurationItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DayTimeDurationItemImpl.java similarity index 78% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DayTimeDurationItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DayTimeDurationItemImpl.java index 8d04c7818..b5ac09415 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DayTimeDurationItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DayTimeDurationItemImpl.java @@ -3,13 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.DayTimeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.datatype.DayTimeAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import java.time.Duration; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DecimalItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DecimalItemImpl.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DecimalItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DecimalItemImpl.java index d7bde671d..3e54a14a0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/DecimalItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/DecimalItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.DecimalAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.datatype.DecimalAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; import java.math.BigDecimal; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/EmailAddressItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/EmailAddressItemImpl.java similarity index 67% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/EmailAddressItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/EmailAddressItemImpl.java index 964ffcdfe..913d7af10 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/EmailAddressItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/EmailAddressItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.EmailAddressAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IEmailAddressItem; +import gov.nist.secauto.metaschema.core.datatype.EmailAddressAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.IEmailAddressItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/HostnameItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/HostnameItemImpl.java similarity index 67% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/HostnameItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/HostnameItemImpl.java index 8aa51f65e..65924fef1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/HostnameItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/HostnameItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.HostnameAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IHostnameItem; +import gov.nist.secauto.metaschema.core.datatype.HostnameAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.IHostnameItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/IPv4AddressItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/IPv4AddressItemImpl.java similarity index 71% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/IPv4AddressItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/IPv4AddressItemImpl.java index b76a9dcca..0ad567986 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/IPv4AddressItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/IPv4AddressItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.IPv4AddressAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIPv4AddressItem; +import gov.nist.secauto.metaschema.core.datatype.IPv4AddressAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIPv4AddressItem; import edu.umd.cs.findbugs.annotations.NonNull; import inet.ipaddr.ipv4.IPv4Address; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/IPv6AddressItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/IPv6AddressItemImpl.java similarity index 71% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/IPv6AddressItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/IPv6AddressItemImpl.java index d9b88b79b..f783dd717 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/IPv6AddressItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/IPv6AddressItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.IPv6AddressAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIPv6AddressItem; +import gov.nist.secauto.metaschema.core.datatype.IPv6AddressAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIPv6AddressItem; import edu.umd.cs.findbugs.annotations.NonNull; import inet.ipaddr.ipv6.IPv6Address; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/IntegerItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/IntegerItemImpl.java similarity index 73% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/IntegerItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/IntegerItemImpl.java index cc4abe588..25c30461d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/IntegerItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/IntegerItemImpl.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.IntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/MarkupLineItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/MarkupLineItemImpl.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/MarkupLineItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/MarkupLineItemImpl.java index 1a16695ed..d75e81e26 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/MarkupLineItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/MarkupLineItemImpl.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IMarkupLineItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IMarkupLineItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/MarkupMultiLineItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/MarkupMultiLineItemImpl.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/MarkupMultiLineItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/MarkupMultiLineItemImpl.java index 426cb1f3b..8be5241e2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/MarkupMultiLineItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/MarkupMultiLineItemImpl.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultilineAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IMarkupMultilineItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IMarkupMultilineItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/NcNameItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/NcNameItemImpl.java similarity index 69% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/NcNameItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/NcNameItemImpl.java index 7b0b9a88b..bc9223070 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/NcNameItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/NcNameItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.NcNameAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INcNameItem; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.NcNameAdapter; +import gov.nist.secauto.metaschema.core.metapath.atomic.INcNameItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/NonAdapterAtomicItemType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/NonAdapterAtomicItemType.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/NonAdapterAtomicItemType.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/NonAdapterAtomicItemType.java index 6761dfc0d..22545397c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/NonAdapterAtomicItemType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/NonAdapterAtomicItemType.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.AbstractAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import java.util.Objects; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/NonNegativeIntegerItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/NonNegativeIntegerItemImpl.java similarity index 69% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/NonNegativeIntegerItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/NonNegativeIntegerItemImpl.java index cdb07c15f..4bd746a4b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/NonNegativeIntegerItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/NonNegativeIntegerItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INonNegativeIntegerItem; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.NonNegativeIntegerAdapter; +import gov.nist.secauto.metaschema.core.metapath.atomic.INonNegativeIntegerItem; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/PositiveIntegerItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/PositiveIntegerItemImpl.java similarity index 69% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/PositiveIntegerItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/PositiveIntegerItemImpl.java index 95cec453a..ad83dbd19 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/PositiveIntegerItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/PositiveIntegerItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IPositiveIntegerItem; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.PositiveIntegerAdapter; +import gov.nist.secauto.metaschema.core.metapath.atomic.IPositiveIntegerItem; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/StringItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/StringItemImpl.java similarity index 72% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/StringItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/StringItemImpl.java index e8bdc1962..98d9e8adc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/StringItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/StringItemImpl.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/TimeWithTimeZoneItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TimeWithTimeZoneItemImpl.java similarity index 73% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/TimeWithTimeZoneItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TimeWithTimeZoneItemImpl.java index feaea64cd..f46bd26bc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/TimeWithTimeZoneItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TimeWithTimeZoneItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.TimeWithTZAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITimeWithTimeZoneItem; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.TimeWithTZAdapter; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITimeWithTimeZoneItem; import java.time.OffsetTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/TimeWithoutTimeZoneItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TimeWithoutTimeZoneItemImpl.java similarity index 83% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/TimeWithoutTimeZoneItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TimeWithoutTimeZoneItemImpl.java index 8ebee2ff4..dc4112666 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/TimeWithoutTimeZoneItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TimeWithoutTimeZoneItemImpl.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.TimeAdapter; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.TimeAdapter; import gov.nist.secauto.metaschema.core.datatype.object.AmbiguousTime; import java.time.OffsetTime; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/TokenItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TokenItemImpl.java similarity index 67% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/TokenItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TokenItemImpl.java index 98dd86349..b1eb4e071 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/TokenItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TokenItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITokenItem; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITokenItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/TypeConstants.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TypeConstants.java similarity index 81% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/TypeConstants.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TypeConstants.java index c65eb4d91..9aa87d26c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/TypeConstants.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/TypeConstants.java @@ -3,15 +3,15 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIPAddressItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITemporalItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIPAddressItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITemporalItem; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/UriReferenceItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/UriReferenceItemImpl.java similarity index 68% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/UriReferenceItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/UriReferenceItemImpl.java index e50775222..b1dd6ecb9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/UriReferenceItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/UriReferenceItemImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriReferenceAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUriReferenceItem; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.UriReferenceAdapter; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUriReferenceItem; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/UuidItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/UuidItemImpl.java similarity index 75% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/UuidItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/UuidItemImpl.java index e4176f65d..dcc21af96 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/UuidItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/UuidItemImpl.java @@ -3,14 +3,14 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; - -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.UuidAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUuidItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; + +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.UuidAdapter; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUuidItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import java.util.UUID; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/YearMonthDurationItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/YearMonthDurationItemImpl.java similarity index 78% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/YearMonthDurationItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/YearMonthDurationItemImpl.java index f4e60476c..a388553b7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/impl/YearMonthDurationItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/impl/YearMonthDurationItemImpl.java @@ -3,13 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic.impl; +package gov.nist.secauto.metaschema.core.metapath.atomic.impl; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.YearMonthAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.AbstractAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.YearMonthAdapter; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import java.time.Period; import java.util.Objects; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/package-info.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/package-info.java similarity index 70% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/package-info.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/package-info.java index c4f1d4a3d..f7f11b346 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/package-info.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/atomic/package-info.java @@ -7,4 +7,4 @@ * Provides implementations of Metapath atomic data type items. */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java index 945c6da3b..233f83b8d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractExpression.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.TypeMetapathError; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractNamedInstanceExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractNamedInstanceExpression.java index 13152f9ea..720eab3ca 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractNamedInstanceExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AbstractNamedInstanceExpression.java @@ -9,7 +9,7 @@ import gov.nist.secauto.metaschema.core.metapath.cst.path.INodeTestExpression; import gov.nist.secauto.metaschema.core.metapath.cst.path.NameTest; import gov.nist.secauto.metaschema.core.metapath.cst.path.Wildcard; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCall.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCall.java index 27a5b6862..7ead9ac57 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCall.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/AnonymousFunctionCall.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.EnumSet; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java index 1cf08b05a..daed7f969 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCSTVisitor.java @@ -5,11 +5,15 @@ package gov.nist.secauto.metaschema.core.metapath.cst; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.Occurrence; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10; -import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10.ParamContext; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10Lexer; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySequenceConstructor; import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySquareConstructor; import gov.nist.secauto.metaschema.core.metapath.cst.items.DecimalLiteral; @@ -62,13 +66,8 @@ import gov.nist.secauto.metaschema.core.metapath.cst.type.TypeTestSupport; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractKeySpecifier; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; -import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; +import gov.nist.secauto.metaschema.core.metapath.function.IKeySpecifier; +import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractKeySpecifier; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -411,7 +410,7 @@ public IExpression handleInlinefunctionexpr(Metapath10.InlinefunctionexprContext 2, (ctx, idx) -> { int pos = (idx - 1) / 2; - ParamContext tree = ctx.param(pos); + Metapath10.ParamContext tree = ctx.param(pos); return IArgument.of( getContext().parseVariableName(ObjectUtils.notNull(tree.eqname().getText())), tree.typedeclaration() == null diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java index 3e36b81a9..c9074ad76 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/DynamicFunctionCall.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/For.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/For.java index 35c95228f..86bc4c8b3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/For.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/For.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.Let.VariableDeclaration; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.LinkedList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java index bcfbd4cdb..2dc5889e4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/FunctionCallAccessor.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.metapath.function.library.ArrayGet; import gov.nist.secauto.metaschema.core.metapath.function.library.MapGet; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/ICstExpressionFactory.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/ICstExpressionFactory.java index a6f5d3877..f16964b62 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/ICstExpressionFactory.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/ICstExpressionFactory.java @@ -5,6 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.cst.Let.VariableDeclaration; import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySequenceConstructor; import gov.nist.secauto.metaschema.core.metapath.cst.items.ArraySquareConstructor; @@ -14,7 +15,6 @@ import gov.nist.secauto.metaschema.core.metapath.cst.logic.Except; import gov.nist.secauto.metaschema.core.metapath.cst.logic.If; import gov.nist.secauto.metaschema.core.metapath.cst.math.Addition; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import java.math.BigDecimal; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpression.java index c54615d39..1e18b96a7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/IExpression.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Let.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Let.java index 47c887a87..3a7651c0b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Let.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Let.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Metapath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Metapath.java index 6ee1b9f0e..dcdb46077 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Metapath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/Metapath.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java index f9661979e..1d9d964a6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/StaticFunctionCall.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/VariableReference.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/VariableReference.java index c775e8647..ebd723037 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/VariableReference.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/VariableReference.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/AbstractLiteralExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/AbstractLiteralExpression.java index 6d94bd891..a679b6bba 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/AbstractLiteralExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/AbstractLiteralExpression.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/AbstractLookup.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/AbstractLookup.java index 5ad3d9a5e..f331e512e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/AbstractLookup.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/AbstractLookup.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IKeySpecifier; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySequenceConstructor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySequenceConstructor.java index 26f584d77..8a12ac0c5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySequenceConstructor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySequenceConstructor.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySquareConstructor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySquareConstructor.java index 5668989eb..c577a8852 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySquareConstructor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ArraySquareConstructor.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/DecimalLiteral.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/DecimalLiteral.java index 18432f253..c42184f48 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/DecimalLiteral.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/DecimalLiteral.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; import java.math.BigDecimal; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/EmptySequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/EmptySequence.java index 1ca7038bd..47e42f581 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/EmptySequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/EmptySequence.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.Collections; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ILiteralExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ILiteralExpression.java index f4e62453f..eea868831 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ILiteralExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/ILiteralExpression.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import java.util.Collections; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/IntegerLiteral.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/IntegerLiteral.java index 2a92f3153..d135924f5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/IntegerLiteral.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/IntegerLiteral.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Intersect.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Intersect.java index f5543f928..1d8ba3229 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Intersect.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Intersect.java @@ -5,11 +5,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.cst.logic.AbstractFilterExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/MapConstructor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/MapConstructor.java index 82836ac45..0d85128b6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/MapConstructor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/MapConstructor.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/PostfixLookup.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/PostfixLookup.java index ecaadea6a..85131c22f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/PostfixLookup.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/PostfixLookup.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IKeySpecifier; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Quantified.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Quantified.java index 1071f9f90..2700609e5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Quantified.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Quantified.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Range.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Range.java index c30ffe2bc..291acccb7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Range.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Range.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractBinaryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import java.math.BigInteger; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/SimpleMap.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/SimpleMap.java index cf2502fbb..9cbe5bbcf 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/SimpleMap.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/SimpleMap.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractBinaryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringConcat.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringConcat.java index 2b3561ee7..cfaf1b04c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringConcat.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringConcat.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNAryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnConcat; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringLiteral.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringLiteral.java index c1235f019..eccb40620 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringLiteral.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/StringLiteral.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/UnaryLookup.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/UnaryLookup.java index 417a2c962..6fb6091b5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/UnaryLookup.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/UnaryLookup.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IKeySpecifier; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Union.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Union.java index 0b320914e..83e282b28 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Union.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/items/Union.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.items; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNAryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/AbstractFilterExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/AbstractFilterExpression.java index 659e0d7c4..cfd074ff9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/AbstractFilterExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/AbstractFilterExpression.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractBinaryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/And.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/And.java index 2bd3aad20..76d5a5870 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/And.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/And.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNAryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Except.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Except.java index 8170b61c5..47f0c0f25 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Except.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Except.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/GeneralComparison.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/GeneralComparison.java index d2ac892de..42b024b09 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/GeneralComparison.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/GeneralComparison.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/IBooleanLogicExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/IBooleanLogicExpression.java index 77767241c..99fafd120 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/IBooleanLogicExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/IBooleanLogicExpression.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; public interface IBooleanLogicExpression extends IExpression { @Override diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/If.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/If.java index a00c15fd5..f9a9f1765 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/If.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/If.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Negate.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Negate.java index 41c245413..56018e3e5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Negate.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Negate.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractUnaryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Or.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Or.java index cf6e933f3..4484c8441 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Or.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/Or.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNAryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import java.util.Arrays; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpression.java index 35d63d1c7..22fbfbbe2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpression.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathEvaluationFeature; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.cst.items.IntegerLiteral; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparison.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparison.java index 00c1727c8..5c6a44653 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparison.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparison.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.logic; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractArithmeticExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractArithmeticExpression.java index f2d9b7343..ba4e4bae8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractArithmeticExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractArithmeticExpression.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractBinaryExpression; import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractBasicArithmeticExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractBasicArithmeticExpression.java index e04d0a18b..b5bfa2a29 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractBasicArithmeticExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/AbstractBasicArithmeticExpression.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Addition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Addition.java index 5a8263343..8eb0b88dd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Addition.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Addition.java @@ -5,17 +5,17 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Division.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Division.java index d13cda286..063685402 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Division.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Division.java @@ -5,16 +5,16 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/IntegerDivision.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/IntegerDivision.java index f72ee98a2..aca6403a1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/IntegerDivision.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/IntegerDivision.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Modulo.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Modulo.java index 050f0c10f..4f76e3634 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Modulo.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Modulo.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Multiplication.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Multiplication.java index f943a2cd2..7a9f203e6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Multiplication.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Multiplication.java @@ -5,16 +5,16 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Subtraction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Subtraction.java index b16e493a8..b62d09d3e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Subtraction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/math/Subtraction.java @@ -5,18 +5,18 @@ package gov.nist.secauto.metaschema.core.metapath.cst.math; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java index 591b245d3..4f1517996 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractPathExpression.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; -import gov.nist.secauto.metaschema.core.metapath.item.node.ICycledAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.ICycledAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.stream.Stream; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractRelativePathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractRelativePathExpression.java index a89bb585d..2ca89efb8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractRelativePathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractRelativePathExpression.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractRootPathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractRootPathExpression.java index 16495f487..f7a9784e1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractRootPathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/AbstractRootPathExpression.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java index 578f4e57e..e9b479d5e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Axis.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java index 5c3bdf74c..dd164de4d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ContextItem.java @@ -7,10 +7,10 @@ import gov.nist.secauto.metaschema.core.metapath.ContextAbsentDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import java.util.Collections; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java index b17c6b906..cbc3e4071 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Flag.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNamedInstanceExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/INameTestExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/INameTestExpression.java index c5b607227..569b30fc9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/INameTestExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/INameTestExpression.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import java.util.Collections; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/IPathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/IPathExpression.java index 9ab010c70..64750c99d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/IPathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/IPathExpression.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; public interface IPathExpression extends IExpression { @Override diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/IWildcardMatcher.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/IWildcardMatcher.java index 4826e1b0a..dd8baee8d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/IWildcardMatcher.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/IWildcardMatcher.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.metapath.cst.type.MatchAnyLocalName; import gov.nist.secauto.metaschema.core.metapath.cst.type.MatchAnyNamespace; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; import java.util.function.Predicate; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java index e25b75aa2..66b0f8c80 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/ModelInstance.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractNamedInstanceExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModelNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java index 7cce923fd..b919631e0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/NameTest.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeDoubleSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeDoubleSlashPath.java index e1f2694de..fe6943bd9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeDoubleSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeDoubleSlashPath.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import java.util.stream.Stream; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeSlashPath.java index 03d87c34d..0edc32d1b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RelativeSlashPath.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java index 764c21eeb..a3cc4104a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootDoubleSlashPath.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java index 46481257f..f926ae2b8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyPath.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentBasedNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentBasedNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java index 06063dafe..562f250eb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashPath.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Step.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Step.java index aff388ef2..780bdb653 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Step.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Step.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java index 95015ee72..3631d26f6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/path/Wildcard.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.path; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ItemUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.ItemUtils; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.function.Predicate; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/AbstractCastingExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/AbstractCastingExpression.java index 1b9d0a388..e4d1bae3d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/AbstractCastingExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/AbstractCastingExpression.java @@ -5,12 +5,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Cast.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Cast.java index 89cf201b4..432dcf9d7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Cast.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Cast.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Castable.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Castable.java index ba9bc0697..020e4583f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Castable.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Castable.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOf.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOf.java index d86812771..2410f9a69 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOf.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOf.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.AbstractExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/MatchAnyLocalName.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/MatchAnyLocalName.java index 6d7eb4338..b7b826ded 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/MatchAnyLocalName.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/MatchAnyLocalName.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.cst.path.IWildcardMatcher; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/MatchAnyNamespace.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/MatchAnyNamespace.java index c3a7ffa60..73af8b005 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/MatchAnyNamespace.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/MatchAnyNamespace.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.cst.path.IWildcardMatcher; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java index f17dacd89..099f2c82f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/Treat.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; import gov.nist.secauto.metaschema.core.metapath.InvalidTreatTypeDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.IExpressionVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/TypeTestSupport.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/TypeTestSupport.java index bd3181fb6..83f23ec1f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/TypeTestSupport.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/TypeTestSupport.java @@ -5,19 +5,19 @@ package gov.nist.secauto.metaschema.core.metapath.cst.type; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.Occurrence; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10Lexer; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; -import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/IPathFormatter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/IPathFormatter.java index 8f4865331..bb2c0bca5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/IPathFormatter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/IPathFormatter.java @@ -5,13 +5,13 @@ package gov.nist.secauto.metaschema.core.metapath.format; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyInstanceGroupedNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyInstanceGroupedNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IRootAssemblyNodeItem; import java.util.stream.Collectors; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/IPathSegment.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/IPathSegment.java index e480c3045..0ee8bc41a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/IPathSegment.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/IPathSegment.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.format; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IMetapathQueryable; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/MetapathFormatter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/MetapathFormatter.java index df04609b1..ee990de93 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/MetapathFormatter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/MetapathFormatter.java @@ -5,15 +5,15 @@ package gov.nist.secauto.metaschema.core.metapath.format; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyInstanceGroupedNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyInstanceGroupedNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModelNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IRootAssemblyNodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArgumentImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArgumentImpl.java index 4ce49e68e..832d03bbe 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArgumentImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ArgumentImpl.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import java.util.Objects; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/CalledContext.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/CalledContext.java index b9511031f..9178ea930 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/CalledContext.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/CalledContext.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import java.util.List; import java.util.Objects; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ComparisonFunctions.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ComparisonFunctions.java index b5ecd4bc4..017cfa9b5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ComparisonFunctions.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/ComparisonFunctions.java @@ -5,23 +5,23 @@ package gov.nist.secauto.metaschema.core.metapath.function; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBase64BinaryItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUntypedAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; import gov.nist.secauto.metaschema.core.metapath.function.library.FnNot; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUntypedAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import java.util.Locale; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DefaultFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DefaultFunction.java index d7747d02a..c9a3d6be2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DefaultFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/DefaultFunction.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; import java.util.Collections; import java.util.EnumSet; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java index aedcc2886..5ac63ea25 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionUtils.java @@ -5,13 +5,13 @@ package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.TypeMetapathError; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.TypeMetapathError; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigInteger; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java index fac1b9f23..b433d52af 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArgument.java @@ -5,12 +5,12 @@ package gov.nist.secauto.metaschema.core.metapath.function; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.Occurrence; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; -import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; import gov.nist.secauto.metaschema.core.qname.EQNameFactory; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArrayItem.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArrayItem.java index 89a2ac40b..ae446d1e3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArrayItem.java @@ -3,17 +3,16 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function; - -import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.ArrayItemN; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; +package gov.nist.secauto.metaschema.core.metapath.function; + +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.IItemVisitor; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.impl.ArrayItemN; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IArrayTest.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArrayTest.java similarity index 82% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IArrayTest.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArrayTest.java index 0c513cef3..45b268e55 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IArrayTest.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IArrayTest.java @@ -3,10 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; +package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java index f0a39b698..5d492d402 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java @@ -6,15 +6,15 @@ package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.Occurrence; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; -import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionExecutor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionExecutor.java index 606d3c630..31f2980c4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionExecutor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionExecutor.java @@ -6,9 +6,9 @@ package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IKeySpecifier.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IKeySpecifier.java similarity index 76% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IKeySpecifier.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IKeySpecifier.java index a1bfa4a11..17441b5a2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IKeySpecifier.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IKeySpecifier.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function; +package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import java.util.stream.Stream; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IMapItem.java similarity index 96% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IMapItem.java index 91fc3dddd..be776e0a5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IMapItem.java @@ -3,17 +3,16 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function; +package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.AbstractMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.MapItemN; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.IItemVisitor; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.function.impl.AbstractMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.impl.MapItemN; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.LinkedHashMap; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapKey.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IMapKey.java similarity index 70% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapKey.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IMapKey.java index 623ab45ee..360db0d1b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IMapKey.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IMapKey.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function; +package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IMapTest.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IMapTest.java similarity index 83% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IMapTest.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IMapTest.java index acb57b340..cb121dfa9 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IMapTest.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IMapTest.java @@ -3,10 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; +package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IndexOutOfBoundsArrayMetapathException.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IndexOutOfBoundsArrayMetapathException.java index 45a4ab664..e0ef58685 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/IndexOutOfBoundsArrayMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IndexOutOfBoundsArrayMetapathException.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function; +package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.ArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.impl.ArrayMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java index bf35f11e5..d7fe6ec73 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/InvalidTypeFunctionException.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.function; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import java.util.Locale; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/NegativeLengthArrayMetapathException.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/NegativeLengthArrayMetapathException.java index 3639a47c8..3f1db19d5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/NegativeLengthArrayMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/NegativeLengthArrayMetapathException.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function; +package gov.nist.secauto.metaschema.core.metapath.function; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.ArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.impl.ArrayMetapathException; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractArrayItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractArrayItem.java similarity index 65% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractArrayItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractArrayItem.java index 78e98dfbe..4d493aed1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractArrayItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractArrayItem.java @@ -3,25 +3,20 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; -import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; -import java.util.EnumSet; import java.util.List; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import edu.umd.cs.findbugs.annotations.NonNull; @@ -35,18 +30,12 @@ */ public abstract class AbstractArrayItem extends ImmutableCollections.AbstractImmutableDelegatedList - implements IArrayItem { + implements IArrayItem, IFeatureCollectionFunctionItem { @NonNull private static final IEnhancedQName QNAME = IEnhancedQName.of("array"); @NonNull - private static final Set PROPERTIES = ObjectUtils.notNull( - EnumSet.of(FunctionProperty.DETERMINISTIC)); - @NonNull private static final List ARGUMENTS = ObjectUtils.notNull(List.of( IArgument.builder().name("position").type(IIntegerItem.type()).one().build())); - @NonNull - private static final ISequenceType RESULT = ISequenceType.of( - IAnyAtomicItem.type(), Occurrence.ZERO_OR_ONE); @NonNull private static final IArrayItem EMPTY = new ArrayItemN<>(); @@ -64,51 +53,16 @@ public static IArrayItem empty() { return (IArrayItem) EMPTY; } - @Override - public boolean isDeterministic() { - return true; - } - - @Override - public boolean isContextDepenent() { - return false; - } - - @Override - public boolean isFocusDependent() { - return false; - } - @Override public IEnhancedQName getQName() { return QNAME; } - @Override - public Set getProperties() { - return PROPERTIES; - } - @Override public List getArguments() { return ARGUMENTS; } - @Override - public int arity() { - return 1; - } - - @Override - public boolean isArityUnbounded() { - return false; - } - - @Override - public ISequenceType getResult() { - return RESULT; - } - @Override public ISequence execute(List> arguments, DynamicContext dynamicContext, ISequence focus) { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java index f6979c09d..cf88c879f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractFunction.java @@ -7,19 +7,19 @@ import gov.nist.secauto.metaschema.core.metapath.ContextAbsentDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.IItemVisitor; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.CalledContext; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractKeySpecifier.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractKeySpecifier.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractKeySpecifier.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractKeySpecifier.java index cbecebdc2..ac76d05a5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractKeySpecifier.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractKeySpecifier.java @@ -3,22 +3,22 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IKeySpecifier; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IndexOutOfBoundsArrayMetapathException; import gov.nist.secauto.metaschema.core.metapath.function.library.ArrayGet; import gov.nist.secauto.metaschema.core.metapath.function.library.MapGet; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IKeySpecifier; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.stream.Stream; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractMapItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractMapItem.java similarity index 65% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractMapItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractMapItem.java index 78adfa6e7..fefa014c7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractMapItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractMapItem.java @@ -3,27 +3,23 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import gov.nist.secauto.metaschema.core.metapath.function.library.MapGet; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; -import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; -import java.util.EnumSet; import java.util.List; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import edu.umd.cs.findbugs.annotations.NonNull; @@ -37,27 +33,18 @@ */ public abstract class AbstractMapItem extends ImmutableCollections.AbstractImmutableDelegatedMap - implements IMapItem { + implements IMapItem, IFeatureCollectionFunctionItem { /** * The function qualified name. */ @NonNull private static final IEnhancedQName QNAME = IEnhancedQName.of("map"); - /** - * The function properties. - */ - @NonNull - private static final Set PROPERTIES = ObjectUtils.notNull( - EnumSet.of(FunctionProperty.DETERMINISTIC)); /** * The function arguments. */ @NonNull private static final List ARGUMENTS = ObjectUtils.notNull(List.of( IArgument.builder().name("key").type(IAnyAtomicItem.type()).one().build())); - @NonNull - private static final ISequenceType RESULT = ISequenceType.of( - IAnyAtomicItem.type(), Occurrence.ZERO_OR_ONE); @NonNull private static final IMapItem EMPTY = new MapItemN<>(); @@ -76,51 +63,16 @@ public static IMapItem empty() { return (IMapItem) EMPTY; } - @Override - public boolean isDeterministic() { - return true; - } - - @Override - public boolean isContextDepenent() { - return false; - } - - @Override - public boolean isFocusDependent() { - return false; - } - @Override public IEnhancedQName getQName() { return QNAME; } - @Override - public Set getProperties() { - return PROPERTIES; - } - @Override public List getArguments() { return ARGUMENTS; } - @Override - public int arity() { - return 1; - } - - @Override - public boolean isArityUnbounded() { - return false; - } - - @Override - public ISequenceType getResult() { - return RESULT; - } - @Override public ISequence execute(List> arguments, DynamicContext dynamicContext, ISequence focus) { diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractStringMapKey.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractStringMapKey.java similarity index 79% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractStringMapKey.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractStringMapKey.java index e123da357..6498e4acc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/AbstractStringMapKey.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AbstractStringMapKey.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; /** * An implementation of a {@link IMapKey} that uses a string-based value. diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AnyFunctionItemType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AnyFunctionItemType.java similarity index 79% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AnyFunctionItemType.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AnyFunctionItemType.java index 911cf9157..33a85befd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AnyFunctionItemType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/AnyFunctionItemType.java @@ -3,12 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.impl.AbstractItemType; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayItemN.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ArrayItemN.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayItemN.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ArrayItemN.java index 20d266813..7573a4cae 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayItemN.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ArrayItemN.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; @@ -49,5 +49,4 @@ public ArrayItemN(@NonNull List items) { public List getValue() { return items; } - } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ArrayMetapathException.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ArrayMetapathException.java index 02e9e5b57..2cb3457b7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ArrayMetapathException.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ArrayMetapathException.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; import gov.nist.secauto.metaschema.core.metapath.IErrorCode; import gov.nist.secauto.metaschema.core.metapath.function.FunctionMetapathError; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/ArrayTestImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ArrayTestImpl.java similarity index 72% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/ArrayTestImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ArrayTestImpl.java index a019b71fe..e261230e7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/ArrayTestImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ArrayTestImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.type.IArrayTest; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayTest; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/IFeatureCollectionFunctionItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/IFeatureCollectionFunctionItem.java new file mode 100644 index 000000000..8782345d8 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/IFeatureCollectionFunctionItem.java @@ -0,0 +1,67 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +package gov.nist.secauto.metaschema.core.metapath.function.impl; + +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.Occurrence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; + +import java.util.EnumSet; +import java.util.Set; + +import edu.umd.cs.findbugs.annotations.NonNull; + +public interface IFeatureCollectionFunctionItem extends IFunction { + /** + * The function properties. + */ + @NonNull + Set PROPERTIES = ObjectUtils.notNull( + EnumSet.of(FunctionProperty.DETERMINISTIC)); + /** + * The function result. + */ + @NonNull + ISequenceType RESULT = ISequenceType.of( + IAnyAtomicItem.type(), Occurrence.ZERO_OR_ONE); + + @Override + default boolean isDeterministic() { + return true; + } + + @Override + default boolean isContextDepenent() { + return false; + } + + @Override + default boolean isFocusDependent() { + return false; + } + + @Override + default Set getProperties() { + return PROPERTIES; + } + + @Override + default int arity() { + return 1; + } + + @Override + default boolean isArityUnbounded() { + return false; + } + + @Override + default ISequenceType getResult() { + return RESULT; + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ImmutableCollections.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ImmutableCollections.java similarity index 98% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ImmutableCollections.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ImmutableCollections.java index 8c4b810ae..da2d310ae 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/ImmutableCollections.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/ImmutableCollections.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/MapItemN.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/MapItemN.java similarity index 85% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/MapItemN.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/MapItemN.java index 0b61691c7..ce2afe1ce 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/function/impl/MapItemN.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/MapItemN.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/MapTestImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/MapTestImpl.java similarity index 74% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/MapTestImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/MapTestImpl.java index 1216e727f..451697938 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/MapTestImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/MapTestImpl.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.function.impl; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.IMapTest; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapTest; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/OperationFunctions.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/OperationFunctions.java index 8aca81644..941dab622 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/OperationFunctions.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/impl/OperationFunctions.java @@ -5,23 +5,23 @@ package gov.nist.secauto.metaschema.core.metapath.function.impl; // NOPMD - intentional +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBase64BinaryItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeWithTimeZoneItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateWithTimeZoneItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.function.ArithmeticFunctionException; import gov.nist.secauto.metaschema.core.metapath.function.DateTimeFunctionException; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeWithTimeZoneItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateWithTimeZoneItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigDecimal; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppend.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppend.java index 0cb5afcee..bf7e67847 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppend.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppend.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlatten.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlatten.java index 07f498403..4236ec00f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlatten.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlatten.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java index fb6fd6cd2..bccbf8535 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGet.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.IndexOutOfBoundsArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHead.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHead.java index 8abf3cdbc..9086da32e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHead.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHead.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java index a008df47d..d38377815 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBefore.java @@ -6,17 +6,17 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.function.NegativeLengthArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.IndexOutOfBoundsArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.NegativeLengthArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoin.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoin.java index 8ed1e4483..0423913eb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoin.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoin.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.Collection; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java index 45903a3fe..c9733eda4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPut.java @@ -6,17 +6,17 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.function.NegativeLengthArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.IndexOutOfBoundsArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.NegativeLengthArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java index 2816bac46..54f1a127a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemove.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.function.NegativeLengthArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.IndexOutOfBoundsArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.NegativeLengthArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.Collection; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverse.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverse.java index 010cfcd32..586b13362 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverse.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverse.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySize.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySize.java index 574b7caff..f812c4396 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySize.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySize.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java index ba174a1e8..e765772f2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarray.java @@ -6,17 +6,17 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IndexOutOfBoundsArrayMetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.function.NegativeLengthArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.IndexOutOfBoundsArrayMetapathException; +import gov.nist.secauto.metaschema.core.metapath.function.NegativeLengthArrayMetapathException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTail.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTail.java index 0f87fdf42..630f78f5a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTail.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTail.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunction.java index 7d69294f4..554151045 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunction.java @@ -6,15 +6,15 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.AbstractAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.IFunctionExecutor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.AbstractAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java index 4c4e7b25f..4daed2faa 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/DefaultFunctionLibrary.java @@ -8,8 +8,8 @@ import gov.nist.secauto.metaschema.core.datatype.DataTypeService; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionLibrary; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbs.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbs.java index 943a5f924..07d3fc2e4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbs.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbs.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvg.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvg.java index 0e70ed55c..42d3fd0cb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvg.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvg.java @@ -6,20 +6,20 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBaseUri.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBaseUri.java index 8ea5299fc..b7fc15929 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBaseUri.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBaseUri.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBoolean.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBoolean.java index fc523ee1a..96a7d8530 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBoolean.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBoolean.java @@ -6,19 +6,19 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUntypedAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUntypedAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeiling.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeiling.java index 59354697d..d646b24ec 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeiling.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeiling.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCompare.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCompare.java index daa9b740d..9fbd966ad 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCompare.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCompare.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcat.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcat.java index 1d71b46ac..09e28bc9d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcat.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcat.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.Arrays; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContains.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContains.java index 8c43dc82e..724219ae0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContains.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContains.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCount.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCount.java index 36d86f8ec..ea56c7d19 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCount.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCount.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentDateTime.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentDateTime.java index 90f072f29..8190d56ba 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentDateTime.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentDateTime.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeWithTimeZoneItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeWithTimeZoneItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTime.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTime.java index bc648aa1f..454c5b559 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTime.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCurrentTime.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.ITimeWithTimeZoneItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.ITimeWithTimeZoneItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnData.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnData.java index ad5cc0ab3..14e0f1b67 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnData.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnData.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDoc.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDoc.java index 0d26c6157..d6040ae40 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDoc.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDoc.java @@ -6,17 +6,17 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.DocumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.io.IOException; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailable.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailable.java index 1687d8245..d3885d34d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailable.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailable.java @@ -6,18 +6,18 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.DocumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.UriFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.io.IOException; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentUri.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentUri.java index ea447fcaf..86d776dc8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentUri.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentUri.java @@ -6,15 +6,15 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmpty.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmpty.java index 33abc9d53..99f4de918 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmpty.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmpty.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWith.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWith.java index fdd8c75ff..78c8d2412 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWith.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWith.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExists.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExists.java index 5eac41385..a4d614cdd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExists.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExists.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalse.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalse.java index 20f5e24a3..5e06b5680 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalse.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalse.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHead.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHead.java index 6f68e5be3..b42ec592c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHead.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHead.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezone.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezone.java index d6d7bfb10..0545bb20b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezone.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezone.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.time.Duration; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBefore.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBefore.java index 80995eb5e..2cd256137 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBefore.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBefore.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCase.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCase.java index 53df351e9..0e434d8c4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCase.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCase.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatches.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatches.java index 70338d601..2521a6ef3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatches.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatches.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegexUtil; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegularExpressionMetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMax.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMax.java index 907f4d773..1abc309ee 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMax.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMax.java @@ -6,23 +6,23 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBase64BinaryItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUntypedAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUntypedAtomicItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpace.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpace.java index ab93eb232..d24d86198 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpace.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpace.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNot.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNot.java index c89dc240f..ba7203e91 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNot.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNot.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnPath.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnPath.java index cfd7a0705..c82645a38 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnPath.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnPath.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemove.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemove.java index 35f8298f8..940396969 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemove.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemove.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnResolveUri.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnResolveUri.java index 50bc0909c..1146138d7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnResolveUri.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnResolveUri.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.function.UriFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverse.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverse.java index 5d65df9b1..e08b43b17 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverse.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverse.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.ArrayList; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRound.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRound.java index 6ec69c8d3..01a9dfbee 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRound.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRound.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWith.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWith.java index 7baae01b4..329423bd6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWith.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWith.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStaticBaseUri.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStaticBaseUri.java index 84f25bcc2..23e5eee9e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStaticBaseUri.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStaticBaseUri.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import java.net.URI; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnString.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnString.java index e1d4e0024..31d5c2793 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnString.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnString.java @@ -6,17 +6,17 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidTypeFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLength.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLength.java index cc9d012a1..821292c15 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLength.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLength.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstring.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstring.java index 2049f8d0e..2f6121032 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstring.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstring.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java index 3de5ca32b..aafc28a01 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.apache.commons.lang3.StringUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java index 234452a63..28e42d8d1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.apache.commons.lang3.StringUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSum.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSum.java index 61ce339e5..2f36d0fdb 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSum.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSum.java @@ -6,19 +6,19 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTail.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTail.java index 4583ec7de..abe13886c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTail.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTail.java @@ -6,12 +6,12 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenize.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenize.java index 388b09f3b..a42e40aba 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenize.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenize.java @@ -6,15 +6,15 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegexUtil; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegularExpressionMetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrue.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrue.java index b1ba91d00..ef44715f6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrue.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrue.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCase.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCase.java index 2ff840f83..5cc4a6787 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCase.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCase.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContains.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContains.java index aff55b8dc..27b6a4987 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContains.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContains.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntry.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntry.java index 6351053eb..c4d156b58 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntry.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntry.java @@ -6,15 +6,15 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFind.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFind.java index 1cb391ddf..b51d3f78b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFind.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFind.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.Collection; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGet.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGet.java index 5c7b62396..175ad5c90 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGet.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGet.java @@ -6,15 +6,15 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeys.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeys.java index eb93b21e0..aa858ca0b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeys.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeys.java @@ -6,15 +6,15 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMerge.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMerge.java index bcef07c3a..917436e2f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMerge.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMerge.java @@ -6,18 +6,18 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import gov.nist.secauto.metaschema.core.metapath.function.JsonFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPut.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPut.java index a7e058ca9..5331fa251 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPut.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPut.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.HashMap; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemove.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemove.java index 4c5b63ab8..c0e440db6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemove.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemove.java @@ -6,16 +6,16 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.Collection; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSize.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSize.java index 53623c773..396b03346 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSize.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSize.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java index e544c8995..1d18bf230 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/MpRecurseDepth.java @@ -6,17 +6,17 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/NumericFunction.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/NumericFunction.java index 549a6ddc3..75e7f71fd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/NumericFunction.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/library/NumericFunction.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; import gov.nist.secauto.metaschema.core.metapath.function.IFunctionExecutor; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AbstractItemType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractItemType.java similarity index 80% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AbstractItemType.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractItemType.java index 87266cf50..a3a38656c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AbstractItemType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractItemType.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.impl; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java index bb56991e4..283a0e691 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AbstractSequence.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.core.metapath.impl; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.impl.ImmutableCollections; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.function.impl.ImmutableCollections; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.stream.Collectors; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AnyItemType.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AnyItemType.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AnyItemType.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AnyItemType.java index 4ae9c4c68..e4851724b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AnyItemType.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/AnyItemType.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.impl; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java index 21a204ba3..5c61f9b8b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/ErroniousMetapathExpression.java @@ -6,10 +6,10 @@ package gov.nist.secauto.metaschema.core.metapath.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/LazyCompilationMetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/LazyCompilationMetapathExpression.java index 0336f215b..316355aa5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/LazyCompilationMetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/LazyCompilationMetapathExpression.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.metapath.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java index 6ed842c60..dba66257d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/MetapathExpression.java @@ -6,6 +6,8 @@ package gov.nist.secauto.metaschema.core.metapath.impl; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; @@ -17,8 +19,6 @@ import gov.nist.secauto.metaschema.core.metapath.cst.CSTPrinter; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.cst.path.ContextItem; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.antlr.v4.runtime.CharStreams; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SequenceN.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SequenceN.java index 6aca051b1..462c5bb0d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SequenceN.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SequenceN.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.impl; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/SequenceTypeImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SequenceTypeImpl.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/SequenceTypeImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SequenceTypeImpl.java index 13a92d3b9..bce5fed1a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/SequenceTypeImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SequenceTypeImpl.java @@ -3,14 +3,14 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; - -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.ISequenceType; -import gov.nist.secauto.metaschema.core.metapath.type.Occurrence; +package gov.nist.secauto.metaschema.core.metapath.impl; + +import gov.nist.secauto.metaschema.core.metapath.ICollectionValue; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequenceType; +import gov.nist.secauto.metaschema.core.metapath.Occurrence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.Objects; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SingletonSequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SingletonSequence.java index f9204d23f..91e37bdba 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SingletonSequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/SingletonSequence.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.impl; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/StreamSequence.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/StreamSequence.java index b5654339a..168b4a585 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/StreamSequence.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/impl/StreamSequence.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.metapath.impl; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/package-info.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/package-info.java deleted file mode 100644 index 109dcdaf4..000000000 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-FileCopyrightText: none - * SPDX-License-Identifier: CC0-1.0 - */ - -/** - * The Metapath type system, which overlays the Metaschema type system defined - * in {@link gov.nist.secauto.metaschema.core.datatype}. - */ - -package gov.nist.secauto.metaschema.core.metapath.item; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractDefinitionNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractDefinitionNodeItem.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractDefinitionNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractDefinitionNodeItem.java index 53b445b70..272d378af 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractDefinitionNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractDefinitionNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.INamedInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractFlagInstanceNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractFlagInstanceNodeItem.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractFlagInstanceNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractFlagInstanceNodeItem.java index dd7203c60..727c39c1e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractFlagInstanceNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractFlagInstanceNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; import gov.nist.secauto.metaschema.core.model.IFlagInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractGlobalDefinitionNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractGlobalDefinitionNodeItem.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractGlobalDefinitionNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractGlobalDefinitionNodeItem.java index 4734fb40c..84abffdc0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractGlobalDefinitionNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractGlobalDefinitionNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.model.IDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractInstanceNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractInstanceNodeItem.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractInstanceNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractInstanceNodeItem.java index db0d6074b..c212e4cdd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractInstanceNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractInstanceNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.IModelDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractNodeItem.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractNodeItem.java index 58aff1707..e6676155a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItemFactory.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractNodeItemFactory.java similarity index 99% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItemFactory.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractNodeItemFactory.java index 0dd694ccf..b146cfac0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItemFactory.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractNodeItemFactory.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItemVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractNodeItemVisitor.java similarity index 98% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItemVisitor.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractNodeItemVisitor.java index 40f8b28e7..81b4362d3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractNodeItemVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractNodeItemVisitor.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import java.util.List; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractOrphanedDefinitionNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractOrphanedDefinitionNodeItem.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractOrphanedDefinitionNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractOrphanedDefinitionNodeItem.java index a35267aa1..7201a556c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractOrphanedDefinitionNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractOrphanedDefinitionNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.model.IDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractRecursionPreventingNodeItemVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractRecursionPreventingNodeItemVisitor.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractRecursionPreventingNodeItemVisitor.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractRecursionPreventingNodeItemVisitor.java index afec70232..490ab7d43 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractRecursionPreventingNodeItemVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractRecursionPreventingNodeItemVisitor.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyGlobalDefinitionNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyGlobalDefinitionNodeItemImpl.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyGlobalDefinitionNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyGlobalDefinitionNodeItemImpl.java index 44f4aca49..a9a304526 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyGlobalDefinitionNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyGlobalDefinitionNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyInstanceNoValueNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyInstanceNoValueNodeItemImpl.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyInstanceNoValueNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyInstanceNoValueNodeItemImpl.java index 3c4d40fe8..520463a21 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyInstanceNoValueNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyInstanceNoValueNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyInstanceNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyInstanceNodeItemImpl.java similarity index 96% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyInstanceNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyInstanceNodeItemImpl.java index 6951b8801..6b5bb158c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyInstanceNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyInstanceNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyOrphanedDefinitionDataNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyOrphanedDefinitionDataNodeItemImpl.java similarity index 96% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyOrphanedDefinitionDataNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyOrphanedDefinitionDataNodeItemImpl.java index a1bb46469..603592c5a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyOrphanedDefinitionDataNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyOrphanedDefinitionDataNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyOrphanedDefinitionNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyOrphanedDefinitionNodeItemImpl.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyOrphanedDefinitionNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyOrphanedDefinitionNodeItemImpl.java index 233a2e887..ca729bd6c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/AssemblyOrphanedDefinitionNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/AssemblyOrphanedDefinitionNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/CycledAssemblyInstanceNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/CycledAssemblyInstanceNodeItemImpl.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/CycledAssemblyInstanceNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/CycledAssemblyInstanceNodeItemImpl.java index e23c44654..756a05cb6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/CycledAssemblyInstanceNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/CycledAssemblyInstanceNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/DefaultNodeItemFactory.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/DefaultNodeItemFactory.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/DefaultNodeItemFactory.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/DefaultNodeItemFactory.java index 4130a8cf1..3ea0f874f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/DefaultNodeItemFactory.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/DefaultNodeItemFactory.java @@ -1,8 +1,8 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFeatureFlagContainerItem.FlagContainer; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFeatureModelContainerItem.ModelContainer; +import gov.nist.secauto.metaschema.core.metapath.node.IFeatureFlagContainerItem.FlagContainer; +import gov.nist.secauto.metaschema.core.metapath.node.IFeatureModelContainerItem.ModelContainer; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceGrouped; import gov.nist.secauto.metaschema.core.model.IChoiceGroupInstance; import gov.nist.secauto.metaschema.core.model.IFlagInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/DocumentNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/DocumentNodeItemImpl.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/DocumentNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/DocumentNodeItemImpl.java index 48806da74..bbf411b23 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/DocumentNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/DocumentNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldGlobalDefinitionNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldGlobalDefinitionNodeItemImpl.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldGlobalDefinitionNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldGlobalDefinitionNodeItemImpl.java index 36ce7c758..075ea73ea 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldGlobalDefinitionNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldGlobalDefinitionNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFieldInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldInstanceNoValueNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldInstanceNoValueNodeItemImpl.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldInstanceNoValueNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldInstanceNoValueNodeItemImpl.java index 4dc4697b6..26433aba7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldInstanceNoValueNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldInstanceNoValueNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFieldInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldInstanceNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldInstanceNodeItemImpl.java similarity index 93% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldInstanceNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldInstanceNodeItemImpl.java index 202a68592..c098e8097 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldInstanceNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldInstanceNodeItemImpl.java @@ -1,7 +1,7 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFieldInstance; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldOrphanedDefinitionNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldOrphanedDefinitionNodeItemImpl.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldOrphanedDefinitionNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldOrphanedDefinitionNodeItemImpl.java index 9b14f23bd..d41803f63 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FieldOrphanedDefinitionNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FieldOrphanedDefinitionNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFieldInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FlagGlobalDefinitionNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FlagGlobalDefinitionNodeItemImpl.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FlagGlobalDefinitionNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FlagGlobalDefinitionNodeItemImpl.java index 05276795c..e6b39b3df 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FlagGlobalDefinitionNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FlagGlobalDefinitionNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; import gov.nist.secauto.metaschema.core.model.IFlagInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FlagInstanceNoValueNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FlagInstanceNoValueNodeItemImpl.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FlagInstanceNoValueNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FlagInstanceNoValueNodeItemImpl.java index af625c127..ff673fa98 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FlagInstanceNoValueNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FlagInstanceNoValueNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IFlagInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FlagInstanceNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FlagInstanceNodeItemImpl.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FlagInstanceNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FlagInstanceNodeItemImpl.java index d750bd10b..4e820f90a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/FlagInstanceNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/FlagInstanceNodeItemImpl.java @@ -1,7 +1,7 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.model.IFlagInstance; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IAssemblyInstanceGroupedNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IAssemblyInstanceGroupedNodeItem.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IAssemblyInstanceGroupedNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IAssemblyInstanceGroupedNodeItem.java index def275e84..efcbb5aae 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IAssemblyInstanceGroupedNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IAssemblyInstanceGroupedNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IAssemblyNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IAssemblyNodeItem.java similarity index 87% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IAssemblyNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IAssemblyNodeItem.java index 0ebdb645d..e652431de 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IAssemblyNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IAssemblyNodeItem.java @@ -1,12 +1,11 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; +import gov.nist.secauto.metaschema.core.metapath.IItemType; import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; import gov.nist.secauto.metaschema.core.metapath.function.InvalidTypeFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/ICycledAssemblyNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/ICycledAssemblyNodeItem.java similarity index 89% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/ICycledAssemblyNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/ICycledAssemblyNodeItem.java index b7165d46b..4002d7f31 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/ICycledAssemblyNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/ICycledAssemblyNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IDefinitionNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IDefinitionNodeItem.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IDefinitionNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IDefinitionNodeItem.java index 4dec59e28..337f2fd32 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IDefinitionNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IDefinitionNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.INamedInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IDocumentBasedNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IDocumentBasedNodeItem.java similarity index 86% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IDocumentBasedNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IDocumentBasedNodeItem.java index e4cad07e6..c7129902a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IDocumentBasedNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IDocumentBasedNodeItem.java @@ -1,8 +1,8 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.InvalidTypeFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IDocumentNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IDocumentNodeItem.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IDocumentNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IDocumentNodeItem.java index f80d75c1d..d6fcca7e1 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IDocumentNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IDocumentNodeItem.java @@ -1,9 +1,8 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; +import gov.nist.secauto.metaschema.core.metapath.IItemType; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureAtomicValuedItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureAtomicValuedItem.java similarity index 74% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureAtomicValuedItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureAtomicValuedItem.java index 14edf0439..cbe18b4e4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureAtomicValuedItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureAtomicValuedItem.java @@ -1,8 +1,8 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAtomicValuedItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicValuedItem; import gov.nist.secauto.metaschema.core.model.IValuedDefinition; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureChildNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureChildNodeItem.java similarity index 88% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureChildNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureChildNodeItem.java index 9f4cf71ec..2f101762e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureChildNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureChildNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.metapath.StaticContext; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureFlagContainerItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureFlagContainerItem.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureFlagContainerItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureFlagContainerItem.java index e6ad88a50..416f28a27 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureFlagContainerItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureFlagContainerItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IModelDefinition; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureModelContainerItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureModelContainerItem.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureModelContainerItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureModelContainerItem.java index 69544a8d2..34c8bfef3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureModelContainerItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureModelContainerItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureNoDataAtomicValuedItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureNoDataAtomicValuedItem.java similarity index 54% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureNoDataAtomicValuedItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureNoDataAtomicValuedItem.java index f4aa60f68..e2884791a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureNoDataAtomicValuedItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureNoDataAtomicValuedItem.java @@ -1,8 +1,8 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAtomicValuedItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicValuedItem; import edu.umd.cs.findbugs.annotations.Nullable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureNoDataValuedItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureNoDataValuedItem.java similarity index 83% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureNoDataValuedItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureNoDataValuedItem.java index a127be516..6ced2894a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureNoDataValuedItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureNoDataValuedItem.java @@ -1,7 +1,7 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; import edu.umd.cs.findbugs.annotations.Nullable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureOrhpanedDefinitionModelNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureOrhpanedDefinitionModelNodeItem.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureOrhpanedDefinitionModelNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureOrhpanedDefinitionModelNodeItem.java index c8de2b8eb..4a1628498 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureOrhpanedDefinitionModelNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureOrhpanedDefinitionModelNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.IModelDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureOrhpanedDefinitionNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureOrhpanedDefinitionNodeItem.java similarity index 93% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureOrhpanedDefinitionNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureOrhpanedDefinitionNodeItem.java index b71d5da5f..ebf9ebd4d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureOrhpanedDefinitionNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureOrhpanedDefinitionNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.INamedInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureRequiredDataItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureRequiredDataItem.java similarity index 66% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureRequiredDataItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureRequiredDataItem.java index 36cd46e8a..3be731e0c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFeatureRequiredDataItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFeatureRequiredDataItem.java @@ -1,7 +1,7 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFieldNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFieldNodeItem.java similarity index 84% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFieldNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFieldNodeItem.java index 0e5aacfaa..1dc20329f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFieldNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFieldNodeItem.java @@ -1,11 +1,10 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; +import gov.nist.secauto.metaschema.core.metapath.IItemType; import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicValuedItem; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAtomicValuedItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFieldInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFlagNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFlagNodeItem.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFlagNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFlagNodeItem.java index 325147e41..a72b05006 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IFlagNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IFlagNodeItem.java @@ -1,11 +1,10 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; +import gov.nist.secauto.metaschema.core.metapath.IItemType; import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicValuedItem; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAtomicValuedItem; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; import gov.nist.secauto.metaschema.core.model.IFlagInstance; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IKindTest.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IKindTest.java similarity index 76% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IKindTest.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IKindTest.java index ac7304875..d843033c6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/IKindTest.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IKindTest.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type; +package gov.nist.secauto.metaschema.core.metapath.node; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; /** * Provides type information that be used to discover type information for, diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IModelNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IModelNodeItem.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IModelNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IModelNodeItem.java index 70f74d853..4efc37bed 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IModelNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IModelNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IModelDefinition; import gov.nist.secauto.metaschema.core.model.INamedModelInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IModuleNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IModuleNodeItem.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IModuleNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IModuleNodeItem.java index af4e033bf..3d86f8ba6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IModuleNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IModuleNodeItem.java @@ -1,9 +1,9 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; +import gov.nist.secauto.metaschema.core.metapath.IItemType; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.model.IModule; import java.net.URI; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItem.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItem.java index 942c67942..33c7d6aaf 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItem.java @@ -1,12 +1,12 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.IItemVisitor; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; import gov.nist.secauto.metaschema.core.metapath.format.IPathSegment; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; import gov.nist.secauto.metaschema.core.model.IResourceLocation; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemFactory.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemFactory.java similarity index 99% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemFactory.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemFactory.java index ad88f7f06..ced3f39d7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemFactory.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemFactory.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemGenerator.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemGenerator.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemGenerator.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemGenerator.java index 12c3197b0..b1f734c5d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemGenerator.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemGenerator.java @@ -1,8 +1,8 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFeatureFlagContainerItem.FlagContainer; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFeatureModelContainerItem.ModelContainer; +import gov.nist.secauto.metaschema.core.metapath.node.IFeatureFlagContainerItem.FlagContainer; +import gov.nist.secauto.metaschema.core.metapath.node.IFeatureModelContainerItem.ModelContainer; import java.util.function.Supplier; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemVisitable.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemVisitable.java similarity index 90% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemVisitable.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemVisitable.java index 64dfd9823..766c3e468 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemVisitable.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemVisitable.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemVisitor.java similarity index 97% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemVisitor.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemVisitor.java index 0c8f3d097..275081cb4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/INodeItemVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/INodeItemVisitor.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IRootAssemblyNodeItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IRootAssemblyNodeItem.java similarity index 96% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IRootAssemblyNodeItem.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IRootAssemblyNodeItem.java index fcb3fd212..46934dcbc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/IRootAssemblyNodeItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/IRootAssemblyNodeItem.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/ModuleNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/ModuleNodeItemImpl.java similarity index 95% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/ModuleNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/ModuleNodeItemImpl.java index 9a877a507..cd92a8588 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/ModuleNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/ModuleNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IModule; import gov.nist.secauto.metaschema.core.model.IResourceLocation; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/NodeItemKind.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/NodeItemKind.java similarity index 87% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/NodeItemKind.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/NodeItemKind.java index 64e56643e..eca66e4fa 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/NodeItemKind.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/NodeItemKind.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; /** * This enumeration provides a listing of the available kinds of diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/RecursionCollectingNodeItemVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/RecursionCollectingNodeItemVisitor.java similarity index 98% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/RecursionCollectingNodeItemVisitor.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/RecursionCollectingNodeItemVisitor.java index 8c5e8bfea..0155e26aa 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/RecursionCollectingNodeItemVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/RecursionCollectingNodeItemVisitor.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IModule; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/RootAssemblyValuedNodeItemImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/RootAssemblyValuedNodeItemImpl.java similarity index 96% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/RootAssemblyValuedNodeItemImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/RootAssemblyValuedNodeItemImpl.java index f3ad57209..f5fe409ef 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/RootAssemblyValuedNodeItemImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/RootAssemblyValuedNodeItemImpl.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AbstractDefinitionTest.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/AbstractDefinitionTest.java similarity index 93% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AbstractDefinitionTest.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/AbstractDefinitionTest.java index bcad8e444..5b4a5267e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AbstractDefinitionTest.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/AbstractDefinitionTest.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.node.impl; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IKindTest; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AnyKindTest.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/AnyKindTest.java similarity index 77% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AnyKindTest.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/AnyKindTest.java index e9c3d0cf9..39c8454a7 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/AnyKindTest.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/AnyKindTest.java @@ -3,15 +3,16 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.node.impl; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.impl.AbstractItemType; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/DynamicTypeSupport.java similarity index 91% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/DynamicTypeSupport.java index 4ce05df08..6946fa8d5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/DynamicTypeSupport.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/DynamicTypeSupport.java @@ -3,15 +3,15 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.node.impl; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindAssemblyTestImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindAssemblyTestImpl.java similarity index 87% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindAssemblyTestImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindAssemblyTestImpl.java index e7e510751..7ba90658e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindAssemblyTestImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindAssemblyTestImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.node.impl; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IKindTest; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindDocumentTestImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindDocumentTestImpl.java similarity index 77% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindDocumentTestImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindDocumentTestImpl.java index b8430a21c..d668d667a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindDocumentTestImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindDocumentTestImpl.java @@ -3,13 +3,13 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.node.impl; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.node.IRootAssemblyNodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindFieldTestImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindFieldTestImpl.java similarity index 87% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindFieldTestImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindFieldTestImpl.java index 06b9a3342..c6e244f4a 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindFieldTestImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindFieldTestImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.node.impl; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IKindTest; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindFlagTestImpl.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindFlagTestImpl.java similarity index 87% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindFlagTestImpl.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindFlagTestImpl.java index 8783ecfc5..092165f71 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/type/impl/KindFlagTestImpl.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/impl/KindFlagTestImpl.java @@ -3,11 +3,11 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.type.impl; +package gov.nist.secauto.metaschema.core.metapath.node.impl; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.IKindTest; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IKindTest; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/package-info.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/package-info.java similarity index 67% rename from core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/package-info.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/package-info.java index cda49f921..9e8a6c593 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/node/package-info.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/node/package-info.java @@ -4,8 +4,8 @@ * represented using a Metaschema model. *

* The factory - * {@link gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory} + * {@link gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory} * can be used to create instances of various node item objects. */ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/IMetapathQueryable.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/IMetapathQueryable.java index 8f0fb5981..8bc910eb3 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/IMetapathQueryable.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/IMetapathQueryable.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.model; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java index f5a1f2a20..a1c72ed83 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/AbstractConstraintValidationHandler.java @@ -7,9 +7,9 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CustomCollectors; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ConstraintValidationFinding.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ConstraintValidationFinding.java index ea3d4f981..9309c2b04 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ConstraintValidationFinding.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ConstraintValidationFinding.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.model.constraint; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IResourceLocation; import gov.nist.secauto.metaschema.core.model.constraint.IConstraint.Level; import gov.nist.secauto.metaschema.core.model.validation.IValidationFinding; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java index bdd67efe4..934e271c5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidator.java @@ -11,16 +11,16 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.library.FnBoolean; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.AbstractNodeItemVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.AbstractNodeItemVisitor; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java index 9323a9a23..50af1eeca 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/ExternalConstraintsModulePostProcessor.java @@ -6,13 +6,13 @@ package gov.nist.secauto.metaschema.core.model.constraint; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.IModule; import gov.nist.secauto.metaschema.core.model.IModuleLoader; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/FindingCollectingConstraintValidationHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/FindingCollectingConstraintValidationHandler.java index 12e645a5e..bc4d41740 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/FindingCollectingConstraintValidationHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/FindingCollectingConstraintValidationHandler.java @@ -7,9 +7,9 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.constraint.IConstraint.Level; import gov.nist.secauto.metaschema.core.model.validation.IValidationFinding.Kind; import gov.nist.secauto.metaschema.core.model.validation.IValidationResult; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConfigurableMessageConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConfigurableMessageConstraint.java index af718b11d..cca7ccdfc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConfigurableMessageConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConfigurableMessageConstraint.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.constraint; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java index fb32c59e5..d15c3e367 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraint.java @@ -8,9 +8,9 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IDescribable; import gov.nist.secauto.metaschema.core.model.ISource; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidationHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidationHandler.java index e6327feab..00ba94dc6 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidationHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidationHandler.java @@ -7,9 +7,9 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import java.util.List; import java.util.regex.Pattern; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidator.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidator.java index 3405382a1..8d02c696d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidator.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IConstraintValidator.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java index cd2f04e50..51588278c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/IIndex.java @@ -6,11 +6,11 @@ package gov.nist.secauto.metaschema.core.model.constraint; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.constraint.impl.DefaultIndex; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/LoggingConstraintValidationHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/LoggingConstraintValidationHandler.java index e44d60d2d..9c820ed6b 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/LoggingConstraintValidationHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/LoggingConstraintValidationHandler.java @@ -7,9 +7,9 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.constraint.IConstraint.Level; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java index b424d021b..832ea8d11 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConfigurableMessageConstraint.java @@ -9,7 +9,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintInitializationException; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java index 25aec68d8..c0166871f 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/AbstractConstraint.java @@ -9,8 +9,8 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/ConstraintComposingVisitor.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/ConstraintComposingVisitor.java index 5ade00e26..0a15260f8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/ConstraintComposingVisitor.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/ConstraintComposingVisitor.java @@ -5,14 +5,14 @@ package gov.nist.secauto.metaschema.core.model.constraint.impl; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyInstanceGroupedNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemVisitor; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyInstanceGroupedNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemVisitor; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintInitializationException; import gov.nist.secauto.metaschema.core.model.constraint.ITargetedConstraints; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java index d7c240853..c2ad1e361 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultExpectConstraint.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.constraint.IExpectConstraint; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndex.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndex.java index 6df6f4d67..84b1fcff4 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndex.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/constraint/impl/DefaultIndex.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.model.constraint.impl; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintInitializationException; import gov.nist.secauto.metaschema.core.model.constraint.IIndex; import gov.nist.secauto.metaschema.core.model.constraint.IIndexConstraint; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/JsonUtil.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/json/JsonUtil.java similarity index 99% rename from core/src/main/java/gov/nist/secauto/metaschema/core/model/util/JsonUtil.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/model/json/JsonUtil.java index 13ccf4aa0..21ac4ce8e 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/JsonUtil.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/json/JsonUtil.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.model.util; +package gov.nist.secauto.metaschema.core.model.json; import com.fasterxml.jackson.core.JsonLocation; import com.fasterxml.jackson.core.JsonParser; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/json/package-info.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/json/package-info.java new file mode 100644 index 000000000..ef6d28f21 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/json/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +/** + * Support for loading Metaschema information from JSON-based resources. + */ + +package gov.nist.secauto.metaschema.core.model.json; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/validation/IContentValidator.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/validation/IContentValidator.java index e3a2420ba..239e86d51 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/validation/IContentValidator.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/validation/IContentValidator.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.core.model.validation; -import gov.nist.secauto.metaschema.core.model.util.JsonUtil; +import gov.nist.secauto.metaschema.core.model.json.JsonUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.json.JSONObject; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/XmlEventUtil.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/XmlEventUtil.java similarity index 99% rename from core/src/main/java/gov/nist/secauto/metaschema/core/model/util/XmlEventUtil.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/XmlEventUtil.java index 89e004a97..9c1d03dbc 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/XmlEventUtil.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/XmlEventUtil.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.model.util; +package gov.nist.secauto.metaschema.core.model.xml; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/XmlUtil.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/XmlUtil.java similarity index 94% rename from core/src/main/java/gov/nist/secauto/metaschema/core/model/util/XmlUtil.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/XmlUtil.java index ce8c944c5..b41b64efd 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/util/XmlUtil.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/XmlUtil.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.model.util; +package gov.nist.secauto.metaschema.core.model.xml; import java.io.IOException; import java.net.URL; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGlobalFieldDefinition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGlobalFieldDefinition.java index a570ac679..44e32f4ee 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGlobalFieldDefinition.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGlobalFieldDefinition.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.xml.impl; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.model.AbstractGlobalFieldDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGlobalFlagDefinition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGlobalFlagDefinition.java index 7fb04f17b..d82e78496 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGlobalFlagDefinition.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGlobalFlagDefinition.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.xml.impl; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.model.AbstractGlobalFlagDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGroupedInlineFieldDefinition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGroupedInlineFieldDefinition.java index cf623f8bd..75d1026d2 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGroupedInlineFieldDefinition.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlGroupedInlineFieldDefinition.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.xml.impl; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.model.AbstractInlineFieldDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlInlineFieldDefinition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlInlineFieldDefinition.java index 6dacbfe03..fcc553fe8 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlInlineFieldDefinition.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlInlineFieldDefinition.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.xml.impl; // NOPMD - intentional import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.model.AbstractInlineFieldDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlInlineFlagDefinition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlInlineFlagDefinition.java index 61495546a..6523d3286 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlInlineFlagDefinition.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/impl/XmlInlineFlagDefinition.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.model.xml.impl; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.model.AbstractInlineFlagDefinition; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/xmlbeans/handler/DatatypesHandler.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/xmlbeans/handler/DatatypesHandler.java index 4d87bdbd3..090a0bc46 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/xmlbeans/handler/DatatypesHandler.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/xml/xmlbeans/handler/DatatypesHandler.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.DataTypeService; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/EQNameFactory.java b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/EQNameFactory.java index e82b4218d..31e90fa8c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/EQNameFactory.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/EQNameFactory.java @@ -5,6 +5,7 @@ package gov.nist.secauto.metaschema.core.qname; +import gov.nist.secauto.metaschema.core.qname.impl.QNameCache; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.util.Optional; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/WellKnown.java b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/WellKnown.java index 5c8df97f1..0172ef371 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/WellKnown.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/WellKnown.java @@ -6,6 +6,7 @@ package gov.nist.secauto.metaschema.core.qname; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; +import gov.nist.secauto.metaschema.core.qname.impl.NamespaceCache; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/NamespaceCache.java b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/impl/NamespaceCache.java similarity index 98% rename from core/src/main/java/gov/nist/secauto/metaschema/core/qname/NamespaceCache.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/qname/impl/NamespaceCache.java index 8a08f08de..b5e7996c5 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/NamespaceCache.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/impl/NamespaceCache.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.qname; +package gov.nist.secauto.metaschema.core.qname.impl; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/QNameCache.java b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/impl/QNameCache.java similarity index 92% rename from core/src/main/java/gov/nist/secauto/metaschema/core/qname/QNameCache.java rename to core/src/main/java/gov/nist/secauto/metaschema/core/qname/impl/QNameCache.java index 8e2823743..214f1ad0d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/QNameCache.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/impl/QNameCache.java @@ -3,8 +3,9 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.qname; +package gov.nist.secauto.metaschema.core.qname.impl; +import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.net.URI; @@ -20,7 +21,7 @@ import edu.umd.cs.findbugs.annotations.Nullable; import nl.talsmasoftware.lazy4j.Lazy; -final class QNameCache { +public final class QNameCache { @NonNull private static final Lazy INSTANCE = ObjectUtils.notNull(Lazy.lazy(QNameCache::new)); @@ -60,7 +61,7 @@ private NamespaceCache getNamespaceCache() { @SuppressWarnings("PMD.ShortMethodName") @NonNull - IEnhancedQName of(@NonNull String namespace, @NonNull String name) { + public IEnhancedQName of(@NonNull String namespace, @NonNull String name) { int namespacePosition = namespaceCache.indexOf(namespace); @@ -83,7 +84,7 @@ IEnhancedQName get(@NonNull QName qname) { } @Nullable - IEnhancedQName get(@NonNull String namespace, @NonNull String name) { + public IEnhancedQName get(@NonNull String namespace, @NonNull String name) { Optional nsPosition = namespaceCache.get(namespace); if (!nsPosition.isPresent()) { throw new IllegalArgumentException( @@ -97,7 +98,7 @@ IEnhancedQName get(@NonNull String namespace, @NonNull String name) { } @Nullable - IEnhancedQName get(int index) { + public IEnhancedQName get(int index) { return indexToQName.get(index); } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/qname/package-info.java b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/package-info.java new file mode 100644 index 000000000..acd6a1d73 --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/qname/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ + +/** + * Support for namespace qualified names. + */ + +package gov.nist.secauto.metaschema.core.qname; diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java b/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java index b8f56f7ad..a23db8ba0 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/util/CustomCollectors.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.util; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import java.util.ArrayList; import java.util.Collections; diff --git a/core/src/main/java/module-info.java b/core/src/main/java/module-info.java index c69b5f2b0..a15d8e29b 100644 --- a/core/src/main/java/module-info.java +++ b/core/src/main/java/module-info.java @@ -4,7 +4,7 @@ */ import gov.nist.secauto.metaschema.core.datatype.IDataTypeProvider; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupDataTypeProvider; import gov.nist.secauto.metaschema.core.metapath.function.IFunctionLibrary; import gov.nist.secauto.metaschema.core.metapath.function.library.DefaultFunctionLibrary; @@ -66,7 +66,6 @@ exports gov.nist.secauto.metaschema.core; exports gov.nist.secauto.metaschema.core.configuration; exports gov.nist.secauto.metaschema.core.datatype; - exports gov.nist.secauto.metaschema.core.datatype.adapter; exports gov.nist.secauto.metaschema.core.datatype.markup; exports gov.nist.secauto.metaschema.core.datatype.object; exports gov.nist.secauto.metaschema.core.metapath; @@ -74,13 +73,11 @@ exports gov.nist.secauto.metaschema.core.metapath.function; exports gov.nist.secauto.metaschema.core.metapath.function.library; exports gov.nist.secauto.metaschema.core.metapath.function.regex; - exports gov.nist.secauto.metaschema.core.metapath.item; - exports gov.nist.secauto.metaschema.core.metapath.item.atomic; - exports gov.nist.secauto.metaschema.core.metapath.item.function; - exports gov.nist.secauto.metaschema.core.metapath.item.node; - exports gov.nist.secauto.metaschema.core.metapath.type; + exports gov.nist.secauto.metaschema.core.metapath.atomic; + exports gov.nist.secauto.metaschema.core.metapath.node; exports gov.nist.secauto.metaschema.core.model; exports gov.nist.secauto.metaschema.core.model.constraint; + exports gov.nist.secauto.metaschema.core.model.json; exports gov.nist.secauto.metaschema.core.model.util; exports gov.nist.secauto.metaschema.core.model.validation; exports gov.nist.secauto.metaschema.core.model.xml; diff --git a/core/src/main/resources/META-INF/services/gov.nist.secauto.metaschema.core.datatype.IDataTypeProvider b/core/src/main/resources/META-INF/services/gov.nist.secauto.metaschema.core.datatype.IDataTypeProvider index e85626b94..39e14e086 100644 --- a/core/src/main/resources/META-INF/services/gov.nist.secauto.metaschema.core.datatype.IDataTypeProvider +++ b/core/src/main/resources/META-INF/services/gov.nist.secauto.metaschema.core.datatype.IDataTypeProvider @@ -1,2 +1,2 @@ -gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider +gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider gov.nist.secauto.metaschema.core.datatype.markup.MarkupDataTypeProvider diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/BooleanAdapterTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/BooleanAdapterTest.java similarity index 90% rename from core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/BooleanAdapterTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/datatype/BooleanAdapterTest.java index e4e5dd109..a290e8fe4 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/BooleanAdapterTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/BooleanAdapterTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -31,7 +31,7 @@ void testParse() throws IOException { parser.nextToken(); parser.nextToken(); - Boolean obj = new BooleanAdapter().parse( + Boolean obj = MetaschemaDataTypeProvider.BOOLEAN.parse( parser, ObjectUtils.notNull(URI.create("https://example.com/not-a-resource"))); assertAll( diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateAdapterTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/DateAdapterTest.java similarity index 91% rename from core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateAdapterTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/datatype/DateAdapterTest.java index aee4a2214..3ee8f66b5 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateAdapterTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/DateAdapterTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -22,8 +22,6 @@ import edu.umd.cs.findbugs.annotations.NonNull; class DateAdapterTest { - private static final DateAdapter ADAPTER = new DateAdapter(); - private static Stream provideValues() { return Stream.of( // Cases without timezone (ambiguous) @@ -40,7 +38,7 @@ private static Stream provideValues() { @ParameterizedTest @MethodSource("provideValues") void testSimpleDate(@NonNull String actual, boolean ambiguous, @NonNull ZonedDateTime expected) { - AmbiguousDate date = ADAPTER.parse(actual); + AmbiguousDate date = MetaschemaDataTypeProvider.DATE.parse(actual); assertAll( () -> assertEquals(ambiguous, !date.hasTimeZone()), () -> assertEquals(expected, date.getValue())); @@ -58,7 +56,7 @@ private static Stream provideInvalidValues() { @MethodSource("provideInvalidValues") void testInvalidDates(@NonNull String actual) { assertThrows(IllegalArgumentException.class, () -> { - ADAPTER.parse(actual); + MetaschemaDataTypeProvider.DATE.parse(actual); }); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeAdapterTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/DateTimeAdapterTest.java similarity index 94% rename from core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeAdapterTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/datatype/DateTimeAdapterTest.java index 5e083d4bc..e62cc40e8 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeAdapterTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/DateTimeAdapterTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -22,8 +22,6 @@ import edu.umd.cs.findbugs.annotations.NonNull; class DateTimeAdapterTest { - private static final DateTimeAdapter ADAPTER = new DateTimeAdapter(); - /** * Provides test cases for date-time parsing. *

@@ -97,7 +95,7 @@ private static int toNanos(double fraction) { @ParameterizedTest @MethodSource("provideValues") void testSimpleDateTime(@NonNull String actual, boolean ambiguous, @NonNull ZonedDateTime expected) { - AmbiguousDateTime date = ADAPTER.parse(actual); + AmbiguousDateTime date = MetaschemaDataTypeProvider.DATE_TIME.parse(actual); assertAll( () -> assertEquals(ambiguous, !date.hasTimeZone()), () -> assertEquals(expected, date.getValue())); diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeWithTZAdapterTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/DateTimeWithTZAdapterTest.java similarity index 77% rename from core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeWithTZAdapterTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/datatype/DateTimeWithTZAdapterTest.java index 662e94066..c07fc80e9 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/DateTimeWithTZAdapterTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/DateTimeWithTZAdapterTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -15,8 +15,6 @@ import edu.umd.cs.findbugs.annotations.NonNull; class DateTimeWithTZAdapterTest { - private static final DateTimeWithTZAdapter ADAPTER = MetaschemaDataTypeProvider.DATE_TIME_WITH_TZ; - @ParameterizedTest @ValueSource(strings = { "2020-12-20T14:47:48.623-05:00", @@ -27,7 +25,7 @@ class DateTimeWithTZAdapterTest { "2019-12-31T23:59:59Z" }) void testParse(@NonNull String value) { - ZonedDateTime obj = ADAPTER.parse(value); + ZonedDateTime obj = MetaschemaDataTypeProvider.DATE_TIME_WITH_TZ.parse(value); assertNotNull(obj, "not null"); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/IPv6AddressAdapterTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/IPv6AddressAdapterTest.java similarity index 89% rename from core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/IPv6AddressAdapterTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/datatype/IPv6AddressAdapterTest.java index 3b2a6ac5d..c2115fb65 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/IPv6AddressAdapterTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/IPv6AddressAdapterTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -30,7 +30,7 @@ class IPv6AddressAdapterTest { }) void testIPv6AddressThrowsWithInvalid(@NonNull String addr) { assertThrows(IllegalArgumentException.class, () -> { - new IPv6AddressAdapter().parse(addr); + MetaschemaDataTypeProvider.IP_V6_ADDRESS.parse(addr); }); } @@ -51,7 +51,7 @@ void testIPv6AddressThrowsWithInvalid(@NonNull String addr) { }) void testIPv6AddressAllowsCommonIPv6Addresses(@NonNull String addr) { assertDoesNotThrow(() -> { - new IPv6AddressAdapter().parse(addr); + MetaschemaDataTypeProvider.IP_V6_ADDRESS.parse(addr); }); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/MetaschemaDataTypeProviderTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/MetaschemaDataTypeProviderTest.java similarity index 81% rename from core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/MetaschemaDataTypeProviderTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/datatype/MetaschemaDataTypeProviderTest.java index 2dbd128d0..6bdcdc7a2 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/adapter/MetaschemaDataTypeProviderTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/MetaschemaDataTypeProviderTest.java @@ -3,11 +3,10 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.datatype.adapter; +package gov.nist.secauto.metaschema.core.datatype; import static org.junit.jupiter.api.Assertions.assertNotNull; -import gov.nist.secauto.metaschema.core.datatype.DataTypeService; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/markup/CommonmarkConformanceTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/markup/CommonmarkConformanceTest.java index a1ce8a251..c7cdc7667 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/markup/CommonmarkConformanceTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/markup/CommonmarkConformanceTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gov.nist.secauto.metaschema.core.MetaschemaConstants; +import gov.nist.secauto.metaschema.core.datatype.markup.impl.XmlMarkupParser; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.codehaus.stax2.XMLStreamWriter2; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/markup/flexmark/MarkupParserTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/markup/flexmark/MarkupParserTest.java index e8d998f97..6394976d3 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/markup/flexmark/MarkupParserTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/datatype/markup/flexmark/MarkupParserTest.java @@ -11,9 +11,9 @@ import com.ctc.wstx.stax.WstxInputFactory; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.datatype.markup.XmlMarkupParser; import gov.nist.secauto.metaschema.core.datatype.markup.flexmark.impl.AstCollectingVisitor; -import gov.nist.secauto.metaschema.core.model.util.XmlEventUtil; +import gov.nist.secauto.metaschema.core.datatype.markup.impl.XmlMarkupParser; +import gov.nist.secauto.metaschema.core.model.xml.XmlEventUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.apache.logging.log4j.LogManager; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ExpressionTestBase.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ExpressionTestBase.java index 89cc6efb2..3e114fc82 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ExpressionTestBase.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ExpressionTestBase.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.jmock.Expectations; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ExpressionUtilsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ExpressionUtilsTest.java index 515c9991c..73db2c722 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ExpressionUtilsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ExpressionUtilsTest.java @@ -9,12 +9,12 @@ import gov.nist.secauto.metaschema.core.metapath.cst.ExpressionUtils; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModelNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import org.jmock.Expectations; import org.jmock.Mockery; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ISequenceTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ISequenceTest.java index 149084706..b3f077302 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ISequenceTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/ISequenceTest.java @@ -11,9 +11,6 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; - import org.junit.jupiter.api.Test; class ISequenceTest { diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java index 19cb54d02..4ece33eef 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/MetapathExpressionTest.java @@ -10,8 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/OperationFunctionsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/OperationFunctionsTest.java index 69628dd63..faa9b4574 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/OperationFunctionsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/OperationFunctionsTest.java @@ -9,9 +9,9 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; import static org.junit.jupiter.api.Assertions.assertEquals; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/TestUtils.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/TestUtils.java index ab5d76757..bf517e24a 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/TestUtils.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/TestUtils.java @@ -5,23 +5,20 @@ package gov.nist.secauto.metaschema.core.metapath; -import gov.nist.secauto.metaschema.core.metapath.item.ICollectionValue; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBase64BinaryItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDecimalItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBase64BinaryItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDateTimeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDecimalItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import java.math.BigDecimal; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBase64BinaryItemTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBase64BinaryItemTest.java similarity index 96% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBase64BinaryItemTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBase64BinaryItemTest.java index 29c6a20c5..1a019cb3a 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBase64BinaryItemTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBase64BinaryItemTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBooleanItemTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBooleanItemTest.java similarity index 97% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBooleanItemTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBooleanItemTest.java index b625d71f9..35fa4682f 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IBooleanItemTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IBooleanItemTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.decimal; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INumericItemTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/INumericItemTest.java similarity index 98% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INumericItemTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/INumericItemTest.java index 7784583ed..b0dbd2b0f 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/INumericItemTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/INumericItemTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.decimal; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IStringItemTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IStringItemTest.java similarity index 93% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IStringItemTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IStringItemTest.java index 88be592ae..24113c879 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IStringItemTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IStringItemTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUuidItemTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUuidItemTest.java similarity index 96% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUuidItemTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUuidItemTest.java index b6087bca2..c8d3fefd7 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IUuidItemTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/atomic/IUuidItemTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.atomic; +package gov.nist.secauto.metaschema.core.metapath.atomic; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java index 46cffdfb8..4716e70aa 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/ArrowExpressionTest.java @@ -13,10 +13,10 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java index 205a149ba..cccb8c8ac 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java @@ -21,11 +21,16 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.antlr.FailingErrorListener; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10; import gov.nist.secauto.metaschema.core.metapath.antlr.Metapath10Lexer; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUuidItem; import gov.nist.secauto.metaschema.core.metapath.cst.items.SimpleMap; import gov.nist.secauto.metaschema.core.metapath.cst.logic.AbstractComparison; import gov.nist.secauto.metaschema.core.metapath.cst.logic.And; @@ -33,16 +38,11 @@ import gov.nist.secauto.metaschema.core.metapath.cst.logic.If; import gov.nist.secauto.metaschema.core.metapath.cst.logic.ValueComparison; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUuidItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IRootAssemblyNodeItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.testing.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/RangeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/RangeTest.java index 60c373df7..93c08d08d 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/RangeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/items/RangeTest.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/CSTLogicalExpressionsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/CSTLogicalExpressionsTest.java index 52b342a30..f2ef5d623 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/CSTLogicalExpressionsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/CSTLogicalExpressionsTest.java @@ -10,9 +10,9 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.jmock.Expectations; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpressionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpressionTest.java index cbf910680..596a8e123 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpressionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/PredicateExpressionTest.java @@ -9,9 +9,9 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.jmock.Expectations; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparisonTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparisonTest.java index 0459b707b..6d59058a0 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparisonTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/logic/ValueComparisonTest.java @@ -9,12 +9,12 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.cst.IExpression; import gov.nist.secauto.metaschema.core.metapath.function.ComparisonFunctions; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import org.jmock.Expectations; import org.jmock.Mockery; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/FlagTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/FlagTest.java index a56b4c562..4f0eaea45 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/FlagTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/FlagTest.java @@ -9,10 +9,10 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.NodeItemKind; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModelNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.NodeItemKind; import gov.nist.secauto.metaschema.core.model.IFlagInstance; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java index 24e3cbade..462e9809a 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/RootSlashOnlyTest.java @@ -11,10 +11,10 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.InvalidTreatTypeDynamicMetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.testing.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.util.CollectionUtil; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java index 6b144ccd0..3a5563730 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/path/StepTest.java @@ -8,12 +8,12 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModelNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.testing.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java index 7456f0c05..dfaa2fbf5 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastTest.java @@ -17,10 +17,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java index c0576527a..73e938a9f 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/CastableTest.java @@ -12,7 +12,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java index 72b3d7291..f295a87d6 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOfTest.java @@ -13,11 +13,11 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUuidItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUuidItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.testing.node.MockNodeItemFactory; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItemTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/IArrayItemTest.java similarity index 97% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItemTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/IArrayItemTest.java index d081061b4..0a621fed2 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/IArrayItemTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/IArrayItemTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function; +package gov.nist.secauto.metaschema.core.metapath.function; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.array; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/LookupTest.java similarity index 97% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/LookupTest.java index a78f40351..d448b9a5d 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/function/LookupTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/LookupTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.metapath.item.function; +package gov.nist.secauto.metaschema.core.metapath.function; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.array; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.entry; @@ -17,7 +17,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctionsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctionsTest.java index fca82d17b..4e730caad 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctionsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/OperationFunctionsTest.java @@ -9,9 +9,9 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; import static org.junit.jupiter.api.Assertions.assertEquals; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.function.impl.OperationFunctions; import gov.nist.secauto.metaschema.core.metapath.function.library.FunctionTestBase; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppendTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppendTest.java index 8a49a51f6..a2397c4f6 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppendTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayAppendTest.java @@ -11,8 +11,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlattenTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlattenTest.java index 5f0099d8c..d9fd57fe2 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlattenTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayFlattenTest.java @@ -11,7 +11,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGetTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGetTest.java index 3170fcf96..2f5969c87 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGetTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayGetTest.java @@ -10,8 +10,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHeadTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHeadTest.java index 0e66adb54..e8d45cf97 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHeadTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayHeadTest.java @@ -13,7 +13,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBeforeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBeforeTest.java index c2705a343..95686fd6b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBeforeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayInsertBeforeTest.java @@ -11,8 +11,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoinTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoinTest.java index efd13817f..56cac829c 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoinTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayJoinTest.java @@ -11,8 +11,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPutTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPutTest.java index af252ca96..8113c427a 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPutTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayPutTest.java @@ -11,8 +11,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemoveTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemoveTest.java index 207ffb200..62e33ad42 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemoveTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayRemoveTest.java @@ -10,8 +10,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverseTest.java index d3cab0911..ccb2ac899 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayReverseTest.java @@ -12,8 +12,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySizeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySizeTest.java index 289eddf3d..1d2026fcc 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySizeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySizeTest.java @@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarrayTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarrayTest.java index 4d4cdcddf..da1ad293e 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarrayTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArraySubarrayTest.java @@ -10,8 +10,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTailTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTailTest.java index 8243a943e..4243053a2 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTailTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/ArrayTailTest.java @@ -13,7 +13,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.function.IArrayItem; +import gov.nist.secauto.metaschema.core.metapath.function.IArrayItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunctionTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunctionTest.java index afe1732cc..77647521a 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunctionTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/CastFunctionTest.java @@ -14,11 +14,11 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbsTest.java index 5be429705..a90818b84 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAbsTest.java @@ -8,8 +8,8 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.decimal; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvgTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvgTest.java index d36ab830d..ec0802117 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvgTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnAvgTest.java @@ -13,12 +13,12 @@ import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBooleanTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBooleanTest.java index f41de971f..6287fe9dc 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBooleanTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnBooleanTest.java @@ -14,13 +14,13 @@ import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNull; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUntypedAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUntypedAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.jmock.Expectations; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeilingTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeilingTest.java index c023a50e9..20354170e 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeilingTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCeilingTest.java @@ -8,8 +8,8 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.decimal; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcatTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcatTest.java index 2ad0a40d5..8e2d308ea 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcatTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnConcatTest.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContainsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContainsTest.java index edc72ac48..ca617a728 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContainsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnContainsTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCountTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCountTest.java index f1c19b935..aca6903a7 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCountTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnCountTest.java @@ -9,9 +9,9 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.string; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.params.ParameterizedTest; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailableTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailableTest.java index 3f7ec6be0..c1fe6208a 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailableTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailableTest.java @@ -8,7 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyUriItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyUriItem; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmptyTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmptyTest.java index db86e7f70..31895569b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmptyTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEmptyTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWithTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWithTest.java index f9dd405c7..df55199ea 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWithTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnEndsWithTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExistsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExistsTest.java index 67f839a42..298ceb232 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExistsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnExistsTest.java @@ -8,9 +8,9 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.bool; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.params.ParameterizedTest; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalseTest.java index ba5ef0b43..97f7c91ac 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnFalseTest.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHeadTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHeadTest.java index 2506aea26..dc73bffcc 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHeadTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnHeadTest.java @@ -11,7 +11,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezoneTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezoneTest.java index 8dde12304..179253e89 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezoneTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnImplicitTimezoneTest.java @@ -9,7 +9,7 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBeforeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBeforeTest.java index 2194e9e37..1be605f6e 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBeforeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnInsertBeforeTest.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCaseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCaseTest.java index 0b99ec0d9..5c178dff9 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCaseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnLowerCaseTest.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java index a3a2da592..6243422e6 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMatchesTest.java @@ -14,11 +14,11 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegularExpressionMetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMaxTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMaxTest.java index 7726b9ff8..73633e338 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMaxTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnMinMaxTest.java @@ -12,10 +12,10 @@ import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java index 0c37899d1..11ff0a77b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNormalizeSpaceTest.java @@ -14,7 +14,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNotTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNotTest.java index 848b09dfb..6db0218f2 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNotTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnNotTest.java @@ -14,13 +14,13 @@ import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNull; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IUntypedAtomicItem; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IUntypedAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.jmock.Expectations; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemoveTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemoveTest.java index b5b057277..bbd3ffe0b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemoveTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRemoveTest.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverseTest.java index f72853ac2..fdf7584a5 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnReverseTest.java @@ -12,7 +12,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRoundTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRoundTest.java index 5710e8dd2..e75f3d15d 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRoundTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnRoundTest.java @@ -8,9 +8,9 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.decimal; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.integer; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWithTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWithTest.java index a1f68a2d1..5dff8bab3 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWithTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStartsWithTest.java @@ -8,9 +8,9 @@ import static gov.nist.secauto.metaschema.core.metapath.TestUtils.bool; import static gov.nist.secauto.metaschema.core.metapath.TestUtils.string; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.junit.jupiter.params.ParameterizedTest; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java index f73f028db..5435a5bce 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringLengthTest.java @@ -13,10 +13,10 @@ import gov.nist.secauto.metaschema.core.metapath.ContextAbsentDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java index 090027510..fa03ea4c8 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnStringTest.java @@ -15,11 +15,11 @@ import gov.nist.secauto.metaschema.core.metapath.ContextAbsentDynamicMetapathException; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.function.InvalidTypeFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.type.InvalidTypeMetapathException; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfterTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfterTest.java index a32433da8..9cd16782c 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfterTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfterTest.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBeforeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBeforeTest.java index 8a9e6dc8e..33e3a3647 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBeforeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBeforeTest.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringTest.java index 37d14cf44..3c5b3644b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringTest.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSumTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSumTest.java index 2e7c317c3..fc3f8bdf9 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSumTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnSumTest.java @@ -12,12 +12,12 @@ import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IDayTimeDurationItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.metapath.function.InvalidArgumentFunctionException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDayTimeDurationItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IYearMonthDurationItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTailTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTailTest.java index 0aab9bf5f..a3a167921 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTailTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTailTest.java @@ -11,7 +11,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java index 97d690e2c..aad88deb3 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenizeTest.java @@ -12,9 +12,9 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathException; import gov.nist.secauto.metaschema.core.metapath.function.regex.RegularExpressionMetapathException; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrueTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrueTest.java index 166650702..e4be2bec2 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrueTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnTrueTest.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.core.metapath.function.library; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IBooleanItem; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCaseTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCaseTest.java index ae95acfb8..c86a75204 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCaseTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnUpperCaseTest.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FunctionTestBase.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FunctionTestBase.java index 7ad52e43b..cdaf2a725 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FunctionTestBase.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FunctionTestBase.java @@ -10,11 +10,11 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.INumericItem; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.INumericItem; import java.util.List; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContainsTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContainsTest.java index 2217b5346..66476704b 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContainsTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapContainsTest.java @@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; +import gov.nist.secauto.metaschema.core.metapath.function.LookupTest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntryTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntryTest.java index 5bea47794..93ccaebc1 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntryTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapEntryTest.java @@ -11,9 +11,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFindTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFindTest.java index 2ac1c9424..a26c724b9 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFindTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapFindTest.java @@ -13,8 +13,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGetTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGetTest.java index 0df719b7d..952f399c3 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGetTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapGetTest.java @@ -11,8 +11,8 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.function.LookupTest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeysTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeysTest.java index 684fa8a05..4b465fb15 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeysTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapKeysTest.java @@ -10,8 +10,8 @@ import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMergeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMergeTest.java index 7cdd66849..7d99df402 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMergeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapMergeTest.java @@ -13,9 +13,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; +import gov.nist.secauto.metaschema.core.metapath.function.LookupTest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPutTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPutTest.java index bbd3b4cf7..20e1567fc 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPutTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapPutTest.java @@ -12,10 +12,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.LookupTest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemoveTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemoveTest.java index a003bd274..9b6b41837 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemoveTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapRemoveTest.java @@ -12,10 +12,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.LookupTest; +import gov.nist.secauto.metaschema.core.metapath.function.IMapItem; +import gov.nist.secauto.metaschema.core.metapath.function.LookupTest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSizeTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSizeTest.java index 8ab6d858b..5844a3477 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSizeTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/MapSizeTest.java @@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.ExpressionTestBase; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IIntegerItem; +import gov.nist.secauto.metaschema.core.metapath.atomic.IIntegerItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractRecursionPreventingNodeItemVisitorTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractRecursionPreventingNodeItemVisitorTest.java similarity index 94% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractRecursionPreventingNodeItemVisitorTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractRecursionPreventingNodeItemVisitorTest.java index 127df9b15..132f1f6fd 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/AbstractRecursionPreventingNodeItemVisitorTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/node/AbstractRecursionPreventingNodeItemVisitorTest.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IModule; import gov.nist.secauto.metaschema.core.model.MetaschemaException; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/DefaultNodeItemFactoryTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/node/DefaultNodeItemFactoryTest.java similarity index 98% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/DefaultNodeItemFactoryTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/node/DefaultNodeItemFactoryTest.java index bd81cfab3..51d3d2cbc 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/DefaultNodeItemFactoryTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/node/DefaultNodeItemFactoryTest.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.allOf; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/RecursionCollectingNodeItemVisitorTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/node/RecursionCollectingNodeItemVisitorTest.java similarity index 93% rename from core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/RecursionCollectingNodeItemVisitorTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/metapath/node/RecursionCollectingNodeItemVisitorTest.java index 9cfd6cb9d..964ce48bf 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/item/node/RecursionCollectingNodeItemVisitorTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/node/RecursionCollectingNodeItemVisitorTest.java @@ -1,5 +1,5 @@ -package gov.nist.secauto.metaschema.core.metapath.item.node; +package gov.nist.secauto.metaschema.core.metapath.node; import gov.nist.secauto.metaschema.core.model.IModule; import gov.nist.secauto.metaschema.core.model.MetaschemaException; @@ -42,7 +42,7 @@ private static String metapath(@NonNull IDefinitionNodeItem item) { } private static String metapath(@NonNull String path) { - return path.replaceAll("\\[1\\]", ""); + return path.replace("[1]", ""); } } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java index 5bf65fc75..8c26f653e 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/model/constraint/DefaultConstraintValidatorTest.java @@ -20,11 +20,11 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItemVisitor; import gov.nist.secauto.metaschema.core.metapath.StaticContext; +import gov.nist.secauto.metaschema.core.metapath.atomic.IStringItem; import gov.nist.secauto.metaschema.core.metapath.format.IPathFormatter; -import gov.nist.secauto.metaschema.core.metapath.item.IItemVisitor; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IStringItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/MetaConstraintLoaderTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/MetaConstraintLoaderTest.java index 1841dbf7a..1d3f51c33 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/MetaConstraintLoaderTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/MetaConstraintLoaderTest.java @@ -7,13 +7,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.metapath.IItem; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; import gov.nist.secauto.metaschema.core.metapath.function.library.FnPath; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.MetaschemaException; import gov.nist.secauto.metaschema.core.model.constraint.ExternalConstraintsModulePostProcessor; import gov.nist.secauto.metaschema.core.model.constraint.IConstraintSet; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/model/util/XmlObjectParserTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/XmlObjectParserTest.java similarity index 98% rename from core/src/test/java/gov/nist/secauto/metaschema/core/model/util/XmlObjectParserTest.java rename to core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/XmlObjectParserTest.java index 41e2fc34b..b81a196f5 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/model/util/XmlObjectParserTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/model/xml/XmlObjectParserTest.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ -package gov.nist.secauto.metaschema.core.model.util; +package gov.nist.secauto.metaschema.core.model.xml; import gov.nist.secauto.metaschema.core.model.ISource; import gov.nist.secauto.metaschema.core.model.xml.impl.XmlObjectParser; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/qname/QNameCacheTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/qname/QNameCacheTest.java index ece1b69a3..02e02d923 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/qname/QNameCacheTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/qname/QNameCacheTest.java @@ -9,6 +9,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import gov.nist.secauto.metaschema.core.qname.impl.QNameCache; + import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/testing/FieldBuilder.java b/core/src/test/java/gov/nist/secauto/metaschema/core/testing/FieldBuilder.java index 25adead9f..589cc22f0 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/testing/FieldBuilder.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/testing/FieldBuilder.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.testing; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFieldInstanceAbsolute; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/testing/FlagBuilder.java b/core/src/test/java/gov/nist/secauto/metaschema/core/testing/FlagBuilder.java index 32c902b77..fb2eb0d4d 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/testing/FlagBuilder.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/testing/FlagBuilder.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.core.testing; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; import gov.nist.secauto.metaschema.core.model.IFlagInstance; import gov.nist.secauto.metaschema.core.model.IModelDefinition; diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/testing/node/MockNodeItemFactory.java b/core/src/test/java/gov/nist/secauto/metaschema/core/testing/node/MockNodeItemFactory.java index 114fcd3f7..5372c037f 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/testing/node/MockNodeItemFactory.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/testing/node/MockNodeItemFactory.java @@ -5,15 +5,15 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.withSettings; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFieldNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IFlagNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.NodeItemKind; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFieldNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IFlagNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModelNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IRootAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.NodeItemKind; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; diff --git a/databind-metaschema/src/test/java/gov/nist/secauto/metaschema/modules/sarif/SarifValidationHandlerTest.java b/databind-metaschema/src/test/java/gov/nist/secauto/metaschema/modules/sarif/SarifValidationHandlerTest.java index 76b3488ac..bd4f38696 100644 --- a/databind-metaschema/src/test/java/gov/nist/secauto/metaschema/modules/sarif/SarifValidationHandlerTest.java +++ b/databind-metaschema/src/test/java/gov/nist/secauto/metaschema/modules/sarif/SarifValidationHandlerTest.java @@ -8,7 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IResourceLocation; import gov.nist.secauto.metaschema.core.model.constraint.ConstraintValidationFinding; import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/IBindingContext.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/IBindingContext.java index 5640b5630..5f8a7c0a4 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/IBindingContext.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/IBindingContext.java @@ -9,9 +9,9 @@ import gov.nist.secauto.metaschema.core.datatype.DataTypeService; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IRootAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IConstraintLoader; import gov.nist.secauto.metaschema.core.model.IModule; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java index 8fcb78df0..30c112582 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/impl/AnnotationGenerator.java @@ -12,10 +12,10 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.ISequence; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IFlagDefinition; import gov.nist.secauto.metaschema.core.model.IModelDefinition; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/typeinfo/FieldInstanceTypeInfoImpl.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/typeinfo/FieldInstanceTypeInfoImpl.java index 2f8965f26..490491965 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/typeinfo/FieldInstanceTypeInfoImpl.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/typeinfo/FieldInstanceTypeInfoImpl.java @@ -12,7 +12,7 @@ import com.squareup.javapoet.TypeSpec; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IFieldInstance; import gov.nist.secauto.metaschema.core.model.IFieldInstanceAbsolute; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/typeinfo/FieldValueTypeInfoImpl.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/typeinfo/FieldValueTypeInfoImpl.java index 9f989af45..131f98c96 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/typeinfo/FieldValueTypeInfoImpl.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/codegen/typeinfo/FieldValueTypeInfoImpl.java @@ -12,7 +12,7 @@ import com.squareup.javapoet.TypeSpec; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; import gov.nist.secauto.metaschema.core.model.IModelDefinition; import gov.nist.secauto.metaschema.databind.codegen.typeinfo.def.IFieldDefinitionTypeInfo; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/AbstractDeserializer.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/AbstractDeserializer.java index b14aee1b5..2cce114a5 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/AbstractDeserializer.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/AbstractDeserializer.java @@ -8,9 +8,9 @@ import gov.nist.secauto.metaschema.core.configuration.IConfiguration; import gov.nist.secauto.metaschema.core.configuration.IMutableConfiguration; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.constraint.DefaultConstraintValidator; import gov.nist.secauto.metaschema.core.model.constraint.IConstraintValidationHandler; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoader.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoader.java index 8a6311ba9..0dbeba13a 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoader.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoader.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.configuration.DefaultConfiguration; import gov.nist.secauto.metaschema.core.configuration.IConfiguration; import gov.nist.secauto.metaschema.core.configuration.IMutableConfiguration; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractResourceResolver; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IBoundLoader.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IBoundLoader.java index cae83a73c..fe56ae226 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IBoundLoader.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IBoundLoader.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.configuration.IConfiguration; import gov.nist.secauto.metaschema.core.configuration.IMutableConfiguration; import gov.nist.secauto.metaschema.core.metapath.IDocumentLoader; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import gov.nist.secauto.metaschema.databind.DefaultBindingContext; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IDeserializer.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IDeserializer.java index b01baabf5..49ce36cde 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IDeserializer.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IDeserializer.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.configuration.IConfiguration; import gov.nist.secauto.metaschema.core.configuration.IMutableConfiguration; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.constraint.IConstraintValidationHandler; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/ModelDetector.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/ModelDetector.java index ad8001992..29d9e8f88 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/ModelDetector.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/ModelDetector.java @@ -14,8 +14,8 @@ import gov.nist.secauto.metaschema.core.configuration.DefaultConfiguration; import gov.nist.secauto.metaschema.core.configuration.IConfiguration; import gov.nist.secauto.metaschema.core.model.IBoundObject; -import gov.nist.secauto.metaschema.core.model.util.JsonUtil; -import gov.nist.secauto.metaschema.core.model.util.XmlEventUtil; +import gov.nist.secauto.metaschema.core.model.json.JsonUtil; +import gov.nist.secauto.metaschema.core.model.xml.XmlEventUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import gov.nist.secauto.metaschema.databind.IBindingContext; import gov.nist.secauto.metaschema.databind.io.json.JsonFactoryFactory; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/DefaultJsonDeserializer.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/DefaultJsonDeserializer.java index c8eecc761..2d9589a94 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/DefaultJsonDeserializer.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/DefaultJsonDeserializer.java @@ -10,8 +10,8 @@ import gov.nist.secauto.metaschema.core.configuration.IConfiguration; import gov.nist.secauto.metaschema.core.configuration.IMutableConfiguration; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import gov.nist.secauto.metaschema.databind.io.AbstractDeserializer; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/DefaultJsonProblemHandler.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/DefaultJsonProblemHandler.java index fd4deae6b..48517e63f 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/DefaultJsonProblemHandler.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/DefaultJsonProblemHandler.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.databind.io.json; import gov.nist.secauto.metaschema.core.model.IBoundObject; -import gov.nist.secauto.metaschema.core.model.util.JsonUtil; +import gov.nist.secauto.metaschema.core.model.json.JsonUtil; import gov.nist.secauto.metaschema.databind.io.AbstractProblemHandler; import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelComplex; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/MetaschemaJsonReader.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/MetaschemaJsonReader.java index 5a50f2eea..46f819ec7 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/MetaschemaJsonReader.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/json/MetaschemaJsonReader.java @@ -13,7 +13,7 @@ import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; -import gov.nist.secauto.metaschema.core.model.util.JsonUtil; +import gov.nist.secauto.metaschema.core.model.json.JsonUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import gov.nist.secauto.metaschema.databind.io.BindingException; import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelAssembly; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/DefaultXmlDeserializer.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/DefaultXmlDeserializer.java index c516570f6..1b880a9d4 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/DefaultXmlDeserializer.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/DefaultXmlDeserializer.java @@ -8,8 +8,8 @@ import com.ctc.wstx.stax.WstxInputFactory; import gov.nist.secauto.metaschema.core.configuration.IMutableConfiguration; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.util.AutoCloser; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/DefaultXmlProblemHandler.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/DefaultXmlProblemHandler.java index d12bbcdde..b4d8d9bba 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/DefaultXmlProblemHandler.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/DefaultXmlProblemHandler.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.databind.io.xml; import gov.nist.secauto.metaschema.core.model.IBoundObject; -import gov.nist.secauto.metaschema.core.model.util.XmlEventUtil; +import gov.nist.secauto.metaschema.core.model.xml.XmlEventUtil; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import gov.nist.secauto.metaschema.databind.io.AbstractProblemHandler; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/MetaschemaXmlReader.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/MetaschemaXmlReader.java index 1c8141a2c..175a89cf2 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/MetaschemaXmlReader.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/xml/MetaschemaXmlReader.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; -import gov.nist.secauto.metaschema.core.model.util.XmlEventUtil; +import gov.nist.secauto.metaschema.core.model.xml.XmlEventUtil; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/metapath/function/Model.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/metapath/function/Model.java index 0a4dc2ad5..d906e5356 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/metapath/function/Model.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/metapath/function/Model.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.databind.metapath.function; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItem; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.function.FunctionUtils; import gov.nist.secauto.metaschema.core.metapath.function.IArgument; import gov.nist.secauto.metaschema.core.metapath.function.IFunction; -import gov.nist.secauto.metaschema.core.metapath.item.IItem; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDefinitionNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDefinitionNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.INamedInstance; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/ModelUtil.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/ModelUtil.java index 663d12a74..a8d287022 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/ModelUtil.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/ModelUtil.java @@ -6,7 +6,7 @@ package gov.nist.secauto.metaschema.databind.model.annotations; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.model.IAttributable; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/NullJavaTypeAdapter.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/NullJavaTypeAdapter.java index 92175540b..ff78fc815 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/NullJavaTypeAdapter.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/annotations/NullJavaTypeAdapter.java @@ -9,9 +9,9 @@ import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.metapath.item.atomic.IAnyAtomicItem; -import gov.nist.secauto.metaschema.core.metapath.item.function.IMapKey; -import gov.nist.secauto.metaschema.core.metapath.type.IItemType; +import gov.nist.secauto.metaschema.core.metapath.IItemType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAnyAtomicItem; +import gov.nist.secauto.metaschema.core.metapath.function.IMapKey; import gov.nist.secauto.metaschema.core.qname.IEnhancedQName; import gov.nist.secauto.metaschema.databind.model.annotations.NullJavaTypeAdapter.VoidItem; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/IBindingMetaschemaModule.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/IBindingMetaschemaModule.java index c294ad7aa..2d755a92c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/IBindingMetaschemaModule.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/IBindingMetaschemaModule.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; import gov.nist.secauto.metaschema.core.model.IMetaschemaModule; import gov.nist.secauto.metaschema.databind.model.metaschema.binding.METASCHEMA; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/IBindingModelElement.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/IBindingModelElement.java index 784cdc413..bccec4507 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/IBindingModelElement.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/IBindingModelElement.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.IModelElement; import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyModel.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyModel.java index b56289c90..21f4ffd1c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyModel.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyModel.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.NonNegativeIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.PositiveIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyReference.java index 2e9b33dfe..b9ffd3fb4 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyReference.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.NonNegativeIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.PositiveIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/ConstraintLetExpression.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/ConstraintLetExpression.java index a8bdaa5ee..f8237da56 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/ConstraintLetExpression.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/ConstraintLetExpression.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundField; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/ConstraintValueEnum.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/ConstraintValueEnum.java index 65bdccf52..e81bd265c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/ConstraintValueEnum.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/ConstraintValueEnum.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Example.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Example.java index eec3e247f..d73d65a66 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Example.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Example.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriReferenceAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.UriReferenceAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldReference.java index 015eb8126..62758c06f 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldReference.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.NonNegativeIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.PositiveIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagAllowedValues.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagAllowedValues.java index 73600ed26..857367a00 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagAllowedValues.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagAllowedValues.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagExpect.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagExpect.java index 5aa748e67..3cc02c354 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagExpect.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagExpect.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagIndexHasKey.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagIndexHasKey.java index 4be00448c..f026b9f1b 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagIndexHasKey.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagIndexHasKey.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagMatches.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagMatches.java index 16ce2b0e3..4ce6a2b7a 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagMatches.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagMatches.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagReference.java index 4c7df291a..3a4037d2e 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagReference.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.PositiveIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/GroupingAs.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/GroupingAs.java index a961237be..c0847f078 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/GroupingAs.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/GroupingAs.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineAssembly.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineAssembly.java index d9b7ccf4b..b708b4e5c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineAssembly.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineAssembly.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.NonNegativeIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.PositiveIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineField.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineField.java index 13b52f23f..e3cfdc20c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineField.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineField.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.NonNegativeIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.PositiveIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineFlag.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineFlag.java index f8f283de9..1d045b2c1 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineFlag.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineFlag.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.PositiveIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/JsonKey.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/JsonKey.java index 01f3182ca..053b4ba1c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/JsonKey.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/JsonKey.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/JsonValueKeyFlag.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/JsonValueKeyFlag.java index 7c13b1066..a18d3d1f0 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/JsonValueKeyFlag.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/JsonValueKeyFlag.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/KeyConstraintField.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/KeyConstraintField.java index f2ad2b6aa..5b66bcf94 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/KeyConstraintField.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/KeyConstraintField.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundField; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java index 4ac2bc226..d23f49a13 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java @@ -5,12 +5,12 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriReferenceAdapter; +import gov.nist.secauto.metaschema.core.datatype.NonNegativeIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.PositiveIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.UriAdapter; +import gov.nist.secauto.metaschema.core.datatype.UriReferenceAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetapathNamespace.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetapathNamespace.java index c540c0e21..f0578e60a 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetapathNamespace.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetapathNamespace.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.UriAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetaConstraints.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetaConstraints.java index e512281e6..c074f7885 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetaConstraints.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetaConstraints.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriReferenceAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.UriAdapter; +import gov.nist.secauto.metaschema.core.datatype.UriReferenceAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.core.model.JsonGroupAsBehavior; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetapath.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetapath.java index f8aa03925..d6747e3fc 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetapath.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetapath.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaModuleConstraints.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaModuleConstraints.java index 9c0cc0c39..9ecf493cf 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaModuleConstraints.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaModuleConstraints.java @@ -5,10 +5,10 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriReferenceAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.UriAdapter; +import gov.nist.secauto.metaschema.core.datatype.UriReferenceAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.core.model.JsonGroupAsBehavior; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Property.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Property.java index 2a2bc7123..b94db7e9b 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Property.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Property.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.UriAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.UriAdapter; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Remarks.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Remarks.java index 2d7fe79a3..8ade369a3 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Remarks.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/Remarks.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultilineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedAllowedValuesConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedAllowedValuesConstraint.java index acfb7a0d4..2391065b3 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedAllowedValuesConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedAllowedValuesConstraint.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedExpectConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedExpectConstraint.java index c7aec1ab7..0675339f6 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedExpectConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedExpectConstraint.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedHasCardinalityConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedHasCardinalityConstraint.java index 3968594f6..e77ea97f4 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedHasCardinalityConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedHasCardinalityConstraint.java @@ -5,9 +5,9 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.NonNegativeIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexConstraint.java index c2199ea3f..7ccf75229 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexConstraint.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexHasKeyConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexHasKeyConstraint.java index 1dd967039..a1eebd244 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexHasKeyConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexHasKeyConstraint.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIsUniqueConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIsUniqueConstraint.java index 5cc57fc37..5cd82d72c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIsUniqueConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIsUniqueConstraint.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedMatchesConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedMatchesConstraint.java index 0b89dba91..2822001a4 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedMatchesConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedMatchesConstraint.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.StringAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/UseName.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/UseName.java index e126d4877..6d4fa0c96 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/UseName.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/UseName.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.binding; -import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.NonNegativeIntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFieldValue; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AbstractAbsoluteModelGenerator.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AbstractAbsoluteModelGenerator.java index 980c53ded..db76ae45c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AbstractAbsoluteModelGenerator.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AbstractAbsoluteModelGenerator.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.impl; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.DefaultChoiceModelBuilder; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceAbsolute; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AssemblyModelGenerator.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AssemblyModelGenerator.java index cfd7fbd7d..cfe105afc 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AssemblyModelGenerator.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/AssemblyModelGenerator.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.impl; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.DefaultAssemblyModelBuilder; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceAbsolute; import gov.nist.secauto.metaschema.core.model.IChoiceGroupInstance; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/BindingModule.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/BindingModule.java index 08c22863b..3c073f03e 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/BindingModule.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/BindingModule.java @@ -8,9 +8,9 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IModuleNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IModuleNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.AbstractModule; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IFieldDefinition; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ChoiceGroupModelGenerator.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ChoiceGroupModelGenerator.java index bf85aa8f1..dae40220d 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ChoiceGroupModelGenerator.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ChoiceGroupModelGenerator.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.impl; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.DefaultChoiceGroupModelBuilder; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceGrouped; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ChoiceModelGenerator.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ChoiceModelGenerator.java index 70dd58999..bc3eaa1cb 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ChoiceModelGenerator.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ChoiceModelGenerator.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.impl; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.DefaultChoiceModelBuilder; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceAbsolute; import gov.nist.secauto.metaschema.core.model.IChoiceInstance; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionAssemblyGlobal.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionAssemblyGlobal.java index 506dcaae0..42de7496a 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionAssemblyGlobal.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionAssemblyGlobal.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.AbstractGlobalAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceAbsolute; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFieldGlobal.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFieldGlobal.java index b746ebcbe..364cc0c19 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFieldGlobal.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFieldGlobal.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractGlobalFieldDefinition; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IContainerFlagSupport; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFlagGlobal.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFlagGlobal.java index 05db31b30..b22a680ad 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFlagGlobal.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFlagGlobal.java @@ -8,8 +8,8 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; import gov.nist.secauto.metaschema.core.model.AbstractGlobalFlagDefinition; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IFlagInstance; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceFlagInline.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceFlagInline.java index d4116c410..a3d9b7517 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceFlagInline.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceFlagInline.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractInlineFlagDefinition; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IFeatureValueless; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceFlagReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceFlagReference.java index fbe0654c8..f68a051d2 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceFlagReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceFlagReference.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractFlagInstance; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IFeatureDefinitionReferenceInstance; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelAssemblyInline.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelAssemblyInline.java index 0cfcce4fc..5bf973a94 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelAssemblyInline.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelAssemblyInline.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.AbstractInlineAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceAbsolute; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelAssemblyReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelAssemblyReference.java index b07133235..780c691a2 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelAssemblyReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelAssemblyReference.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractAssemblyInstance; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceAbsolute; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelChoice.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelChoice.java index 08ce71696..6f01be798 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelChoice.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelChoice.java @@ -6,8 +6,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.impl; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.AbstractChoiceInstance; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceAbsolute; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelChoiceGroup.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelChoiceGroup.java index abd76cf08..9e8a5cc3f 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelChoiceGroup.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelChoiceGroup.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.impl; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.AbstractChoiceGroupInstance; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceGrouped; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelFieldInline.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelFieldInline.java index 98d2b00fd..603372115 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelFieldInline.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelFieldInline.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractInlineFieldDefinition; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IContainerFlagSupport; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelFieldReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelFieldReference.java index f462689ba..9e6caaf62 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelFieldReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelFieldReference.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractFieldInstance; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IContainerModelAbsolute; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedAssemblyInline.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedAssemblyInline.java index dc114f02c..0fa2f3b44 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedAssemblyInline.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedAssemblyInline.java @@ -7,8 +7,8 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.AbstractInlineAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceAbsolute; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedAssemblyReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedAssemblyReference.java index d25441704..92e64a899 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedAssemblyReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedAssemblyReference.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractAssemblyInstance; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceGrouped; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedFieldInline.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedFieldInline.java index 986758239..9c912bf14 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedFieldInline.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedFieldInline.java @@ -8,7 +8,7 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractInlineFieldDefinition; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IChoiceGroupInstance; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedFieldReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedFieldReference.java index 32391a2c2..7fc5b8ce0 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedFieldReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/InstanceModelGroupedFieldReference.java @@ -7,7 +7,7 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.model.AbstractFieldInstance; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IChoiceGroupInstance; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ModelSupport.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ModelSupport.java index cbcda4484..c6ee7d594 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ModelSupport.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/ModelSupport.java @@ -6,14 +6,14 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.impl; import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider; +import gov.nist.secauto.metaschema.core.datatype.MetaschemaDataTypeProvider; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.MetapathConstants; import gov.nist.secauto.metaschema.core.metapath.StaticContext; import gov.nist.secauto.metaschema.core.metapath.StaticMetapathError; -import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; -import gov.nist.secauto.metaschema.core.metapath.type.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.atomic.IAtomicOrUnionType; +import gov.nist.secauto.metaschema.core.metapath.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IDefinition; import gov.nist.secauto.metaschema.core.model.IFieldInstance; diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java index 872a19882..d3bf010c6 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/codegen/BasicMetaschemaTest.java @@ -14,9 +14,9 @@ import gov.nist.secauto.metaschema.core.metapath.DynamicContext; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.IConstraintLoader; import gov.nist.secauto.metaschema.core.model.MetaschemaException; import gov.nist.secauto.metaschema.core.model.constraint.IConstraintSet; diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoaderTest.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoaderTest.java index 17136bf5d..42cc500e1 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoaderTest.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/io/DefaultBoundLoaderTest.java @@ -8,7 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; -import gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.IDocumentNodeItem; import gov.nist.secauto.metaschema.core.model.MetaschemaException; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import gov.nist.secauto.metaschema.databind.IBindingContext; diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedAssembly.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedAssembly.java index b0d51b092..8e64ab944 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedAssembly.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedAssembly.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.test; -import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.IntegerAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedBoundAssembly.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedBoundAssembly.java index 304b75a1d..f74569cec 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedBoundAssembly.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedBoundAssembly.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.test; -import gov.nist.secauto.metaschema.core.datatype.adapter.BooleanAdapter; +import gov.nist.secauto.metaschema.core.datatype.BooleanAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedBoundField.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedBoundField.java index 16867d2b6..babb0869a 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedBoundField.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/FlaggedBoundField.java @@ -5,8 +5,8 @@ package gov.nist.secauto.metaschema.databind.model.test; -import gov.nist.secauto.metaschema.core.datatype.adapter.BooleanAdapter; -import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; +import gov.nist.secauto.metaschema.core.datatype.BooleanAdapter; +import gov.nist.secauto.metaschema.core.datatype.TokenAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFieldValue; diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/RootBoundAssembly.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/RootBoundAssembly.java index a86285d4f..00c343ab3 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/RootBoundAssembly.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/RootBoundAssembly.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.test; -import gov.nist.secauto.metaschema.core.datatype.adapter.UuidAdapter; +import gov.nist.secauto.metaschema.core.datatype.UuidAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.core.model.JsonGroupAsBehavior; diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/SimpleAssembly.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/SimpleAssembly.java index b638b8956..b0771f707 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/SimpleAssembly.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/model/test/SimpleAssembly.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.model.test; -import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.IntegerAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; diff --git a/databind/src/test/java/gov/nist/secauto/metaschema/databind/testing/model/RootAssemblyWithFlags.java b/databind/src/test/java/gov/nist/secauto/metaschema/databind/testing/model/RootAssemblyWithFlags.java index 53d222814..3caba4f63 100644 --- a/databind/src/test/java/gov/nist/secauto/metaschema/databind/testing/model/RootAssemblyWithFlags.java +++ b/databind/src/test/java/gov/nist/secauto/metaschema/databind/testing/model/RootAssemblyWithFlags.java @@ -5,7 +5,7 @@ package gov.nist.secauto.metaschema.databind.testing.model; -import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter; +import gov.nist.secauto.metaschema.core.datatype.IntegerAdapter; import gov.nist.secauto.metaschema.core.model.IBoundObject; import gov.nist.secauto.metaschema.core.model.IMetaschemaData; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; diff --git a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateModuleCommand.java b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateModuleCommand.java index 270644159..8dee67ebd 100644 --- a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateModuleCommand.java +++ b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateModuleCommand.java @@ -10,7 +10,7 @@ import gov.nist.secauto.metaschema.cli.processor.command.ICommandExecutor; import gov.nist.secauto.metaschema.core.model.IModule; import gov.nist.secauto.metaschema.core.model.constraint.IConstraintSet; -import gov.nist.secauto.metaschema.core.model.util.JsonUtil; +import gov.nist.secauto.metaschema.core.model.json.JsonUtil; import gov.nist.secauto.metaschema.core.model.validation.JsonSchemaContentValidator; import gov.nist.secauto.metaschema.core.model.validation.XmlSchemaContentValidator; import gov.nist.secauto.metaschema.core.util.ObjectUtils; diff --git a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java index 78fa20ec4..3edb0fb25 100644 --- a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java +++ b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java @@ -12,14 +12,14 @@ import gov.nist.secauto.metaschema.cli.processor.command.CommandExecutionException; import gov.nist.secauto.metaschema.cli.processor.command.ExtraArgument; import gov.nist.secauto.metaschema.cli.processor.command.ICommandExecutor; +import gov.nist.secauto.metaschema.core.metapath.DefaultItemWriter; import gov.nist.secauto.metaschema.core.metapath.DynamicContext; +import gov.nist.secauto.metaschema.core.metapath.IItemWriter; import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression; +import gov.nist.secauto.metaschema.core.metapath.ISequence; import gov.nist.secauto.metaschema.core.metapath.StaticContext; -import gov.nist.secauto.metaschema.core.metapath.item.DefaultItemWriter; -import gov.nist.secauto.metaschema.core.metapath.item.IItemWriter; -import gov.nist.secauto.metaschema.core.metapath.item.ISequence; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; -import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItem; +import gov.nist.secauto.metaschema.core.metapath.node.INodeItemFactory; import gov.nist.secauto.metaschema.core.model.IModule; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; From 28018ca8614b904bc007588a76b6676552451a09 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Tue, 3 Dec 2024 19:17:18 -0500 Subject: [PATCH 11/11] Added coderabbit config. --- .coderabbit.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 000000000..ef21e0803 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,15 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +language: "en-US" +early_access: false +reviews: + profile: "chill" + request_changes_workflow: true + high_level_summary: true + poem: false + review_status: true + collapse_walkthrough: true + auto_review: + enabled: true + drafts: false +chat: + auto_reply: true