From 6844c1a07c2bca0ac4b5d229379933d2eac258e7 Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Fri, 16 Aug 2024 11:32:23 +0200 Subject: [PATCH] refactor: apply formatting rules ING-4375 --- .../hale/app/cli/CLIApplication.java | 3 +- .../hale/app/cli/VersionCommand.java | 3 +- .../hale/app/transform/ConsoleConstants.java | 6 +- .../app/transform/ConsoleProgressMonitor.java | 33 ++- .../hale/app/transform/ExecApplication.groovy | 13 +- .../app/transform/ExecTransformation.java | 53 ++-- .../hale/app/transform/ExecUtil.groovy | 34 ++- .../app/transform/TransformCommand.groovy | 1 - .../app/transform/TransformationReports.java | 16 +- .../groovy/accessor/EntityAccessor.groovy | 6 +- .../accessor/internal/EntityAccessorUtil.java | 9 +- .../groovy/accessor/path/PathElement.java | 4 +- .../groovy/accessor/EntityAccessorTest.groovy | 6 +- .../test/AbstractMergeCellMigratorTest.java | 36 +-- .../common/align/merge/MergeCellMigrator.java | 17 +- .../hale/common/align/merge/MergeIndex.java | 11 +- .../common/align/merge/MergeSettings.java | 4 +- .../merge/extension/MigratorExtension.java | 14 +- .../merge/extension/MigratorFactory.java | 8 +- .../functions/GroovyRetypeMergeMigrator.java | 2 - .../align/merge/functions/JoinContext.java | 28 +- .../merge/functions/JoinMergeMigrator.java | 6 +- .../merge/impl/AbstractMergeCellMigrator.java | 36 ++- .../align/merge/impl/AbstractMigration.groovy | 3 +- .../merge/impl/DefaultSchemaMigration.groovy | 6 +- .../align/merge/impl/MatchingMigration.groovy | 7 +- .../common/align/merge/impl/TargetIndex.java | 6 +- .../impl/DefaultMergeCellMigratorTest.groovy | 4 +- .../test/impl/FormattedStringMergeTest.groovy | 3 +- .../test/impl/GroovyRetypeMergeTest.groovy | 3 +- .../impl/JoinFocusRetainConditionTest.groovy | 8 +- .../merge/test/impl/JoinMergeTest.groovy | 10 +- .../align/io/TestAnnotationDescriptor.groovy | 3 +- .../compatibility/CompatibilityMode.java | 7 +- .../compatibility/CompatibilityModeUtil.java | 1 - .../annotation/AnnotationExtension.java | 3 +- .../annotation/DefinedAnnotation.java | 7 +- .../align/extension/category/Category.java | 2 +- .../extension/category/CategoryExtension.java | 3 +- .../extension/engine/EngineExtension.java | 7 +- .../extension/function/AbstractFunction.java | 18 +- .../function/AbstractFunctionExtension.java | 17 +- .../extension/function/AbstractParameter.java | 8 +- .../function/FunctionDefinition.java | 15 +- .../extension/function/FunctionParameter.java | 30 +- .../function/FunctionParameterDefinition.java | 11 +- .../extension/function/FunctionUtil.java | 22 +- .../function/ParameterDefinition.java | 4 +- .../extension/function/PropertyFunction.java | 6 +- .../function/PropertyFunctionDefinition.java | 3 +- .../function/PropertyFunctionExtension.java | 3 +- .../extension/function/PropertyParameter.java | 22 +- .../function/PropertyParameterDefinition.java | 7 +- .../extension/function/TypeFunction.java | 9 +- .../function/TypeFunctionExtension.java | 3 +- .../extension/function/TypeParameter.java | 8 +- .../function/TypeParameterDefinition.java | 3 +- .../custom/CustomPropertyFunction.java | 4 +- .../validator/EnumerationValidator.java | 4 +- .../function/validator/LengthValidator.java | 4 +- .../function/validator/NumberValidator.java | 4 +- .../AbstractTransformationFactory.java | 15 +- .../PropertyTransformationFactory.java | 4 +- .../transformation/TransformationFactory.java | 10 +- .../TransformationFunctionUtil.java | 6 +- .../AbstractTransformationExtension.java | 3 +- .../PropertyTransformationExtension.java | 9 +- .../internal/TypeTransformationExtension.java | 13 +- .../helper/EntityDefinitionComparator.java | 6 +- .../common/align/helper/EntityFinder.java | 11 +- .../helper/GeometryPropertyFinder.groovy | 6 +- .../align/instance/EntityAwareFilter.java | 12 +- .../hale/common/align/io/AlignmentIO.java | 4 +- .../common/align/io/BaseAlignmentReader.java | 3 +- .../hale/common/align/io/EntityResolver.java | 3 +- .../io/impl/AbstractAlignmentReader.java | 15 +- .../io/impl/AbstractAlignmentWriter.java | 7 +- .../align/io/impl/CastorAlignmentIO.java | 14 +- .../align/io/impl/CastorAlignmentReader.java | 5 +- .../align/io/impl/CastorAlignmentWriter.java | 5 +- .../io/impl/DOMEntityDefinitionHelper.java | 14 +- .../align/io/impl/DefaultEntityResolver.java | 3 +- .../common/align/io/impl/JaxbAlignmentIO.java | 23 +- .../align/io/impl/JaxbAlignmentReader.java | 5 +- .../align/io/impl/JaxbAlignmentWriter.java | 5 +- .../io/impl/JaxbBaseAlignmentReader.java | 5 +- .../align/io/impl/LoadAlignmentAdvisor.java | 4 +- .../align/io/impl/dummy/EntityToDef.groovy | 3 +- .../internal/AbstractBaseAlignmentLoader.java | 73 +++-- .../align/io/impl/internal/AlignmentBean.java | 46 ++-- .../io/impl/internal/AlignmentToJaxb.groovy | 4 +- .../align/io/impl/internal/CellBean.java | 18 +- .../internal/CellOrModifierComparator.groovy | 3 +- .../io/impl/internal/ChildContextBean.java | 10 +- .../align/io/impl/internal/EntityBean.java | 3 +- .../io/impl/internal/JaxbToAlignment.java | 31 +-- .../impl/internal/JaxbToEntityDefinition.java | 31 +-- .../internal/LoadAlignmentContextImpl.groovy | 2 +- .../io/impl/internal/NamedEntityBean.java | 4 +- .../align/io/impl/internal/PropertyBean.java | 40 ++- .../io/impl/internal/QNameFieldHandler.java | 1 - .../align/io/impl/internal/TypeBean.java | 11 +- .../align/migrate/AlignmentMigration.java | 3 +- .../AlignmentMigrationNameLookupSupport.java | 7 +- .../impl/DefaultAlignmentMigrator.java | 8 +- .../migrate/impl/DefaultCellMigrator.java | 6 +- .../migrate/impl/MigrationOptionsImpl.java | 4 +- .../align/migrate/impl/UnmigratedCell.java | 18 +- .../align/migrate/util/EffectiveMapping.java | 15 +- .../align/migrate/util/MigrationUtil.java | 15 +- .../hale/common/align/model/Alignment.java | 47 ++-- .../common/align/model/AlignmentUtil.java | 131 +++++---- .../common/align/model/BaseAlignmentCell.java | 7 +- .../hale/common/align/model/Cell.java | 46 ++-- .../common/align/model/CellExplanation.java | 4 +- .../hale/common/align/model/CellUtil.java | 17 +- .../hale/common/align/model/ChildContext.java | 2 +- .../hale/common/align/model/Condition.java | 12 +- .../common/align/model/EntityDefinition.java | 22 +- .../common/align/model/MutableAlignment.java | 7 +- .../common/align/model/ParameterValue.java | 8 +- .../hale/common/align/model/Priority.java | 5 +- .../align/model/TransformationMode.java | 1 + .../model/annotations/messages/CellLog.groovy | 3 +- .../model/annotations/messages/Comment.java | 6 +- .../model/annotations/messages/Message.java | 11 +- .../messages/MessageDescriptor.groovy | 9 +- .../PropertyOrChildrenTypeCondition.java | 9 +- .../condition/PropertyTypeCondition.java | 4 +- .../condition/impl/BindingCondition.java | 21 +- .../condition/impl/GeometryCondition.java | 28 +- .../align/model/functions/AssignFunction.java | 3 +- .../ClassificationMappingFunction.java | 4 +- .../functions/ClassificationMappingUtil.java | 16 +- .../functions/FormattedStringFunction.java | 17 +- .../functions/FormattedStringMigrator.java | 18 +- .../align/model/functions/JoinFunction.java | 3 +- .../align/model/functions/RenameFunction.java | 8 +- .../explanations/AssignExplanation.java | 5 +- .../ClassificationMappingExplanation.java | 6 +- .../explanations/CreateExplanation.java | 5 +- .../FormattedStringExplanation.java | 13 +- .../explanations/InlineExplanation.java | 8 +- .../explanations/JoinExplanation.java | 5 +- .../explanations/MergeExplanation.java | 9 +- .../model/functions/join/JoinMigrator.java | 8 +- .../model/functions/join/JoinParameter.java | 32 +-- .../functions/join/JoinParameterType.groovy | 8 +- .../model/functions/merge/MergeMigrator.java | 13 +- .../model/functions/merge/MergeUtil.java | 37 ++- .../model/impl/AbstractCellExplanation.java | 56 ++-- .../model/impl/ChildEntityDefinition.java | 7 +- .../align/model/impl/DefaultAlignment.java | 58 ++-- .../common/align/model/impl/DefaultCell.java | 10 +- .../model/impl/MutableCellDecorator.java | 6 +- .../model/impl/PropertyEntityDefinition.java | 5 +- .../model/impl/TypeEntityDefinition.java | 7 +- .../impl/mdexpl/MarkdownCellExplanation.java | 35 ++- .../model/impl/mdexpl/ParameterBinding.java | 11 +- .../model/transformation/tree/CellNode.java | 11 +- .../model/transformation/tree/GroupNode.java | 3 +- .../model/transformation/tree/Leftovers.java | 26 +- .../model/transformation/tree/SourceNode.java | 49 ++-- .../model/transformation/tree/TargetNode.java | 26 +- .../tree/TransformationNodeVisitor.java | 12 +- .../tree/TransformationTree.java | 3 +- .../tree/TransformationTreeUtil.java | 21 +- .../tree/context/TransformationContext.java | 3 +- .../context/impl/IdentityHashMultimap.java | 5 +- .../tree/context/impl/TargetContext.java | 113 ++++---- .../impl/matcher/AsDeepAsPossible.java | 7 +- .../tree/impl/AbstractGroupNode.java | 5 +- .../tree/impl/AbstractTransformationNode.java | 3 +- .../tree/impl/CellNodeImpl.java | 17 +- .../tree/impl/LeftoversImpl.java | 19 +- .../tree/impl/SourceNodeFactory.java | 13 +- .../tree/impl/SourceNodeImpl.java | 16 +- .../tree/impl/TargetNodeImpl.java | 23 +- .../tree/impl/TransformationTreeImpl.java | 24 +- .../tree/visitor/CellNodeValidator.java | 4 +- .../tree/visitor/DuplicationVisitor.java | 14 +- .../tree/visitor/InstanceVisitor.java | 37 +-- .../tree/visitor/TreeToGraphVisitor.java | 11 +- .../common/align/service/FunctionService.java | 6 +- .../TransformationFunctionService.java | 3 +- .../impl/AbstractDefaultFunctionService.java | 14 +- ...tDefaultTransformationFunctionService.java | 26 +- ...lignmentTransformationFunctionService.java | 4 +- .../service/impl/StaticFunctionService.java | 6 +- .../StaticTransformationFunctionService.java | 3 +- .../function/ExecutionContext.java | 12 +- .../function/InstanceHandler.java | 8 +- .../function/PropertyTransformation.java | 22 +- .../function/PropertyValue.java | 11 +- .../function/TransformationFunction.java | 11 +- .../function/TransformationVariables.java | 8 +- .../function/TypeTransformation.java | 11 +- .../impl/AbstractPropertyTransformation.java | 16 +- ...actSingleTargetPropertyTransformation.java | 15 +- .../AbstractSingleTypeTransformation.java | 4 +- .../impl/AbstractTransformationFunction.java | 28 +- .../impl/AbstractTypeTransformation.java | 8 +- .../impl/DefaultTransformationVariables.java | 5 +- .../function/impl/FamilyInstanceImpl.java | 7 +- .../function/impl/PropertyValueImpl.java | 5 +- .../report/TransformationReporter.java | 4 +- .../transformation/report/impl/CellLog.java | 2 +- .../impl/DefaultTransformationReporter.java | 27 +- .../impl/PreparedTransformationReporter.java | 4 +- .../impl/TransformationMessageImpl.java | 2 +- .../TransformationMessageImplDefinition.java | 7 +- .../TransformationReportImplDefinition.java | 3 +- .../service/PropertyTransformer.java | 4 +- .../service/TransformationSchemas.java | 4 +- .../service/impl/DefaultInstanceSink.java | 5 +- .../align/io/CastorAlignmentIOTest.java | 7 +- .../align/io/DefaultAlignmentIOTest.java | 118 ++++---- .../common/align/io/JaxbAlignmentIOTest.java | 7 +- .../functions/join/JoinParameterTest.groovy | 11 +- .../mdexpl/MarkdownCellExplanationTest.java | 23 +- .../hale/common/app/AbstractApplication.java | 7 +- .../hale/common/app/ApplicationUtil.java | 16 +- .../hale/common/cache/Request.java | 44 ++- .../hale/common/cache/RequestTest.java | 7 +- .../hale/common/cli/HaleCLIUtil.groovy | 5 +- .../cli/project/AbstractProjectCommand.groovy | 5 +- .../cli/project/ListProjectsCommand.groovy | 5 +- .../codelist/validator/CodeListValidator.java | 6 +- .../hale/common/codelist/CodeList.java | 4 +- .../config/CodeListAssociations.groovy | 4 +- .../config/CodeListAssociationsType.groovy | 7 +- .../codelist/config/DummyEntityKey.java | 11 +- .../codelist/service/CodeListRegistry.java | 3 +- .../hale/common/config/ConfigValue.groovy | 1 - .../hale/common/config/ConfigValueTest.groovy | 8 +- ...AbstractStringToDateTimeTypeConverter.java | 3 +- .../convert/core/CalendarToDateConverter.java | 1 - .../core/CalendarToJodaDateTimeConverter.java | 1 - .../convert/core/DateToInstantConverter.java | 1 - .../core/DateToJodaDateTimeConverter.java | 1 - .../core/DateToLocalDateConverter.java | 1 - .../convert/core/DateToSqlDateConverter.java | 1 - .../convert/core/DateToSqlTimeConverter.java | 1 - .../core/DateToSqlTimestampConverter.java | 1 - .../core/GStringImplToURIConverter.java | 1 - .../convert/core/InstantToDateConverter.java | 1 - .../core/InstantToSqlDateConverter.java | 1 - .../core/InstantToSqlTimestampConverter.java | 1 - .../core/JodaDateTimeToDateConverter.java | 1 - .../core/JodaDateTimeToSqlDateConverter.java | 1 - .../JodaDateTimeToSqlTimestampConverter.java | 1 - .../core/LocalDateToDateConverter.java | 1 - .../core/LocalDateToSqlDateConverter.java | 1 - .../LocalDateToSqlTimestampConverter.java | 1 - .../core/SqlDateToJodaDateTimeConverter.java | 1 - .../SqlTimestampToJodaDateTimeConverter.java | 1 - .../core/SqlTimestampToSqlDateConverter.java | 1 - .../common/convert/wkt/StringToGeometry.java | 3 +- .../wkt/StringToGeometryCollection.java | 3 +- .../convert/wkt/StringToLineString.java | 3 +- .../convert/wkt/StringToLinearRing.java | 3 +- .../convert/wkt/StringToMultiLineString.java | 3 +- .../convert/wkt/StringToMultiPoint.java | 3 +- .../convert/wkt/StringToMultipolygon.java | 3 +- .../common/convert/wkt/StringToPoint.java | 3 +- .../common/convert/wkt/StringToPolygon.java | 3 +- .../internal/AbstractGeometryConverter.java | 6 +- .../convert/CachingConversionService.java | 1 - .../convert/ConversionServiceFactory.java | 5 +- .../hale/common/convert/ConversionUtil.java | 8 +- .../convert/ConverterPackageFactoryBean.java | 16 +- .../convert/extension/ConverterExtension.java | 3 +- .../convert/extension/ConverterInfo.java | 5 +- .../hale/common/core/HalePlatform.java | 31 +-- .../hale/common/core/internal/CoreBundle.java | 7 +- .../hale/common/core/io/DOMValueUtil.groovy | 4 +- .../hale/common/core/io/ExportProvider.java | 3 +- .../hale/common/core/io/HaleIO.java | 144 +++++----- .../hale/common/core/io/IOAction.java | 7 +- .../hale/common/core/io/IOAdvisor.java | 8 +- .../hale/common/core/io/IOProvider.java | 32 +-- .../hale/common/core/io/ImportProvider.java | 27 +- .../hale/common/core/io/JsonValueUtil.groovy | 1 - .../hale/common/core/io/PathUpdate.java | 56 ++-- .../common/core/io/ProgressIndicator.java | 4 +- .../core/io/ProgressMonitorIndicator.java | 13 +- .../hale/common/core/io/ResourceAdvisor.java | 22 +- .../hale/common/core/io/Value.java | 46 ++-- .../core/io/extension/ComplexValueAlias.java | 3 +- .../extension/ComplexValueAliasExtension.java | 3 +- .../io/extension/ComplexValueDefinition.java | 15 +- .../io/extension/ComplexValueExtension.java | 11 +- .../extension/ComplexValueJsonDescriptor.java | 5 +- .../extension/ComplexValueJsonExtension.java | 3 +- .../core/io/extension/IOActionExtension.java | 10 +- .../core/io/extension/IOAdvisorExtension.java | 8 +- .../core/io/extension/IOAdvisorFactory.java | 4 +- .../core/io/extension/IOProviderAlias.java | 3 +- .../extension/IOProviderAliasExtension.java | 3 +- .../io/extension/IOProviderDescriptor.java | 10 +- .../IOProviderDescriptorDecorator.java | 8 +- .../io/extension/IOProviderExtension.java | 16 +- .../core/io/extension/IOProviderFactory.java | 4 +- .../extension/ResourceAdvisorDescriptor.java | 6 +- .../extension/ResourceAdvisorExtension.java | 22 +- .../core/io/impl/AbstractExportProvider.java | 11 +- .../core/io/impl/AbstractGroovyValueJson.java | 7 +- .../core/io/impl/AbstractIOProvider.java | 25 +- .../core/io/impl/AbstractImportProvider.java | 13 +- .../core/io/impl/AbstractStreamValueJson.java | 7 +- .../common/core/io/impl/ComplexValue.java | 7 +- .../core/io/impl/ConfigurationIOAdvisor.java | 5 +- .../common/core/io/impl/DefaultIOAdvisor.java | 3 +- .../core/io/impl/DefaultResourceAdvisor.java | 8 +- .../common/core/io/impl/ElementValue.java | 3 +- .../core/io/impl/GZipEnabledExport.java | 6 +- .../core/io/impl/GZipEnabledImport.java | 6 +- .../core/io/impl/LogProgressIndicator.java | 12 +- .../hale/common/core/io/impl/QNameType.groovy | 10 +- .../hale/common/core/io/impl/SimpleValue.java | 5 +- .../hale/common/core/io/impl/StringValue.java | 10 +- .../hale/common/core/io/impl/TextType.java | 8 +- .../common/core/io/impl/ValueListType.groovy | 3 +- .../common/core/io/impl/ValueMapType.groovy | 3 +- .../core/io/impl/ValuePropertiesType.groovy | 3 +- .../core/io/project/DOMProjectHelper.java | 10 +- .../io/project/FixedProjectInfoService.java | 3 +- .../common/core/io/project/ProjectIO.java | 34 ++- .../common/core/io/project/ProjectInfo.java | 4 +- .../core/io/project/ProjectInfoAware.java | 11 +- .../core/io/project/ProjectInfoService.java | 3 +- .../common/core/io/project/ProjectReader.java | 7 +- .../io/project/ProjectVariableReplacer.java | 3 +- .../core/io/project/ProjectVariables.java | 7 +- .../common/core/io/project/ProjectWriter.java | 17 +- ...modifiableComplexConfigurationService.java | 3 +- .../extension/ProjectFileExtension.java | 7 +- .../extension/internal/ActionFileFactory.java | 8 +- .../extension/internal/ActionProjectFile.java | 36 ++- .../extension/internal/CustomFileFactory.java | 3 +- .../project/impl/AbstractProjectReader.java | 11 +- .../project/impl/AbstractProjectWriter.java | 8 +- .../io/project/impl/ArchiveProjectImport.java | 21 +- .../io/project/impl/ArchiveProjectReader.java | 16 +- .../io/project/impl/ArchiveProjectWriter.java | 35 ++- .../io/project/impl/DefaultProjectReader.java | 31 +-- .../io/project/impl/DefaultProjectWriter.java | 21 +- .../io/project/model/IOConfiguration.java | 16 +- .../model/IOConfigurationResource.java | 12 +- .../common/core/io/project/model/Project.java | 15 +- .../core/io/project/model/ProjectFile.java | 11 +- .../core/io/project/model/Resource.java | 6 +- .../model/impl/PredefinedProjectFile.java | 10 +- .../project/model/internal/JaxbProjectIO.java | 10 +- .../project/model/internal/JaxbToProject.java | 13 +- .../model/internal/OsgiClassFieldHandler.java | 3 +- .../project/model/internal/ProjectToJaxb.java | 18 +- .../model/internal/URIFieldHandler.java | 1 - .../core/io/project/util/LocationUpdater.java | 29 +- .../io/project/util/XMLAlignmentUpdater.java | 25 +- .../core/io/project/util/XMLPathUpdater.java | 57 ++-- .../io/project/util/XMLSchemaUpdater.java | 31 +-- .../common/core/io/report/IOReporter.java | 3 +- .../io/report/impl/DefaultIOReporter.java | 6 +- .../core/io/report/impl/IOMessageImpl.java | 5 +- .../report/impl/IOMessageImplDefinition.java | 7 +- .../report/impl/IOReportImplDefinition.java | 5 +- .../io/supplier/DefaultInputSupplier.java | 7 +- .../core/io/supplier/FileIOSupplier.java | 5 +- .../core/io/supplier/FilesIOSupplier.java | 5 +- .../io/supplier/LocatableInputSupplier.java | 7 +- .../io/supplier/LookupStreamResource.java | 20 +- .../util/AbstractScopedVariableReplacer.java | 6 +- .../common/core/io/util/DebugInputStream.java | 7 +- .../core/io/util/ExportProviderDecorator.java | 5 +- .../core/io/util/GZipContentDescriber.java | 16 +- .../core/io/util/IOProviderDecorator.java | 12 +- .../core/io/util/ImportProviderDecorator.java | 7 +- .../parameter/AbstractCommonParameter.java | 1 - .../AbstractParameterValueDescriptor.java | 3 +- .../core/parameter/IOProviderParameter.java | 13 +- .../core/parameter/NamedDefinition.java | 6 +- .../common/core/parameter/ParameterUtil.java | 40 ++- .../parameter/ParameterValueDescriptor.java | 11 +- .../QNameParameterValueDescriptor.java | 3 +- .../hale/common/core/parameter/Validator.java | 3 +- .../hale/common/core/report/LogAware.java | 6 +- .../common/core/report/MessageFactory.java | 8 +- .../hale/common/core/report/Report.java | 12 +- .../common/core/report/ReportFactory.java | 8 +- .../hale/common/core/report/ReportLog.java | 8 +- .../common/core/report/ReportSession.java | 9 +- .../hale/common/core/report/Reporter.java | 15 +- .../hale/common/core/report/SimpleLog.java | 1 - .../common/core/report/SimpleLogContext.java | 23 +- .../impl/AbstractMessageDefinition.java | 14 +- .../report/impl/AbstractReportDefinition.java | 16 +- .../core/report/impl/AbstractReporter.java | 7 +- .../core/report/impl/AllInMemoryReporter.java | 29 +- .../core/report/impl/DefaultReporter.java | 12 +- .../common/core/report/impl/MessageImpl.java | 3 +- .../report/impl/MessageImplDefinition.java | 3 +- .../core/report/impl/ReportImplDefintion.java | 3 +- .../core/report/impl/SimpleReporter.java | 4 +- .../core/report/util/StatisticsHelper.groovy | 3 +- .../common/core/report/util/StatsMerge.groovy | 3 - .../core/report/writer/ReportReader.java | 13 +- .../core/report/writer/ReportWriter.java | 17 +- .../core/service/DelegateServiceProvider.java | 3 +- .../common/core/service/ServiceFactory.java | 3 +- .../common/core/service/ServiceManager.java | 11 +- .../common/core/service/ServiceProvider.java | 4 +- .../core/service/cleanup/CleanupService.java | 8 +- .../cleanup/impl/CleanupServiceImpl.java | 11 +- .../internal/ServiceFactoryDefinition.java | 10 +- .../internal/ServiceFactoryExtension.java | 5 +- .../hale/common/core/io/PathUpdateTest.java | 69 +++-- .../core/io/impl/TextTypeJsonTest.groovy | 4 +- .../core/io/impl/ValueListTypeTest.java | 19 +- .../core/io/impl/ValueMapTypeTest.groovy | 11 +- .../io/impl/ValuePropertiesTypeTest.groovy | 11 +- .../common/core/io/project/ProjectTest.java | 8 +- .../io/project/util/XMLPathUpdaterTest.java | 8 +- .../io/supplier/LookupStreamResourceTest.java | 8 +- .../common/filter/AbstractGeotoolsFilter.java | 25 +- .../definition/CQLFilterDefinition.java | 3 +- .../definition/ECQLFilterDefinition.java | 3 +- .../internal/EntityReplacementVisitor.java | 10 +- .../common/filter/AbstractFilterTest.groovy | 23 +- .../hale/common/filter/CQLFilterTest.groovy | 5 +- .../hale/common/filter/FilterTest.java | 41 ++- .../orient/OrientTransformationSink.java | 19 +- .../headless/test/AbstractProjectTest.java | 8 +- .../common/headless/EnvironmentService.java | 7 +- .../hale/common/headless/HeadlessIO.java | 26 +- .../headless/TransformationEnvironment.java | 13 +- .../common/headless/WorkspaceService.java | 12 +- .../headless/impl/CodeListAdvisor.groovy | 10 +- .../headless/impl/EnvironmentManagerImpl.java | 5 +- .../headless/impl/HeadlessProjectAdvisor.java | 41 ++- .../headless/impl/LoadSchemaAdvisor.java | 11 +- .../ProjectTransformationEnvironment.java | 22 +- .../headless/impl/WorkspaceServiceImpl.java | 25 +- .../common/headless/report/ReportFile.java | 5 +- .../scavenger/AbstractProjectScavenger.java | 17 +- .../headless/scavenger/ProjectProperties.java | 3 +- .../headless/scavenger/ProjectReference.java | 55 ++-- .../transform/AbstractTransformationJob.java | 2 - .../transform/AbstractTransformationSink.java | 3 +- .../common/headless/transform/ExportJob.java | 7 +- .../headless/transform/LimboInstanceSink.java | 13 +- .../StatsCountInstanceCollection.java | 3 +- .../headless/transform/Transformation.java | 81 +++--- .../transform/TransformationSettings.java | 4 +- .../transform/TransformationSink.java | 4 +- .../transform/TransformationWorkspace.java | 85 +++--- .../headless/transform/ValidationJob.java | 17 +- .../TransformationSinkExtension.java | 43 ++- .../filter/InstanceFilterDefinition.java | 20 +- .../DefaultTransformedInstanceValidator.java | 8 +- .../apps/templates/GenerateTemplates.groovy | 12 +- .../GenerateTemplatesApplication.java | 7 +- .../codelists/RegistryCodeLists.groovy | 7 +- .../inspire/schemas/ApplicationSchemas.groovy | 4 +- .../reference/IdentityReferenceInspector.java | 4 +- .../graph/reference/ReferenceGraph.java | 60 ++-- .../graph/reference/impl/XMLInspector.java | 12 +- .../ReferencesInstanceCollection.java | 5 +- .../graph/test/ReferenceGraphTest.groovy | 6 +- .../instance/groovy/InstanceAccessor.groovy | 5 +- .../instance/groovy/InstanceBuilder.groovy | 6 +- .../groovy/InstanceFamilyAccessor.groovy | 5 +- .../meta/InstanceFamilyAccessorMetaClass.java | 3 +- .../groovy/InstanceBuilderTest.groovy | 12 +- .../instance/index/DeepIterableKey.java | 11 +- .../instance/index/HaleInstanceIndex.java | 9 +- .../instance/index/IndexedPropertyValue.java | 11 +- .../common/instance/index/InstanceIndex.java | 8 +- .../index/InstanceIndexContribution.java | 11 +- .../instance/index/InstanceIndexService.java | 19 +- .../index/InstanceIndexServiceImpl.java | 27 +- .../instance/index/InstanceIndexUtil.java | 16 +- .../index/LocalizableInstanceReference.java | 7 +- .../instance/index/MultimapInstanceIndex.java | 11 +- .../PropertyEntityDefinitionMapping.java | 11 +- .../spatial/RTreeSpatialIndexService.java | 10 +- .../SpatialIndexInstanceProcessor.java | 17 +- .../index/spatial/SpatialIndexService.java | 23 +- .../hale/common/instance/orient/OGroup.java | 41 ++- .../common/instance/orient/OInstance.java | 24 +- .../common/instance/orient/ONameUtil.java | 9 +- .../orient/internal/ExtendedWKBReader.java | 9 +- .../orient/internal/ExtendedWKBWriter.java | 1 - .../orient/internal/ONamespaceMap.java | 13 +- .../orient/internal/OSerializationHelper.java | 60 ++-- .../BrowseOrientInstanceCollection.java | 19 +- .../orient/storage/DatabaseHandle.java | 20 +- .../orient/storage/DatabaseReference.java | 9 +- .../orient/storage/LocalOrientDB.java | 3 +- .../storage/OrientInstanceReference.java | 1 - .../orient/storage/OrientInstanceSink.java | 6 +- .../storage/SQLQueryInstanceCollection.java | 20 +- .../storage/SharedDatabaseConnection.java | 8 +- .../orient/storage/StoreInstancesJob.java | 43 ++- .../filter/FilterDefinitionExtension.java | 11 +- .../filter/FilterDefinitionManager.java | 7 +- .../metadata/MetadataActionExtension.java | 43 ++- .../metadata/MetadataIdGenerator.java | 3 +- .../extension/metadata/MetadataInfo.java | 6 +- .../metadata/MetadataInfoExtension.java | 3 +- .../extension/metadata/MetadataWorker.java | 7 +- .../ConstraintValidatorExtension.java | 25 +- .../ConstraintValidatorFactory.java | 14 +- .../GroupPropertyConstraintValidator.java | 10 +- .../validation/InstanceValidationContext.java | 14 +- .../PropertyConstraintValidator.java | 4 +- .../validation/ValidationLocation.java | 4 +- .../extension/validation/ValidatorBase.java | 4 +- .../report/InstanceValidationMessage.java | 10 +- .../report/InstanceValidationReporter.java | 4 +- .../DefaultInstanceValidationMessage.java | 12 +- .../DefaultInstanceValidationReporter.java | 4 +- .../InstanceValidationMessageDefinition.java | 8 +- .../InstanceValidationReportDefinition.java | 7 +- .../geometry/CRSDefinitionManager.java | 9 +- .../instance/geometry/CRSDefinitionUtil.java | 21 +- .../common/instance/geometry/CRSProvider.java | 11 +- .../instance/geometry/CRSResolveCache.java | 8 +- .../geometry/DefaultGeometryProperty.java | 8 +- .../instance/geometry/GeometryFinder.java | 16 +- .../instance/geometry/GeometryUtil.java | 15 +- .../geometry/InterpolationHelper.java | 23 +- .../geometry/impl/AbstractCRSManager.java | 27 +- .../geometry/impl/CodeDefinition.java | 19 +- .../geometry/impl/EPSGResolveCache.java | 8 +- .../instance/geometry/impl/WKTDefinition.java | 3 +- .../helper/BreadthFirstInstanceTraverser.java | 1 - .../helper/DepthFirstInstanceTraverser.java | 10 +- .../helper/InstanceTraversalCallback.java | 17 +- .../instance/helper/InstanceTraverser.java | 16 +- .../instance/helper/PropertyResolver.java | 125 ++++----- .../instance/helper/QueueDefinitionItem.java | 4 +- .../common/instance/io/GeoInstanceWriter.java | 19 +- .../hale/common/instance/io/InstanceIO.java | 11 +- .../common/instance/io/InstanceReader.java | 6 +- .../common/instance/io/InstanceWriter.java | 16 +- .../io/impl/AbstractGeoInstanceWriter.java | 51 ++-- .../io/impl/AbstractInstanceReader.java | 9 +- .../io/impl/AbstractInstanceValidator.java | 4 +- .../io/impl/AbstractInstanceWriter.java | 6 +- .../io/util/GeoInstanceWriterDecorator.java | 2 +- .../io/util/InstanceReaderDecorator.java | 4 +- .../io/util/InstanceWriterDecorator.java | 5 +- .../instance/model/ContextAwareFilter.java | 5 +- .../hale/common/instance/model/DataSet.java | 1 + .../hale/common/instance/model/Filter.java | 6 +- .../hale/common/instance/model/Group.java | 8 +- .../common/instance/model/Identifiable.java | 8 +- .../hale/common/instance/model/Instance.java | 26 +- .../instance/model/InstanceCollection.java | 8 +- .../instance/model/InstanceMetadata.java | 8 +- .../instance/model/InstanceResolver.java | 11 +- .../common/instance/model/InstanceUtil.java | 38 ++- .../common/instance/model/MetaFilter.java | 13 +- .../instance/model/MutableInstance.java | 8 +- .../model/ResolvableInstanceReference.java | 4 +- .../instance/model/ResourceIterator.java | 4 +- .../model/ext/InstanceCollection2.java | 10 +- .../instance/model/ext/InstanceIterator.java | 8 +- .../ext/helper/EmptyInstanceCollection.java | 3 +- .../helper/InstanceCollectionDecorator.java | 3 +- .../ext/impl/PerTypeInstanceCollection.java | 21 +- .../instance/model/impl/DefaultGroup.java | 15 +- .../instance/model/impl/DefaultInstance.java | 14 +- .../model/impl/DefaultInstanceCollection.java | 9 +- .../impl/FilterResourceIteratorAdapter.java | 7 +- .../impl/FilteredInstanceCollection.java | 10 +- .../impl/GenericResourceIteratorAdapter.java | 3 +- .../instance/model/impl/GroupDecorator.java | 3 +- .../model/impl/InstanceDecorator.java | 8 +- .../impl/InstanceReferenceDecorator.java | 11 +- .../model/impl/MultiInstanceCollection.java | 26 +- .../impl/ReferenceInstanceCollection.java | 5 +- .../model/impl/ResourceIteratorAdapter.java | 3 +- .../model/impl/TypeFilteredIterator.java | 4 +- .../processing/AbstractInstanceProcessor.java | 5 +- .../InstanceProcessingExtension.java | 22 +- .../processing/InstanceProcessor.java | 5 +- .../tools/InstanceCollectionPartitioner.java | 4 +- .../instance/tools/impl/NoPartitioner.java | 3 +- .../tools/impl/PartitionIterator.java | 11 +- .../geometry/CRSDefinitionUtilTest.java | 1 - .../instance/helper/PropertyResolverTest.java | 74 +++-- .../tools/impl/SimplePartitionerTest.java | 8 +- .../InstanceModelValidator.java | 7 +- .../instancevalidator/InstanceValidator.java | 56 ++-- .../InstanceModelValidatorExtension.java | 3 +- .../InstanceModelValidatorFactory.java | 3 +- .../validators/CardinalityValidator.java | 2 +- .../validators/ChoiceFlagValidator.java | 12 +- .../validators/UniqueValidator.java | 9 +- .../ValidationConstraintValidator.java | 8 +- .../hale/common/lookup/LookupService.java | 4 +- .../hale/common/lookup/LookupTable.java | 10 +- .../lookup/impl/AbstractLookupExport.java | 4 +- .../lookup/impl/AbstractLookupImport.java | 7 +- .../common/lookup/impl/LookupTableImpl.java | 18 +- .../impl/LookupTableParameterValue.java | 5 +- .../lookup/internal/LookupServiceImpl.java | 8 +- .../lookup/internal/LookupTableType.groovy | 3 +- .../lookup/internal/LookupTableTypeTest.java | 23 +- .../InstancePropertyAccessorFactory.java | 27 +- .../factory/adv/AdvCrsAuthorityFactory.java | 11 +- .../adv/AdvCrsUrnAuthorityFactory.java | 11 +- .../factory/CrsAuthorityFactoryTest.groovy | 3 +- .../schema/groovy/DefinitionAccessor.groovy | 1 - .../common/schema/groovy/SchemaBuilder.groovy | 4 +- .../constraints/CardinalityFactory.groovy | 6 +- .../groovy/DefinitionAccessorTest.groovy | 4 +- .../schema/groovy/SchemaBuilderTest.groovy | 4 +- .../AugmentedValueFactoryTest.groovy | 4 +- .../constraints/BindingFactoryTest.groovy | 4 +- .../constraints/CardinalityFactoryTest.groovy | 4 +- .../constraints/ChoiceFactoryTest.groovy | 4 +- .../constraints/DisplayNameFactoryTest.groovy | 4 +- .../constraints/EnumerationFactoryTest.groovy | 4 +- .../constraints/GeometryFactoryTest.groovy | 11 +- .../constraints/NillableFactoryTest.groovy | 4 +- .../TypeAbstractFactoryTest.groovy | 4 +- .../persist/AbstractCachedSchemaReader.java | 3 +- .../AbstractCachedSchemaReaderBase.java | 35 ++- .../persist/hsd/HaleSchemaConstants.java | 3 +- .../schema/persist/hsd/HaleSchemaReader.java | 9 +- .../schema/persist/hsd/HaleSchemaUtil.java | 8 +- .../schema/persist/hsd/HaleSchemaWriter.java | 19 +- .../schema/persist/hsd/MergeSchemas.java | 17 +- .../schema/persist/hsd/SchemaToXml.groovy | 6 +- .../schema/persist/hsd/XmlToSchema.groovy | 6 +- .../hsd/json/HaleSchemaReaderJson.java | 15 +- .../hsd/json/HaleSchemaWriterJson.java | 11 +- .../persist/hsd/json/JsonToSchema.groovy | 3 +- .../persist/hsd/json/SchemaToJson.groovy | 3 +- .../hsd/test/HaleSchemaWriterTest.groovy | 20 +- .../test/json/HaleSchemaWriterJsonTest.groovy | 7 +- .../extension/SchemaCategoryExtension.java | 6 +- .../presets/extension/SchemaPreset.java | 5 +- .../extension/SchemaPresetExtension.java | 11 +- .../internal/PredefinedSchemaImpl.java | 12 +- .../internal/SchemaCategoryImpl.java | 3 +- .../hale/common/schema/Classification.java | 8 +- .../common/schema/geometry/CRSDefinition.java | 1 - .../schema/geometry/GeometryProperty.java | 4 +- .../hale/common/schema/io/SchemaIO.java | 31 +-- .../schema/io/util/SchemaReaderDecorator.java | 4 +- .../common/schema/model/ChildDefinition.java | 12 +- .../hale/common/schema/model/Constraint.java | 11 +- .../hale/common/schema/model/Definition.java | 12 +- .../common/schema/model/DefinitionGroup.java | 12 +- .../common/schema/model/DefinitionUtil.java | 44 ++- .../schema/model/GroupPropertyDefinition.java | 12 +- .../common/schema/model/TypeConstraint.java | 4 +- .../common/schema/model/TypeDefinition.java | 4 +- .../hale/common/schema/model/TypeIndex.java | 8 +- .../model/constraint/ConstraintUtil.java | 30 +- .../schema/model/constraint/DisplayName.java | 6 +- .../factory/DefaultClassResolver.java | 3 +- .../constraint/factory/MapTypeProvider.java | 11 +- .../factory/MapTypeReferenceBuilder.java | 8 +- .../constraint/factory/MapTypeResolver.java | 8 +- .../constraint/factory/OsgiClassResolver.java | 3 +- .../constraint/factory/TypeProvider.java | 7 +- .../factory/TypeReferenceBuilder.java | 3 +- .../constraint/factory/TypeResolver.java | 3 +- .../factory/ValueConstraintFactory.java | 4 +- .../constraint/factory/extension/Alias.java | 3 +- .../factory/extension/AliasExtension.java | 3 +- .../extension/ValueConstraintExtension.java | 8 +- .../ValueConstraintFactoryDescriptor.java | 6 +- .../constraint/property/Cardinality.java | 14 +- .../model/constraint/property/ChoiceFlag.java | 2 +- .../property/CodeListAssociation.java | 5 +- .../constraint/property/NillableFlag.java | 6 +- .../model/constraint/property/Reference.java | 13 +- .../constraint/property/ReferenceLike.java | 3 +- .../property/ReferenceProperty.java | 8 +- .../model/constraint/property/Unique.java | 3 +- .../factory/CodeListAssocationFactory.java | 13 +- .../property/factory/ReferenceFactory.java | 5 +- .../model/constraint/type/AbstractFlag.java | 6 +- .../constraint/type/AugmentedValueFlag.java | 5 +- .../schema/model/constraint/type/Binding.java | 5 +- .../model/constraint/type/ElementType.java | 11 +- .../model/constraint/type/Enumeration.java | 17 +- .../constraint/type/GeometryMetadata.java | 9 +- .../model/constraint/type/GeometryType.java | 25 +- .../model/constraint/type/HasValueFlag.java | 7 +- .../constraint/type/IgnoreOrderFlag.java | 4 +- .../model/constraint/type/MappableFlag.java | 6 +- .../constraint/type/MappingRelevantFlag.java | 6 +- .../model/constraint/type/PrimaryKey.java | 12 +- .../model/constraint/type/SkipValidation.java | 16 +- .../constraint/type/ValidationConstraint.java | 5 +- .../type/factory/ElementTypeFactory.java | 5 +- .../type/factory/EnumerationFactory.java | 5 +- .../type/factory/GeometryTypeFactory.java | 3 +- .../type/factory/PrimaryKeyFactory.java | 8 +- .../model/impl/AbstractChildDefinition.java | 7 +- .../schema/model/impl/AbstractDefinition.java | 29 +- .../impl/AbstractGroupPropertyDecorator.java | 10 +- .../model/impl/AbstractPropertyDecorator.java | 8 +- .../schema/model/impl/DefaultGroup.java | 32 +-- .../impl/DefaultGroupPropertyDefinition.java | 10 +- .../model/impl/DefaultPropertyDefinition.java | 3 +- .../schema/model/impl/DefaultSchema.java | 3 +- .../schema/model/impl/DefaultSchemaSpace.java | 14 +- .../model/impl/DefaultTypeDefinition.java | 23 +- .../schema/model/impl/DefaultTypeIndex.java | 14 +- .../impl/PropertyTypeOverrideProperty.java | 3 +- .../model/impl/ResourceSchemaSpace.java | 20 +- .../ConstraintOverrideGroupProperty.java | 11 +- .../internal/ConstraintOverrideProperty.java | 7 +- .../impl/internal/RedeclareGroupProperty.java | 10 +- .../impl/internal/RedeclareProperty.java | 10 +- .../impl/internal/ReparentGroupProperty.java | 4 +- .../model/impl/internal/ReparentProperty.java | 4 +- .../extension/ValidatorFactoryDescriptor.java | 7 +- .../extension/ValidatorFactoryExtension.java | 15 +- .../AbstractCombinedValidatorFactory.java | 9 +- .../factory/impl/AndValidatorFactory.java | 3 +- .../impl/EnumerationValidatorFactory.java | 8 +- .../factory/impl/NumberValidatorFactory.java | 3 +- .../factory/impl/OrValidatorFactory.java | 3 +- .../internal/ValidatorValueType.groovy | 3 +- .../schema/paths/DefinitionResolver.java | 54 ++-- .../schema/paths/internal/CachedResolver.java | 16 +- .../helper/DefinitionResolverTest.groovy | 4 +- .../AbstractValueConstraintFactoryTest.java | 36 ++- .../factory/DisplayNameFactoryTest.java | 7 +- .../property/ReferenceFactoryTest.groovy | 6 +- .../type/AugmentedValueFlagFactoryTest.java | 4 +- .../type/ElementTypeFactoryTest.groovy | 6 +- .../type/MappingRelevantFlagFactoryTest.java | 4 +- .../factory/type/PrimaryKeyFactoryTest.groovy | 6 +- .../ValidationConstraintFactoryTest.groovy | 6 +- .../hale/common/scripting/Script.java | 22 +- .../common/scripting/ScriptExtension.java | 4 +- .../hale/common/scripting/ScriptFactory.java | 6 +- .../scripts/groovy/GroovyScript.java | 38 ++- .../scripts/mathematical/MathScript.java | 7 +- ...bstractScriptedPropertyTransformation.java | 32 +-- ...eTargetScriptedPropertyTransformation.java | 12 +- .../population/EntityPopulationCount.java | 5 +- .../helper/population/IPopulationUpdater.java | 9 +- .../helper/test/PopulationCountTest.groovy | 5 +- .../service/helper/test/dummy/Population.java | 10 +- .../test/dummy/PopulationContainer.java | 13 +- .../helper/test/dummy/PopulationImpl.java | 1 - .../hale/common/style/io/StyleReader.java | 3 +- .../hale/common/style/io/StyleWriter.java | 3 +- .../style/io/impl/AbstractStyleWriter.java | 3 +- .../common/style/io/impl/SLDStyleReader.java | 14 +- .../common/style/io/impl/SLDStyleWriter.java | 8 +- .../common/tasks/AbstractTaskProvider.java | 3 +- .../hale/common/tasks/CellMessageTask.java | 3 +- .../hale/common/tasks/CellTaskFactory.java | 7 +- .../hale/common/tasks/ResolvedTask.java | 9 +- .../esdihumboldt/hale/common/tasks/Task.java | 7 +- .../hale/common/tasks/TaskFactory.java | 4 +- .../hale/common/tasks/TaskProvider.java | 4 +- .../hale/common/tasks/TaskRegistry.java | 4 +- .../hale/common/tasks/TaskType.java | 29 +- .../hale/common/tasks/TaskUserData.java | 1 + .../extension/TaskProviderExtension.java | 8 +- .../test/allure/AllureTestListener.java | 1 - .../test/docker/AbstractDockerTest.java | 7 +- .../docker/config/ContainerParameters.java | 14 +- .../test/docker/config/DockerConfig.java | 43 +-- .../docker/config/DockerConfigInstance.java | 9 +- .../test/docker/config/HaleDockerClient.java | 23 +- .../docker/helper/DockerConfigHelper.java | 6 +- .../hale/common/test/TestUtil.java | 39 ++- .../collector/AssignFromCollector.java | 23 +- .../AssignFromCollectorFunction.java | 4 +- .../AssignFromCollectorExplanation.java | 5 +- .../cst/functions/core/Assign.java | 12 +- .../functions/core/ClassificationMapping.java | 4 +- .../cst/functions/core/Create.java | 5 +- .../cst/functions/core/FormattedString.java | 17 +- .../cst/functions/core/GenerateUID.java | 15 +- .../esdihumboldt/cst/functions/core/Join.java | 9 +- .../cst/functions/core/Merge.java | 7 +- .../cst/functions/core/Rename.java | 42 ++- .../cst/functions/core/Retype.java | 15 +- .../core/inline/InlineTransformation.java | 25 +- .../core/join/DefaultValueProcessor.java | 4 +- .../functions/core/join/IndexJoinHandler.java | 14 +- .../core/join/IndexJoinIterator.java | 21 +- .../cst/functions/core/join/JoinHandler.java | 12 +- .../cst/functions/core/join/JoinIterator.java | 14 +- .../cst/functions/core/join/JoinUtil.java | 6 +- .../functions/core/join/ValueProcessor.java | 8 +- .../core/merge/AbstractMergeHandler.java | 13 +- .../core/merge/IndexMergeHandler.java | 53 ++-- .../core/merge/PropertiesMergeHandler.java | 51 ++-- .../DefaultCustomFunctionExplanation.java | 30 +- .../custom/DefaultCustomPropertyFunction.java | 19 +- .../DefaultCustomPropertyFunctionEntity.java | 5 +- ...efaultCustomPropertyFunctionParameter.java | 3 +- ...omPropertyFunctionParameterDefinition.java | 7 +- .../groovy/CustomGroovyTransformation.java | 6 +- .../DefaultCustomPropertyFunctionType.groovy | 7 +- ...DefaultCustomPropertyFunctionTypeTest.java | 24 +- .../geometric/CRSHelperFunctions.groovy | 7 +- .../functions/geometric/CalculateArea.java | 9 +- .../functions/geometric/CalculateLength.java | 9 +- .../cst/functions/geometric/Centroid.java | 19 +- .../geometric/GeometryHelperFunctions.groovy | 92 ++++--- .../functions/geometric/NetworkExpansion.java | 44 ++- .../NetworkExpansionExplanation.java | 13 +- .../functions/geometric/OrdinatesToPoint.java | 23 +- .../geometric/ReprojectGeometry.java | 43 ++- .../cst/functions/geometric/SRSValidator.java | 1 - .../SimpleFeatureGeometryHelpers.groovy | 12 +- .../aggregate/AggregateTransformation.java | 48 ++-- .../extent/ExtentHelperFunctions.java | 17 +- .../extent/ExtentTransformation.java | 27 +- .../geometric/extent/ExtentType.java | 1 + .../interiorpoint/InteriorPoint.java | 16 +- .../geometric/join/SpatialJoinHandler.java | 30 +- .../geometric/join/SpatialJoinParameter.java | 21 +- .../join/SpatialJoinParameterType.groovy | 8 +- .../join/SpatialRelationEvaluator.java | 8 +- .../test/CRSHelperFunctionsTest.java | 8 +- .../test/GeometryHelperFunctionsTest.java | 7 +- .../geometric/test/InteriorPointTest.java | 123 ++++----- .../test/join/SpatialJoinParameterTest.groovy | 16 +- .../AbstractHandlerTest.java | 13 +- .../ReprojectGeometryTest.java | 24 +- .../test/reprojectgeometry/TestData.java | 10 +- .../groovy/helpers/ContextHelpers.groovy | 10 +- .../groovy/helpers/ConversionHelper.java | 7 +- .../groovy/helpers/CryptoHelpers.groovy | 13 +- .../cst/functions/groovy/GroovyCreate.java | 7 +- .../groovy/GroovyCreateExplanation.java | 5 +- .../functions/groovy/GroovyExplanation.java | 5 +- .../groovy/GroovyGreedyTransformation.java | 33 ++- .../cst/functions/groovy/GroovyJoin.java | 5 +- .../groovy/GroovyJoinExplanation.java | 3 +- .../cst/functions/groovy/GroovyMerge.java | 5 +- .../groovy/GroovyMergeExplanation.java | 3 +- .../cst/functions/groovy/GroovyRetype.java | 5 +- .../groovy/GroovyRetypeExplanation.java | 3 +- .../groovy/GroovyTransformation.java | 35 ++- .../functions/groovy/filter/GroovyFilter.java | 7 +- .../cst/functions/groovy/helper/Category.java | 8 +- .../groovy/helper/DefaultHelperContext.java | 3 +- .../groovy/helper/HelperContext.java | 3 +- .../helper/HelperFunctionOrCategory.java | 8 +- .../groovy/helper/HelperFunctions.java | 7 +- .../extension/HelperFunctionsExtension.java | 48 ++-- .../impl/HelperFunctionSpecification.java | 5 +- .../internal/AsMultiValueMetaClass.java | 7 +- .../internal/GroovyProjectVariables.java | 6 +- .../functions/groovy/internal/GroovyUtil.java | 36 ++- .../internal/InstanceAccessorArrayList.java | 3 +- .../groovy/internal/ProjectAccessor.java | 9 +- .../groovy/internal/TargetCollector.java | 14 +- .../internal/TransformationLogWrapper.java | 16 +- .../functions/inspire/GeographicalName.java | 23 +- .../inspire/GeographicalNameExplanation.java | 7 +- .../cst/functions/inspire/Identifier.java | 4 +- .../inspire/IdentifierExplanation.java | 5 +- .../cst/functions/inspire/Util.java | 3 +- .../numeric/MathematicalExpression.java | 16 +- .../MathematicalExpressionExplanation.java | 13 +- .../numeric/sequentialid/SequentialID.java | 8 +- .../cst/functions/string/DateExtraction.java | 10 +- .../string/DateExtractionFormatValidator.java | 4 +- .../string/DateExtractionFunction.java | 15 +- .../cst/functions/string/RegexAnalysis.java | 10 +- .../string/RegexFormatValidator.java | 4 +- .../cst/test/AbstractTransformationTest.java | 17 +- .../cst/test/TransformationExample.java | 5 +- .../cst/test/TransformationExampleImpl.java | 11 +- .../cst/test/internal/InternalExample.java | 11 +- .../cst/ConceptualSchemaTransformer.java | 31 +-- .../src/eu/esdihumboldt/cst/MultiValue.java | 4 +- .../cst/extension/hooks/HooksUtil.java | 5 +- .../hooks/TransformationTreeHook.java | 5 +- .../TransformationTreeHookExtension.java | 7 +- .../hooks/TransformationTreeHookFactory.java | 4 +- .../hooks/TransformationTreeHooks.java | 4 +- .../internal/DefaultTreeHookFactory.java | 7 +- .../cst/internal/CSTCompatibilityMode.java | 7 +- .../cst/internal/EngineManager.java | 15 +- .../cst/internal/ExecutionContextImpl.java | 10 +- .../cst/internal/FunctionContexts.java | 3 +- .../cst/internal/FunctionExecutor.java | 59 ++-- .../cst/internal/InstanceBuilder.java | 10 +- .../cst/internal/TransformationContext.java | 9 +- .../cst/internal/TransformationTreePool.java | 4 +- .../cst/internal/TreePropertyTransformer.java | 33 ++- .../internal/util/CountingInstanceSink.java | 3 +- .../ConceptualSchemaTransformerTest.java | 46 ++-- .../cst/test/DefaultTransformationTest.java | 52 ++-- .../adv/merge/AdVMeasurementMigrator.java | 4 +- .../merge/test/AdVMeasurementMergeTest.groovy | 5 +- .../src/de/fhg/igd/geom/BoundingBox.java | 46 ++-- .../src/de/fhg/igd/geom/Extent.java | 32 +-- .../src/de/fhg/igd/geom/Point2D.java | 19 +- .../src/de/fhg/igd/geom/Point3D.java | 10 +- .../src/de/fhg/igd/geom/Verifier.java | 4 +- .../igd/geom/algorithm/FaceTriangulation.java | 23 +- .../sweepline/Point2DEventQueue.java | 5 +- .../algorithm/sweepline/SortedCollection.java | 3 +- .../sweepline/SweepLineComparator.java | 4 +- .../SweepPoint2DEventComparator.java | 6 +- .../sweepline/SweepPoint2DXYComparator.java | 9 +- .../de/fhg/igd/geom/indices/NNComparator.java | 3 +- .../src/de/fhg/igd/geom/indices/Node.java | 64 +++-- .../src/de/fhg/igd/geom/indices/RTree.java | 34 +-- .../de/fhg/igd/geom/indices/SpatialIndex.java | 4 +- .../src/de/fhg/igd/geom/shape/Line2D.java | 16 +- .../src/de/fhg/igd/geom/shape/Polygon.java | 46 ++-- .../src/de/fhg/igd/geom/shape/Shape.java | 5 +- .../src/de/fhg/igd/geom/shape/Surface.java | 7 +- .../src/de/fhg/igd/geom/util/MathHelper.java | 30 +- .../hale/util/nonosgi/NonOsgiPlatform.java | 5 +- .../nonosgi/contenttype/BasicDescription.java | 2 +- .../contenttype/ContentDescription.java | 12 +- .../util/nonosgi/contenttype/ContentType.java | 85 +++--- .../contenttype/ContentTypeBuilder.java | 83 +++--- .../contenttype/ContentTypeCatalog.java | 259 +++++++++++------- .../contenttype/ContentTypeHandler.java | 30 +- .../contenttype/ContentTypeManager.java | 79 ++++-- .../contenttype/ContentTypeMatcher.java | 45 +-- .../contenttype/ContentTypeSettings.java | 38 ++- .../contenttype/ContentTypeVisitor.java | 1 + .../contenttype/DefaultDescription.java | 2 +- .../util/nonosgi/contenttype/FileSpec.java | 9 +- .../nonosgi/contenttype/IContentTypeInfo.java | 7 +- .../contenttype/LowLevelIOException.java | 8 +- .../describer/XMLContentDescriber.java | 43 ++- .../XMLRootElementContentDescriber2.java | 121 ++++---- .../contenttype/describer/XMLRootHandler.java | 76 ++--- .../nonosgi/logging/NonOSGiLoggingFilter.java | 9 +- .../nonosgi/internal/registry/Activator.java | 17 +- .../registry/ContributorFactoryNonOSGI.java | 6 +- .../internal/registry/DebugHelper.java | 2 +- .../registry/RegistryProviderNonOSGI.java | 8 +- .../registry/RegistryStrategyNonOSGI.java | 129 ++++----- .../nonosgi/internal/registry/Utils.java | 27 +- .../registry/RegistryFactoryHelper.java | 22 +- .../io/codelist/skos/reader/SkosCodeList.java | 9 +- .../skos/reader/SkosCodeListReader.java | 9 +- .../codelist/skos/test/SkosCodeListTest.java | 18 +- .../io/codelist/InspireCodeListAdvisor.java | 18 +- .../inspire/reader/INSPIRECodeList.java | 3 +- .../inspire/reader/INSPIRECodeListReader.java | 39 ++- .../io/codelist/xml/reader/XmlCodeList.java | 9 +- .../xml/reader/XmlCodeListReader.java | 7 +- .../codelist/xml/reader/XmlCodeListTest.java | 14 +- .../hale/io/csv/InstanceTableIOConstants.java | 4 +- .../hale/io/csv/PropertyTypeExtension.java | 3 +- .../io/csv/TypenameParameterDescriptor.java | 3 +- .../propertytype/AbstractPropertyType.java | 3 +- .../hale/io/csv/reader/CSVConstants.java | 3 +- .../io/csv/reader/DefaultCSVLookupReader.java | 9 +- .../internal/CSVInstanceCollection.java | 33 +-- .../reader/internal/CSVInstanceReader.java | 3 +- .../csv/reader/internal/CSVLookupReader.java | 13 +- .../csv/reader/internal/CSVSchemaReader.java | 8 +- .../hale/io/csv/reader/internal/CSVUtil.java | 17 +- .../AbstractAlignmentMappingExport.java | 56 ++-- .../writer/AbstractTableInstanceWriter.java | 30 +- .../hale/io/csv/writer/CellInformation.java | 4 +- .../writer/LookupTableExportConstants.java | 4 +- .../internal/CSVAlignmentMappingWriter.java | 9 +- .../writer/internal/CSVInstanceWriter.java | 32 +-- .../csv/writer/internal/CSVLookupWriter.java | 15 +- .../hale/io/csv/CSVInstanceReaderTest.java | 23 +- .../hale/io/csv/CSVSchemaReaderTest.java | 22 +- .../io/csv/writer/CSVInstanceWriterTest.java | 41 ++- .../mapping/MappingAlignmentWriter.java | 18 +- .../io/deegree/mapping/MappingHelper.groovy | 7 +- .../deegree/mapping/MappingSchemaWriter.java | 5 +- .../io/deegree/mapping/MappingWriter.java | 57 ++-- .../config/GenericMappingConfiguration.java | 4 +- .../mapping/config/MappingConfiguration.java | 5 +- .../mapping/model/AppSchemaDecorator.java | 2 - .../mapping/model/MappedAppSchemaCopy.java | 13 +- .../deegree/mapping/MappingWriterTest.groovy | 5 +- .../geopackage/GeopackageInstanceReader.java | 23 +- .../geopackage/GeopackageInstanceWriter.java | 76 +++-- .../geopackage/GeopackageSchemaBuilder.java | 31 +-- .../io/geopackage/GeopackageSchemaReader.java | 7 +- .../GeopackageSpatialIndexType.java | 6 +- .../internal/GeopackageFeatureCollection.java | 23 +- .../internal/TableInstanceBuilder.groovy | 11 +- .../hale/io/geopackage/GeopackageApiTest.java | 4 +- .../GeopackageInstanceReaderTest.groovy | 14 +- .../GeopackageInstanceWriterTest.groovy | 24 +- .../GeopackageSchemaReaderTest.java | 16 +- .../gml/geometry/AbstractGeometryHandler.java | 2 - .../hale/io/gml/geometry/CRSFinder.java | 6 +- .../FixedConstraintsGeometryHandler.java | 10 +- .../hale/io/gml/geometry/GMLConstants.java | 4 +- .../hale/io/gml/geometry/GMLGeometryUtil.java | 55 ++-- .../hale/io/gml/geometry/Geometries.java | 15 +- .../hale/io/gml/geometry/GeometryHandler.java | 13 +- .../geometry/constraint/GeometryFactory.java | 6 +- .../handler/ArcByCenterPointHandler.java | 25 +- .../io/gml/geometry/handler/ArcHandler.java | 17 +- .../geometry/handler/ArcStringHandler.java | 19 +- .../handler/CircleByCenterPointHandler.java | 25 +- .../gml/geometry/handler/CircleHandler.java | 17 +- .../io/gml/geometry/handler/CurveHandler.java | 23 +- .../gml/geometry/handler/EnvelopeHandler.java | 27 +- .../handler/GenericGeometryHandler.java | 36 ++- .../geometry/handler/LineStringHandler.java | 25 +- .../geometry/handler/LinearRingHandler.java | 19 +- .../io/gml/geometry/handler/PointHandler.java | 19 +- .../gml/geometry/handler/PolygonHandler.java | 21 +- .../io/gml/geometry/handler/RingHandler.java | 21 +- .../gml/geometry/handler/SurfaceHandler.java | 28 +- .../hale/io/gml/CityGMLConstants.java | 4 +- .../esdihumboldt/hale/io/gml/InspireUtil.java | 7 +- .../internal/simpletype/SimpleTypeUtil.java | 25 +- .../converters/BigDecimalToXmlDecimal.java | 1 - .../converters/BigIntegerToXmlInteger.java | 1 - .../simpletype/converters/DateToXmlDate.java | 1 - .../converters/DateToXmlDateTime.java | 1 - .../simpletype/converters/DateToXmlTime.java | 1 - .../converters/StringToXmlDate.java | 1 - .../converters/StringToXmlDateTime.java | 1 - .../converters/StringToXmlTime.java | 1 - .../converters/XmlDateTimeToDate.java | 1 - .../converters/XmlDateTimeToTimestamp.java | 1 - .../simpletype/converters/XmlDateToDate.java | 1 - .../converters/XmlDateToSQLDate.java | 1 - .../converters/XmlDateToTimestamp.java | 1 - .../converters/XmlDecimalToBigDecimal.java | 1 - .../converters/XmlIntegerToBigInteger.java | 1 - .../simpletype/converters/XmlTimeToDate.java | 1 - .../converters/XmlTimeToTimestamp.java | 1 - .../internal/GmlInstanceCollection.java | 81 +++--- .../gml/reader/internal/StreamGmlReader.java | 44 ++- .../reader/internal/instance/GroupPath.java | 42 ++- .../reader/internal/instance/GroupUtil.java | 148 +++++----- .../internal/instance/StreamGmlHelper.java | 116 ++++---- .../internal/instance/StreamGmlInstance.java | 4 +- .../wfs/WfsBackedGmlInstanceCollection.java | 116 ++++---- .../io/gml/writer/CityGMLInstanceWriter.java | 16 +- .../writer/InspireDatasetFeedWriter.groovy | 24 +- .../io/gml/writer/InspireInstanceWriter.java | 56 ++-- .../io/gml/writer/XPlanGmlInstanceWriter.java | 36 ++- .../hale/io/gml/writer/XmlWrapper.java | 13 +- .../internal/DefaultMultipartHandler.java | 15 +- .../writer/internal/ExtentPartsHandler.java | 13 +- .../io/gml/writer/internal/GmlWriterUtil.java | 51 ++-- .../internal/LocalReferenceUpdater.java | 4 +- .../gml/writer/internal/MultipartHandler.java | 8 +- .../writer/internal/PerTypePartsHandler.java | 14 +- .../PrefixAwareStreamWriterDecorator.java | 1 - .../ReferenceUpdatingStreamWriter.java | 5 +- .../gml/writer/internal/SchemaDecorator.java | 6 +- .../gml/writer/internal/StreamGmlWriter.java | 193 +++++++------ .../geometry/AbstractTypeMatcher.java | 25 +- .../internal/geometry/DefinitionPath.java | 41 ++- .../gml/writer/internal/geometry/Descent.java | 40 ++- .../geometry/GeometryConverterRegistry.java | 12 +- .../internal/geometry/GeometryWriter.java | 24 +- .../writer/internal/geometry/PathElement.java | 20 +- .../geometry/StreamGeometryWriter.java | 60 ++-- .../AbstractGeometryCollectionConverter.java | 3 +- .../converters/AbstractGeometryConverter.java | 7 +- .../MultiLineStringToLineString.java | 4 +- .../MultiPolygonToMultiLineString.java | 4 +- .../converters/MultiPolygonToPolygon.java | 4 +- .../converters/PolygonToLineString.java | 3 +- .../writers/AbstractGeometryWriter.java | 49 ++-- .../writers/AbstractMultiPolygonWriter.java | 15 +- .../geometry/writers/AbstractPathMatcher.java | 51 ++-- .../writers/CompositeSurfaceWriter.java | 1 - .../writers/CurveSingleSegmentWriter.java | 13 +- .../geometry/writers/CurveWriter.java | 19 +- .../geometry/writers/EnvelopeWriter.java | 11 +- .../writers/LegacyMultiPolygonWriter.java | 28 +- .../geometry/writers/LegacyPolygonWriter.java | 23 +- .../geometry/writers/LineStringWriter.java | 13 +- .../geometry/writers/MultiCurveWriter.java | 15 +- .../writers/MultiLineStringWriter.java | 36 ++- .../geometry/writers/MultiPointWriter.java | 15 +- .../geometry/writers/MultiPolygonWriter.java | 1 - .../internal/geometry/writers/Pattern.java | 47 ++-- .../geometry/writers/PointWriter.java | 13 +- .../geometry/writers/PolygonWriter.java | 13 +- .../internal/GmlInstanceCollectionTest.java | 31 +-- .../internal/StreamGmlReaderTest.groovy | 12 +- .../internal/StreamGmlWriter2Test.groovy | 19 +- .../writer/internal/StreamGmlWriterTest.java | 120 ++++---- .../converters/PolygonToLineStringTest.java | 1 - .../geometry/writers/PatternTest.java | 27 +- .../io/groovy/snippets/GroovySnippets.java | 15 +- .../snippets/impl/AbstractSnippetReader.java | 3 +- .../io/groovy/snippets/impl/FileSnippet.java | 5 +- .../snippets/impl/SnippetReaderImpl.java | 14 +- .../snippets/impl/SnippetServiceImpl.java | 7 +- .../io/groovy/snippets/impl/URISnippet.java | 5 +- .../hale/io/haleconnect/BasePathManager.java | 4 +- .../hale/io/haleconnect/BasePathResolver.java | 4 +- .../io/haleconnect/HaleConnectException.java | 8 +- .../haleconnect/HaleConnectInputSupplier.java | 14 +- .../io/haleconnect/HaleConnectService.java | 33 +-- .../haleconnect/HaleConnectUrnBuilder.groovy | 6 +- .../hale/io/haleconnect/OwnerType.java | 1 + .../internal/ApiClientHelper.groovy | 4 +- .../internal/BucketServiceHelper.java | 1 - .../internal/HaleConnectServiceImpl.groovy | 82 +++--- .../internal/HaleConnectSessionImpl.java | 6 +- .../internal/ProjectServiceHelper.java | 1 - .../internal/ProjectStoreHelper.java | 6 +- .../internal/UserServiceHelper.groovy | 24 +- .../project/HaleConnectProjectReader.java | 16 +- .../project/HaleConnectProjectWriter.groovy | 54 ++-- .../haleconnect/project/SharingOptions.groovy | 1 - .../project/SimpleProjectReader.java | 7 +- .../io/html/svg/mapping/MappingExporter.java | 25 +- .../svg/mapping/json/AlignmentJson.groovy | 19 +- .../json/ExtendedCellRepresentation.groovy | 2 - .../mapping/json/JsonMappingExporter.groovy | 3 +- .../mapping/json/JsonValueRepresentation.java | 8 +- .../io/html/svg/mapping/json/JsonXML.java | 42 ++- .../io/html/svg/MappingExporterTest.groovy | 12 +- .../svg/json/JsonMappingExporterTest.groovy | 15 +- .../InstanceBuilderReader.java | 12 +- .../MsAccessConnectionConfigurer.java | 3 +- .../jdbc/msaccess/MsAccessInstanceReader.java | 5 +- .../jdbc/msaccess/MsAccessJdbcIOSupplier.java | 3 +- .../jdbc/msaccess/MsAccessSchemaReader.java | 5 +- .../msaccess/MsAccessSchemaReaderAdvisor.java | 3 +- .../io/jdbc/msaccess/MsAccessURIBuilder.java | 3 +- .../reader/MsAccessInstanceReaderTest.java | 5 +- .../reader/MsAccessSchemaReaderTest.java | 7 +- .../test/MsAccessDataReaderTestSuit.java | 19 +- .../jdbc/mssql/MsSqlConnectionConfigurer.java | 4 +- .../io/jdbc/mssql/MsSqlConnectionHelper.java | 7 +- .../hale/io/jdbc/mssql/MsSqlGeometries.java | 29 +- .../io/jdbc/mssql/MsSqlSchemaSelector.java | 7 +- .../hale/io/jdbc/mssql/MsSqlURIBuilder.java | 7 +- .../hale/io/jdbc/mssql/util/SRSUtil.java | 20 +- .../io/jdbc/mssql/test/MsSQLServer14Test.java | 15 +- .../jdbc/mssql/test/MsSqlDataReaderTest.java | 27 +- .../PostGISConnectionConfigurer.java | 8 +- .../io/jdbc/postgresql/PostGISGeometries.java | 51 ++-- .../jdbc/postgresql/PostSchemaSelector.java | 7 +- .../io/jdbc/postgresql/PostURIBuilder.java | 3 +- .../jdbc/postgresql/internal/Activator.java | 6 +- .../test/AutoGenKeyReferenceIT.groovy | 8 +- .../test/CheckComplexTypeOrderIT.groovy | 7 +- .../CheckSortingForCyclicTypesTest.groovy | 10 +- .../io/jdbc/postgresql/test/DatabaseIT.java | 6 +- .../test/MultiDimensionalArraysIT.groovy | 12 +- .../test/OneDimensionalArraysIT.groovy | 6 +- .../postgresql/test/PostDataTypesIT.groovy | 18 +- .../jdbc/postgresql/test/ReadWriteIT.groovy | 19 +- .../test/WriteInstanceOrderIT.groovy | 18 +- .../SpatiaLiteConnectionConfigurer.java | 8 +- .../jdbc/spatialite/SpatiaLiteGeometries.java | 65 ++--- .../spatialite/SpatiaLiteJdbcIOSupplier.java | 3 +- .../jdbc/spatialite/SpatiaLiteURIBuilder.java | 3 +- .../SpatialLiteSchemaReaderAdvisor.java | 5 +- .../internal/AbstractSpatiaLiteSupport.java | 30 +- .../jdbc/spatialite/internal/Activator.java | 1 - .../spatialite/internal/SpatiaLiteHelper.java | 26 +- .../internal/SpatiaLiteSupport.java | 3 +- .../internal/SpatiaLiteSupportFactory.java | 15 +- .../internal/SpatiaLiteInstanceReader.java | 11 +- .../internal/SpatiaLiteSchemaReader.java | 11 +- .../internal/SpatiaLiteInstanceWriter.java | 9 +- .../SpatiaLiteInstanceReaderTest.java | 5 +- .../internal/SpatiaLiteSchemaReaderTest.java | 13 +- .../spatialite/test/SpatiaLiteTestSuite.java | 80 +++--- .../SpatiaLiteInstanceWriterTest.java | 5 +- .../hale/io/jdbc/test/AbstractDBTest.java | 52 ++-- .../hale/io/jdbc/test/DBConfigInstance.java | 5 +- .../hale/io/jdbc/test/DBImageParameters.java | 4 +- .../hale/io/jdbc/GeometryAdvisor.java | 34 ++- .../hale/io/jdbc/JDBCConnection.java | 18 +- .../hale/io/jdbc/JDBCConstants.java | 4 +- .../hale/io/jdbc/JDBCInstanceReader.java | 16 +- .../hale/io/jdbc/JDBCInstanceWriter.java | 105 ++++--- .../hale/io/jdbc/JDBCProvider.java | 3 +- .../hale/io/jdbc/JDBCSchemaReader.java | 52 ++-- .../hale/io/jdbc/JDBCTableCollection.java | 18 +- .../esdihumboldt/hale/io/jdbc/JDBCUtil.java | 13 +- .../hale/io/jdbc/SQLSchemaReader.java | 20 +- .../hale/io/jdbc/TableInstanceBuilder.groovy | 11 +- .../io/jdbc/constraints/DatabaseTable.java | 15 +- .../io/jdbc/constraints/DefaultValue.java | 7 +- .../hale/io/jdbc/constraints/SQLArray.java | 10 +- .../hale/io/jdbc/constraints/SQLQuery.java | 3 +- .../hale/io/jdbc/constraints/SQLType.java | 10 +- .../constraints/factory/SQLArrayFactory.java | 4 +- .../jdbc/extension/ConnectionConfigurer.java | 5 +- .../jdbc/extension/DriverConfiguration.java | 17 +- .../DriverConfigurationExtension.java | 4 +- .../extension/JDBCSchemaReaderAdvisor.java | 13 +- .../internal/ConnectionConfiguration.java | 29 +- .../ConnectionConfigurerExtension.java | 30 +- .../jdbc/extension/internal/CustomType.java | 10 +- .../internal/CustomTypeExtension.java | 4 +- .../internal/GeometryTypeExtension.java | 29 +- .../extension/internal/GeometryTypeInfo.java | 9 +- .../SchemaReaderAdvisorDescriptor.java | 10 +- .../SchemaReaderAdvisorExtension.java | 24 +- .../factory/GeometryMetadataFactoryTest.java | 8 +- .../hale/io/json/JsonInstanceReader.java | 22 +- .../hale/io/json/JsonInstanceWriter.java | 21 +- .../hale/io/json/JsonSchemaReader.java | 9 +- .../AbstractJsonInstanceProcessor.java | 26 +- .../io/json/internal/IgnoreNamespaces.java | 19 +- .../io/json/internal/IncludeNamespaces.java | 6 +- .../hale/io/json/internal/InstanceToJson.java | 55 ++-- .../json/internal/JsonInstanceBuilder.groovy | 12 +- .../json/internal/JsonInstanceCollection.java | 18 +- .../json/internal/JsonInstanceProcessor.java | 18 +- .../hale/io/json/internal/JsonReadMode.java | 3 +- .../hale/io/json/internal/JsonToInstance.java | 53 ++-- .../io/json/internal/NamespaceManager.java | 8 +- .../hale/io/json/internal/TransformCache.java | 3 +- .../json/internal/schema/JsonProperty.groovy | 21 +- .../io/json/internal/schema/JsonToSchema.java | 7 +- .../io/json/internal/schema/JsonType.java | 9 +- .../io/json/internal/schema/JsonTypes.java | 6 +- .../internal/schema/SchemaBuilderContext.java | 15 +- .../io/json/test/InstanceToJsonTest.groovy | 7 +- .../test/JsonInstanceCollectionTest.groovy | 17 +- .../json/test/JsonInstanceReaderTest.groovy | 14 +- .../io/json/test/JsonSchemaReaderTest.groovy | 20 +- .../io/json/test/JsonToInstanceTest.groovy | 22 +- .../io/pb/ProtocolBufferInstanceWriter.java | 15 +- .../ProtocolBufferInstanceWriterTest.java | 9 +- .../project/jaxb/generated/ConfigSection.java | 16 +- .../project/jaxb/generated/HaleProject.java | 17 +- .../project/jaxb/generated/ObjectFactory.java | 14 +- .../hale/io/project/jaxb/generated/Task.java | 13 +- .../io/project/jaxb/generated/TaskStatus.java | 13 +- .../io/project/jaxb/reader/ProjectParser.java | 23 +- .../project/jaxb/writer/ProjectGenerator.java | 6 +- .../io/schemabuilder/SchemaBuilderReader.java | 10 +- .../util/SchematronReportParser.groovy | 3 +- .../SchematronInstanceValidator.java | 22 +- .../schematron/validator/SchematronUtils.java | 5 +- .../io/schematron/ResourceInputSupplier.java | 3 +- .../SchematronInstanceValidatorTest.java | 5 +- .../hale/io/shp/ShapefileAdvisor.java | 19 +- .../hale/io/shp/ShapefileConstants.java | 42 ++- .../reader/internal/ShapeInstanceReader.java | 53 ++-- .../reader/internal/ShapeSchemaReader.java | 37 ++- .../internal/ShapesInstanceCollection.java | 42 ++- .../shp/writer/ShapefileInstanceWriter.java | 118 ++++---- .../io/shp/ShapeInstanceReaderTest.groovy | 19 +- .../io/shp/ShapefileInstanceWriterTest.groovy | 31 +-- .../io/topojson/TopoJsonInstanceWriter.java | 39 ++- .../test/TopoJsonInstanceWriterTest.groovy | 17 +- .../hale/io/validation/ProjectValidator.java | 11 +- .../io/validation/ValidatorConfiguration.java | 1 - .../ValidatorConfigurationImportAdvisor.java | 3 +- .../ValidatorConfigurationReaderImpl.java | 14 +- .../ValidatorConfigurationService.java | 3 +- .../ValidatorConfigurationServiceImpl.java | 8 +- .../hale/io/wfs/AbstractWFSWriter.java | 37 ++- .../hale/io/wfs/PartitioningWFSWriter.java | 30 +- .../hale/io/wfs/SimpleWFSWriter.java | 4 +- .../hale/io/wfs/WFSConstants.java | 4 +- .../esdihumboldt/hale/io/wfs/WFSVersion.java | 17 +- .../capabilities/CapabilitiesHelper.groovy | 9 +- .../wfs/capabilities/WFSCapabilities.groovy | 5 +- .../hale/io/wfs/file/WFS2FCWriter.java | 17 +- .../wfs/file/WFSFeatureCollectionWriter.java | 15 +- .../transactions/AbstractWFSTransaction.java | 13 +- .../hale/io/wfs/transactions/WFSInsert.java | 3 +- .../CapabilitiesHelperTest.groovy | 9 +- .../hale/io/xls/AbstractAnalyseTable.java | 16 +- .../hale/io/xls/AnalyseXLSSchemaTable.java | 4 +- .../eu/esdihumboldt/hale/io/xls/XLSUtil.java | 1 - .../reader/DefaultXLSLookupTableReader.java | 10 +- .../hale/io/xls/reader/ReaderSettings.java | 19 +- .../hale/io/xls/reader/SheetSettings.java | 6 +- .../reader/SheetSettingsValueDescriptor.java | 3 +- .../hale/io/xls/reader/XLSInstanceReader.java | 23 +- .../io/xls/reader/XLSLookupTableReader.java | 23 +- .../hale/io/xls/reader/XLSSchemaReader.java | 12 +- .../xls/writer/XLSAlignmentMappingWriter.java | 31 +-- .../hale/io/xls/writer/XLSInstanceWriter.java | 33 +-- .../io/xls/writer/XLSLookupTableWriter.java | 18 +- .../hale/io/xls/test/XLSInstanceIOTest.java | 28 +- .../test/XLSInstanceWriterTestExamples.groovy | 5 +- .../io/xls/test/reader/XLSReaderTest.java | 67 +++-- .../xls/test/reader/XLSReaderTestUtil.groovy | 5 +- .../test/writer/XLSInstanceWriterTest.java | 53 ++-- .../hale/io/xml/validator/Report.java | 1 - .../io/xml/validator/ValidatorFactory.java | 6 +- .../xml/validator/XmlInstanceValidator.java | 14 +- .../xml/validator/internal/LSInputImpl.java | 1 - .../internal/ReportErrorHandler.java | 12 +- .../io/xml/validator/internal/ReportImpl.java | 4 +- .../validator/internal/SchemaResolver.java | 8 +- .../validator/internal/XMLApiValidator.java | 8 +- .../validator/internal/XercesValidator.java | 16 +- .../esdihumboldt/hale/io/xsd/XMLSchemaIO.java | 1 - .../hale/io/xsd/XMLSchemaResourceAdvisor.java | 10 +- .../io/xsd/anytype/CustomTypeContent.groovy | 1 - .../CustomTypeContentAssociation.groovy | 1 - .../xsd/anytype/CustomTypeContentHelper.java | 11 +- .../CustomTypeContentAssociationType.groovy | 6 +- .../CustomTypeContentConfigurationType.groovy | 19 +- .../valuetypes/CustomTypeContentType.groovy | 6 +- .../io/xsd/constraint/RestrictionFlag.java | 7 +- .../hale/io/xsd/constraint/XmlAppInfo.java | 8 +- .../io/xsd/constraint/XmlAttributeFlag.java | 8 +- .../hale/io/xsd/constraint/XmlElements.java | 7 +- .../hale/io/xsd/constraint/XmlIdUnique.java | 3 +- .../hale/io/xsd/constraint/XmlMixedFlag.java | 6 +- .../factory/XmlElementsFactory.java | 6 +- .../io/xsd/model/HasNotInheritableValue.java | 2 +- .../hale/io/xsd/model/XmlAttribute.java | 3 +- .../hale/io/xsd/model/XmlElement.java | 3 +- .../hale/io/xsd/model/XmlIndex.java | 15 +- .../hale/io/xsd/reader/XmlSchemaReader.java | 170 ++++++------ .../xsd/reader/internal/AnonymousXmlType.java | 3 +- .../reader/internal/HumboldtURIResolver.java | 8 +- .../internal/LazyGroupPropertyDefinition.java | 10 +- .../internal/LazyPropertyDefinition.java | 3 +- .../reader/internal/ProgressURIResolver.java | 11 +- .../internal/SubstitutionGroupProperty.java | 42 ++- .../reader/internal/SubstitutionProperty.java | 3 +- .../XmlAttributeGroupReferenceProperty.java | 7 +- .../XmlAttributeReferenceProperty.java | 7 +- .../internal/XmlElementReferenceProperty.java | 3 +- .../internal/XmlGroupReferenceProperty.java | 7 +- .../reader/internal/XmlTypeDefinition.java | 30 +- .../io/xsd/reader/internal/XmlTypeUtil.java | 73 +++-- .../internal/constraint/ElementName.java | 7 +- .../constraint/ElementReferenceProperty.java | 8 +- .../constraint/MappableUsingXsiType.java | 3 +- .../constraint/SkipGeometryValidation.java | 2 +- .../internal/constraint/UnionBinding.java | 12 +- .../internal/constraint/UnionEnumeration.java | 5 +- .../constraint/UnionValidationConstraint.java | 5 +- .../internal/constraint/XLinkReference.java | 3 +- .../validator/XLinkReferenceContext.java | 9 +- .../CustomTypeContentAssociationTypeTest.java | 17 +- ...ustomTypeContentConfigurationTypeTest.java | 15 +- .../valuetypes/CustomTypeContentTypeTest.java | 11 +- .../xsd/reader/HumboldtURIResolverTest.java | 3 +- .../xsd/reader/XmlSchemaReaderMoreTest.groovy | 9 +- .../io/xsd/reader/XmlSchemaReaderTest.java | 48 ++-- .../blueprints/entities/IterableDelegate.java | 5 +- .../blueprints/entities/VertexEntity.java | 8 +- .../entities/VertexEntityDelegates.java | 7 +- .../entities/VertexEntityTransformation.java | 35 ++- .../VertexEntityTransformationTest.groovy | 4 +- .../src/eu/esdihumboldt/util/cli/Command.java | 8 +- .../util/cli/bash/BashCompletion.java | 4 +- .../util/cli/extension/GroupCommand.java | 12 +- .../extension/command/CommandExtension.java | 3 +- .../cli/extension/command/CommandFactory.java | 3 +- .../command/ConfigurationCommandFactory.java | 3 +- .../util/cli/extension/group/Group.java | 3 +- .../cli/extension/group/GroupExtension.java | 3 +- .../util/cli/impl/DelegatingCommand.groovy | 1 - .../util/config/ConfigYaml.groovy | 4 +- .../util/geometry/CurveHelper.java | 24 +- .../util/geometry/WindingOrder.java | 17 +- .../AbstractInterpolationAlgorithm.java | 4 +- .../geometry/interpolation/ArcSegment.java | 1 - .../interpolation/InterpolatedLineString.java | 3 +- .../interpolation/InterpolationAlgorithm.java | 6 +- .../interpolation/InterpolationUtil.java | 8 +- .../interpolation/NoInterpolation.java | 5 +- .../extension/InterpolationExtension.java | 3 +- .../interpolation/grid/ArcGridSegment.java | 3 +- .../grid/FixedStartEndGridSegment.java | 3 +- .../interpolation/grid/GridInterpolation.java | 12 +- .../geometry/interpolation/grid/GridUtil.java | 1 - .../interpolation/model/ArcByCenterPoint.java | 5 +- .../model/impl/ArcByCenterPointImpl.java | 6 +- .../model/impl/ArcByPointsImpl.java | 6 +- .../model/impl/ArcStringImpl.java | 5 +- .../interpolation/split/ArcSplitSegment.java | 3 +- .../split/FixedStartEndSplitSegment.java | 3 +- .../split/SplitInterpolation.java | 12 +- .../quadtree/FixedBoundaryQuadtree.groovy | 3 +- .../util/geometry/quadtree/Quadtree.java | 1 - .../geometry/quadtree/QuadtreeBuilder.groovy | 3 +- .../util/geometry/DecimalFormatUtilTest.java | 4 +- .../util/geometry/WindingOrderTest.java | 10 +- .../interpolation/AbstractArcTest.java | 50 ++-- .../grid/GridInterpolationTest.java | 19 +- .../interpolation/grid/GridUtilTest.java | 3 - .../model/impl/ArcByCenterPointImplTest.java | 9 +- .../model/impl/ArcByPointsImplTest.java | 9 +- .../split/SplitInterpolationTest.java | 23 +- .../geometry/quadtree/QuadtreeTest.groovy | 3 +- .../meta/extension/MetaClassDescriptor.java | 3 +- .../meta/extension/MetaClassExtension.java | 3 +- .../CustomMetaClassCreationHandle.java | 7 +- .../groovy/sandbox/DefaultGroovyService.java | 31 +-- .../sandbox/GroovyRestrictionException.java | 4 +- .../util/groovy/sandbox/GroovyService.java | 7 +- .../RestrictiveGroovyInterceptor.java | 35 ++- .../test/internal/GroovySandboxTest.java | 8 +- .../util/groovy/builder/BuilderBase.groovy | 1 - .../groovy/collector/GenericCollector.java | 9 +- .../groovy/collector/PropertyCollector.java | 17 +- .../util/groovy/json/JsonStreamBuilder.groovy | 1 - .../util/groovy/paths/AbstractAccessor.java | 17 +- .../util/groovy/paths/PathImpl.java | 3 +- .../util/groovy/paths/PathWithNulls.java | 3 +- .../util/groovy/xml/NSDOMBuilder.groovy | 13 +- .../util/groovy/xml/NSDOMCategory.groovy | 5 +- .../collector/StatsCollectorTest.groovy | 2 +- .../util/groovy/xml/NSDOMBuilderTest.groovy | 17 +- .../eu/esdihumboldt/util/http/ProxyUtil.java | 33 +-- .../util/http/client/ClientProxyUtil.java | 8 +- .../util/http/client/ClientUtil.java | 11 +- .../http/client/fluent/FluentProxyUtil.java | 6 +- ...ingHttpClientConnectionManagerMetrics.java | 34 +-- .../metrics/CollectorRegistryService.java | 12 +- .../impl/HaleCollectorRegistryService.java | 3 +- .../CustomMetaClassCreationHandle.java | 148 +++++----- .../eu/esdihumboldt/util/nonosgi/Init.java | 25 +- .../orient/embedded/AbstractDocumentTest.java | 12 +- .../embedded/BrowseClassIterateTest.java | 8 +- .../orient/embedded/LocalDocumentTest.java | 4 +- .../orient/embedded/MemoryDocumentTest.java | 3 +- .../util/resource/ResourceResolver.java | 3 +- .../esdihumboldt/util/resource/Resources.java | 14 +- .../resource/internal/BundleResolver.java | 15 +- .../internal/ResolverConfiguration.java | 6 +- .../resource/internal/ResolverExtension.java | 3 +- .../util/resource/internal/ResourceType.java | 4 +- .../internal/ResourceTypeExtension.java | 3 +- .../util/svg/test/AbstractSVGPainterTest.java | 1 - .../util/svg/test/PaintSettings.java | 7 +- .../util/svg/test/SVGPainter.java | 6 +- .../util/svg/test/SVGPainterTest.java | 2 - .../util/test/AbstractPlatformTest.java | 8 +- .../esdihumboldt/util/CustomIdentifiers.java | 4 +- .../util/DependencyOrderedList.java | 4 +- .../src/eu/esdihumboldt/util/Identifiers.java | 12 +- .../eu/esdihumboldt/util/IdentityWrapper.java | 5 +- .../src/eu/esdihumboldt/util/Pair.java | 3 +- .../eu/esdihumboldt/util/PlatformUtil.java | 1 - .../eu/esdihumboldt/util/PropertiesFile.java | 4 +- .../esdihumboldt/util/StructuredEquals.java | 13 +- .../util/SyncedPropertiesFile.java | 5 +- .../definition/AbstractObjectFactory.java | 34 ++- .../util/definition/ObjectDefinition.java | 4 +- .../util/format/DecimalFormatUtil.java | 4 +- .../esdihumboldt/util/internal/Activator.java | 5 +- .../src/eu/esdihumboldt/util/io/IOUtils.java | 25 +- .../esdihumboldt/util/io/InputSupplier.java | 4 +- .../esdihumboldt/util/io/OutputSupplier.java | 4 +- .../util/reflection/OSGIPackageResolver.java | 4 +- .../util/reflection/ReflectionHelper.java | 45 ++- .../scavenger/AbstractResourceScavenger.java | 28 +- .../util/scavenger/ResourceScavenger.java | 11 +- .../util/validator/AbstractValidator.java | 4 +- .../util/validator/AndValidator.java | 3 +- .../util/validator/DigitCountValidator.java | 8 +- .../util/validator/LengthValidator.java | 4 +- .../util/validator/NumberValidator.java | 5 +- .../util/validator/Validator.java | 11 +- .../src/eu/esdihumboldt/util/xml/XmlUtil.java | 10 +- .../util/DependencyOrderedListTest.java | 1 - 1478 files changed, 9369 insertions(+), 11667 deletions(-) diff --git a/app/plugins/eu.esdihumboldt.hale.app.cli/src/eu/esdihumboldt/hale/app/cli/CLIApplication.java b/app/plugins/eu.esdihumboldt.hale.app.cli/src/eu/esdihumboldt/hale/app/cli/CLIApplication.java index b30c178cd2..b6da92286a 100644 --- a/app/plugins/eu.esdihumboldt.hale.app.cli/src/eu/esdihumboldt/hale/app/cli/CLIApplication.java +++ b/app/plugins/eu.esdihumboldt.hale.app.cli/src/eu/esdihumboldt/hale/app/cli/CLIApplication.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.app.cli; +import eu.esdihumboldt.util.cli.Runner; import org.eclipse.equinox.app.IApplication; import org.eclipse.equinox.app.IApplicationContext; -import eu.esdihumboldt.util.cli.Runner; - /** * CLI application. * diff --git a/app/plugins/eu.esdihumboldt.hale.app.cli/src/eu/esdihumboldt/hale/app/cli/VersionCommand.java b/app/plugins/eu.esdihumboldt.hale.app.cli/src/eu/esdihumboldt/hale/app/cli/VersionCommand.java index 33fd6489be..4ee020c248 100644 --- a/app/plugins/eu.esdihumboldt.hale.app.cli/src/eu/esdihumboldt/hale/app/cli/VersionCommand.java +++ b/app/plugins/eu.esdihumboldt.hale.app.cli/src/eu/esdihumboldt/hale/app/cli/VersionCommand.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.app.cli; -import java.util.List; - import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.util.cli.Command; import eu.esdihumboldt.util.cli.CommandContext; +import java.util.List; /** * Command that prints the hale version. diff --git a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ConsoleConstants.java b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ConsoleConstants.java index 8d78cdc6ed..5eba6a159f 100755 --- a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ConsoleConstants.java +++ b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ConsoleConstants.java @@ -26,17 +26,17 @@ public interface ConsoleConstants { * Prefix for messages on System out. */ public static final String MSG_PREFIX = "(I) "; - + /** * Prefix for status messages on System out. */ public static final String STATUS_PREFIX = "(S) "; - + /** * Prefix for warning messages on System out. */ public static final String WARN_PREFIX = "(W) "; - + /** * Prefix for error messages on System out. */ diff --git a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ConsoleProgressMonitor.java b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ConsoleProgressMonitor.java index d05b2866aa..90b7786546 100755 --- a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ConsoleProgressMonitor.java +++ b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ConsoleProgressMonitor.java @@ -15,52 +15,51 @@ package eu.esdihumboldt.hale.app.transform; +import com.google.common.base.Objects; import java.text.MessageFormat; import java.util.Date; - import org.eclipse.core.runtime.IProgressMonitor; -import com.google.common.base.Objects; - /** * Progress monitor that gives status updates on the console. * * @author Simon Templer */ public class ConsoleProgressMonitor implements IProgressMonitor, ConsoleConstants { - + private static final String PROG_PREFIX = MSG_PREFIX + "-- "; private static final long TRIGGER_CLOCK_MS = 500; - + private String mainTaskName; - + private String currentTask; - + private int totalWork; - + private int worked = 0; - + private boolean canceled = false; - + private long lastTrigger = -1; @Override public void beginTask(String name, int totalWork) { this.mainTaskName = name; this.totalWork = totalWork; - + // System.out.println(PROG_PREFIX + "Starting task: " + mainTaskName); } - + private void trigger(boolean force) { long now = new Date().getTime(); - + if (force || lastTrigger < 0 || now - lastTrigger > TRIGGER_CLOCK_MS) { if (totalWork > 0 && totalWork != UNKNOWN) { - System.out.println(PROG_PREFIX + MessageFormat.format((currentTask == null) ? ("{0} - {1,number,percent}") - : ("{0} - {1,number,percent} - {2}"), mainTaskName, (float) worked - / (float) totalWork, currentTask)); + System.out.println(PROG_PREFIX + MessageFormat.format( + (currentTask == null) ? ("{0} - {1,number,percent}") + : ("{0} - {1,number,percent} - {2}"), + mainTaskName, (float) worked / (float) totalWork, currentTask)); } else { if (currentTask != null) { @@ -71,7 +70,7 @@ private void trigger(boolean force) { System.out.println(PROG_PREFIX + mainTaskName); } } - + lastTrigger = now; } } diff --git a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecApplication.groovy b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecApplication.groovy index e65480239f..0f30e54df1 100755 --- a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecApplication.groovy +++ b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecApplication.groovy @@ -17,19 +17,17 @@ package eu.esdihumboldt.hale.app.transform; import static eu.esdihumboldt.hale.app.transform.ExecUtil.* -import javax.xml.parsers.DocumentBuilderFactory - -import org.eclipse.equinox.app.IApplicationContext -import org.w3c.dom.Document -import org.w3c.dom.Element -import org.xml.sax.SAXException - import eu.esdihumboldt.hale.common.app.AbstractApplication import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.core.io.impl.ElementValue import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import javax.xml.parsers.DocumentBuilderFactory +import org.eclipse.equinox.app.IApplicationContext +import org.w3c.dom.Document +import org.w3c.dom.Element +import org.xml.sax.SAXException /** @@ -264,7 +262,6 @@ $baseCommand file.eachLine { line -> args << line } //recall processCommandLineArguments function with args file parameter. processCommandLineArguments(args as String[] ,executionContext ) - } diff --git a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecTransformation.java b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecTransformation.java index c41a56fa3e..ef7717d9e6 100755 --- a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecTransformation.java +++ b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecTransformation.java @@ -21,6 +21,29 @@ import static eu.esdihumboldt.hale.app.transform.ExecUtil.status; import static eu.esdihumboldt.hale.app.transform.ExecUtil.warn; +import com.google.common.util.concurrent.ListenableFuture; +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.common.core.io.extension.IOProviderDescriptor; +import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; +import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; +import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; +import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; +import eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment; +import eu.esdihumboldt.hale.common.headless.transform.DefaultTransformationSettings; +import eu.esdihumboldt.hale.common.headless.transform.Transformation; +import eu.esdihumboldt.hale.common.headless.transform.TransformationSettings; +import eu.esdihumboldt.hale.common.instance.io.InstanceReader; +import eu.esdihumboldt.hale.common.instance.io.InstanceValidator; +import eu.esdihumboldt.hale.common.instance.io.InstanceWriter; +import eu.esdihumboldt.util.groovy.collector.StatsCollector; +import eu.esdihumboldt.util.groovy.sandbox.DefaultGroovyService; +import eu.esdihumboldt.util.groovy.sandbox.GroovyService; +import groovy.json.JsonOutput; +import groovy.lang.Binding; +import groovy.lang.GroovyShell; +import groovy.util.DelegatingScript; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -46,35 +69,9 @@ import java.util.Map; import java.util.UUID; import java.util.concurrent.ExecutionException; - import org.codehaus.groovy.control.CompilerConfiguration; import org.eclipse.core.runtime.content.IContentType; -import com.google.common.util.concurrent.ListenableFuture; - -import eu.esdihumboldt.hale.common.core.io.HaleIO; -import eu.esdihumboldt.hale.common.core.io.extension.IOProviderDescriptor; -import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; -import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; -import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; -import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; -import eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment; -import eu.esdihumboldt.hale.common.headless.transform.DefaultTransformationSettings; -import eu.esdihumboldt.hale.common.headless.transform.Transformation; -import eu.esdihumboldt.hale.common.headless.transform.TransformationSettings; -import eu.esdihumboldt.hale.common.instance.io.InstanceReader; -import eu.esdihumboldt.hale.common.instance.io.InstanceValidator; -import eu.esdihumboldt.hale.common.instance.io.InstanceWriter; -import eu.esdihumboldt.util.groovy.collector.StatsCollector; -import eu.esdihumboldt.util.groovy.sandbox.DefaultGroovyService; -import eu.esdihumboldt.util.groovy.sandbox.GroovyService; -import groovy.json.JsonOutput; -import groovy.lang.Binding; -import groovy.lang.GroovyShell; -import groovy.util.DelegatingScript; - /** * Executes a transformation. * @@ -117,8 +114,8 @@ public DirVisitor(Path parentDir, List includes, List excludes) public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { /* - * XXX currently cannot determine from the patterns if a directory - * should be inspected or not + * XXX currently cannot determine from the patterns if a directory should be + * inspected or not */ return FileVisitResult.CONTINUE; } diff --git a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecUtil.groovy b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecUtil.groovy index 1e4a896b77..cd11aeaf5a 100755 --- a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecUtil.groovy +++ b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/ExecUtil.groovy @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.app.transform +import eu.esdihumboldt.hale.common.core.report.Report +import groovy.transform.CompileStatic +import groovy.transform.TypeChecked +import groovy.transform.TypeCheckingMode import org.joda.time.Period import org.joda.time.format.PeriodFormat -import eu.esdihumboldt.hale.common.core.report.Report -import groovy.transform.CompileStatic; -import groovy.transform.TypeChecked; -import groovy.transform.TypeCheckingMode; - /** * Utilities for console output. * @@ -30,7 +29,7 @@ import groovy.transform.TypeCheckingMode; */ @TypeChecked class ExecUtil implements ConsoleConstants { - + static void printSummary(Report report) { // print report summary println "${MSG_PREFIX}Action summary: ${report.taskName}" @@ -39,40 +38,39 @@ class ExecUtil implements ConsoleConstants { // state success print(report.isSuccess() ? - "${MSG_PREFIX} Completed" : - "${ERROR_PREFIX} Failed") - + "${MSG_PREFIX} Completed" : + "${ERROR_PREFIX} Failed") + // add duration if applicable if (report.startTime) { def duration = PeriodFormat.wordBased().print( - new Period(report.startTime.time, report.timestamp.time)) - - print(report.isSuccess() ? ' in ' : ' after ') + new Period(report.startTime.time, report.timestamp.time)) + + print(report.isSuccess() ? ' in ' : ' after ') print duration } // complete success line println '' } - + static void info(String msg) { println "${MSG_PREFIX}$msg" } - + static void warn(String msg) { println "${WARN_PREFIX}$msg" } - + static void error(String msg) { println "${ERROR_PREFIX}$msg" } - + static void status(String msg) { println "${STATUS_PREFIX}$msg" } - + static IllegalStateException fail(String msg) { error(msg) throw new IllegalStateException(msg) } - } diff --git a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/TransformCommand.groovy b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/TransformCommand.groovy index cc91bfdf1d..197b49639c 100644 --- a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/TransformCommand.groovy +++ b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/TransformCommand.groovy @@ -44,5 +44,4 @@ class TransformCommand implements Command { } final String shortDescription = 'Run a transformation based on a hale project' - } diff --git a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/TransformationReports.java b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/TransformationReports.java index f5ee8f7136..c751bc8106 100644 --- a/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/TransformationReports.java +++ b/app/plugins/eu.esdihumboldt.hale.app.transform/src/eu/esdihumboldt/hale/app/transform/TransformationReports.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.app.transform; -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.core.report.Report; import eu.esdihumboldt.hale.common.core.report.ReportHandler; import eu.esdihumboldt.hale.common.core.report.util.StatisticsHelper; import eu.esdihumboldt.hale.common.headless.report.ReportFile; import eu.esdihumboldt.util.groovy.collector.StatsCollector; +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.annotation.Nullable; /** * Transformation report handler. @@ -57,8 +55,8 @@ public TransformationReports(@Nullable File reportFile) { } /** - * Create a report handler that collects the reports and in addition - * delegates to another report handler. + * Create a report handler that collects the reports and in addition delegates + * to another report handler. * * @param delegate the delegate report handler */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/EntityAccessor.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/EntityAccessor.groovy index 3e41e5245c..8e626bc7c0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/EntityAccessor.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/EntityAccessor.groovy @@ -15,11 +15,8 @@ package eu.esdihumboldt.hale.common.align.groovy.accessor -import eu.esdihumboldt.hale.common.align.groovy.accessor.path.PathElement - -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.align.groovy.accessor.internal.EntityAccessorUtil +import eu.esdihumboldt.hale.common.align.groovy.accessor.path.PathElement import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ChildContextType import eu.esdihumboldt.hale.common.align.model.ChildContext import eu.esdihumboldt.hale.common.align.model.Condition @@ -40,6 +37,7 @@ import eu.esdihumboldt.util.groovy.paths.AbstractAccessor import eu.esdihumboldt.util.groovy.paths.Path import eu.esdihumboldt.util.groovy.paths.PathImpl import groovy.transform.CompileStatic +import javax.xml.namespace.QName /** * Entity definition accessor. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/internal/EntityAccessorUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/internal/EntityAccessorUtil.java index 287a571533..ddadf0844d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/internal/EntityAccessorUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/internal/EntityAccessorUtil.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.common.align.groovy.accessor.internal; -import java.util.ArrayList; -import java.util.List; - import eu.esdihumboldt.hale.common.align.groovy.accessor.path.PathElement; import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.ChildContext; @@ -27,6 +24,8 @@ import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.util.groovy.paths.Path; +import java.util.ArrayList; +import java.util.List; /** * Entity definition access utilites. @@ -41,8 +40,8 @@ public class EntityAccessorUtil { * @param path the path, the topmost element has to represent an * {@link EntityDefinition}, all other elements must represent * {@link ChildContext}s - * @return the created entity definition or null if the path - * was null + * @return the created entity definition or null if the path was + * null */ public static EntityDefinition createEntity(Path path) { if (path == null) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/path/PathElement.java b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/path/PathElement.java index 7ae530b268..35ec58fc66 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/path/PathElement.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/src/eu/esdihumboldt/hale/common/align/groovy/accessor/path/PathElement.java @@ -21,8 +21,8 @@ import eu.esdihumboldt.hale.common.schema.model.Definition; /** - * Path element for {@link EntityAccessor}, which is either a type - * entity definiton which must be the root of a path or a child context. + * Path element for {@link EntityAccessor}, which is either a type entity + * definiton which must be the root of a path or a child context. * * @author Simon Templer */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/test/eu/esdihumboldt/hale/common/align/groovy/accessor/EntityAccessorTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/test/eu/esdihumboldt/hale/common/align/groovy/accessor/EntityAccessorTest.groovy index 0bf9af7dff..fa22764665 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/test/eu/esdihumboldt/hale/common/align/groovy/accessor/EntityAccessorTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/test/eu/esdihumboldt/hale/common/align/groovy/accessor/EntityAccessorTest.groovy @@ -15,6 +15,8 @@ package eu.esdihumboldt.hale.common.align.groovy.accessor +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.align.groovy.accessor.path.PathElement import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ChildContextType import eu.esdihumboldt.hale.common.align.model.ChildContext @@ -27,8 +29,6 @@ import eu.esdihumboldt.util.test.AbstractPlatformTest import org.junit.Before import org.junit.Test -import static org.junit.Assert.* - /** * Tests for the {@link DefinitionAccessor}. @@ -93,7 +93,7 @@ class EntityAccessorTest extends AbstractPlatformTest { assertEquals 2, names.size() assertEquals 2, names[0].elements.size() - PathElement directName = names[0].elements.last() + PathElement directName = names[0].elements.last() assertNotNull directName assertEquals 3, names[1].elements.size() diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge.test/src/eu/esdihumboldt/hale/common/align/merge/test/AbstractMergeCellMigratorTest.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge.test/src/eu/esdihumboldt/hale/common/align/merge/test/AbstractMergeCellMigratorTest.java index 21814472fc..34c1aedf8a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge.test/src/eu/esdihumboldt/hale/common/align/merge/test/AbstractMergeCellMigratorTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge.test/src/eu/esdihumboldt/hale/common/align/merge/test/AbstractMergeCellMigratorTest.java @@ -19,18 +19,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.net.URL; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map.Entry; -import java.util.stream.Collectors; - -import org.junit.Assert; - import com.google.common.collect.Iterables; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionUtil; import eu.esdihumboldt.hale.common.align.merge.MergeCellMigrator; import eu.esdihumboldt.hale.common.align.merge.MergeIndex; @@ -54,6 +43,14 @@ import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment; import eu.esdihumboldt.hale.common.headless.test.AbstractProjectTest; +import java.net.URL; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map.Entry; +import java.util.stream.Collectors; +import org.junit.Assert; /** * Base class for {@link MergeCellMigrator} tests. @@ -172,8 +169,7 @@ public List merge(String cellId, URL projectToMigrate, URL matching /** * Retrieve the default cell migrator for a given transformation. * - * @param transformationIdentifier the identifier of the transformation - * function + * @param transformationIdentifier the identifier of the transformation function * @return the cell migrator */ protected CellMigrator getCellMigrator(String transformationIdentifier) { @@ -187,8 +183,7 @@ protected CellMigrator getCellMigrator(String transformationIdentifier) { * Check if the given cell's target matches the expected target. * * @param cell the cell to check - * @param targetDef the expected target entity (simple definition as name - * list) + * @param targetDef the expected target entity (simple definition as name list) */ protected void assertCellTargetEquals(Cell cell, List targetDef) { Entity entity = CellUtil.getFirstEntity(cell.getTarget()); @@ -198,12 +193,11 @@ protected void assertCellTargetEquals(Cell cell, List targetDef) { } /** - * Check if the given cell's sources match the expected sources (order does - * not matter). + * Check if the given cell's sources match the expected sources (order does not + * matter). * * @param cell the cell to check - * @param expected the expected source entities (simple definition as name - * list) + * @param expected the expected source entities (simple definition as name list) */ protected void assertCellSourcesEqual(Cell cell, @SuppressWarnings("unchecked") List... expected) { @@ -251,8 +245,8 @@ protected void assertDefEquals(List expected, EntityDefinition def) { /** * Check if an entity equals the given simple definition * - * @param expected the list of expected entities (each a simple definition - * as name list) + * @param expected the list of expected entities (each a simple definition as + * name list) * @param def the entity definition to check * @return the match from the expected entities */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeCellMigrator.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeCellMigrator.java index e6427a3774..2bbfedfd60 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeCellMigrator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeCellMigrator.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.align.merge; -import java.util.function.Function; - import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; import eu.esdihumboldt.hale.common.align.migrate.CellMigrator; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.MutableCell; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import java.util.function.Function; /** * Interface for migration of single cells based on a {@link MergeIndex}. @@ -31,16 +30,16 @@ public interface MergeCellMigrator { /** - * Update a cell as part of an alignment merge. The target of the cell stays - * the same while source and parameters are update. + * Update a cell as part of an alignment merge. The target of the cell stays the + * same while source and parameters are update. * * @param originalCell the original cell * @param mergeIndex the merge index - * @param migration the alignment migration (may be useful for cases where - * only entity replacement needs to be done) - * @param getCellMigrator functions that yields a cell migrator for a - * function (may be useful for cases where only entity - * replacement needs to be done) + * @param migration the alignment migration (may be useful for cases where only + * entity replacement needs to be done) + * @param getCellMigrator functions that yields a cell migrator for a function + * (may be useful for cases where only entity replacement needs to be + * done) * @param log the migration process log * @return the updated cell or cells */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeIndex.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeIndex.java index a4990871cc..5697685e7d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeIndex.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeIndex.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.align.merge; -import java.util.List; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; +import java.util.List; /** * Index of cells for an alignment that is used for a Merge. @@ -28,12 +27,12 @@ public interface MergeIndex { /** - * Get cells with a specific target. The target is usually a source of a - * cell that is to be migrated. + * Get cells with a specific target. The target is usually a source of a cell + * that is to be migrated. * * @param def the entity definition of the target - * @return the cells have the given target, conditions or other contexts on - * the entity are ignored + * @return the cells have the given target, conditions or other contexts on the + * entity are ignored */ List getCellsForTarget(EntityDefinition def); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeSettings.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeSettings.java index 477b57c9de..4b88b6f669 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeSettings.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/MergeSettings.java @@ -38,8 +38,8 @@ private static boolean defaultTransferContextsToJoinFocus() { } /** - * States if contexts should be tried to be transferred to the Join focus, - * if applicable. + * States if contexts should be tried to be transferred to the Join focus, if + * applicable. * * @return true if the setting is enabled, false * otherwise diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/extension/MigratorExtension.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/extension/MigratorExtension.java index 531e9e4088..6761e88747 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/extension/MigratorExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/extension/MigratorExtension.java @@ -15,14 +15,6 @@ package eu.esdihumboldt.hale.common.align.merge.extension; -import java.text.MessageFormat; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactoryCollection; @@ -30,6 +22,12 @@ import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.merge.MergeCellMigrator; +import java.text.MessageFormat; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension point for merge migrators. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/extension/MigratorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/extension/MigratorFactory.java index 8a7eae1776..3ffff14720 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/extension/MigratorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/extension/MigratorFactory.java @@ -26,12 +26,12 @@ public interface MigratorFactory extends ExtensionObjectFactory { /** - * States if the function with the given identifier is supported to be - * migrated by the migrator. + * States if the function with the given identifier is supported to be migrated + * by the migrator. * * @param functionId the function identifier - * @return true if the function is supported, - * false otherwise + * @return true if the function is supported, false + * otherwise */ boolean supportsFunction(String functionId); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/GroovyRetypeMergeMigrator.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/GroovyRetypeMergeMigrator.java index ad2695d4cb..6a9a2ab34e 100755 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/GroovyRetypeMergeMigrator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/GroovyRetypeMergeMigrator.java @@ -17,7 +17,6 @@ import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.cst.functions.groovy.GroovyConstants; import eu.esdihumboldt.cst.functions.groovy.GroovyCreate; import eu.esdihumboldt.cst.functions.groovy.GroovyJoin; @@ -39,7 +38,6 @@ import eu.esdihumboldt.hale.common.core.io.Text; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.report.SimpleLog; -import eu.esdihumboldt.hale.common.instance.extension.filter.FilterDefinitionManager; /** * Merge migrator for the Groovy Retype function. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/JoinContext.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/JoinContext.java index a199bea7e9..dae819b0d4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/JoinContext.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/JoinContext.java @@ -15,20 +15,8 @@ package eu.esdihumboldt.hale.common.align.merge.functions; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.cst.functions.groovy.GroovyConstants; import eu.esdihumboldt.cst.functions.groovy.GroovyJoin; import eu.esdihumboldt.hale.common.align.merge.MergeUtil; @@ -50,6 +38,16 @@ import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.util.Pair; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * Context for merge of a Join cell. @@ -134,9 +132,9 @@ public void apply(MutableCell newCell, AlignmentMigration migration, SimpleLog l } /* - * Conditions: (1) add conditions from matches and (2) add conditions - * from original cell translated to new schema (via property mapping), - * if they are not duplicates + * Conditions: (1) add conditions from matches and (2) add conditions from + * original cell translated to new schema (via property mapping), if they are + * not duplicates */ Set> cons = new LinkedHashSet<>(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/JoinMergeMigrator.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/JoinMergeMigrator.java index 97825d437c..4d2ef9e8ca 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/JoinMergeMigrator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/functions/JoinMergeMigrator.java @@ -15,12 +15,8 @@ package eu.esdihumboldt.hale.common.align.merge.functions; -import java.util.Map.Entry; -import java.util.function.Predicate; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.cst.functions.groovy.GroovyConstants; import eu.esdihumboldt.cst.functions.groovy.GroovyJoin; import eu.esdihumboldt.cst.functions.groovy.GroovyRetype; @@ -42,6 +38,8 @@ import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; import eu.esdihumboldt.hale.common.core.io.Text; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import java.util.Map.Entry; +import java.util.function.Predicate; /** * Merge migrator for Join functions. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMergeCellMigrator.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMergeCellMigrator.java index b7f7692b8d..9ecfbd2bbe 100755 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMergeCellMigrator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMergeCellMigrator.java @@ -17,21 +17,9 @@ import static eu.esdihumboldt.hale.common.align.migrate.util.MigrationUtil.isDirectMatch; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Function; -import java.util.stream.Collectors; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.cst.functions.groovy.GroovyJoin; import eu.esdihumboldt.hale.common.align.merge.MergeCellMigrator; import eu.esdihumboldt.hale.common.align.merge.MergeIndex; @@ -61,6 +49,16 @@ import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; +import java.util.stream.Collectors; /** * Cell merger base class. @@ -103,11 +101,11 @@ public Iterable mergeCell(Cell originalCell, MergeIndex mergeIndex, * @param sources the old sources * @param mergeIndex the merge index * @param originalCell the original cell - * @param migration the alignment migration (may be useful for cases where - * only entity replacement needs to be done) - * @param getCellMigrator functions that yields a cell migrator for a - * function (may be useful for cases where only entity - * replacement needs to be done) + * @param migration the alignment migration (may be useful for cases where only + * entity replacement needs to be done) + * @param getCellMigrator functions that yields a cell migrator for a function + * (may be useful for cases where only entity replacement needs to be + * done) * @param log the migration process log * @return the merged cell or cells */ @@ -330,8 +328,8 @@ private List findParentMatch(EntityDefinition entity, MergeIndex mergeInde } /** - * Apply contexts/conditions from the original source to the source of the - * new mapping cell that replaces it. + * Apply contexts/conditions from the original source to the source of the new + * mapping cell that replaces it. * * @param newCell the cell to adapt * @param originalSource the original source diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMigration.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMigration.groovy index 014a1706df..ade1393b62 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMigration.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/AbstractMigration.groovy @@ -209,7 +209,7 @@ abstract class AbstractMigration implements AlignmentMigration { protected Optional findParentMatch(EntityDefinition entity) { //XXX only allow parent matches for specific cases right now if (!(entity.definition instanceof PropertyDefinition) || - !((PropertyDefinition) entity.definition).propertyType.getConstraint(GeometryType).isGeometry()) { + !((PropertyDefinition) entity.definition).propertyType.getConstraint(GeometryType).isGeometry()) { // not a geometry return Optional.empty() } @@ -225,5 +225,4 @@ abstract class AbstractMigration implements AlignmentMigration { return Optional.empty() } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/DefaultSchemaMigration.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/DefaultSchemaMigration.groovy index aa7031ca00..2ad28962e7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/DefaultSchemaMigration.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/DefaultSchemaMigration.groovy @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.common.align.merge.impl -import javax.annotation.Nullable -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.align.groovy.accessor.EntityAccessor import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration import eu.esdihumboldt.hale.common.align.model.ChildContext @@ -28,6 +25,8 @@ import eu.esdihumboldt.hale.common.core.report.SimpleLog import eu.esdihumboldt.hale.common.schema.model.SchemaSpace import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import groovy.transform.CompileStatic +import javax.annotation.Nullable +import javax.xml.namespace.QName /** * Default migration implementation supporting basic migration functionality like replacing namespaces. @@ -184,5 +183,4 @@ class DefaultSchemaMigration implements AlignmentMigration { candidate } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/MatchingMigration.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/MatchingMigration.groovy index 5075af47e1..81df7c009c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/MatchingMigration.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/MatchingMigration.groovy @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.common.align.merge.impl -import java.util.function.Function - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil import eu.esdihumboldt.hale.common.align.model.Cell import eu.esdihumboldt.hale.common.align.model.EntityDefinition -import eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment; +import eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment import eu.esdihumboldt.hale.common.schema.SchemaSpaceID -import groovy.transform.CompileStatic;;; +import groovy.transform.CompileStatic +import java.util.function.Function /** * Alignment migration based on a alignment representing a matching between different schemas. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/TargetIndex.java b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/TargetIndex.java index e6d09ee314..e4e50156cb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/TargetIndex.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/src/eu/esdihumboldt/hale/common/align/merge/impl/TargetIndex.java @@ -15,12 +15,8 @@ package eu.esdihumboldt.hale.common.align.merge.impl; -import java.util.Collections; -import java.util.List; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.merge.MergeIndex; import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; @@ -28,6 +24,8 @@ import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; +import java.util.Collections; +import java.util.List; /** * @author Simon Templer diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/DefaultMergeCellMigratorTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/DefaultMergeCellMigratorTest.groovy index e4f4ac5a1d..5e977a2da3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/DefaultMergeCellMigratorTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/DefaultMergeCellMigratorTest.groovy @@ -17,10 +17,7 @@ package eu.esdihumboldt.hale.common.align.merge.test.impl import static org.junit.Assert.* -import org.junit.Test - import com.google.common.collect.ListMultimap - import eu.esdihumboldt.cst.functions.groovy.GroovyRetype import eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentIO import eu.esdihumboldt.hale.common.align.merge.impl.DefaultMergeCellMigrator @@ -33,6 +30,7 @@ import eu.esdihumboldt.hale.common.align.model.functions.JoinFunction import eu.esdihumboldt.hale.common.align.model.functions.RenameFunction import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import org.junit.Test /** * Tests for default merge cell migrator. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/FormattedStringMergeTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/FormattedStringMergeTest.groovy index 7a243438e0..75266372c0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/FormattedStringMergeTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/FormattedStringMergeTest.groovy @@ -17,14 +17,13 @@ package eu.esdihumboldt.hale.common.align.merge.test.impl import static org.junit.Assert.* -import org.junit.Test - import eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentIO import eu.esdihumboldt.hale.common.align.merge.impl.DefaultMergeCellMigrator import eu.esdihumboldt.hale.common.align.merge.test.AbstractMergeCellMigratorTest import eu.esdihumboldt.hale.common.align.model.CellUtil import eu.esdihumboldt.hale.common.align.model.MutableCell import eu.esdihumboldt.hale.common.align.model.functions.FormattedStringFunction +import org.junit.Test /** * Merge tests related to the FormattedString function. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/GroovyRetypeMergeTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/GroovyRetypeMergeTest.groovy index 4e04c00940..3dc158471f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/GroovyRetypeMergeTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/GroovyRetypeMergeTest.groovy @@ -17,8 +17,6 @@ package eu.esdihumboldt.hale.common.align.merge.test.impl import static org.junit.Assert.* -import org.junit.Test - import eu.esdihumboldt.cst.functions.groovy.GroovyConstants import eu.esdihumboldt.cst.functions.groovy.GroovyJoin import eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentIO @@ -28,6 +26,7 @@ import eu.esdihumboldt.hale.common.align.model.Cell import eu.esdihumboldt.hale.common.align.model.CellUtil import eu.esdihumboldt.hale.common.align.model.MutableCell import eu.esdihumboldt.hale.common.core.io.Text +import org.junit.Test /** * Merge tests related to the FormattedString function. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/JoinFocusRetainConditionTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/JoinFocusRetainConditionTest.groovy index 69e6059097..716fc19acd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/JoinFocusRetainConditionTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/JoinFocusRetainConditionTest.groovy @@ -17,10 +17,6 @@ package eu.esdihumboldt.hale.common.align.merge.test.impl import static org.junit.Assert.* -import org.junit.AfterClass -import org.junit.BeforeClass -import org.junit.Test - import eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentIO import eu.esdihumboldt.hale.common.align.merge.MergeSettings import eu.esdihumboldt.hale.common.align.merge.test.AbstractMergeCellMigratorTest @@ -28,6 +24,9 @@ import eu.esdihumboldt.hale.common.align.model.CellUtil import eu.esdihumboldt.hale.common.align.model.Entity import eu.esdihumboldt.hale.common.align.model.functions.JoinFunction import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter +import org.junit.AfterClass +import org.junit.BeforeClass +import org.junit.Test /** * Test for retaining conditions during Merge. @@ -209,5 +208,4 @@ class JoinFocusRetainConditionTest extends AbstractMergeCellMigratorTest { assertEquals(expected, names) } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/JoinMergeTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/JoinMergeTest.groovy index e417be356f..d1b3a0500e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/JoinMergeTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/test/eu/esdihumboldt/hale/common/align/merge/test/impl/JoinMergeTest.groovy @@ -17,8 +17,6 @@ package eu.esdihumboldt.hale.common.align.merge.test.impl import static org.junit.Assert.* -import org.junit.Test - import eu.esdihumboldt.cst.functions.groovy.GroovyJoin import eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentIO import eu.esdihumboldt.hale.common.align.merge.functions.JoinMergeMigrator @@ -30,6 +28,7 @@ import eu.esdihumboldt.hale.common.align.model.EntityDefinition import eu.esdihumboldt.hale.common.align.model.MutableCell import eu.esdihumboldt.hale.common.align.model.functions.JoinFunction import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter +import org.junit.Test /** * Tests for merging Joins with a Join. @@ -83,13 +82,15 @@ class JoinMergeTest extends AbstractMergeCellMigratorTest { ['Lake', 'id'], [ 'LakeProperties', - 'lakeId'] + 'lakeId' + ] ], [ ['Lake', 'id'], [ 'Connection', - 'standingId'] + 'standingId' + ] ] ]) } @@ -342,5 +343,4 @@ class JoinMergeTest extends AbstractMergeCellMigratorTest { assertTrue("Expected conditions not found ${remaining}", remaining.empty) } - } \ No newline at end of file diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.test/src/eu/esdihumboldt/hale/common/align/io/TestAnnotationDescriptor.groovy b/common/plugins/eu.esdihumboldt.hale.common.align.test/src/eu/esdihumboldt/hale/common/align/io/TestAnnotationDescriptor.groovy index d67f7eca0e..6a299b6369 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.test/src/eu/esdihumboldt/hale/common/align/io/TestAnnotationDescriptor.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align.test/src/eu/esdihumboldt/hale/common/align/io/TestAnnotationDescriptor.groovy @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.align.io -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.align.model.AnnotationDescriptor import groovy.xml.DOMBuilder import groovy.xml.dom.DOMCategory +import org.w3c.dom.Element /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/compatibility/CompatibilityMode.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/compatibility/CompatibilityMode.java index 906729a5df..eac2b87dd5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/compatibility/CompatibilityMode.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/compatibility/CompatibilityMode.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.align.compatibility; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import javax.annotation.Nullable; /** * The purpose of this class is to check up compatibility of transformation @@ -33,8 +32,8 @@ public interface CompatibilityMode { * checks the functions id of compatibility * * @param id the functions id - * @param serviceProvider the service provider, may be null if - * none is available in the context + * @param serviceProvider the service provider, may be null if none + * is available in the context * @return true, if the function is compatible */ public boolean supportsFunction(String id, @Nullable ServiceProvider serviceProvider); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/compatibility/CompatibilityModeUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/compatibility/CompatibilityModeUtil.java index 314c73b6eb..a02553eec6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/compatibility/CompatibilityModeUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/compatibility/CompatibilityModeUtil.java @@ -17,7 +17,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.Condition; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/annotation/AnnotationExtension.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/annotation/AnnotationExtension.java index b76067b176..f206408bed 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/annotation/AnnotationExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/annotation/AnnotationExtension.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.align.extension.annotation; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.model.AnnotationDescriptor; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for cell annotations. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/annotation/DefinedAnnotation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/annotation/DefinedAnnotation.java index 008cf21f9b..5780dbc35c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/annotation/DefinedAnnotation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/annotation/DefinedAnnotation.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.align.extension.annotation; -import org.w3c.dom.Element; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.align.model.AnnotationDescriptor; +import org.w3c.dom.Element; /** * Represents a cell annotation defined in the extension point. @@ -36,8 +35,8 @@ public class DefinedAnnotation implements Identifiable, AnnotationDescriptor implements EngineFactory { + public static class ConfigurationFactory + extends AbstractConfigurationFactory implements EngineFactory { /** * Create a {@link TransformationEngine} factory based on the given diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractFunction.java index ad7e594bad..4692c04c2e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractFunction.java @@ -16,6 +16,11 @@ package eu.esdihumboldt.hale.common.align.extension.function; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.align.migrate.CellMigrator; +import eu.esdihumboldt.hale.common.align.model.CellExplanation; import java.net.URL; import java.util.Collection; import java.util.Collections; @@ -23,25 +28,16 @@ import java.util.Map; import java.util.Optional; import java.util.Set; - +import net.jcip.annotations.Immutable; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.align.migrate.CellMigrator; -import eu.esdihumboldt.hale.common.align.model.CellExplanation; -import net.jcip.annotations.Immutable; - /** * {@link IConfigurationElement} based function base class * - * @param - *

- * the parameter type + * @param

the parameter type * @author Simon Templer */ @Immutable diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractFunctionExtension.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractFunctionExtension.java index 2ad0310e44..9013d42fb5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractFunctionExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractFunctionExtension.java @@ -16,19 +16,16 @@ package eu.esdihumboldt.hale.common.align.extension.function; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.SetMultimap; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; - import org.eclipse.core.runtime.IConfigurationElement; -import com.google.common.collect.LinkedHashMultimap; -import com.google.common.collect.SetMultimap; - -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; - /** * Abstract function extension * @@ -36,8 +33,8 @@ * * @author Simon Templer */ -public abstract class AbstractFunctionExtension> extends - IdentifiableExtension { +public abstract class AbstractFunctionExtension> + extends IdentifiableExtension { private SetMultimap categoryFunctions; @@ -51,8 +48,8 @@ public AbstractFunctionExtension(String extensionId) { } /** - * Calls {@link #doCreate(String, IConfigurationElement)} to create an - * object for the given configuration element. + * Calls {@link #doCreate(String, IConfigurationElement)} to create an object + * for the given configuration element. * * @see IdentifiableExtension#create(String, IConfigurationElement) */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractParameter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractParameter.java index b4cb2bbc82..3f5f974b3f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractParameter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/AbstractParameter.java @@ -16,20 +16,18 @@ package eu.esdihumboldt.hale.common.align.extension.function; +import eu.esdihumboldt.hale.common.core.parameter.AbstractCommonParameter; import net.jcip.annotations.Immutable; - import org.eclipse.core.runtime.IConfigurationElement; -import eu.esdihumboldt.hale.common.core.parameter.AbstractCommonParameter; - /** * Abstract definition of a parameter based on an {@link IConfigurationElement} * * @author Simon Templer */ @Immutable -public abstract class AbstractParameter extends AbstractCommonParameter implements - ParameterDefinition { +public abstract class AbstractParameter extends AbstractCommonParameter + implements ParameterDefinition { private final int minOccurrence; private final int maxOccurrence; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionDefinition.java index c0686495ea..b21f9ea491 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionDefinition.java @@ -16,21 +16,18 @@ package eu.esdihumboldt.hale.common.align.extension.function; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; +import eu.esdihumboldt.hale.common.align.migrate.CellMigrator; +import eu.esdihumboldt.hale.common.align.model.CellExplanation; import java.net.URL; import java.util.Collection; import java.util.Optional; import java.util.Set; -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; -import eu.esdihumboldt.hale.common.align.migrate.CellMigrator; -import eu.esdihumboldt.hale.common.align.model.CellExplanation; - /** * Basic interface for function definitions * - * @param - *

- * entity parameter definition type + * @param

entity parameter definition type * @author Simon Templer */ public interface FunctionDefinition

extends Identifiable { @@ -103,8 +100,8 @@ public interface FunctionDefinition

extends Ident /** * Get the associated cell explanation. * - * @return the cell explanation or null if none is available - * for this function + * @return the cell explanation or null if none is available for + * this function */ public CellExplanation getExplanation(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionParameter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionParameter.java index dd9d2575ab..3fef74b6d5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionParameter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionParameter.java @@ -16,18 +16,14 @@ package eu.esdihumboldt.hale.common.align.extension.function; -import java.util.List; - -import javax.annotation.Nullable; - -import net.jcip.annotations.Immutable; - -import org.eclipse.core.runtime.IConfigurationElement; - import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueDefinition; import eu.esdihumboldt.hale.common.core.parameter.ParameterUtil; import eu.esdihumboldt.hale.common.core.parameter.ParameterValueDescriptor; import eu.esdihumboldt.hale.common.core.parameter.Validator; +import java.util.List; +import javax.annotation.Nullable; +import net.jcip.annotations.Immutable; +import org.eclipse.core.runtime.IConfigurationElement; /** * Definition of a function parameter. @@ -35,7 +31,8 @@ * @author Simon Templer */ @Immutable -public final class FunctionParameter extends AbstractParameter implements FunctionParameterDefinition { +public final class FunctionParameter extends AbstractParameter + implements FunctionParameterDefinition { private final Class binding; private final Validator validator; @@ -67,8 +64,7 @@ public FunctionParameter(IConfigurationElement conf) { * @see eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition#getBinding() */ @Override - public @Nullable - Class getBinding() { + public @Nullable Class getBinding() { return binding; } @@ -76,8 +72,7 @@ Class getBinding() { * @see eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition#getEnumeration() */ @Override - public @Nullable - List getEnumeration() { + public @Nullable List getEnumeration() { return enumeration; } @@ -85,8 +80,7 @@ List getEnumeration() { * @see eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition#getValidator() */ @Override - public @Nullable - Validator getValidator() { + public @Nullable Validator getValidator() { return validator; } @@ -110,8 +104,7 @@ public boolean isDeprecated() { * @see eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition#getComplexBinding() */ @Override - public @Nullable - ComplexValueDefinition getComplexBinding() { + public @Nullable ComplexValueDefinition getComplexBinding() { return complexBinding; } @@ -119,8 +112,7 @@ ComplexValueDefinition getComplexBinding() { * @see eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition#getValueDescriptor() */ @Override - public @Nullable - ParameterValueDescriptor getValueDescriptor() { + public @Nullable ParameterValueDescriptor getValueDescriptor() { return valueDescriptor; } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionParameterDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionParameterDefinition.java index 124a1fcc0e..c9c562b6ae 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionParameterDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionParameterDefinition.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.align.extension.function; -import java.util.List; - import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueDefinition; import eu.esdihumboldt.hale.common.core.parameter.ParameterValueDescriptor; import eu.esdihumboldt.hale.common.core.parameter.Validator; +import java.util.List; /** * Function parameter definition. @@ -29,16 +28,16 @@ public interface FunctionParameterDefinition extends ParameterDefinition { /** - * Returns the binding class for this function parameter or null if there is - * an enumeration present. + * Returns the binding class for this function parameter or null if there is an + * enumeration present. * * @return the binding or null */ public abstract Class getBinding(); /** - * Returns the enumeration of allowed values for this function parameter or - * null if there is a binding present. + * Returns the enumeration of allowed values for this function parameter or null + * if there is a binding present. * * @return the value enumeration or null */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionUtil.java index bb0c90e3c7..07f957d1ce 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/FunctionUtil.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.common.align.extension.function; -import java.util.Collection; - -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.service.FunctionService; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.Collection; +import javax.annotation.Nullable; /** * Function utility methods @@ -36,8 +34,8 @@ public abstract class FunctionUtil { * declarations if no service is available. * * @param id the function ID - * @param serviceProvider the service provider to retrieve the function - * service for resolving the function identifier + * @param serviceProvider the service provider to retrieve the function service + * for resolving the function identifier * @return the function or null if no function with the given * identifier was found */ @@ -66,8 +64,8 @@ public static FunctionDefinition getFunction(String id, * function declarations if no service is available. * * @param id the function ID - * @param serviceProvider the service provider to retrieve the function - * service for resolving the function identifier + * @param serviceProvider the service provider to retrieve the function service + * for resolving the function identifier * @return the function or null if no function with the given * identifier was found */ @@ -84,12 +82,12 @@ public static PropertyFunctionDefinition getPropertyFunction(String id, } /** - * Get the type function w/ the given identifier. Falls back to static - * function declarations if no service is available. + * Get the type function w/ the given identifier. Falls back to static function + * declarations if no service is available. * * @param id the function ID - * @param serviceProvider the service provider to retrieve the function - * service for resolving the function identifier + * @param serviceProvider the service provider to retrieve the function service + * for resolving the function identifier * @return the function or null if no function with the given * identifier was found */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/ParameterDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/ParameterDefinition.java index 5468035acc..1a22a1b273 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/ParameterDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/ParameterDefinition.java @@ -25,8 +25,8 @@ public interface ParameterDefinition extends NamedDefinition { /** - * Value for {@link #getMaxOccurrence()} that represents an unbounded - * maximum occurrence + * Value for {@link #getMaxOccurrence()} that represents an unbounded maximum + * occurrence */ public static final int UNBOUNDED = -1; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunction.java index b1c7c68f47..89a595e5b4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunction.java @@ -20,9 +20,7 @@ import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; - import net.jcip.annotations.Immutable; - import org.eclipse.core.runtime.IConfigurationElement; /** @@ -31,8 +29,8 @@ * @author Simon Templer */ @Immutable -public final class PropertyFunction extends AbstractFunction implements - PropertyFunctionDefinition { +public final class PropertyFunction extends AbstractFunction + implements PropertyFunctionDefinition { private final Set source; private final Set target; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunctionDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunctionDefinition.java index 76202b2cf2..86cdfe8721 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunctionDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunctionDefinition.java @@ -20,7 +20,8 @@ * * @author Simon Templer */ -public interface PropertyFunctionDefinition extends FunctionDefinition { +public interface PropertyFunctionDefinition + extends FunctionDefinition { // concrete typed interface diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunctionExtension.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunctionExtension.java index c2e3e14994..0ae2aef9b3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunctionExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyFunctionExtension.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.align.extension.function; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link PropertyFunction}s diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyParameter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyParameter.java index 43b33f775c..9565ad639f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyParameter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyParameter.java @@ -16,17 +16,6 @@ package eu.esdihumboldt.hale.common.align.extension.function; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; - -import org.locationtech.jts.geom.Geometry; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; @@ -40,6 +29,14 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.AugmentedValueFlag; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.locationtech.jts.geom.Geometry; /** * Represents a source or target property as parameter to a @@ -47,7 +44,8 @@ * * @author Simon Templer */ -public final class PropertyParameter extends AbstractParameter implements PropertyParameterDefinition { +public final class PropertyParameter extends AbstractParameter + implements PropertyParameterDefinition { private static final ALogger log = ALoggerFactory.getLogger(PropertyParameter.class); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyParameterDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyParameterDefinition.java index e244deb608..d75897f60b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyParameterDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/PropertyParameterDefinition.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.align.extension.function; -import java.util.List; - import eu.esdihumboldt.hale.common.align.model.condition.PropertyCondition; +import java.util.List; /** * Cell property parameter definition. @@ -34,8 +33,8 @@ public interface PropertyParameterDefinition extends ParameterDefinition { public abstract List getConditions(); /** - * Get if the property is eager, i.e. if it wants to consume all property - * values instead of one at a time. + * Get if the property is eager, i.e. if it wants to consume all property values + * instead of one at a time. * * @return if the property is eager */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeFunction.java index 54f56cc23d..ffff1521ba 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeFunction.java @@ -20,9 +20,7 @@ import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; - import net.jcip.annotations.Immutable; - import org.eclipse.core.runtime.IConfigurationElement; /** @@ -31,8 +29,8 @@ * @author Simon Templer */ @Immutable -public final class TypeFunction extends AbstractFunction implements - TypeFunctionDefinition { +public final class TypeFunction extends AbstractFunction + implements TypeFunctionDefinition { private final Set source; private final Set target; @@ -51,7 +49,8 @@ public TypeFunction(IConfigurationElement conf) { addTypes(target, conf.getChildren("targetTypes")); } - private static void addTypes(Set collector, IConfigurationElement[] typesElements) { + private static void addTypes(Set collector, + IConfigurationElement[] typesElements) { if (typesElements != null) { for (IConfigurationElement typesElement : typesElements) { IConfigurationElement[] types = typesElement.getChildren("type"); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeFunctionExtension.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeFunctionExtension.java index 192b5281fc..3fde6fd2a3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeFunctionExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeFunctionExtension.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.align.extension.function; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link TypeFunction}s diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeParameter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeParameter.java index fbfd0d9d2a..6c92c3201f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeParameter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeParameter.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.hale.common.align.extension.function; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.align.model.condition.TypeCondition; import java.util.ArrayList; import java.util.Collections; import java.util.List; - import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.align.model.condition.TypeCondition; - /** * Represents a source or target type as parameter to a {@link TypeFunction} * diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeParameterDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeParameterDefinition.java index 27e6bb9a32..68f87609e3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeParameterDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/TypeParameterDefinition.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.align.extension.function; -import java.util.List; - import eu.esdihumboldt.hale.common.align.model.condition.TypeCondition; +import java.util.List; /** * Type entity parameter definition. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/custom/CustomPropertyFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/custom/CustomPropertyFunction.java index 75a1c6af11..0c4a823c13 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/custom/CustomPropertyFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/custom/CustomPropertyFunction.java @@ -23,8 +23,8 @@ * * @author Simon Templer */ -public interface CustomPropertyFunction extends - CustomFunction> { +public interface CustomPropertyFunction + extends CustomFunction> { // concrete typed interface diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/EnumerationValidator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/EnumerationValidator.java index 02cc38dfbc..1dc126ec95 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/EnumerationValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/EnumerationValidator.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.common.align.extension.function.validator; -import java.util.List; - import com.google.common.base.Joiner; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.core.parameter.Validator; +import java.util.List; /** * Validator that checks whether the value is one of the given values.
diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/LengthValidator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/LengthValidator.java index 3055898924..e4ebec8772 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/LengthValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/LengthValidator.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.align.extension.function.validator; -import java.util.List; - import com.google.common.collect.ListMultimap; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.parameter.Validator; +import java.util.List; /** * Validator that checks whether the value's length is in given bounds.
diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/NumberValidator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/NumberValidator.java index e8a63d1696..16c11754fa 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/NumberValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/function/validator/NumberValidator.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.align.extension.function.validator; -import java.math.BigDecimal; - import com.google.common.collect.ListMultimap; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.parameter.Validator; +import java.math.BigDecimal; /** * Validator that checks whether the value is a number.
diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/AbstractTransformationFactory.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/AbstractTransformationFactory.java index 6335b7130d..77fac91062 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/AbstractTransformationFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/AbstractTransformationFactory.java @@ -16,19 +16,16 @@ package eu.esdihumboldt.hale.common.align.extension.transformation; +import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; +import de.fhg.igd.eclipse.util.extension.ExtensionObjectDefinition; +import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; +import eu.esdihumboldt.hale.common.align.transformation.function.TransformationFunction; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; - import net.jcip.annotations.Immutable; - import org.eclipse.core.runtime.IConfigurationElement; -import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; -import de.fhg.igd.eclipse.util.extension.ExtensionObjectDefinition; -import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; -import eu.esdihumboldt.hale.common.align.transformation.function.TransformationFunction; - /** * Base class for transformation function factories * @@ -37,8 +34,8 @@ * @author Simon Templer */ @Immutable -public abstract class AbstractTransformationFactory> extends - AbstractConfigurationFactory implements TransformationFactory { +public abstract class AbstractTransformationFactory> + extends AbstractConfigurationFactory implements TransformationFactory { private final Map parameters; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/PropertyTransformationFactory.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/PropertyTransformationFactory.java index dcebb15c1e..1ca19861d9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/PropertyTransformationFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/PropertyTransformationFactory.java @@ -23,8 +23,8 @@ * * @author Simon Templer */ -public interface PropertyTransformationFactory extends - TransformationFactory> { +public interface PropertyTransformationFactory + extends TransformationFactory> { // concrete typed interface diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/TransformationFactory.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/TransformationFactory.java index 209261346d..994f8b1fe6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/TransformationFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/TransformationFactory.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.hale.common.align.extension.transformation; -import java.util.Map; - import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationFunction; +import java.util.Map; /** * Factory for {@link TransformationFunction}s @@ -28,12 +27,11 @@ * * @author Simon Templer */ -public interface TransformationFactory> extends - ExtensionObjectFactory { +public interface TransformationFactory> + extends ExtensionObjectFactory { /** - * Get the identifier of the engine the transformation must be executed - * with. + * Get the identifier of the engine the transformation must be executed with. * * @return the engine ID or null */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/TransformationFunctionUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/TransformationFunctionUtil.java index 33bc868843..0182d3d13f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/TransformationFunctionUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/TransformationFunctionUtil.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.common.align.extension.transformation; -import java.util.List; - -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.extension.transformation.internal.PropertyTransformationExtension; import eu.esdihumboldt.hale.common.align.extension.transformation.internal.TypeTransformationExtension; import eu.esdihumboldt.hale.common.align.service.TransformationFunctionService; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.List; +import javax.annotation.Nullable; /** * Function utility methods diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/AbstractTransformationExtension.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/AbstractTransformationExtension.java index 940a975225..7ee58a68de 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/AbstractTransformationExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/AbstractTransformationExtension.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.align.extension.transformation.internal; -import java.util.List; - import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactoryCollection; import de.fhg.igd.eclipse.util.extension.FactoryFilter; import eu.esdihumboldt.hale.common.align.extension.transformation.TransformationFactory; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationFunction; +import java.util.List; /** * Abstract extension for transformation functions diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/PropertyTransformationExtension.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/PropertyTransformationExtension.java index 32cbf2e687..d6967abc8c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/PropertyTransformationExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/PropertyTransformationExtension.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.align.extension.transformation.internal; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractExtension; import eu.esdihumboldt.hale.common.align.extension.transformation.AbstractTransformationFactory; import eu.esdihumboldt.hale.common.align.extension.transformation.PropertyTransformationFactory; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyTransformation; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link PropertyTransformation}s @@ -34,9 +33,9 @@ public class PropertyTransformationExtension extends /** * Factory for {@link PropertyTransformation}s that are defined directly */ - public static class PropertyTransformationConfiguration extends - AbstractTransformationFactory> implements - PropertyTransformationFactory { + public static class PropertyTransformationConfiguration + extends AbstractTransformationFactory> + implements PropertyTransformationFactory { /** * @see AbstractTransformationFactory#AbstractTransformationFactory(IConfigurationElement) diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/TypeTransformationExtension.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/TypeTransformationExtension.java index e7ff6f8e36..152828c52b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/TypeTransformationExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/extension/transformation/internal/TypeTransformationExtension.java @@ -16,27 +16,26 @@ package eu.esdihumboldt.hale.common.align.extension.transformation.internal; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractExtension; import eu.esdihumboldt.hale.common.align.extension.transformation.AbstractTransformationFactory; import eu.esdihumboldt.hale.common.align.extension.transformation.TypeTransformationFactory; import eu.esdihumboldt.hale.common.align.transformation.function.TypeTransformation; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link TypeTransformation}s * * @author Simon Templer */ -public class TypeTransformationExtension extends - AbstractTransformationExtension, TypeTransformationFactory> { +public class TypeTransformationExtension + extends AbstractTransformationExtension, TypeTransformationFactory> { /** * Factory for {@link TypeTransformation}s */ - public static class TypeTransformationConfiguration extends - AbstractTransformationFactory> implements - TypeTransformationFactory { + public static class TypeTransformationConfiguration + extends AbstractTransformationFactory> + implements TypeTransformationFactory { /** * @see AbstractTransformationFactory#AbstractTransformationFactory(IConfigurationElement) diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/EntityDefinitionComparator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/EntityDefinitionComparator.java index 8632bdaa0f..791b555a12 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/EntityDefinitionComparator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/EntityDefinitionComparator.java @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.common.align.helper; -import java.util.Comparator; -import java.util.Iterator; - import com.google.common.base.Strings; - import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.instance.extension.filter.FilterDefinitionManager; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; +import java.util.Comparator; +import java.util.Iterator; /** * Comparator for entity definitions. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/EntityFinder.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/EntityFinder.java index 0432f94a5b..8a707c2b20 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/EntityFinder.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/EntityFinder.java @@ -15,6 +15,9 @@ package eu.esdihumboldt.hale.common.align.helper; +import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; +import eu.esdihumboldt.hale.common.align.model.EntityDefinition; +import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -23,10 +26,6 @@ import java.util.Set; import java.util.function.Predicate; -import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; -import eu.esdihumboldt.hale.common.align.model.EntityDefinition; -import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; - /** * Helper for finding entities matching certain conditions in the entity * hierarchy. @@ -91,8 +90,8 @@ public List find(EntityDefinition parent) { * Find entities matching the condition in (and including) the given parent. * * @param parent the entity to search - * @param checked the set of already checked type definitions (to avoid - * endless recursion) + * @param checked the set of already checked type definitions (to avoid endless + * recursion) * @return the entities found matching the condition */ protected List find(EntityDefinition parent, Set checked) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/GeometryPropertyFinder.groovy b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/GeometryPropertyFinder.groovy index 458e2951a8..8d66db9331 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/GeometryPropertyFinder.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/helper/GeometryPropertyFinder.groovy @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.align.helper -import java.util.function.Function - -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil import eu.esdihumboldt.hale.common.align.model.EntityDefinition import eu.esdihumboldt.hale.common.core.report.SimpleLog @@ -26,6 +22,8 @@ import eu.esdihumboldt.hale.common.schema.SchemaSpaceID import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType +import java.util.function.Function +import javax.xml.namespace.QName /** * Helper for identifying geometry properties diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/instance/EntityAwareFilter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/instance/EntityAwareFilter.java index 43c3e3376a..c3998d954a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/instance/EntityAwareFilter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/instance/EntityAwareFilter.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.align.instance; -import java.util.List; -import java.util.Optional; - import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.instance.model.Filter; +import java.util.List; +import java.util.Optional; /** * Extended filter interface for filters aware of referenced entities. @@ -35,8 +34,8 @@ public interface EntityAwareFilter extends Filter { * * @param context the filter entity context * @return the list of referenced entities, for each distinct variable - * encountered in the filter there should be an entry, if may be - * empty if the reference cannot be resolved in the given context + * encountered in the filter there should be an entry, if may be empty + * if the reference cannot be resolved in the given context */ List> getReferencedEntities(EntityDefinition context); @@ -50,8 +49,7 @@ public interface EntityAwareFilter extends Filter { boolean supportsMigration(); /** - * Migrate the filter based on the given entity context and alignment - * migration. + * Migrate the filter based on the given entity context and alignment migration. * * @param context the entity context * @param migration the alignment migration diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/AlignmentIO.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/AlignmentIO.java index d4907c3973..fa9e2e8f1c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/AlignmentIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/AlignmentIO.java @@ -31,8 +31,8 @@ public abstract class AlignmentIO { public static final String ACTION_LOAD_ALIGNMENT = "eu.esdihumboldt.hale.io.align.read"; /** - * The name of the project file containing the alignment. Reflects the file - * name registered in the extension. + * The name of the project file containing the alignment. Reflects the file name + * registered in the extension. */ public static final String PROJECT_FILE_ALIGNMENT = "alignment.xml"; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/BaseAlignmentReader.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/BaseAlignmentReader.java index 01ee190567..284b80f8f9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/BaseAlignmentReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/BaseAlignmentReader.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.align.io; -import java.net.URI; - import eu.esdihumboldt.hale.common.align.model.MutableAlignment; import eu.esdihumboldt.hale.common.core.io.ImportProvider; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.net.URI; /** * Provides support for reading a base alignment. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/EntityResolver.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/EntityResolver.java index a7da780ad6..a33b83977c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/EntityResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/EntityResolver.java @@ -53,7 +53,8 @@ public interface EntityResolver { * @return the schema property entity * @throws IllegalStateException if resolving the entity is not possible */ - public Property resolveProperty(PropertyType entity, TypeIndex schema, SchemaSpaceID schemaSpace); + public Property resolveProperty(PropertyType entity, TypeIndex schema, + SchemaSpaceID schemaSpace); /** * Resolve a schema type entity based on the given JAXB type. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/AbstractAlignmentReader.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/AbstractAlignmentReader.java index f514140469..712d27cbd0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/AbstractAlignmentReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/AbstractAlignmentReader.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.hale.common.align.io.impl; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; - import eu.esdihumboldt.hale.common.align.io.AlignmentReader; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.MutableAlignment; @@ -35,14 +31,17 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; /** * Abstract alignment reader implementation * * @author Simon Templer */ -public abstract class AbstractAlignmentReader extends AbstractImportProvider implements - AlignmentReader { +public abstract class AbstractAlignmentReader extends AbstractImportProvider + implements AlignmentReader { private TypeIndex sourceSchema; private TypeIndex targetSchema; @@ -132,8 +131,8 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) */ protected MutableAlignment postProcess(MutableAlignment alignment) { /* - * Processing of core functions. This should eventually be handled - * through an extension point to allow external contributions. + * Processing of core functions. This should eventually be handled through an + * extension point to allow external contributions. */ Collection originalCells = new ArrayList<>(alignment.getCells()); for (Cell orgCell : originalCells) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/AbstractAlignmentWriter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/AbstractAlignmentWriter.java index ff3f63b4d3..25a268a57a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/AbstractAlignmentWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/AbstractAlignmentWriter.java @@ -16,8 +16,6 @@ package eu.esdihumboldt.hale.common.align.io.impl; -import java.net.URI; - import eu.esdihumboldt.hale.common.align.io.AlignmentWriter; import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -25,14 +23,15 @@ import eu.esdihumboldt.hale.common.core.io.project.ProjectInfo; import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoAware; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; +import java.net.URI; /** * Abstract alignment writer implementation * * @author Simon Templer */ -public abstract class AbstractAlignmentWriter extends AbstractExportProvider implements - AlignmentWriter, ProjectInfoAware { +public abstract class AbstractAlignmentWriter extends AbstractExportProvider + implements AlignmentWriter, ProjectInfoAware { private Alignment alignment; private SchemaSpace sourceSchema; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentIO.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentIO.java index c26ce9f5ce..41f74b0872 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentIO.java @@ -16,6 +16,12 @@ package eu.esdihumboldt.hale.common.align.io.impl; +import eu.esdihumboldt.hale.common.align.io.impl.internal.AlignmentBean; +import eu.esdihumboldt.hale.common.align.model.Alignment; +import eu.esdihumboldt.hale.common.align.model.MutableAlignment; +import eu.esdihumboldt.hale.common.core.io.PathUpdate; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.schema.model.TypeIndex; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; @@ -23,7 +29,6 @@ import java.io.OutputStreamWriter; import java.io.Writer; import java.net.URI; - import org.exolab.castor.mapping.Mapping; import org.exolab.castor.mapping.MappingException; import org.exolab.castor.xml.MarshalException; @@ -32,13 +37,6 @@ import org.exolab.castor.xml.XMLContext; import org.xml.sax.InputSource; -import eu.esdihumboldt.hale.common.align.io.impl.internal.AlignmentBean; -import eu.esdihumboldt.hale.common.align.model.Alignment; -import eu.esdihumboldt.hale.common.align.model.MutableAlignment; -import eu.esdihumboldt.hale.common.core.io.PathUpdate; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.schema.model.TypeIndex; - /** * Save or load an alignment * diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentReader.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentReader.java index 25bb5e3a4e..8e72e908f0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentReader.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.common.align.io.impl; -import java.io.IOException; -import java.io.InputStream; - import eu.esdihumboldt.hale.common.align.model.MutableAlignment; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -26,6 +23,8 @@ import eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import java.io.IOException; +import java.io.InputStream; /** * HALE alignment reader diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentWriter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentWriter.java index a37519328b..e1f33d1274 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/CastorAlignmentWriter.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.common.align.io.impl; -import java.io.IOException; -import java.io.OutputStream; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.PathUpdate; @@ -27,6 +24,8 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import java.io.IOException; +import java.io.OutputStream; /** * HALE alignment writer diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/DOMEntityDefinitionHelper.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/DOMEntityDefinitionHelper.java index 3596ba957c..174fc3e5a9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/DOMEntityDefinitionHelper.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/DOMEntityDefinitionHelper.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.common.align.io.impl; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - import eu.esdihumboldt.hale.common.align.io.EntityResolver; import eu.esdihumboldt.hale.common.align.io.impl.dummy.DummyEntityResolver; import eu.esdihumboldt.hale.common.align.io.impl.internal.EntityDefinitionToJaxb; @@ -36,6 +30,10 @@ import jakarta.xml.bind.JAXBElement; import jakarta.xml.bind.Marshaller; import jakarta.xml.bind.Unmarshaller; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; /** * Helper class for converting EntityDefinitions to DOM (and back) using the @@ -78,8 +76,8 @@ public static TypeEntityDefinition typeFromDOM(Element fragment, TypeIndex types } /** - * Converts the given element to a property entity definition. If any - * exception occurs null is returned. + * Converts the given element to a property entity definition. If any exception + * occurs null is returned. * * @param fragment the fragment to convert * @param types the type index to use for unmarshalling diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/DefaultEntityResolver.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/DefaultEntityResolver.java index ee17900a94..055fa640f0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/DefaultEntityResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/DefaultEntityResolver.java @@ -64,7 +64,8 @@ public Entity resolve(AbstractEntityType entity, TypeIndex schema, SchemaSpaceID } @Override - public Property resolveProperty(PropertyType entity, TypeIndex schema, SchemaSpaceID schemaSpace) { + public Property resolveProperty(PropertyType entity, TypeIndex schema, + SchemaSpaceID schemaSpace) { return new DefaultProperty(JaxbToEntityDefinition.convert(entity, schema, schemaSpace)); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentIO.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentIO.java index d2f1386118..4c7b2d01c0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentIO.java @@ -16,14 +16,6 @@ package eu.esdihumboldt.hale.common.align.io.impl; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintStream; -import java.net.URI; - -import org.apache.commons.io.output.CloseShieldOutputStream; - import eu.esdihumboldt.hale.common.align.io.EntityResolver; import eu.esdihumboldt.hale.common.align.io.impl.internal.AlignmentToJaxb; import eu.esdihumboldt.hale.common.align.io.impl.internal.JaxbToAlignment; @@ -43,6 +35,12 @@ import jakarta.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBException; import jakarta.xml.bind.Marshaller; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintStream; +import java.net.URI; +import org.apache.commons.io.output.CloseShieldOutputStream; /** * Save or load an alignment @@ -114,9 +112,8 @@ public static void addBaseAlignment(MutableAlignment alignment, URI newBase, * @param pathUpdate to update relative paths in case of a path change * @throws Exception if converting or writing the alignment fails * @deprecated use {@link #convert(Alignment, IOReporter, PathUpdate)} and - * {@link #save(AlignmentType, IOReporter, OutputStream)} - * instead to prevent an empty file being written on conversion - * errors + * {@link #save(AlignmentType, IOReporter, OutputStream)} instead to + * prevent an empty file being written on conversion errors */ @Deprecated public static void save(Alignment alignment, IOReporter reporter, OutputStream out, @@ -187,8 +184,8 @@ public static void printCell(MutableCell cell, PrintStream out) throws Exception } /** - * Print a cell to an output stream (intended for tests/debugging). The - * stream is closed when the cell was written. + * Print a cell to an output stream (intended for tests/debugging). The stream + * is closed when the cell was written. * * @param cell the cell to print * @param out the output stream diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentReader.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentReader.java index 0e4787b6de..5594d6df18 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentReader.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.common.align.io.impl; -import java.io.IOException; -import java.io.InputStream; - import eu.esdihumboldt.hale.common.align.io.EntityResolver; import eu.esdihumboldt.hale.common.align.model.MutableAlignment; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -27,6 +24,8 @@ import eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import java.io.IOException; +import java.io.InputStream; /** * HALE alignment reader diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentWriter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentWriter.java index 4f6922368f..a9d62a2f92 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbAlignmentWriter.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.common.align.io.impl; -import java.io.IOException; -import java.io.OutputStream; - import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.AlignmentType; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -28,6 +25,8 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import java.io.IOException; +import java.io.OutputStream; /** * HALE alignment writer diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbBaseAlignmentReader.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbBaseAlignmentReader.java index edc194806f..0745cc8639 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbBaseAlignmentReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/JaxbBaseAlignmentReader.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.common.align.io.impl; -import java.io.IOException; -import java.net.URI; - import eu.esdihumboldt.hale.common.align.io.BaseAlignmentReader; import eu.esdihumboldt.hale.common.align.model.MutableAlignment; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -27,6 +24,8 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.io.IOException; +import java.net.URI; /** * Base alignment reader. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/LoadAlignmentAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/LoadAlignmentAdvisor.java index b374534e86..9b8bbfc92e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/LoadAlignmentAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/LoadAlignmentAdvisor.java @@ -82,8 +82,8 @@ public void handleResults(AlignmentReader provider) { /** * Get the loaded alignment. * - * @return the alignment or null if it was not loaded or - * loading failed + * @return the alignment or null if it was not loaded or loading + * failed */ public Alignment getAlignment() { return alignment; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/dummy/EntityToDef.groovy b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/dummy/EntityToDef.groovy index 293117dee6..969867a4a8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/dummy/EntityToDef.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/dummy/EntityToDef.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.align.io.impl.dummy -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.AbstractEntityType import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ChildContextType import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ClassType @@ -34,6 +32,7 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.DisplayName import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition import groovy.transform.TypeChecked +import javax.xml.namespace.QName /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AbstractBaseAlignmentLoader.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AbstractBaseAlignmentLoader.java index 344a6ed89b..0f58a5740a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AbstractBaseAlignmentLoader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AbstractBaseAlignmentLoader.java @@ -15,21 +15,7 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - import com.google.common.base.Strings; - import eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction; import eu.esdihumboldt.hale.common.align.migrate.impl.UnmigratedCell; import eu.esdihumboldt.hale.common.align.model.Alignment; @@ -49,6 +35,18 @@ import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; import eu.esdihumboldt.util.io.IOUtils; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; /** * Base class for converting alignment representations to alignments. @@ -61,8 +59,8 @@ public abstract class AbstractBaseAlignmentLoader { /** - * Load a alignment representation from the given stream. This method must - * close the stream after it is done. + * Load a alignment representation from the given stream. This method must close + * the stream after it is done. * * @param in the input stream * @param reporter the I/O reporter to report any errors to, may be @@ -92,8 +90,8 @@ public abstract class AbstractBaseAlignmentLoader { protected abstract Collection getCells(A alignment); /** - * Returns a collection of property function definitions of the given - * alignment representation. + * Returns a collection of property function definitions of the given alignment + * representation. * * @param alignment the alignment representation in question * @param sourceTypes the source types to use for resolving definition @@ -114,9 +112,8 @@ protected abstract Collection getPropertyFunctions(A ali protected abstract String getCellId(C cell); /** - * Create a cell from the given cell representation. Implementations can - * return {@link UnmigratedCell}s which will be migrated by this alignment - * loader. + * Create a cell from the given cell representation. Implementations can return + * {@link UnmigratedCell}s which will be migrated by this alignment loader. * * @param cell the cell representation * @param sourceTypes the source types to use for resolving definition @@ -180,8 +177,7 @@ private class AlignmentInfo { /** * Private class for a pair of URIs. The used URI and the absolute URI. * - * {@link #equals(Object)} and {@link #hashCode()} only use the absolute - * URI. + * {@link #equals(Object)} and {@link #hashCode()} only use the absolute URI. */ private class URIPair { @@ -228,7 +224,7 @@ public boolean equals(Object obj) { */ protected final void internalAddBaseAlignment(MutableAlignment alignment, URI newBase, URI projectLocation, TypeIndex sourceTypes, TypeIndex targetTypes, IOReporter reporter) - throws IOException { + throws IOException { Map> prefixMapping = new HashMap>(); Map alignmentToInfo = new HashMap(); @@ -247,8 +243,7 @@ protected final void internalAddBaseAlignment(MutableAlignment alignment, URI ne * references * @param targetTypes the target types to use for resolving definition * references - * @param prefixMapping gets filled with a mapping from local to global - * prefixes + * @param prefixMapping gets filled with a mapping from local to global prefixes * @param alignmentToInfo gets filled with a mapping from base alignment * representations to prefixes and URIs * @param reporter the I/O reporter to report any errors to, may be @@ -321,8 +316,7 @@ private void processBaseAlignments(MutableAlignment alignment, TypeIndex sourceT * @param addBase the URI of the new base alignment to add * @param projectLocation the project location or null * @param existingBases the map of existing bases - * @param prefixMapping gets filled with a mapping from local to global - * prefixes + * @param prefixMapping gets filled with a mapping from local to global prefixes * @param alignmentToInfo gets filled with a mapping from base alignment * representations to prefixes and URIs * @param reporter the reporter @@ -364,9 +358,9 @@ private boolean generatePrefixMapping(URI addBase, URI projectLocation, uriToPrefix.put(absoluteAddBaseURI, newPrefix); /* - * XXX Adding a base alignment could only use a PathUpdate for the - * movement of the base alignment which is not known in the current - * project. Maybe could try the one of the current project either way? + * XXX Adding a base alignment could only use a PathUpdate for the movement of + * the base alignment which is not known in the current project. Maybe could try + * the one of the current project either way? */ // find all alignments to load (also missing ones) and load the beans @@ -523,8 +517,7 @@ protected void loadCustomFunctions(A source, DefaultAlignment alignment, TypeInd * Function to fill the prefixMapping and alignmentToInfo maps. * * @param start the main alignment representation - * @param prefixMapping gets filled with a mapping from local to global - * prefixes + * @param prefixMapping gets filled with a mapping from local to global prefixes * @param alignmentToInfo gets filled with a mapping from base alignment * representations to prefixes and URIs * @param updater the location updater to use for base alignments @@ -533,7 +526,7 @@ protected void loadCustomFunctions(A source, DefaultAlignment alignment, TypeInd */ private void generatePrefixMapping(A start, Map> prefixMapping, Map alignmentToInfo, PathUpdate updater, IOReporter reporter) - throws IOException { + throws IOException { // XXX What if the project file path would change? // Alignment is a project file, so it is in the same directory. URI currentAbsolute = updater.getNewLocation(); @@ -638,8 +631,8 @@ private void generatePrefixMapping(A start, Map> prefixMa * {@link #getCell(Alignment, String, String, Map, IOReporter)}) * @param defaultPrefix the default prefix (may be null) (see * {@link #getCell(Alignment, String, String, Map, IOReporter)}) - * @param base whether the added modifiers are from a base alignment or the - * main alignment + * @param base whether the added modifiers are from a base alignment or the main + * alignment * @param reporter the I/O reporter to report any errors to, may be * null */ @@ -692,15 +685,15 @@ else if (!alignment.getPropertyCells(other, true, false).contains(cell)) { } /** - * Returns the cell in question or null, if it could not be found in which - * case a suitable warning was generated. + * Returns the cell in question or null, if it could not be found in which case + * a suitable warning was generated. * * @param alignment the alignment which contains the cell * @param cellId the cell id * @param defaultPrefix the prefix to use if the cell id does not contain a * prefix, may be null - * @param prefixMapping the prefix map to transform the prefix of the cell - * id with, if it has one + * @param prefixMapping the prefix map to transform the prefix of the cell id + * with, if it has one * @param reporter the I/O reporter to report any errors to, may be * null * @return the cell in question or null diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AlignmentBean.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AlignmentBean.java index 030b53bc9c..e3a3ce695f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AlignmentBean.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AlignmentBean.java @@ -16,6 +16,18 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal; +import com.google.common.base.Function; +import com.google.common.collect.Maps; +import eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction; +import eu.esdihumboldt.hale.common.align.model.Alignment; +import eu.esdihumboldt.hale.common.align.model.BaseAlignmentCell; +import eu.esdihumboldt.hale.common.align.model.Cell; +import eu.esdihumboldt.hale.common.align.model.MutableAlignment; +import eu.esdihumboldt.hale.common.align.model.MutableCell; +import eu.esdihumboldt.hale.common.align.model.TransformationMode; +import eu.esdihumboldt.hale.common.core.io.PathUpdate; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.schema.model.TypeIndex; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -25,7 +37,6 @@ import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; - import org.exolab.castor.mapping.Mapping; import org.exolab.castor.mapping.MappingException; import org.exolab.castor.xml.MarshalException; @@ -34,27 +45,13 @@ import org.exolab.castor.xml.XMLContext; import org.xml.sax.InputSource; -import com.google.common.base.Function; -import com.google.common.collect.Maps; - -import eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction; -import eu.esdihumboldt.hale.common.align.model.Alignment; -import eu.esdihumboldt.hale.common.align.model.BaseAlignmentCell; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.MutableAlignment; -import eu.esdihumboldt.hale.common.align.model.MutableCell; -import eu.esdihumboldt.hale.common.align.model.TransformationMode; -import eu.esdihumboldt.hale.common.core.io.PathUpdate; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.schema.model.TypeIndex; - /** * Alignment bean serving as model for alignment I/O * * @author Simon Templer */ -public class AlignmentBean extends - AbstractBaseAlignmentLoader { +public class AlignmentBean + extends AbstractBaseAlignmentLoader { private Map base = new HashMap(); private Collection cells = new LinkedHashSet(); @@ -76,8 +73,8 @@ public AlignmentBean() { public AlignmentBean(Alignment alignment, final PathUpdate pathUpdate) { super(); - base = new HashMap(Maps.transformValues(alignment.getBaseAlignments(), - new Function() { + base = new HashMap( + Maps.transformValues(alignment.getBaseAlignments(), new Function() { @Override public URI apply(URI input) { @@ -96,8 +93,7 @@ public URI apply(URI input) { } /** - * Load an AlignmentBean from an input stream. The stream is closed at the - * end. + * Load an AlignmentBean from an input stream. The stream is closed at the end. * * @param in the input stream * @param reporter the I/O reporter to report any errors to, may be @@ -108,11 +104,11 @@ public URI apply(URI input) { * @throws MarshalException if the alignment could not be read * @throws ValidationException if the input stream did not provide valid XML */ - public static AlignmentBean load(InputStream in, IOReporter reporter) throws MappingException, - MarshalException, ValidationException { + public static AlignmentBean load(InputStream in, IOReporter reporter) + throws MappingException, MarshalException, ValidationException { Mapping mapping = new Mapping(AlignmentBean.class.getClassLoader()); - mapping.loadMapping(new InputSource(AlignmentBean.class - .getResourceAsStream("AlignmentBean.xml"))); + mapping.loadMapping( + new InputSource(AlignmentBean.class.getResourceAsStream("AlignmentBean.xml"))); XMLContext context = new XMLContext(); context.addMapping(mapping); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AlignmentToJaxb.groovy b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AlignmentToJaxb.groovy index fb522c2d96..c0e18ecceb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AlignmentToJaxb.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/AlignmentToJaxb.groovy @@ -15,11 +15,8 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal -import java.util.Map.Entry - import com.google.common.collect.ListMultimap import com.google.common.collect.MultimapBuilder - import eu.esdihumboldt.hale.common.align.extension.annotation.AnnotationExtension import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.AbstractParameterType import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.AlignmentType @@ -51,6 +48,7 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReporter import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode import jakarta.xml.bind.JAXBElement +import java.util.Map.Entry diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/CellBean.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/CellBean.java index 9d61dfa6ba..064e844951 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/CellBean.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/CellBean.java @@ -16,13 +16,8 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal; -import java.util.ArrayList; -import java.util.List; -import java.util.Map.Entry; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.MutableCell; @@ -32,6 +27,9 @@ import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; /** * Bean representing a {@link Cell} @@ -66,9 +64,10 @@ public CellBean(Cell cell) { this.transformationIdentifier = cell.getTransformationIdentifier(); if (cell.getTransformationParameters() != null) { - for (Entry param : cell.getTransformationParameters().entries()) { - transformationParameters.add(new ParameterValueBean(param.getKey(), param - .getValue())); + for (Entry param : cell.getTransformationParameters() + .entries()) { + transformationParameters + .add(new ParameterValueBean(param.getKey(), param.getValue())); } } @@ -97,7 +96,8 @@ public CellBean(Cell cell) { * references * @return the created cell or null */ - public MutableCell createCell(IOReporter reporter, TypeIndex sourceTypes, TypeIndex targetTypes) { + public MutableCell createCell(IOReporter reporter, TypeIndex sourceTypes, + TypeIndex targetTypes) { MutableCell cell = new DefaultCell(); cell.setTransformationIdentifier(getTransformationIdentifier()); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/CellOrModifierComparator.groovy b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/CellOrModifierComparator.groovy index 30a7d40de6..0db3bdfc0c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/CellOrModifierComparator.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/CellOrModifierComparator.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.AbstractEntityType import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.CellType import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ChildContextType @@ -26,6 +24,7 @@ import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ModifierType import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.NamedEntityType import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.PropertyType import groovy.transform.CompileStatic +import javax.xml.namespace.QName /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/ChildContextBean.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/ChildContextBean.java index 7a3b3712bd..a613300833 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/ChildContextBean.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/ChildContextBean.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.instance.extension.filter.FilterDefinitionManager; +import javax.xml.namespace.QName; /** * Bean representing a {@link ChildContext}. Instead of the child definition it @@ -51,9 +50,10 @@ public ChildContextBean() { */ public ChildContextBean(ChildContext context) { this(context.getContextName(), context.getIndex(), - (context.getCondition() == null) ? (null) : (FilterDefinitionManager.getInstance() - .asString(context.getCondition().getFilter())), context.getChild() - .getName()); + (context.getCondition() == null) ? (null) + : (FilterDefinitionManager.getInstance() + .asString(context.getCondition().getFilter())), + context.getChild().getName()); } /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/EntityBean.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/EntityBean.java index ca65f5fa20..39b65339d4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/EntityBean.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/EntityBean.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import javax.xml.namespace.QName; /** * Represents an {@link Entity} diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/JaxbToAlignment.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/JaxbToAlignment.java index fcb5259ad2..54e5fefc85 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/JaxbToAlignment.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/JaxbToAlignment.java @@ -15,25 +15,11 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.transform.stream.StreamSource; - -import org.w3c.dom.Element; - import com.google.common.base.Function; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Collections2; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.hale.common.align.extension.annotation.AnnotationExtension; import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; import eu.esdihumboldt.hale.common.align.extension.function.FunctionUtil; @@ -82,6 +68,16 @@ import jakarta.xml.bind.JAXBException; import jakarta.xml.bind.Unmarshaller; import jakarta.xml.bind.helpers.DefaultValidationEventHandler; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.transform.stream.StreamSource; +import org.w3c.dom.Element; /** * Converts an {@link AlignmentType} loaded with JAXB to a @@ -142,8 +138,8 @@ public JaxbToAlignment(AlignmentType alignment, IOReporter reporter, TypeIndex s } /** - * Load a {@link AlignmentType} from an input stream. The stream is closed - * at the end. + * Load a {@link AlignmentType} from an input stream. The stream is closed at + * the end. * * @param in the input stream * @param reporter the I/O reporter to report any errors to, may be @@ -354,8 +350,7 @@ private static ListMultimap> convertEntities( *

    *
  • non-null entity - entity could be resolved
  • *
  • null entity - entity could not be resolved, continue
  • - *
  • IllegalStateException - entity could not be resolved, reject - * cell
  • + *
  • IllegalStateException - entity could not be resolved, reject cell
  • *
*/ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/JaxbToEntityDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/JaxbToEntityDefinition.java index 5fd16de64d..dd941d5072 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/JaxbToEntityDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/JaxbToEntityDefinition.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal; -import java.math.BigInteger; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ChildContextType; import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ClassType; import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ConditionType; @@ -41,6 +34,11 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; import eu.esdihumboldt.util.Pair; +import java.math.BigInteger; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; /** * Static methods for conversion from JAXB to {@link EntityDefinition}s. @@ -101,8 +99,8 @@ public static PropertyEntityDefinition convert(PropertyType property, TypeIndex "Could not resolve property entity definition: child not present"); } - Pair, List>> childs = PropertyBean.findChild( - parent, asName(childContext)); + Pair, List>> childs = PropertyBean + .findChild(parent, asName(childContext)); // if the child is still null throw an exception if (childs == null || childs.getFirst() == null) { @@ -114,10 +112,9 @@ public static PropertyEntityDefinition convert(PropertyType property, TypeIndex else { parentName = parent.getIdentifier(); } - throw new IllegalStateException( - MessageFormat - .format("Could not resolve property entity definition: child {0} not found in parent {1}", - childName, parentName)); + throw new IllegalStateException(MessageFormat.format( + "Could not resolve property entity definition: child {0} not found in parent {1}", + childName, parentName)); } ChildDefinition child = childs.getFirst(); @@ -125,14 +122,14 @@ public static PropertyEntityDefinition convert(PropertyType property, TypeIndex if (childs.getSecond() != null) { for (ChildDefinition pathElems : childs.getSecond()) { path.add(new ChildContext(contextName(childContext.getContext()), - contextIndex(childContext.getIndex()), createCondition(childContext - .getCondition()), pathElems)); + contextIndex(childContext.getIndex()), + createCondition(childContext.getCondition()), pathElems)); } } path.add(new ChildContext(contextName(childContext.getContext()), - contextIndex(childContext.getIndex()), createCondition(childContext - .getCondition()), child)); + contextIndex(childContext.getIndex()), + createCondition(childContext.getCondition()), child)); if (child instanceof DefinitionGroup) { parent = (DefinitionGroup) child; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/LoadAlignmentContextImpl.groovy b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/LoadAlignmentContextImpl.groovy index b8c7af1e69..ae5783928b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/LoadAlignmentContextImpl.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/LoadAlignmentContextImpl.groovy @@ -15,7 +15,7 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal -import eu.esdihumboldt.hale.common.align.io.LoadAlignmentContext; +import eu.esdihumboldt.hale.common.align.io.LoadAlignmentContext import eu.esdihumboldt.hale.common.schema.model.TypeIndex diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/NamedEntityBean.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/NamedEntityBean.java index fff08e965a..853444e17d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/NamedEntityBean.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/NamedEntityBean.java @@ -54,8 +54,8 @@ else if (entity instanceof Property) { this.entity = new PropertyBean((Property) entity); } else { - throw new IllegalArgumentException("Unsupported entity type: " - + entity.getClass().getSimpleName()); + throw new IllegalArgumentException( + "Unsupported entity type: " + entity.getClass().getSimpleName()); } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/PropertyBean.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/PropertyBean.java index 42e00d2291..7d4e2fc1fe 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/PropertyBean.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/PropertyBean.java @@ -16,14 +16,6 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.Condition; import eu.esdihumboldt.hale.common.align.model.Entity; @@ -40,6 +32,12 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; import eu.esdihumboldt.util.Pair; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; /** * Represents a {@link Property}. @@ -66,8 +64,8 @@ public PropertyBean(Property property) { super(); setTypeName(property.getDefinition().getType().getName()); - setFilter(FilterDefinitionManager.getInstance().asString( - property.getDefinition().getFilter())); + setFilter(FilterDefinitionManager.getInstance() + .asString(property.getDefinition().getFilter())); for (ChildContext child : property.getDefinition().getPropertyPath()) { properties.add(new ChildContextBean(child)); @@ -90,8 +88,8 @@ protected PropertyEntityDefinition createEntityDefinition(TypeIndex index, SchemaSpaceID schemaSpace) { TypeDefinition typeDef = index.getType(getTypeName()); if (typeDef == null) { - throw new IllegalStateException(MessageFormat.format( - "TypeDefinition for type {0} not found", getTypeName())); + throw new IllegalStateException( + MessageFormat.format("TypeDefinition for type {0} not found", getTypeName())); } List path = new ArrayList(); @@ -116,15 +114,14 @@ protected PropertyEntityDefinition createEntityDefinition(TypeIndex index, if (childs.getSecond() != null) { for (ChildDefinition pathElems : childs.getSecond()) { - path.add(new ChildContext(childContext.getContextName(), childContext - .getContextIndex(), createCondition(childContext.getConditionFilter()), - pathElems)); + path.add(new ChildContext(childContext.getContextName(), + childContext.getContextIndex(), + createCondition(childContext.getConditionFilter()), pathElems)); } } - path.add(new ChildContext(childContext.getContextName(), - childContext.getContextIndex(), createCondition(childContext - .getConditionFilter()), child)); + path.add(new ChildContext(childContext.getContextName(), childContext.getContextIndex(), + createCondition(childContext.getConditionFilter()), child)); if (child instanceof DefinitionGroup) { parent = (DefinitionGroup) child; @@ -137,8 +134,8 @@ else if (child.asProperty() != null) { } } - return new PropertyEntityDefinition(typeDef, path, schemaSpace, FilterDefinitionManager - .getInstance().parse(getFilter())); + return new PropertyEntityDefinition(typeDef, path, schemaSpace, + FilterDefinitionManager.getInstance().parse(getFilter())); } /** @@ -193,7 +190,8 @@ public static Pair, List>> findChild( List> second = new ArrayList>(); second.add(temp); ChildDefinition first = recTemp.getFirst(); - return new Pair, List>>(first, second); + return new Pair, List>>(first, + second); } else { recTemp.getSecond().add(0, temp); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/QNameFieldHandler.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/QNameFieldHandler.java index 30df1f5420..c163a1ef1b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/QNameFieldHandler.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/QNameFieldHandler.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.align.io.impl.internal; import javax.xml.namespace.QName; - import org.exolab.castor.mapping.GeneralizedFieldHandler; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/TypeBean.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/TypeBean.java index dc95aaffa3..f66814a2cd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/TypeBean.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/io/impl/internal/TypeBean.java @@ -45,8 +45,8 @@ public TypeBean() { * @param type the type entity */ public TypeBean(Type type) { - super(type.getDefinition().getDefinition().getName(), FilterDefinitionManager.getInstance() - .asString(type.getDefinition().getFilter())); + super(type.getDefinition().getDefinition().getName(), + FilterDefinitionManager.getInstance().asString(type.getDefinition().getFilter())); } /** @@ -61,10 +61,11 @@ public Entity createEntity(TypeIndex types, SchemaSpaceID schemaSpace) { * @see EntityBean#createEntityDefinition(TypeIndex, SchemaSpaceID) */ @Override - protected TypeEntityDefinition createEntityDefinition(TypeIndex index, SchemaSpaceID schemaSpace) { + protected TypeEntityDefinition createEntityDefinition(TypeIndex index, + SchemaSpaceID schemaSpace) { TypeDefinition typeDef = index.getType(getTypeName()); - return new TypeEntityDefinition(typeDef, schemaSpace, FilterDefinitionManager.getInstance() - .parse(getFilter())); + return new TypeEntityDefinition(typeDef, schemaSpace, + FilterDefinitionManager.getInstance().parse(getFilter())); } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/AlignmentMigration.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/AlignmentMigration.java index c65ef04431..919acbde73 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/AlignmentMigration.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/AlignmentMigration.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.align.migrate; -import java.util.Optional; - import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import java.util.Optional; /** * Interface describing an alignment migration. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/AlignmentMigrationNameLookupSupport.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/AlignmentMigrationNameLookupSupport.java index 6b68135958..dfb4dcaaf2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/AlignmentMigrationNameLookupSupport.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/AlignmentMigrationNameLookupSupport.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.align.migrate; -import java.util.Optional; - import eu.esdihumboldt.hale.common.align.model.EntityDefinition; +import java.util.Optional; /** * Interface describing an alignment migration, adding a method for lenient @@ -28,8 +27,8 @@ public interface AlignmentMigrationNameLookupSupport extends AlignmentMigration { /** - * Yields a replacement for an entity of which only the name is known, e.g. - * a function parameter referencing a property + * Yields a replacement for an entity of which only the name is known, e.g. a + * function parameter referencing a property * * @param name entity name * @return the replacement entity, if the entity should be replaced diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/DefaultAlignmentMigrator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/DefaultAlignmentMigrator.java index 03464c57ec..83d9bf4525 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/DefaultAlignmentMigrator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/DefaultAlignmentMigrator.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.common.align.migrate.impl; -import java.util.ArrayList; -import java.util.Collection; - -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionUtil; import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigrator; @@ -33,6 +28,9 @@ import eu.esdihumboldt.hale.common.align.model.impl.DefaultAlignment; import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.ArrayList; +import java.util.Collection; +import javax.annotation.Nullable; /** * Default implementation of migrator for a complete alignment. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/DefaultCellMigrator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/DefaultCellMigrator.java index 2cee521a51..d7cea55c2e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/DefaultCellMigrator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/DefaultCellMigrator.java @@ -15,14 +15,10 @@ package eu.esdihumboldt.hale.common.align.migrate.impl; -import java.util.Optional; -import java.util.concurrent.atomic.AtomicBoolean; - import com.google.common.base.Objects; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Maps.EntryTransformer; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; import eu.esdihumboldt.hale.common.align.migrate.CellMigrator; import eu.esdihumboldt.hale.common.align.migrate.MigrationOptions; @@ -37,6 +33,8 @@ import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicBoolean; /** * Default implementation of migrator for single cells. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/MigrationOptionsImpl.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/MigrationOptionsImpl.java index 5d3a0261a7..53c6db4065 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/MigrationOptionsImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/MigrationOptionsImpl.java @@ -33,8 +33,8 @@ public class MigrationOptionsImpl implements MigrationOptions { * * @param updateSource if the migration should update source entities * @param updateTarget if the migration should update target entities - * @param transferBase if the migration should transfer base alignment - * content to the updated alignment + * @param transferBase if the migration should transfer base alignment content + * to the updated alignment */ public MigrationOptionsImpl(boolean updateSource, boolean updateTarget, boolean transferBase) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/UnmigratedCell.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/UnmigratedCell.java index 371ab0d75c..6313a72ed9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/UnmigratedCell.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/impl/UnmigratedCell.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.common.align.migrate.impl; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigrationNameLookupSupport; import eu.esdihumboldt.hale.common.align.migrate.CellMigrator; @@ -29,6 +23,10 @@ import eu.esdihumboldt.hale.common.align.model.MutableCell; import eu.esdihumboldt.hale.common.align.model.impl.MutableCellDecorator; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import javax.xml.namespace.QName; /** * Decorator for a {@link MutableCell} that allows to do lazy migration. @@ -45,8 +43,8 @@ public class UnmigratedCell extends MutableCellDecorator { * * @param unmigratedCell Original cell that is to be migrated later * @param migrator The migrator to apply - * @param mappings The original {@link EntityDefinition}s mapped to the - * resolved ones + * @param mappings The original {@link EntityDefinition}s mapped to the resolved + * ones */ public UnmigratedCell(MutableCell unmigratedCell, CellMigrator migrator, Map mappings) { @@ -63,8 +61,8 @@ public boolean canMigrate() { } /** - * Perform the migration of the original cell and return the migrated cell. - * The UnmigratedCell instance is not changed. + * Perform the migration of the original cell and return the migrated cell. The + * UnmigratedCell instance is not changed. * * @param additionalMappings Additional mappings of original * {@link EntityDefinition}s to the resolved ones that should be diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/util/EffectiveMapping.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/util/EffectiveMapping.java index 23d3bc6b9d..edec1f4db3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/util/EffectiveMapping.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/util/EffectiveMapping.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.align.migrate.util; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.Cell; @@ -26,6 +22,9 @@ import eu.esdihumboldt.hale.common.align.model.MutableCell; import eu.esdihumboldt.hale.common.align.model.impl.DefaultAlignment; import eu.esdihumboldt.hale.common.align.model.impl.DefaultCell; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; /** * Helper that converts an alignment into an expanded version where all @@ -38,10 +37,10 @@ public class EffectiveMapping { /** - * Convert an alignment into an expanded version where all effective - * mappings are defined explicitly, i.e. mappings effective due to - * inheritance are converted to use the respective sub-types. Also, base - * alignment cells are converted into normal cells. + * Convert an alignment into an expanded version where all effective mappings + * are defined explicitly, i.e. mappings effective due to inheritance are + * converted to use the respective sub-types. Also, base alignment cells are + * converted into normal cells. * * @param alignment the alignment to convert * @return the expanded copy of the alignment diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/util/MigrationUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/util/MigrationUtil.java index 08bf2d3b90..117a15cf89 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/util/MigrationUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/migrate/util/MigrationUtil.java @@ -15,17 +15,16 @@ package eu.esdihumboldt.hale.common.align.migrate.util; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.MutableAlignment; import eu.esdihumboldt.hale.common.align.model.MutableCell; import eu.esdihumboldt.hale.common.align.model.functions.RenameFunction; import eu.esdihumboldt.hale.common.align.model.functions.RetypeFunction; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; /** * Migration utility methods. @@ -35,9 +34,9 @@ public class MigrationUtil { /** - * Remove base alignment cells from the mapping by removing the base - * alignments. Custom functions will be retained as functions defined - * directly in the alignment. + * Remove base alignment cells from the mapping by removing the base alignments. + * Custom functions will be retained as functions defined directly in the + * alignment. * * @param alignment the alignment to adapt */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Alignment.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Alignment.java index e9e1932933..7a8affa425 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Alignment.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Alignment.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.align.model; -import java.net.URI; -import java.util.Collection; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.net.URI; +import java.util.Collection; +import java.util.Map; /** * An alignment contains alignment cells @@ -100,16 +99,16 @@ public interface Alignment { * Get the cells associated with the given entity definition.
* * @param entityDefinition the entity definition - * @param includeInherited if set, it will also include cells that are - * mapped to the given entity definition on super types + * @param includeInherited if set, it will also include cells that are mapped to + * the given entity definition on super types * @return the associated cells or an empty collection */ public Collection getCells(EntityDefinition entityDefinition, boolean includeInherited); /** - * Get the cells associated with the given type. These may be cells - * associated to the type or its properties. + * Get the cells associated with the given type. These may be cells associated + * to the type or its properties. * * @param type the type definition * @param schemaSpace the type schema space @@ -118,10 +117,10 @@ public Collection getCells(EntityDefinition entityDefinition, public Collection getCells(TypeDefinition type, SchemaSpaceID schemaSpace); /** - * Get the cells representing a mapping between properties that are - * associated with the given cell, not including disabled cells.
- * The type cell needs to have at least a source or a target set for this - * method to return anything. + * Get the cells representing a mapping between properties that are associated + * with the given cell, not including disabled cells.
+ * The type cell needs to have at least a source or a target set for this method + * to return anything. * * @see #getPropertyCells(Cell, boolean, boolean) * @param typeCell the cell in question, has to be a type cell @@ -130,10 +129,10 @@ public Collection getCells(EntityDefinition entityDefinition, public Collection getPropertyCells(Cell typeCell); /** - * Get the cells representing a mapping between properties that are - * associated with the given cell.
- * The type cell needs to have at least a source or a target set for this - * method to return anything. + * Get the cells representing a mapping between properties that are associated + * with the given cell.
+ * The type cell needs to have at least a source or a target set for this method + * to return anything. * * @param typeCell the cell in question, has to be a type cell * @param includeDisabled also get cells that are disabled @@ -142,10 +141,10 @@ public Collection getCells(EntityDefinition entityDefinition, // public Collection getPropertyCells(Cell typeCell, boolean includeDisabled); /** - * Get the cells representing a mapping between properties that are - * associated with the given cell.
- * The type cell needs to have at least a source or a target set for this - * method to return anything. + * Get the cells representing a mapping between properties that are associated + * with the given cell.
+ * The type cell needs to have at least a source or a target set for this method + * to return anything. * * @param typeCell the cell in question, has to be a type cell * @param includeDisabled also get cells that are disabled @@ -159,8 +158,8 @@ Collection getPropertyCells(Cell typeCell, boolean includeDisabl /** * Get all type cells that match the given query cell's sources and targets.
* If the query cell has neither sources nor a target, all type cells are - * returned. Otherwise matching means, that the type cell's sources and - * target have to be the same or super types of the query cell's. + * returned. Otherwise matching means, that the type cell's sources and target + * have to be the same or super types of the query cell's. * * @param queryCell the query cell * @return matching type cells @@ -168,8 +167,8 @@ Collection getPropertyCells(Cell typeCell, boolean includeDisabl public Collection getTypeCells(Cell queryCell); /** - * Returns the cell referenced by the given id string or null - * if it cannot be found. + * Returns the cell referenced by the given id string or null if it + * cannot be found. * * @param cellId the cell id * @return the cell or null if it cannot be found diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/AlignmentUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/AlignmentUtil.java index c86efe63ca..829875a7b2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/AlignmentUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/AlignmentUtil.java @@ -16,22 +16,12 @@ package eu.esdihumboldt.hale.common.align.model; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; - -import javax.xml.namespace.QName; - import com.google.common.base.Function; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.HashMultiset; import com.google.common.collect.ListMultimap; import com.google.common.collect.Lists; import com.google.common.collect.Multiset; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.model.impl.ChildEntityDefinition; @@ -54,6 +44,13 @@ import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.util.groovy.paths.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import javax.xml.namespace.QName; /** * Alignment model utility methods. @@ -96,10 +93,10 @@ public static boolean hasTypeRelation(Alignment alignment) { * types. * * @param alignment the alignment - * @param sourceType the source type, may be null for any - * source type - * @param targetType the target type, may be null for any - * target type + * @param sourceType the source type, may be null for any source + * type + * @param targetType the target type, may be null for any target + * type * @return if a relation between the given types exists in the alignment */ public static boolean hasTypeRelation(Alignment alignment, TypeEntityDefinition sourceType, @@ -142,8 +139,7 @@ public static boolean isAugmentation(Cell cell) { * Get the parent entity definition for the given entity definition. * * @param entity the entity definition - * @return the parent entity definition or null if it has no - * parent + * @return the parent entity definition or null if it has no parent */ public static EntityDefinition getParent(EntityDefinition entity) { List path = entity.getPropertyPath(); @@ -165,8 +161,8 @@ public static EntityDefinition getParent(EntityDefinition entity) { * * @param entity the parent entity * @param childName the child name - * @return the child entity or null if no child with the given - * name exists + * @return the child entity or null if no child with the given name + * exists */ public static EntityDefinition getChild(EntityDefinition entity, QName childName) { ChildDefinition child = DefinitionUtil.getChild(entity.getDefinition(), childName); @@ -222,8 +218,8 @@ else if (path.get(path.size() - 1).getChild() instanceof PropertyDefinition) { } /** - * Create an entity definition from a definition path. Child contexts will - * all be defaults contexts. + * Create an entity definition from a definition path. Child contexts will all + * be defaults contexts. * * @param path the definition path, the topmost element has to represent a * {@link TypeDefinition}, all other elements must be @@ -257,8 +253,8 @@ public ChildDefinition apply(Definition input) { } /** - * Create an entity definition from a definition path. Child contexts will - * all be defaults contexts. + * Create an entity definition from a definition path. Child contexts will all + * be defaults contexts. * * @param type the path parent * @param path the child path @@ -318,9 +314,9 @@ public static EntityDefinition getDefaultEntity(EntityDefinition entity) { * default instance context for each path entry and w/o filter. * * @param entity the entity definition - * @return the entity definition with the default context in all path - * elements and w/o type filter, if no contexts and type filter are - * present the supplied entity is returned directly + * @return the entity definition with the default context in all path elements + * and w/o type filter, if no contexts and type filter are present the + * supplied entity is returned directly */ public static EntityDefinition getAllDefaultEntity(EntityDefinition entity) { return getAllDefaultEntity(entity, false); @@ -331,11 +327,11 @@ public static EntityDefinition getAllDefaultEntity(EntityDefinition entity) { * default instance context for each path entry and w/o filter. * * @param entity the entity definition - * @param stripSchemaSpace if the schema space information should be - * stripped from the entity - * @return the entity definition with the default context in all path - * elements and w/o type filter, if no contexts and type filter are - * present the supplied entity is returned directly + * @param stripSchemaSpace if the schema space information should be stripped + * from the entity + * @return the entity definition with the default context in all path elements + * and w/o type filter, if no contexts and type filter are present the + * supplied entity is returned directly */ public static EntityDefinition getAllDefaultEntity(EntityDefinition entity, final boolean stripSchemaSpace) { @@ -381,8 +377,8 @@ public static EntityDefinition getAllDefaultEntity(EntityDefinition entity, } /** - * Apply the given schema space to the entity definition. Creates a new - * entity definition if necessary. + * Apply the given schema space to the entity definition. Creates a new entity + * definition if necessary. * * @param entity the entity definition * @param schemaSpace the schema space to apply @@ -409,9 +405,9 @@ public static EntityDefinition applySchemaSpace(EntityDefinition entity, * * @param entity the entity definition * @param pathLength the maximum path length - * @return the entity definition derived from the given entity definition - * but with the property path shortened if needed, otherwise the - * given definition will be returned + * @return the entity definition derived from the given entity definition but + * with the property path shortened if needed, otherwise the given + * definition will be returned */ public static EntityDefinition deriveEntity(EntityDefinition entity, int pathLength) { if (pathLength < 0) { @@ -439,8 +435,8 @@ public static EntityDefinition deriveEntity(EntityDefinition entity, int pathLen * * @param parent the parent * @param child the potential child - * @return if the first entity definition is a parent of the second or if - * both are equal + * @return if the first entity definition is a parent of the second or if both + * are equal */ public static boolean isParent(EntityDefinition parent, EntityDefinition child) { if (!parent.getType().equals(child.getType())) { @@ -476,13 +472,13 @@ public static boolean isParent(EntityDefinition parent, EntityDefinition child) } /** - * States if the given entity definition or one of its children is mapped in - * the given alignment. + * States if the given entity definition or one of its children is mapped in the + * given alignment. * * @param entity the entity definition * @param alignment the alignment - * @return if the alignment contains a relation where the given entity or - * one of its children (including grand-children etc.) is involved + * @return if the alignment contains a relation where the given entity or one of + * its children (including grand-children etc.) is involved */ public static boolean entityOrChildMapped(EntityDefinition entity, Alignment alignment) { // check for a direct mapping @@ -508,8 +504,8 @@ && entityOrChildContained(entity, cell.getTarget().values())) { } /** - * Determines if the given entity definition or one of its children is - * contained in the given entity candidates. + * Determines if the given entity definition or one of its children is contained + * in the given entity candidates. * * @param entity the entity definition * @param candidates the entity candidates to test @@ -609,8 +605,8 @@ public static Condition getContextCondition(EntityDefinition candidate) { * Get a text representation for the entity definition context. * * @param entityDef the entity definition - * @return the context text or null if it is the default - * context or the context has no text representation + * @return the context text or null if it is the default context or + * the context has no text representation */ public static String getContextText(EntityDefinition entityDef) { List path = entityDef.getPropertyPath(); @@ -671,13 +667,12 @@ public static boolean isDefaultEntity(EntityDefinition entity) { /** * Assures that an entity is a {@link TypeEntityDefinition}, - * {@link PropertyEntityDefinition} or {@link ChildEntityDefinition} and - * that the inherent classification is correct. + * {@link PropertyEntityDefinition} or {@link ChildEntityDefinition} and that + * the inherent classification is correct. * * @param entity the entity definition - * @return the entity that is guaranteed to be a - * {@link TypeEntityDefinition}, {@link PropertyEntityDefinition} or - * {@link ChildEntityDefinition} + * @return the entity that is guaranteed to be a {@link TypeEntityDefinition}, + * {@link PropertyEntityDefinition} or {@link ChildEntityDefinition} */ public static EntityDefinition normalizeEntity(EntityDefinition entity) { if (entity instanceof TypeEntityDefinition) { @@ -750,8 +745,8 @@ else if (child.asGroup() != null) { * * @param condition the property condition * @param value the property value - * @param parent the parent of the property value, may be null - * if there is none + * @param parent the parent of the property value, may be null if + * there is none * @return if the value matched the property condition */ public static boolean matchCondition(Condition condition, Object value, Object parent) { @@ -768,19 +763,19 @@ public static boolean matchCondition(Condition condition, Object value, Object p } /** - * Returns a cell like the given property cell with all source and target - * types matching those off the given type cell.
- * If the types already match they are unchanged. If the types are sub types - * of the types of the type cell they are changed. If no change is necessary - * the cell itself is returned. + * Returns a cell like the given property cell with all source and target types + * matching those off the given type cell.
+ * If the types already match they are unchanged. If the types are sub types of + * the types of the type cell they are changed. If no change is necessary the + * cell itself is returned. * * @param propertyCell the property cell to update * @param typeCell the type cell with the target types - * @param strict If false and the target type cell has no sources or target, - * the property cell is updated to have the sources/target in - * their declaring type. If true, said properties are left - * unchanged. Does not matter for complete type cells, since they - * have sources and a target. + * @param strict If false and the target type cell has no sources or target, the + * property cell is updated to have the sources/target in their + * declaring type. If true, said properties are left unchanged. Does + * not matter for complete type cells, since they have sources and a + * target. * @return the updated cell or null if an update isn't possible */ public static Cell reparentCell(Cell propertyCell, Cell typeCell, boolean strict) { @@ -922,8 +917,8 @@ else if (childDef.getDeclaringGroup() instanceof TypeDefinition) { } /** - * Checks whether the given entity (or one of its children) is associated - * with the given cell (considering inheritance). + * Checks whether the given entity (or one of its children) is associated with + * the given cell (considering inheritance). * * @param entity the entity to check * @param cell the cell to check the entity against @@ -974,8 +969,8 @@ public static boolean associatedWith(EntityDefinition entity, Cell cell, * * @param instance the instance to collect values from * @param definition the property - * @param onlyValues whether to only return values, or to return whatever - * can be found (including groups/instances) + * @param onlyValues whether to only return values, or to return whatever can be + * found (including groups/instances) * @return all values of the given property */ public static Multiset getValues(Instance instance, PropertyEntityDefinition definition, @@ -991,8 +986,8 @@ public static Multiset getValues(Instance instance, PropertyEntityDefini * @param group the parent group * @param path the path on the group * @param collectedValues the set to add the values to - * @param onlyValues whether to only return values, or to return whatever - * can be found (including groups/instances) + * @param onlyValues whether to only return values, or to return whatever can be + * found (including groups/instances) */ public static void addValues(Group group, List path, Multiset collectedValues, boolean onlyValues) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/BaseAlignmentCell.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/BaseAlignmentCell.java index fd38c630ba..76bb239a4f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/BaseAlignmentCell.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/BaseAlignmentCell.java @@ -15,16 +15,15 @@ package eu.esdihumboldt.hale.common.align.model; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Multimaps; +import com.google.common.collect.Sets; import java.net.URI; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; -import com.google.common.collect.ListMultimap; -import com.google.common.collect.Multimaps; -import com.google.common.collect.Sets; - /** * Cell wrapper for cells of a base alignment. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Cell.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Cell.java index fccee8f656..cb6909f122 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Cell.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Cell.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.align.model; +import com.google.common.collect.ListMultimap; import java.util.List; import java.util.Set; -import com.google.common.collect.ListMultimap; - /** * An alignment cell represents a mapping between two entities * @@ -49,32 +48,31 @@ public interface Cell { public static final String PROPERTY_DISABLE_FOR = "disabled_for"; /** - * Property name for enabling a disabled cell again. Trying to enable a - * cell, which was disabled in a base alignment will fail and result in an - * exception. + * Property name for enabling a disabled cell again. Trying to enable a cell, + * which was disabled in a base alignment will fail and result in an exception. */ public static final String PROPERTY_ENABLE_FOR = "enable_for"; /** - * Get the source entities. For each the name is mapped to the entity. - * Multiple entities may share the same name. The map may not be modified. + * Get the source entities. For each the name is mapped to the entity. Multiple + * entities may share the same name. The map may not be modified. * * @return the source entities, may be null */ public ListMultimap getSource(); /** - * Get the target entities. For each the name is mapped to the entity. - * Multiple entities may share the same name. The map may not be modified. + * Get the target entities. For each the name is mapped to the entity. Multiple + * entities may share the same name. The map may not be modified. * * @return the target entities */ public ListMultimap getTarget(); /** - * Get the transformation parameters that shall be applied to the - * transformation specified by {@link #getTransformationIdentifier()}. The - * map may not be modified. + * Get the transformation parameters that shall be applied to the transformation + * specified by {@link #getTransformationIdentifier()}. The map may not be + * modified. * * @return the transformation parameters, parameter names are mapped to * parameter values, may be null @@ -84,8 +82,8 @@ public interface Cell { /** * Get the annotations of the given type. * - * @param type the annotation type identifier as registered in the - * corresponding extension point + * @param type the annotation type identifier as registered in the corresponding + * extension point * @return the list of annotation objects or an empty list */ public List getAnnotations(String type); @@ -102,8 +100,8 @@ public interface Cell { * associated with the {@link AnnotationDescriptor} registered for the given * type identifier. * - * @param type the annotation type identifier as registered in the - * corresponding extension point + * @param type the annotation type identifier as registered in the corresponding + * extension point * @return a new annotation object as created by * {@link AnnotationDescriptor#create()} or null if no * annotation definition with that type identifier exists @@ -113,8 +111,8 @@ public interface Cell { /** * Add an existing annotation object. * - * @param type the annotation type identifier as registered in the - * corresponding extension point + * @param type the annotation type identifier as registered in the corresponding + * extension point * @param annotation annotation object to add */ void addAnnotation(String type, Object annotation); @@ -122,19 +120,19 @@ public interface Cell { /** * Remove the given annotation object. * - * @param type the annotation type identifier as registered in the - * corresponding extension point + * @param type the annotation type identifier as registered in the corresponding + * extension point * @param annotation the annotation object associated to the annotation type * that should be removed */ public void removeAnnotation(String type, Object annotation); /** - * Get the cell documentation. This essentially are key-value pairs similar - * to cell annotations but represented only by a string value. + * Get the cell documentation. This essentially are key-value pairs similar to + * cell annotations but represented only by a string value. * - * @return documentation types mapped to string values, changes are - * reflected in the cell (not thread safe) + * @return documentation types mapped to string values, changes are reflected in + * the cell (not thread safe) */ public ListMultimap getDocumentation(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/CellExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/CellExplanation.java index 9fb121d4fe..d3e27b8186 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/CellExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/CellExplanation.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.common.align.model; +import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import java.util.Locale; - import javax.annotation.Nullable; -import eu.esdihumboldt.hale.common.core.service.ServiceProvider; - /** * Provides a human readable explanation for a cell. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/CellUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/CellUtil.java index 22743e99f0..3b64ba416b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/CellUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/CellUtil.java @@ -16,19 +16,16 @@ package eu.esdihumboldt.hale.common.align.model; -import java.util.Collection; -import java.util.List; - -import javax.annotation.Nullable; - import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.collect.Collections2; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.service.FunctionService; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.Collection; +import java.util.List; +import javax.annotation.Nullable; /** * Cell related utility methods. @@ -38,8 +35,8 @@ public abstract class CellUtil { /** - * Get the first entity from the given entities map (as contained e.g. as - * source or target in a cell). + * Get the first entity from the given entities map (as contained e.g. as source + * or target in a cell). * * @param entities the entities map * @return first entity or null if there is none @@ -133,8 +130,8 @@ public static String getCellDescription(Cell cell, @Nullable ServiceProvider ser } private static String entitiesText(Collection entities) { - return Joiner.on(", ").join( - Collections2.transform(entities, new Function() { + return Joiner.on(", ") + .join(Collections2.transform(entities, new Function() { @Override public String apply(Entity input) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/ChildContext.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/ChildContext.java index 0a172498a7..f358d2733e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/ChildContext.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/ChildContext.java @@ -16,8 +16,8 @@ package eu.esdihumboldt.hale.common.align.model; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; +import net.jcip.annotations.Immutable; /** * Associates an instance context with a child definition. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Condition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Condition.java index bce348bb25..426ae48896 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Condition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Condition.java @@ -16,8 +16,8 @@ package eu.esdihumboldt.hale.common.align.model; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.instance.model.Filter; +import net.jcip.annotations.Immutable; /** * Property condition. @@ -30,11 +30,11 @@ public class Condition { private final Filter filter; /* - * TODO condition scope This class is intended to hold additional - * information on the filter - how and to what to apply it. This could be - * e.g. a type (the containing main entity type) or value (the property - * value) scope. Currently it seems to make more sense to implement the - * value scope, this will be used as the only scope for now. + * TODO condition scope This class is intended to hold additional information on + * the filter - how and to what to apply it. This could be e.g. a type (the + * containing main entity type) or value (the property value) scope. Currently + * it seems to make more sense to implement the value scope, this will be used + * as the only scope for now. */ /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/EntityDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/EntityDefinition.java index 9f5575ea4d..b5afe161c2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/EntityDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/EntityDefinition.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.align.model; -import java.util.List; - import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.List; /** * Definition of an entity. Represents either a type or a property. @@ -40,9 +39,9 @@ public interface EntityDefinition { public Definition getDefinition(); /** - * Get the type definition that is associated with the entity. This is - * either the type represented by the entity or the topmost parent to the - * property represented by the entity. + * Get the type definition that is associated with the entity. This is either + * the type represented by the entity or the topmost parent to the property + * represented by the entity. * * @return the type definition */ @@ -56,9 +55,8 @@ public interface EntityDefinition { public Filter getFilter(); /** - * Get the property path. Each path item is an instance context name paired - * with a child definition. The default instance context name is - * null. + * Get the property path. Each path item is an instance context name paired with + * a child definition. The default instance context name is null. * * @return the path down to the property represented by the entity, an empty * list if the entity represents a type @@ -66,10 +64,10 @@ public interface EntityDefinition { public List getPropertyPath(); /** - * Get the schema space the entity definition is associated to. The schema - * space itself is no characteristic of the entity, but is needed as - * additional information to differentiate between source and target schema - * entities with the same names. + * Get the schema space the entity definition is associated to. The schema space + * itself is no characteristic of the entity, but is needed as additional + * information to differentiate between source and target schema entities with + * the same names. * * @return the identifier of the entity definition's schema space */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/MutableAlignment.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/MutableAlignment.java index c8e1380c2d..904f240483 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/MutableAlignment.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/MutableAlignment.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.align.model; -import java.net.URI; - import eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction; +import java.net.URI; /** * Mutable {@link Alignment} which is used where changes to the alignment are @@ -31,8 +30,8 @@ public interface MutableAlignment extends Alignment { /** * Add a cell to the alignment. * - * @param cell the cell to add. It should be already configured, especially - * with the cell target. A cell id may be generated for new cells + * @param cell the cell to add. It should be already configured, especially with + * the cell target. A cell id may be generated for new cells */ public void addCell(MutableCell cell); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/ParameterValue.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/ParameterValue.java index 464878daf2..67c43b0632 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/ParameterValue.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/ParameterValue.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.common.align.model; +import eu.esdihumboldt.hale.common.core.io.Value; import net.jcip.annotations.Immutable; - import org.w3c.dom.Element; -import eu.esdihumboldt.hale.common.core.io.Value; - /** * Class to represent the value of a transformation parameter. * @@ -37,8 +35,8 @@ public class ParameterValue extends Value { public static final ParameterValue NULL = new ParameterValue(Value.NULL); /** - * The name of the default type of value. null represents also - * the default type. + * The name of the default type of value. null represents also the + * default type. */ public static final String DEFAULT_TYPE = "default"; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Priority.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Priority.java index 80722d5e7d..3110ea74e4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Priority.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/Priority.java @@ -24,6 +24,7 @@ * @author Andrea Antonello */ public enum Priority { + /** * Highest priority. */ @@ -100,8 +101,8 @@ public String toString() { * * @param priority1 the first priority. * @param priority2 the second priority. - * @return a negative integer, zero, or a positive integer as p1 is less - * than, equal to, or greater than p2. + * @return a negative integer, zero, or a positive integer as p1 is less than, + * equal to, or greater than p2. */ public static int compare(Priority priority1, Priority priority2) { if (priority1.getPriorityNumber() > priority2.getPriorityNumber()) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/TransformationMode.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/TransformationMode.java index 0e272ec2bf..77a1f1356b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/TransformationMode.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/TransformationMode.java @@ -21,6 +21,7 @@ * @author Simon Templer */ public enum TransformationMode { + /** * The cell is active and will initiate transformations. */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/CellLog.groovy b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/CellLog.groovy index 641ab291a4..205e6a61cd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/CellLog.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/CellLog.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.align.model.annotations.messages -import java.nio.charset.StandardCharsets - import de.fhg.igd.slf4jplus.ALogger import de.fhg.igd.slf4jplus.ALoggerFactory import eu.esdihumboldt.hale.common.align.model.Cell @@ -24,6 +22,7 @@ import eu.esdihumboldt.hale.common.core.io.Text import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.core.report.SimpleLog import groovy.transform.CompileStatic +import java.nio.charset.StandardCharsets /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/Comment.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/Comment.java index d7d94de4e4..1e5cda5879 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/Comment.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/Comment.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.common.align.model.annotations.messages; -import java.util.Optional; - -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueProperties; +import java.util.Optional; +import javax.annotation.Nullable; /** * Represents a comment to a message. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/Message.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/Message.java index a5fd5adb67..657aeb5282 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/Message.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/Message.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.hale.common.align.model.annotations.messages; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.core.io.ValueList; +import eu.esdihumboldt.hale.common.core.io.ValueProperties; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; - import javax.annotation.Nullable; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.ValueList; -import eu.esdihumboldt.hale.common.core.io.ValueProperties; - /** * Represents a message. * @@ -237,8 +235,7 @@ public ValueProperties toProperties() { } /** - * Apply from a given {@link Value}, if the value represents a - * {@link Message}. + * Apply from a given {@link Value}, if the value represents a {@link Message}. * * @param value the value to interpret as {@link Message} * @return this for chaining diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/MessageDescriptor.groovy b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/MessageDescriptor.groovy index ce44d376d0..c4962f0e8e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/MessageDescriptor.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/annotations/messages/MessageDescriptor.groovy @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.common.align.model.annotations.messages; -import java.util.function.Consumer - -import javax.xml.parsers.ParserConfigurationException - -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.align.model.AnnotationDescriptor import eu.esdihumboldt.hale.common.core.io.DOMValueUtil import eu.esdihumboldt.hale.common.core.io.HaleIO @@ -29,6 +23,9 @@ import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import eu.esdihumboldt.util.groovy.xml.NSDOMCategory import groovy.transform.CompileStatic +import java.util.function.Consumer +import javax.xml.parsers.ParserConfigurationException +import org.w3c.dom.Element /** * Annotation descriptor for generic messages attached to cells. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/PropertyOrChildrenTypeCondition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/PropertyOrChildrenTypeCondition.java index 203e2e9749..bab5674947 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/PropertyOrChildrenTypeCondition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/PropertyOrChildrenTypeCondition.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.condition; -import java.util.HashSet; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; @@ -33,6 +30,8 @@ import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.HashSet; +import java.util.Set; /** * Property condition wrapping a type condition and applying it to the property @@ -87,8 +86,8 @@ private boolean accept(EntityDefinition entityDef, Set tested) { } // test the children - for (ChildDefinition child : DefinitionUtil.getAllChildren(DefinitionUtil - .getDefinitionGroup(def))) { + for (ChildDefinition child : DefinitionUtil + .getAllChildren(DefinitionUtil.getDefinitionGroup(def))) { EntityDefinition childDef = AlignmentUtil.getChild(entityDef, child.getName()); if (accept(childDef, tested)) { return true; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/PropertyTypeCondition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/PropertyTypeCondition.java index 6f91609d1d..22f8a615bb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/PropertyTypeCondition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/PropertyTypeCondition.java @@ -49,8 +49,8 @@ public PropertyTypeCondition(TypeCondition typeCondition) { @Override public boolean accept(Property entity) { TypeDefinition propertyType = entity.getDefinition().getDefinition().getPropertyType(); - Type type = new DefaultType(new TypeEntityDefinition(propertyType, entity.getDefinition() - .getSchemaSpace(), null)); + Type type = new DefaultType(new TypeEntityDefinition(propertyType, + entity.getDefinition().getSchemaSpace(), null)); return typeCondition.accept(type); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/impl/BindingCondition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/impl/BindingCondition.java index c8a3297f86..e7bbef337d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/impl/BindingCondition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/impl/BindingCondition.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.condition.impl; -import net.jcip.annotations.Immutable; - -import org.springframework.core.convert.ConversionService; - import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.Type; import eu.esdihumboldt.hale.common.align.model.condition.EntityCondition; @@ -30,6 +26,8 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import net.jcip.annotations.Immutable; +import org.springframework.core.convert.ConversionService; /** * Type condition that checks its binding and element type @@ -47,10 +45,10 @@ public class BindingCondition implements TypeCondition { * Create a binding condition * * @param compatibleClass the class the binding should be compatible to - * @param allowConversion specifies if a binding is classified as compatible - * if conversion to the compatible class is possible - * @param allowCollection specifies if a binding is classified as compatible - * if it is a collection of the compatible class + * @param allowConversion specifies if a binding is classified as compatible if + * conversion to the compatible class is possible + * @param allowCollection specifies if a binding is classified as compatible if + * it is a collection of the compatible class */ public BindingCondition(Class compatibleClass, boolean allowConversion, boolean allowCollection) { @@ -101,8 +99,7 @@ public boolean accept(Type entity) { } /** - * Check if the given binding is compatible to the configured compatible - * class + * Check if the given binding is compatible to the configured compatible class * * @param binding the binding * @param to if a value of {@link #compatibleClass} shall be assigned to the @@ -117,8 +114,8 @@ protected boolean isCompatibleClass(Class binding, boolean to) { * Check if the given binding is compatible to the given compatible class * * @param binding the binding - * @param to if a value of the compatible class shall be assigned to the - * binding or vice versa + * @param to if a value of the compatible class shall be assigned to the binding + * or vice versa * @param compatibleClass the compatible class * @param allowConversion if conversion is allowed * @return if the binding is compatible diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/impl/GeometryCondition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/impl/GeometryCondition.java index e5cb579055..450ee29e68 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/impl/GeometryCondition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/condition/impl/GeometryCondition.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.condition.impl; -import java.util.Collection; -import java.util.HashSet; - -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.Type; import eu.esdihumboldt.hale.common.align.model.condition.EntityCondition; @@ -30,6 +25,9 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import java.util.Collection; +import java.util.HashSet; +import org.locationtech.jts.geom.Geometry; /** * Type condition that checks if it's geometry and optionally for certain @@ -57,15 +55,15 @@ public GeometryCondition() { * @param allowConversion if conversion is allowed regarding the geometry * binding check (only applicable if bindings is not * null) - * @param allowCollection if a collection of geometries is allowed regarding - * the geometry binding check (only applicable if bindings is not + * @param allowCollection if a collection of geometries is allowed regarding the + * geometry binding check (only applicable if bindings is not * null) */ public GeometryCondition(Collection> bindings, boolean allowConversion, boolean allowCollection) { super(); - this.bindings = (bindings == null) ? (null) : (new HashSet>( - bindings)); + this.bindings = (bindings == null) ? (null) + : (new HashSet>(bindings)); this.allowConversion = allowConversion; this.allowCollection = allowCollection; } @@ -128,19 +126,19 @@ public boolean accept(Type entity) { * Determine if the given binding is compatible to the compatible class. * * @param binding the geometry binding - * @param to true if the binding is the target, - * false if it is the source + * @param to true if the binding is the target, false + * if it is the source * @param compatibleClass the geometry compatible class requested * @param allowConversion if conversion is allowed - * @return if the binding is classified as compatible to the geometry - * compatible class + * @return if the binding is classified as compatible to the geometry compatible + * class */ private boolean isCompatibleClass(Class binding, boolean to, Class compatibleClass, boolean allowConversion) { if (to && compatibleClass.equals(Geometry.class)) { /* - * Special case: It is not further specified, which type of geometry - * is produced. So we allow any geometry binding. + * Special case: It is not further specified, which type of geometry is + * produced. So we allow any geometry binding. */ return true; } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/AssignFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/AssignFunction.java index 9ccfcbc024..8449858040 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/AssignFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/AssignFunction.java @@ -40,8 +40,7 @@ public interface AssignFunction { public static final String PARAMETER_VALUE = "value"; /** - * Name of the anchor source entity, that may be associated with the - * assignment. + * Name of the anchor source entity, that may be associated with the assignment. */ public static final String ENTITY_ANCHOR = "anchor"; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/ClassificationMappingFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/ClassificationMappingFunction.java index bf7b9a0039..027f411a6d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/ClassificationMappingFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/ClassificationMappingFunction.java @@ -49,8 +49,8 @@ public interface ClassificationMappingFunction { public static final String PARAMETER_NOT_CLASSIFIED_ACTION = "notClassifiedAction"; /** - * Value for PARAMETER_NOT_CLASSIFIED_ACTION specifying that the source - * value should be used. + * Value for PARAMETER_NOT_CLASSIFIED_ACTION specifying that the source value + * should be used. */ public static final String USE_SOURCE_ACTION = "source"; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/ClassificationMappingUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/ClassificationMappingUtil.java index 09c02ce093..74d83fc5ae 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/ClassificationMappingUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/ClassificationMappingUtil.java @@ -15,14 +15,7 @@ package eu.esdihumboldt.hale.common.align.model.functions; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - import com.google.common.collect.Multimap; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.Value; @@ -31,6 +24,11 @@ import eu.esdihumboldt.hale.common.lookup.LookupTable; import eu.esdihumboldt.hale.common.lookup.LookupTableInfo; import eu.esdihumboldt.hale.common.lookup.impl.LookupTableImpl; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; /** * Common utility methods for dealing with the classification mapping function. @@ -60,8 +58,8 @@ public static LookupTable getClassificationLookup(Multimap tmpMap = parameters.get(PARAMETER_LOOKUPTABLE_ID); - LookupTableInfo lookupTableInfo = lookupServiceImpl.getTable(tmpMap.iterator() - .next().as(String.class)); + LookupTableInfo lookupTableInfo = lookupServiceImpl + .getTable(tmpMap.iterator().next().as(String.class)); return lookupTableInfo.getTable(); } } catch (NullPointerException e) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/FormattedStringFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/FormattedStringFunction.java index 4b9d048f45..dd2b6d5f68 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/FormattedStringFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/FormattedStringFunction.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.common.align.model.functions; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - import com.google.common.base.Joiner; - import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; /** * Formatted string function constants. @@ -33,9 +31,8 @@ public interface FormattedStringFunction { /** - * Name of the parameter specifying the pattern for the string format. See - * the function definition in eu.esdihumboldt.hale.common.align - * . + * Name of the parameter specifying the pattern for the string format. See the + * function definition in eu.esdihumboldt.hale.common.align . */ public static final String PARAMETER_PATTERN = "pattern"; @@ -51,8 +48,8 @@ public interface FormattedStringFunction { public static final String ID = "eu.esdihumboldt.hale.align.formattedstring"; /** - * Add a value to the given map of values, with the variable names derived - * from the associated property definition. + * Add a value to the given map of values, with the variable names derived from + * the associated property definition. * * @param values the map associating variable names to values * @param value the value diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/FormattedStringMigrator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/FormattedStringMigrator.java index cf151635eb..6534d6567d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/FormattedStringMigrator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/FormattedStringMigrator.java @@ -15,18 +15,8 @@ package eu.esdihumboldt.hale.common.align.model.functions; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; import eu.esdihumboldt.hale.common.align.migrate.MigrationOptions; import eu.esdihumboldt.hale.common.align.migrate.impl.DefaultCellMigrator; @@ -39,6 +29,14 @@ import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.regex.Pattern; +import java.util.stream.Collectors; /** * Migrator for FormattedString function. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/JoinFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/JoinFunction.java index fc7b83f0c9..0c67d46968 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/JoinFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/JoinFunction.java @@ -29,8 +29,7 @@ public interface JoinFunction { public static final String PARAMETER_JOIN = "join"; /** - * Name of the parameter that specifies if an inner join should be - * performed. + * Name of the parameter that specifies if an inner join should be performed. */ public static final String PARAMETER_INNER_JOIN = "innerJoin"; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/RenameFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/RenameFunction.java index 7dc390368b..67e13140b8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/RenameFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/RenameFunction.java @@ -36,14 +36,14 @@ public interface RenameFunction { /** * Name of the parameter specifying whether for the structural rename, when - * checking for structure equality, the namespaces of properties may be - * ignored. Default value for the parameter is false. + * checking for structure equality, the namespaces of properties may be ignored. + * Default value for the parameter is false. */ public static final String PARAMETER_IGNORE_NAMESPACES = "ignoreNamespaces"; /** - * Name of the parameter specifying whether for the structural rename, - * geometry objects should be copied. Default value for the parameter is + * Name of the parameter specifying whether for the structural rename, geometry + * objects should be copied. Default value for the parameter is * true. */ public static final String PARAMETER_COPY_GEOMETRIES = "copyGeometries"; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/AssignExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/AssignExplanation.java index 5e971f0c36..9462c58afe 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/AssignExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/AssignExplanation.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.align.model.functions.explanations; -import java.util.Locale; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.functions.AssignFunction; import eu.esdihumboldt.hale.common.align.model.impl.mdexpl.MarkdownCellExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.Locale; +import java.util.Map; /** * Explanation for the assign function. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/ClassificationMappingExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/ClassificationMappingExplanation.java index d92744627c..0dd605f09d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/ClassificationMappingExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/ClassificationMappingExplanation.java @@ -16,11 +16,7 @@ package eu.esdihumboldt.hale.common.align.model.functions.explanations; -import java.text.MessageFormat; -import java.util.Locale; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; @@ -30,6 +26,8 @@ import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.lookup.LookupTable; +import java.text.MessageFormat; +import java.util.Locale; /** * Explanation for classification mapping cells. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/CreateExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/CreateExplanation.java index 418ec53f87..e1eb887ecf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/CreateExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/CreateExplanation.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.functions.explanations; -import java.text.MessageFormat; -import java.util.Locale; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; @@ -26,6 +23,8 @@ import eu.esdihumboldt.hale.common.align.model.impl.AbstractCellExplanation; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.Locale; /** * Explanation for the Create function. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/FormattedStringExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/FormattedStringExplanation.java index e70154854e..d99eb88c39 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/FormattedStringExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/FormattedStringExplanation.java @@ -16,18 +16,17 @@ package eu.esdihumboldt.hale.common.align.model.functions.explanations; -import java.text.MessageFormat; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.stream.Collectors; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.functions.FormattedStringFunction; import eu.esdihumboldt.hale.common.align.model.impl.AbstractCellExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; /** * Explanation for formatted string cells. @@ -59,7 +58,7 @@ protected String getExplanation(Cell cell, boolean html, ServiceProvider service Map varToProperty = sources.stream() .collect(Collectors.toMap(entity -> { return '{' + getEntityNameWithoutCondition(entity) + '}'; - } , entity -> { + }, entity -> { return formatEntity(entity, true, false, locale); })); explanation += buildReplacementTable(varToProperty, locale); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/InlineExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/InlineExplanation.java index 2749f70eec..d543534b80 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/InlineExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/InlineExplanation.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.functions.explanations; -import java.text.MessageFormat; -import java.util.Locale; - -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; @@ -30,6 +25,9 @@ import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.text.MessageFormat; +import java.util.Locale; +import javax.annotation.Nullable; /** * Explanation for the inline transformation function. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/JoinExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/JoinExplanation.java index 8eb9189b29..9cead3d841 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/JoinExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/JoinExplanation.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.functions.explanations; -import java.text.MessageFormat; -import java.util.Locale; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; @@ -29,6 +26,8 @@ import eu.esdihumboldt.hale.common.align.model.impl.AbstractCellExplanation; import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.Locale; /** * Explanation for join function cells. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/MergeExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/MergeExplanation.java index 760cfb93dc..9a0c223939 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/MergeExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/explanations/MergeExplanation.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.functions.explanations; -import java.text.MessageFormat; -import java.util.List; -import java.util.Locale; -import java.util.stream.Collectors; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; @@ -28,6 +23,10 @@ import eu.esdihumboldt.hale.common.align.model.functions.MergeFunction; import eu.esdihumboldt.hale.common.align.model.impl.AbstractCellExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.List; +import java.util.Locale; +import java.util.stream.Collectors; /** * Explanation for merge function cells. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinMigrator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinMigrator.java index 5d1cc10562..2dfd09837a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinMigrator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinMigrator.java @@ -15,13 +15,8 @@ package eu.esdihumboldt.hale.common.align.model.functions.join; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; import eu.esdihumboldt.hale.common.align.migrate.MigrationOptions; import eu.esdihumboldt.hale.common.align.migrate.impl.DefaultCellMigrator; @@ -35,6 +30,9 @@ import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; /** * Cell migrator for joins. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameter.java index 0d435923af..a613c61e9f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameter.java @@ -15,6 +15,10 @@ package eu.esdihumboldt.hale.common.align.model.functions.join; +import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; +import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; +import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -22,11 +26,6 @@ import java.util.List; import java.util.Set; -import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; -import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Information for a Join transformation. * @@ -72,11 +71,10 @@ public Set getConditions() { /** * Checks whether this join parameter is valid.
*
- * Valid means, that there has to be at least two types, with each type - * after the first having at least one join condition on previous types. + * Valid means, that there has to be at least two types, with each type after + * the first having at least one join condition on previous types. * - * @return a error description or null if the parameter is - * valid. + * @return a error description or null if the parameter is valid. */ public String validate() { return validate(false); @@ -85,14 +83,13 @@ public String validate() { /** * Checks whether this join parameter is valid.
*
- * Valid means, that there has to be at least two types, with each type - * after the first having at least one join condition on previous types. + * Valid means, that there has to be at least two types, with each type after + * the first having at least one join condition on previous types. * - * @param tryFix if it should be attempted to fix the configuration, the - * user is expected to complete it + * @param tryFix if it should be attempted to fix the configuration, the user is + * expected to complete it * - * @return a error description or null if the parameter is - * valid. + * @return a error description or null if the parameter is valid. */ public String validate(boolean tryFix) { // enough types? @@ -204,9 +201,8 @@ public static class JoinCondition { public final PropertyEntityDefinition joinProperty; /** - * Constructs a join condition to join the type of - * joinProperty if the condition - * joinProperty = baseProperty matches. + * Constructs a join condition to join the type of joinProperty if + * the condition joinProperty = baseProperty matches. * * @param baseProperty the property of a base type * @param joinProperty the property of the type to join diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameterType.groovy b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameterType.groovy index 0e871c92f1..cb01045e30 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameterType.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameterType.groovy @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.common.align.model.functions.join; -import javax.xml.parsers.DocumentBuilderFactory - -import org.w3c.dom.Document -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.align.helper.EntityDefinitionComparator import eu.esdihumboldt.hale.common.align.io.LoadAlignmentContext import eu.esdihumboldt.hale.common.align.io.impl.DOMEntityDefinitionHelper @@ -29,6 +24,9 @@ import eu.esdihumboldt.hale.common.core.io.ComplexValueType import eu.esdihumboldt.hale.common.schema.SchemaSpaceID import eu.esdihumboldt.hale.common.schema.model.TypeIndex import groovy.xml.dom.DOMCategory +import javax.xml.parsers.DocumentBuilderFactory +import org.w3c.dom.Document +import org.w3c.dom.Element /** * Descriptor for conversion between DOM and JoinParameter. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/merge/MergeMigrator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/merge/MergeMigrator.java index 706dfbe129..ee2ece6512 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/merge/MergeMigrator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/merge/MergeMigrator.java @@ -15,16 +15,8 @@ package eu.esdihumboldt.hale.common.align.model.functions.merge; -import java.text.MessageFormat; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigrationNameLookupSupport; import eu.esdihumboldt.hale.common.align.migrate.MigrationOptions; @@ -39,6 +31,11 @@ import eu.esdihumboldt.hale.common.align.model.functions.MergeFunction; import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.text.MessageFormat; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; /** * Cell migrator for Merge. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/merge/MergeUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/merge/MergeUtil.java index 7c76ce88ce..20eeaa0e17 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/merge/MergeUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/functions/merge/MergeUtil.java @@ -15,15 +15,7 @@ package eu.esdihumboldt.hale.common.align.model.functions.merge; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.ChildContext; @@ -38,6 +30,11 @@ import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; /** * Common utilities for getting and setting merge function parameters. @@ -69,8 +66,8 @@ public static List> getProperties(ListMultimap getPropertyPath(Value value) { } /** - * Get the property path for a value representing a property configured as - * Merge function parameter and resolve it to an entity definition. + * Get the property path for a value representing a property configured as Merge + * function parameter and resolve it to an entity definition. * * @param value the value representation of the parameter - * @param parentType the parent type of the property (the type that is - * merged) + * @param parentType the parent type of the property (the type that is merged) * @return the entity definition resolved from the property path * @throws IllegalStateException if the property path cannot be resolved */ @@ -143,16 +139,15 @@ public static ParameterValue toPropertyParameter(List path) { } /** - * Get the {@link PropertyEntityDefinition} paths for all key properties of - * a merge.
+ * Get the {@link PropertyEntityDefinition} paths for all key properties of a + * merge.
*
- * Subproperties are not yet supported to be part of a merge key. - * Therefore, the inner lists will contain only a single property for the - * time being. + * Subproperties are not yet supported to be part of a merge key. Therefore, + * the inner lists will contain only a single property for the time being. * * @param cell Mapping cell of the merge - * @return PropertyEntityDefinition paths for all key - * properties of the merge + * @return PropertyEntityDefinition paths for all key properties of + * the merge */ public static List getKeyPropertyDefinitions(Cell cell) { List result = new ArrayList<>(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/AbstractCellExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/AbstractCellExplanation.java index 05232f648c..2d63a1091e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/AbstractCellExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/AbstractCellExplanation.java @@ -16,6 +16,16 @@ package eu.esdihumboldt.hale.common.align.model.impl; +import com.google.common.base.Joiner; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; +import eu.esdihumboldt.hale.common.align.model.Cell; +import eu.esdihumboldt.hale.common.align.model.CellExplanation; +import eu.esdihumboldt.hale.common.align.model.ChildContext; +import eu.esdihumboldt.hale.common.align.model.Entity; +import eu.esdihumboldt.hale.common.align.model.EntityDefinition; +import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import java.io.IOException; import java.text.MessageFormat; import java.util.ArrayList; @@ -27,24 +37,10 @@ import java.util.ResourceBundle; import java.util.Set; import java.util.stream.Collectors; - import javax.annotation.Nullable; - import org.apache.commons.lang.StringEscapeUtils; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; -import com.google.common.base.Joiner; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.CellExplanation; -import eu.esdihumboldt.hale.common.align.model.ChildContext; -import eu.esdihumboldt.hale.common.align.model.Entity; -import eu.esdihumboldt.hale.common.align.model.EntityDefinition; -import eu.esdihumboldt.hale.common.core.service.ServiceProvider; - /** * Abstract cell explanation implementation. * @@ -68,8 +64,7 @@ public String getExplanationAsHtml(Cell cell, ServiceProvider provider, Locale l * Get the explanation string in the specified format. * * @param cell the cell to create an explanation for - * @param html if the format should be HMTL, otherwise the format is just - * text + * @param html if the format should be HMTL, otherwise the format is just text * @param provider the service provider, if available * @param locale the locale for the explanation, to be matched if content is * available @@ -82,8 +77,7 @@ protected abstract String getExplanation(Cell cell, boolean html, * Format an entity for inclusion in an explanation. * * @param entity the entity, may be null - * @param html if the format should be HMTL, otherwise the format is just - * text + * @param html if the format should be HMTL, otherwise the format is just text * @param indexInFront whether index conditions should be in front of the * property name or behind in brackets * @param locale the locale for the explanation, to be matched if content is @@ -103,8 +97,7 @@ protected String formatEntity(Entity entity, boolean html, boolean indexInFront, * Format an entity for inclusion in an explanation. * * @param entityDef the entity definition, may be null - * @param html if the format should be HMTL, otherwise the format is just - * text + * @param html if the format should be HMTL, otherwise the format is just text * @param indexInFront whether index conditions should be in front of the * property name or behind in brackets * @param locale the locale for the explanation, to be matched if content is @@ -181,8 +174,7 @@ protected boolean hasIndexCondition(Entity entity) { * Quote or otherwise format (in case of HTML) the given text. * * @param text the text, may be null - * @param html if the format should be HMTL, otherwise the format is just - * text + * @param html if the format should be HMTL, otherwise the format is just text * @return the quoted text or null in case of null * input */ @@ -199,8 +191,7 @@ protected String quoteText(String text, boolean html) { * Quote or otherwise format (in case of HTML) the given value. * * @param value the value to quote, may be null - * @param html if the format should be HMTL, otherwise the format is just - * text + * @param html if the format should be HMTL, otherwise the format is just text * @return the quoted text or null in case of null * input */ @@ -214,12 +205,11 @@ protected String quoteValue(Object value, boolean html) { } /** - * Quote or otherwise format (in case of HTML) the given name (e.g. an - * entity or parameter name). + * Quote or otherwise format (in case of HTML) the given name (e.g. an entity or + * parameter name). * * @param name the name to quote, may be null - * @param html if the format should be HMTL, otherwise the format is just - * text + * @param html if the format should be HMTL, otherwise the format is just text * @return the quoted text or null in case of null * input */ @@ -330,13 +320,11 @@ protected Locale getDefaultLocale() { * * @param clazz the clazz the resource resides next to * @param baseName the base name of the resource - * @param suffix the suffix of the resource file, e.g. - * properties + * @param suffix the suffix of the resource file, e.g. properties * @param defaultLocale the default locale to be assumed for an unqualified * resource * @return the set of locales the resource is available for - * @throws IOException if an error occurs trying to determine the resource - * files + * @throws IOException if an error occurs trying to determine the resource files */ public static Set findLocales(final Class clazz, final String baseName, final String suffix, Locale defaultLocale) throws IOException { @@ -425,8 +413,8 @@ else if (i < items.size() - 2) { /** * Build a replacement table (HTML only). * - * @param varToProperty variable expressions mapped to the entities that - * replace them + * @param varToProperty variable expressions mapped to the entities that replace + * them * @param locale the locale * @return the replacement table as string */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/ChildEntityDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/ChildEntityDefinition.java index be25479c22..a4ea57a4a6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/ChildEntityDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/ChildEntityDefinition.java @@ -16,16 +16,15 @@ package eu.esdihumboldt.hale.common.align.model.impl; -import java.util.Collections; -import java.util.List; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collections; +import java.util.List; +import net.jcip.annotations.Immutable; /** * Entity definition for a property or group property diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/DefaultAlignment.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/DefaultAlignment.java index d41590778f..41eb0ef43d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/DefaultAlignment.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/DefaultAlignment.java @@ -16,22 +16,8 @@ package eu.esdihumboldt.hale.common.align.model.impl; -import java.net.URI; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction; @@ -50,6 +36,18 @@ import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.net.URI; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; /** * Default alignment implementation. @@ -118,8 +116,8 @@ public DefaultAlignment(Alignment alignment) { // Since the cells came out of another alignment just pass addCell for (Cell cell : alignment.getCells()) { /* - * But copy the cell as it is not immutable (things like - * transformation mode and priority may change) + * But copy the cell as it is not immutable (things like transformation mode and + * priority may change) */ internalAdd(new DefaultCell(cell)); // XXX is this working properly // for BaseAlignmentCells? @@ -193,8 +191,7 @@ private void internalAdd(Cell cell) { } /** - * Add a cell to the internal indexes, based on the given associated - * entities. + * Add a cell to the internal indexes, based on the given associated entities. * * @param entities the cell entities (usually either source or target) * @param cell the cell to add @@ -349,14 +346,13 @@ && matchesSources(cell.getSource(), sourceTypes)) } /** - * Determines if the given type entity definition of the test cell is - * associated to at least one of the given type entity definitions of a type - * cell. + * Determines if the given type entity definition of the test cell is associated + * to at least one of the given type entity definitions of a type cell. * * @param testCellType type entity definition of the test cell * @param typeCellTypes type entity definitions of a type cell - * @return whether the entity definition is associated to at least one of - * the others + * @return whether the entity definition is associated to at least one of the + * others */ private boolean matchesSources(TypeEntityDefinition testCellType, Iterable typeCellTypes) { @@ -371,8 +367,8 @@ private boolean matchesSources(TypeEntityDefinition testCellType, } /** - * Determines if all of the given entities are associated to at least one of - * the given type entity definitions. + * Determines if all of the given entities are associated to at least one of the + * given type entity definitions. * * @param testCellSources the entities * @param typeCellTypes the type entity definitions @@ -422,14 +418,12 @@ public Collection getTypeCells(Cell queryCell) { if (sources.size() == 1) { /* - * Special case handling when there is exactly one type, - * that in this case also allows to find a Join that only - * uses one of the types. + * Special case handling when there is exactly one type, that in this case also + * allows to find a Join that only uses one of the types. * - * Unclear if this is intended, but the else case does not - * yield any results in such cases, which could be due to - * the implementation of `matchesSources` in that case being - * focused on property relations. + * Unclear if this is intended, but the else case does not yield any results in + * such cases, which could be due to the implementation of `matchesSources` in + * that case being focused on property relations. */ TypeEntityDefinition type = sources.iterator().next(); if (sources.isEmpty() || matchesSources(type, diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/DefaultCell.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/DefaultCell.java index 3c48eb0e85..9574586073 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/DefaultCell.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/DefaultCell.java @@ -16,15 +16,9 @@ package eu.esdihumboldt.hale.common.align.model.impl; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.hale.common.align.extension.annotation.AnnotationExtension; import eu.esdihumboldt.hale.common.align.model.AnnotationDescriptor; import eu.esdihumboldt.hale.common.align.model.Cell; @@ -34,6 +28,10 @@ import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.Priority; import eu.esdihumboldt.hale.common.align.model.TransformationMode; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * Default implementation of an alignment cell diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/MutableCellDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/MutableCellDecorator.java index bafc3bf1f3..b583cb8db7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/MutableCellDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/MutableCellDecorator.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.common.align.model.impl; -import java.util.List; -import java.util.Set; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.MutableCell; import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.Priority; import eu.esdihumboldt.hale.common.align.model.TransformationMode; +import java.util.List; +import java.util.Set; /** * Decorator for {@link MutableCell}s diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/PropertyEntityDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/PropertyEntityDefinition.java index 1b86df33c1..b5702d8ec6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/PropertyEntityDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/PropertyEntityDefinition.java @@ -18,15 +18,14 @@ import static com.google.common.base.Preconditions.checkArgument; -import java.util.List; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.List; +import net.jcip.annotations.Immutable; /** * Entity definition for a property diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/TypeEntityDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/TypeEntityDefinition.java index 18f7bd41b6..a55bc17b07 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/TypeEntityDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/TypeEntityDefinition.java @@ -18,15 +18,14 @@ import static com.google.common.base.Preconditions.checkNotNull; -import java.util.Collections; -import java.util.List; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collections; +import java.util.List; +import net.jcip.annotations.Immutable; /** * Entity definition for a type diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/MarkdownCellExplanation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/MarkdownCellExplanation.java index a648757dc7..7a098a3eb7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/MarkdownCellExplanation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/MarkdownCellExplanation.java @@ -15,22 +15,6 @@ package eu.esdihumboldt.hale.common.align.model.impl.mdexpl; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Optional; -import java.util.ResourceBundle; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.annotation.Nullable; - import com.google.common.collect.ListMultimap; import com.vladsch.flexmark.html.HtmlRenderer; import com.vladsch.flexmark.parser.Parser; @@ -38,7 +22,6 @@ import com.vladsch.flexmark.profile.pegdown.PegdownOptionsAdapter; import com.vladsch.flexmark.util.ast.Document; import com.vladsch.flexmark.util.data.DataHolder; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; @@ -51,6 +34,20 @@ import groovy.text.GStringTemplateEngine; import groovy.text.Template; import groovy.text.TemplateEngine; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.stream.Collectors; +import javax.annotation.Nullable; /** * Markdown based cell explanation. @@ -104,8 +101,8 @@ protected TemplateEngine getEngine() { } /** - * Load an explanation template. The default implementation locates - * localized Markdown files located next to the class. + * Load an explanation template. The default implementation locates localized + * Markdown files located next to the class. * * @param clazz the explanation class * @param locale the locale diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/ParameterBinding.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/ParameterBinding.java index fcfa61e480..f205d92f61 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/ParameterBinding.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/ParameterBinding.java @@ -15,18 +15,17 @@ package eu.esdihumboldt.hale.common.align.model.impl.mdexpl; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; import eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.core.parameter.ParameterValueDescriptor; import groovy.lang.GroovyObjectSupport; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; /** * Parameter binding for cell explanations. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/CellNode.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/CellNode.java index 75f8ae3527..2eeaf20059 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/CellNode.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/CellNode.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree; +import eu.esdihumboldt.hale.common.align.model.Cell; import java.util.List; import java.util.Set; -import eu.esdihumboldt.hale.common.align.model.Cell; - /** * Represents a cell in the transformation tree * @@ -48,8 +47,8 @@ public interface CellNode extends TransformationNode { public List getSources(); /** - * Get the entity names for the given source node. These are the names of - * the cell entities the node is associated to. + * Get the entity names for the given source node. These are the names of the + * cell entities the node is associated to. * * @param source the source node * @return the source names @@ -80,8 +79,8 @@ public interface CellNode extends TransformationNode { public void setValid(boolean valid); /** - * Get the value of the valid annotation. Returns false in any - * case if no validation has been performed yet. + * Get the value of the valid annotation. Returns false in any case + * if no validation has been performed yet. * * @return if the cell node is valid in its configuration for transformation * execution diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/GroupNode.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/GroupNode.java index c7003b8c46..4367c59915 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/GroupNode.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/GroupNode.java @@ -26,8 +26,7 @@ public interface GroupNode extends TransformationNode { /** - * Name of the children annotation. It represents a list of additional - * children. + * Name of the children annotation. It represents a list of additional children. */ public static final String ANNOTATION_CHILDREN = "children"; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/Leftovers.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/Leftovers.java index 88957150e2..0e151ea626 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/Leftovers.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/Leftovers.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.util.Pair; +import java.util.Set; /** * Represents additional values not represented in their own source node or not @@ -30,26 +29,23 @@ public interface Leftovers { /** - * Consume a left over value completely (for all remaining cells). The - * returned source node associated as annotated child to the parent of the - * original source node. + * Consume a left over value completely (for all remaining cells). The returned + * source node associated as annotated child to the parent of the original + * source node. * - * @return the source node created for the value paired with the set of - * cells that have already been consumed for the value, or - * null if there is no value that hasn't been consumed - * completely + * @return the source node created for the value paired with the set of cells + * that have already been consumed for the value, or null + * if there is no value that hasn't been consumed completely */ Pair> consumeValue(); /** - * Consume a left over value regarding the given cell. The returned source - * node associated as annotated child to the parent of the original source - * node. + * Consume a left over value regarding the given cell. The returned source node + * associated as annotated child to the parent of the original source node. * * @param cell the cell - * @return the source node created for the value or null if - * there is no value that is not yet consumed completely or for the - * given cell + * @return the source node created for the value or null if there + * is no value that is not yet consumed completely or for the given cell */ SourceNode consumeValue(Cell cell); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/SourceNode.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/SourceNode.java index 16c3221a28..9db85dacc4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/SourceNode.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/SourceNode.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree; -import java.util.Collection; - import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.align.model.transformation.tree.context.TransformationContext; import eu.esdihumboldt.hale.common.schema.model.Definition; +import java.util.Collection; /** * Represents a source type, group or property @@ -30,26 +29,25 @@ public interface SourceNode extends TransformationNode { /** - * Name of the value defined annotation. It specifies if a value is defined - * for the source node. + * Name of the value defined annotation. It specifies if a value is defined for + * the source node. */ public static final String ANNOTATION_VALUE_DEFINED = "value:defined"; /** - * Name of the value annotation. It specifies a concrete value for the node - * from an instance. + * Name of the value annotation. It specifies a concrete value for the node from + * an instance. */ public static final String ANNOTATION_VALUE = "value"; /** - * Name of the all values annotation. It holds all original values for the - * node from an instance. + * Name of the all values annotation. It holds all original values for the node + * from an instance. */ public static final String ANNOTATION_ALL_VALUES = "all-values"; /** - * Name of the children annotation. It represents a list of additional - * children. + * Name of the children annotation. It represents a list of additional children. */ public static final String ANNOTATION_CHILDREN = "children"; @@ -66,8 +64,7 @@ public interface SourceNode extends TransformationNode { public static final String ANNOTATION_RELATIONS = "relations"; /** - * Name of the parent annotation. It represents a parent of a type source - * node. + * Name of the parent annotation. It represents a parent of a type source node. */ public static final String ANNOTATION_PARENT = "parent"; @@ -100,8 +97,8 @@ public interface SourceNode extends TransformationNode { public void addChild(SourceNode child); /** - * Add a child node as annotation. This means resetting the node will remove - * the child. + * Add a child node as annotation. This means resetting the node will remove the + * child. * * @param child the child node to add */ @@ -130,16 +127,16 @@ public interface SourceNode extends TransformationNode { public TransformationContext getContext(); /** - * Set the left over values associated to the node's entity, but not - * represented by the node. + * Set the left over values associated to the node's entity, but not represented + * by the node. * * @param leftovers the leftovers */ public void setLeftovers(Leftovers leftovers); /** - * Get the left over values associated to the node's entity, but not - * represented by the node. + * Get the left over values associated to the node's entity, but not represented + * by the node. * * @return the leftovers, may be null */ @@ -149,8 +146,8 @@ public interface SourceNode extends TransformationNode { * Get if the source node value is defined. * * @see #ANNOTATION_VALUE_DEFINED - * @return the value of the defined annotation, or false if it - * is not set + * @return the value of the defined annotation, or false if it is + * not set */ public boolean isDefined(); @@ -166,15 +163,14 @@ public interface SourceNode extends TransformationNode { * Get the value of the node in the context of a specific source instance. * * @see #ANNOTATION_VALUE - * @return the property value associated to the node, may be - * null + * @return the property value associated to the node, may be null */ public Object getValue(); /** - * Set the value of the value annotation. When setting a value the value of - * the defined annotation is set to true. Will also set the all - * values annotation if it is not set yet. + * Set the value of the value annotation. When setting a value the value of the + * defined annotation is set to true. Will also set the all values + * annotation if it is not set yet. * * @see #ANNOTATION_VALUE * @see #ANNOTATION_VALUE_DEFINED @@ -197,8 +193,7 @@ public interface SourceNode extends TransformationNode { * Get all values of the node in the context of a specific source instance. * * @see #ANNOTATION_ALL_VALUES - * @return the property values associated to the node, may be - * null + * @return the property values associated to the node, may be null */ public Object[] getAllValues(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TargetNode.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TargetNode.java index ee813fa275..48a4ac8bf0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TargetNode.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TargetNode.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; +import java.util.Set; /** * Target group or property @@ -29,14 +28,14 @@ public interface TargetNode extends GroupNode { /** - * Name of the value defined annotation. It specifies if a value is defined - * for the source node. + * Name of the value defined annotation. It specifies if a value is defined for + * the source node. */ public static final String ANNOTATION_RESULT_DEFINED = "result:defined"; /** - * Name of the value annotation. It specifies a concrete value for the node - * from an instance. + * Name of the value annotation. It specifies a concrete value for the node from + * an instance. */ public static final String ANNOTATION_RESULT = "result"; @@ -62,8 +61,8 @@ public interface TargetNode extends GroupNode { public EntityDefinition getEntityDefinition(); /** - * Get the assignment names for the given cell. These are the names of the - * cell entities the node is associated to. + * Get the assignment names for the given cell. These are the names of the cell + * entities the node is associated to. * * @param assignment the assigned cell * @return the assignment names @@ -74,8 +73,8 @@ public interface TargetNode extends GroupNode { * Get if the node result is defined. * * @see #ANNOTATION_RESULT_DEFINED - * @return the value of the result defined annotation, or false - * if it is not set + * @return the value of the result defined annotation, or false if + * it is not set */ public boolean isDefined(); @@ -92,14 +91,13 @@ public interface TargetNode extends GroupNode { * transformation. * * @see #ANNOTATION_RESULT - * @return the property value associated to the node, may be - * null + * @return the property value associated to the node, may be null */ public Object getResult(); /** - * Set the value of the result annotation. When setting a result the value - * of the result defined annotation is set to true. + * Set the value of the result annotation. When setting a result the value of + * the result defined annotation is set to true. * * @see #ANNOTATION_RESULT * @see #ANNOTATION_RESULT_DEFINED diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationNodeVisitor.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationNodeVisitor.java index e4393c7b1d..a65bbc26e8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationNodeVisitor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationNodeVisitor.java @@ -27,8 +27,7 @@ public interface TransformationNodeVisitor { * Visit a transformation tree root. * * @param root the transformation tree root - * @return if the visitor is to be applied to any further nodes down the - * path + * @return if the visitor is to be applied to any further nodes down the path */ public boolean visit(TransformationTree root); @@ -43,8 +42,7 @@ public interface TransformationNodeVisitor { * Visit a target node. * * @param target the target node - * @return if the visitor is to be applied to any further nodes down the - * path + * @return if the visitor is to be applied to any further nodes down the path */ public boolean visit(TargetNode target); @@ -59,8 +57,7 @@ public interface TransformationNodeVisitor { * Visit a cell node. * * @param cell the cell node - * @return if the visitor is to be applied to any further nodes down the - * path + * @return if the visitor is to be applied to any further nodes down the path */ public boolean visit(CellNode cell); @@ -75,8 +72,7 @@ public interface TransformationNodeVisitor { * Visit a source node. * * @param source the source node - * @return if the visitor is to be applied to any further nodes down the - * path + * @return if the visitor is to be applied to any further nodes down the path */ public boolean visit(SourceNode source); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationTree.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationTree.java index 3a180a8177..b0b3973629 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationTree.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationTree.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree; -import java.util.Collection; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collection; /** * Represents the root in a transformation tree. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationTreeUtil.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationTreeUtil.java index 168a10190d..782c2c2ea9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationTreeUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/TransformationTreeUtil.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionUtil; import eu.esdihumboldt.hale.common.align.extension.function.PropertyFunctionDefinition; import eu.esdihumboldt.hale.common.align.extension.function.PropertyParameterDefinition; @@ -28,6 +24,9 @@ import eu.esdihumboldt.hale.common.align.transformation.report.impl.TransformationMessageImpl; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.util.IdentityWrapper; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; /** * Transformation tree utilities. @@ -71,8 +70,7 @@ public static Object extractObject(Object node) { * @param source the source node * @param log the transformation log, may be null * @param serviceProvider the service provider - * @return if the cell has eager source parameters connected to the source - * node + * @return if the cell has eager source parameters connected to the source node */ public static boolean isEager(Cell cell, SourceNode source, TransformationLog log, ServiceProvider serviceProvider) { @@ -96,16 +94,16 @@ public static boolean isEager(Cell cell, SourceNode source, TransformationLog lo * @param source the source node * @param log the transformation log, may be null * @param serviceProvider the service provider - * @return if the cell contained in the cell node has eager source - * parameters connected to the source node + * @return if the cell contained in the cell node has eager source parameters + * connected to the source node */ public static boolean isEager(CellNode cell, SourceNode source, TransformationLog log, ServiceProvider serviceProvider) { // get all entity names the cell is associated to the source node with Set names = cell.getSourceNames(source); - PropertyFunctionDefinition function = FunctionUtil.getPropertyFunction(cell.getCell() - .getTransformationIdentifier(), serviceProvider); + PropertyFunctionDefinition function = FunctionUtil + .getPropertyFunction(cell.getCell().getTransformationIdentifier(), serviceProvider); if (function != null) { Set defSources = function.getSource(); Set eager = new HashSet(); @@ -120,8 +118,7 @@ public static boolean isEager(CellNode cell, SourceNode source, TransformationLo // if any connection is eager we cannot duplicate the cell if (log != null && eager.size() != names.size()) { - log.warn(new TransformationMessageImpl( - cell.getCell(), + log.warn(new TransformationMessageImpl(cell.getCell(), "Source node with a mix of eager and non-eager connections to a cell, treating as eager.", null)); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/TransformationContext.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/TransformationContext.java index 9e01293f44..6d720bb443 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/TransformationContext.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/TransformationContext.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.context; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.transformation.tree.SourceNode; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; +import java.util.Set; /** * Duplicates a context sub-tree in a transformation tree. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/IdentityHashMultimap.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/IdentityHashMultimap.java index b125be4cbf..ebdba57335 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/IdentityHashMultimap.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/IdentityHashMultimap.java @@ -15,6 +15,8 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.context.impl; +import com.google.common.collect.Multimap; +import com.google.common.collect.Multiset; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -23,9 +25,6 @@ import java.util.Map.Entry; import java.util.Set; -import com.google.common.collect.Multimap; -import com.google.common.collect.Multiset; - /** * Experimental implementation of a multimap where values are stored in an * identity based set/map. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/TargetContext.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/TargetContext.java index fec3662f07..2b0f5597c9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/TargetContext.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/TargetContext.java @@ -16,18 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.context.impl; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Deque; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.collect.ArrayListMultimap; @@ -35,7 +23,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Multimap; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; @@ -55,6 +42,17 @@ import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.util.IdentityWrapper; import eu.esdihumboldt.util.Pair; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * Transformation context that duplicates subgraphs leading to certain target @@ -99,8 +97,8 @@ public DuplicationContext(Set ignoreCells) { * Get the cell node associated to the given cell. * * @param cell the cell - * @return the cell node or null if none has yet been - * associated to the cell + * @return the cell node or null if none has yet been associated to + * the cell */ public CellNodeImpl getNode(Cell cell) { return cellNodes.get(cell); @@ -110,8 +108,8 @@ public CellNodeImpl getNode(Cell cell) { * Add a node to the duplication context. * * @param cellNode the cell node to add to the duplication context - * @param originalCell the original cell node where the cell node was - * duplicated from + * @param originalCell the original cell node where the cell node was duplicated + * from */ public void addNode(CellNodeImpl cellNode, CellNode originalCell) { cellNodes.put(cellNode.getCell(), cellNode); @@ -122,8 +120,8 @@ public void addNode(CellNodeImpl cellNode, CellNode originalCell) { * Get the target node associated to the given entity. * * @param entity the entity - * @return the target node or null if none has yet been - * associated to the entity + * @return the target node or null if none has yet been associated + * to the entity */ public TargetNodeImpl getNode(EntityDefinition entity) { return targetNodes.get(entity); @@ -133,8 +131,8 @@ public TargetNodeImpl getNode(EntityDefinition entity) { * Add a node to the duplication context. * * @param targetNode the target node to add to the duplication context - * @param originalTarget the original target node where the target node - * was duplicated from + * @param originalTarget the original target node where the target node was + * duplicated from */ public void addNode(TargetNodeImpl targetNode, TargetNode originalTarget) { targetNodes.put(targetNode.getEntityDefinition(), targetNode); @@ -153,8 +151,8 @@ public Set getIgnoreCells() { /** * Get cell nodes that have incomplete sources compared to the original. * - * @return the incomplete cell node paired with the original cell node - * it was duplicated from + * @return the incomplete cell node paired with the original cell node it was + * duplicated from */ public Collection> getIncompleteCellNodes() { return Collections2.filter(cellNodePairs, @@ -171,11 +169,11 @@ public boolean apply(Pair input) { } /** - * Get target nodes that have incomplete children or assignments - * compared to the original. + * Get target nodes that have incomplete children or assignments compared to the + * original. * - * @return the incomplete target node paired with the original target - * node it was duplicated from + * @return the incomplete target node paired with the original target node it + * was duplicated from */ public Collection> getIncompleteTargetNodes() { return new ArrayList>(Collections2 @@ -254,8 +252,7 @@ public SourceNode getDuplicatedNode() { * Checks whether the given cell is in the ignored cells. * * @param cell the cell to check - * @return true, if the given cell is in the ignored cells, false - * otherwise + * @return true, if the given cell is in the ignored cells, false otherwise */ boolean isIgnoreCell(Cell cell) { return ignoreCells.contains(cell); @@ -315,8 +312,8 @@ void addNewCellNode(Cell cell, CellNodeImpl cellNode) { * Returns a collection of existing cell nodes with the given cell. * * @param cell the cell - * @return a collection of existing cell nodes, the collection uses the - * objects identity instead of equals + * @return a collection of existing cell nodes, the collection uses the objects + * identity instead of equals */ Collection> getOldCellNodes(Cell cell) { return oldCellNodes.get(cell); @@ -337,16 +334,16 @@ CellNodeImpl getNewCellNode(Cell cell) { * definition. * * @param entityDef the entity definition - * @return a collection of existing source nodes, the collection uses - * the objects identity instead of equals + * @return a collection of existing source nodes, the collection uses the + * objects identity instead of equals */ Collection getOldSourceNodes(EntityDefinition entityDef) { return oldSourceNodes.get(entityDef); } /** - * Returns all target nodes of the given definition. First newly - * created, then existing ones. + * Returns all target nodes of the given definition. First newly created, then + * existing ones. * * @param entityDef the entity definition * @return existing target nodes @@ -373,8 +370,8 @@ public TargetNode apply(IdentityWrapper input) { * Returns existing target nodes of the given definition. * * @param entityDef the entity definition - * @return existing target nodes, the collection uses the objects - * identity instead of equals + * @return existing target nodes, the collection uses the objects identity + * instead of equals */ Collection> getOldTargetNodes(EntityDefinition entityDef) { return oldTargetNodes.get(entityDef); @@ -394,8 +391,8 @@ public Set getContextTargets() { private final ServiceProvider serviceProvider; /** - * Create a transformation context that duplicates subgraphs leading to - * given target nodes. + * Create a transformation context that duplicates subgraphs leading to given + * target nodes. * * @param serviceProvider the service provider */ @@ -600,14 +597,14 @@ private static void augmentCell(CellNode cell, CellNodeImpl duplicatedCell, // an existing fitting source node! Collection possibleSources = info .getOldSourceNodes(source.getEntityDefinition()); - // Only add the node here if there is exactly one - // possible - // source. - // For zero there is nothing to add, for more they are - // duplicates - // which should add themselves to this cell when they - // are - // handled. + // Only add the node here if there is exactly one + // possible + // source. + // For zero there is nothing to add, for more they are + // duplicates + // which should add themselves to this cell when they + // are + // handled. // False? // In case of zero there may be something to add, not duplicated @@ -1049,8 +1046,8 @@ public boolean visit(SourceNode source) { * @param addToParent if the new source node should be added as child to the * parent * @param duplicationContext the duplication context - * @return the new duplicated source node or null if - * duplication was prohibited + * @return the new duplicated source node or null if duplication + * was prohibited */ private SourceNode duplicateSource(SourceNode source, SourceNode parent, boolean addToParent, DuplicationContext duplicationContext) { @@ -1069,10 +1066,10 @@ private SourceNode duplicateSource(SourceNode source, SourceNode parent, boolean * @param duplicate the duplicated source node * @param parent the parent for the duplicated source node * @param duplicationContext the duplication context - * @param addToParent if the duplicated source node should be added as child - * to its parent - * @return the duplicated source node or null if it has no - * further connections + * @param addToParent if the duplicated source node should be added as child to + * its parent + * @return the duplicated source node or null if it has no further + * connections */ private SourceNode configureSourceDuplicate(SourceNode originalSource, SourceNode duplicate, SourceNode parent, DuplicationContext duplicationContext, boolean addToParent) { @@ -1136,9 +1133,9 @@ private SourceNode configureSourceDuplicate(SourceNode originalSource, SourceNod * Get the duplicated cell node. * * @param relation the original cell node - * @param duplicateSource the duplicated source node to be associated with - * the duplicated cell node, may be null if the cell - * is an augmentation + * @param duplicateSource the duplicated source node to be associated with the + * duplicated cell node, may be null if the cell is an + * augmentation * @param duplicationContext the context of the current duplication process * @return the duplicated cell node or null if duplication was * prohibited @@ -1198,8 +1195,8 @@ private CellNode duplicateCell(CellNode relation, SourceNode duplicateSource, * @param target the original target node * @param relation the relation to associated to the target node * @param duplicationContext the duplication context - * @return the duplicated target node or null if duplication - * was prohibited + * @return the duplicated target node or null if duplication was + * prohibited */ private TargetNode duplicateTarget(TargetNode target, CellNode relation, DuplicationContext duplicationContext) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/matcher/AsDeepAsPossible.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/matcher/AsDeepAsPossible.java index 514a89f73a..368b8be409 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/matcher/AsDeepAsPossible.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/context/impl/matcher/AsDeepAsPossible.java @@ -16,8 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.context.impl.matcher; -import java.util.Stack; - import eu.esdihumboldt.hale.common.align.model.transformation.tree.SourceNode; import eu.esdihumboldt.hale.common.align.model.transformation.tree.TargetNode; import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationNodeVisitor; @@ -30,6 +28,7 @@ import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; import eu.esdihumboldt.hale.common.schema.model.constraint.property.Cardinality; +import java.util.Stack; /** * Simple context matching strategy that looks for connected @@ -85,8 +84,8 @@ else if (context instanceof TargetContext) { } /** - * Determines if a target node is a candidate for a context match. For - * this the cardinality of the corresponding definition is checked. + * Determines if a target node is a candidate for a context match. For this the + * cardinality of the corresponding definition is checked. * * @param target the target node to check * @return if the target node is a candidate for a context match diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/AbstractGroupNode.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/AbstractGroupNode.java index 1bf3e1e207..7f2962222b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/AbstractGroupNode.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/AbstractGroupNode.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.impl; +import eu.esdihumboldt.hale.common.align.model.transformation.tree.GroupNode; +import eu.esdihumboldt.hale.common.align.model.transformation.tree.TargetNode; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import eu.esdihumboldt.hale.common.align.model.transformation.tree.GroupNode; -import eu.esdihumboldt.hale.common.align.model.transformation.tree.TargetNode; - /** * Abstract group node implementation. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/AbstractTransformationNode.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/AbstractTransformationNode.java index 435a6521af..1fbf0aef4b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/AbstractTransformationNode.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/AbstractTransformationNode.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.impl; +import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationNode; import java.util.HashMap; import java.util.Map; -import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationNode; - /** * Abstract transformation node implementation. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/CellNodeImpl.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/CellNodeImpl.java index be9985cd32..f495fba5df 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/CellNodeImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/CellNodeImpl.java @@ -16,19 +16,9 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.impl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Set; - -import net.jcip.annotations.Immutable; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.transformation.tree.CellNode; @@ -36,6 +26,13 @@ import eu.esdihumboldt.hale.common.align.model.transformation.tree.TargetNode; import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationNode; import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationNodeVisitor; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Set; +import net.jcip.annotations.Immutable; /** * Default {@link CellNode} implementation diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/LeftoversImpl.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/LeftoversImpl.java index dd12ec86e4..477201113b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/LeftoversImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/LeftoversImpl.java @@ -16,17 +16,16 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.impl; +import eu.esdihumboldt.hale.common.align.model.Cell; +import eu.esdihumboldt.hale.common.align.model.transformation.tree.Leftovers; +import eu.esdihumboldt.hale.common.align.model.transformation.tree.SourceNode; +import eu.esdihumboldt.util.Pair; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.transformation.tree.Leftovers; -import eu.esdihumboldt.hale.common.align.model.transformation.tree.SourceNode; -import eu.esdihumboldt.util.Pair; - /** * Default {@link Leftovers} implementation. * @@ -35,9 +34,9 @@ public class LeftoversImpl implements Leftovers { /** - * Pairs source nodes for left over values with the cells it has been - * consumed for. If the cell set is null this means a leftover - * has been consumed completely. + * Pairs source nodes for left over values with the cells it has been consumed + * for. If the cell set is null this means a leftover has been + * consumed completely. */ private final List>> values = new ArrayList>>(); @@ -97,8 +96,8 @@ public Pair> consumeValue() { } private Pair> unmodifiablePair(Pair> pair) { - return new Pair>(pair.getFirst(), Collections.unmodifiableSet(pair - .getSecond())); + return new Pair>(pair.getFirst(), + Collections.unmodifiableSet(pair.getSecond())); } /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/SourceNodeFactory.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/SourceNodeFactory.java index 7f557be131..ae82f62bf3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/SourceNodeFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/SourceNodeFactory.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.impl; -import java.util.HashMap; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.align.model.transformation.tree.SourceNode; +import java.util.HashMap; +import java.util.Map; /** * Factory for creating {@link SourceNode}s. @@ -33,11 +32,11 @@ public class SourceNodeFactory { /** * Get or create source node for the given entity definition. Source nodes - * created from this factory are ensured to exist only once for the same - * entity definition. + * created from this factory are ensured to exist only once for the same entity + * definition. * - * @param entityDefinition the entity definition the source node is - * associated to + * @param entityDefinition the entity definition the source node is associated + * to * @return the source node */ public SourceNode getSourceNode(EntityDefinition entityDefinition) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/SourceNodeImpl.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/SourceNodeImpl.java index fbcd9714d5..818fad8832 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/SourceNodeImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/SourceNodeImpl.java @@ -16,13 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.align.model.transformation.tree.CellNode; @@ -32,6 +25,12 @@ import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationNodeVisitor; import eu.esdihumboldt.hale.common.align.model.transformation.tree.context.TransformationContext; import eu.esdihumboldt.hale.common.schema.model.Definition; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * Default {@link SourceNode} implementation @@ -177,7 +176,8 @@ public void accept(TransformationNodeVisitor visitor) { } // visit annotated children if (visitor.includeAnnotatedNodes() && getAnnotation(ANNOTATION_CHILDREN) != null) { - for (SourceNode child : (Iterable) getAnnotation(ANNOTATION_CHILDREN)) { + for (SourceNode child : (Iterable) getAnnotation( + ANNOTATION_CHILDREN)) { child.accept(visitor); } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/TargetNodeImpl.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/TargetNodeImpl.java index 498a45fc30..1503fe0997 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/TargetNodeImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/TargetNodeImpl.java @@ -16,21 +16,11 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map.Entry; -import java.util.Set; - -import net.jcip.annotations.Immutable; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.HashMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; import com.google.common.collect.SetMultimap; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.Entity; @@ -43,6 +33,13 @@ import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationTree; import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map.Entry; +import java.util.Set; +import net.jcip.annotations.Immutable; /** * Default {@link TargetNode} implementation @@ -131,9 +128,9 @@ public TargetNodeImpl(EntityDefinition entity, GroupNode parent) { } /** - * Add an assignment to the target node. May only be called if the target - * node was created using the - * {@link #TargetNodeImpl(EntityDefinition, GroupNode)} constructor. + * Add an assignment to the target node. May only be called if the target node + * was created using the {@link #TargetNodeImpl(EntityDefinition, GroupNode)} + * constructor. * * @param names the entity names associated to the assignment * @param cell the cell node representing the assignment diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/TransformationTreeImpl.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/TransformationTreeImpl.java index e7d362816d..e96958f30b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/TransformationTreeImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/impl/TransformationTreeImpl.java @@ -16,17 +16,8 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map.Entry; - -import net.jcip.annotations.Immutable; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.Cell; @@ -43,6 +34,12 @@ import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationNodeVisitor; import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationTree; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map.Entry; +import net.jcip.annotations.Immutable; /** * Default {@link TransformationTree} implementation @@ -105,15 +102,16 @@ public TransformationTreeImpl(Alignment alignment, Cell typeCell) { } /** - * Get the property cells relevant for the transformation tree from the - * given alignment. The default implementation returns all property cells - * related to the type cell. + * Get the property cells relevant for the transformation tree from the given + * alignment. The default implementation returns all property cells related to + * the type cell. * * @param alignment the alignment * @param typeCell the type cell type * @return the property cells */ - protected Collection getRelevantPropertyCells(Alignment alignment, Cell typeCell) { + protected Collection getRelevantPropertyCells(Alignment alignment, + Cell typeCell) { return alignment.getPropertyCells(typeCell); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/CellNodeValidator.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/CellNodeValidator.java index d958b67fe7..8f5d40ff6e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/CellNodeValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/CellNodeValidator.java @@ -16,11 +16,8 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.visitor; -import java.util.Map.Entry; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; @@ -36,6 +33,7 @@ import eu.esdihumboldt.hale.common.align.transformation.report.impl.TransformationMessageImpl; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.util.Pair; +import java.util.Map.Entry; /** * Visitor that validates cell nodes. The tree should have already been diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/DuplicationVisitor.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/DuplicationVisitor.java index e8413ea0a6..6fd678f57a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/DuplicationVisitor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/DuplicationVisitor.java @@ -16,8 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.visitor; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.transformation.tree.CellNode; import eu.esdihumboldt.hale.common.align.model.transformation.tree.Leftovers; @@ -29,6 +27,7 @@ import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.util.Pair; +import java.util.Set; /** * DuplicationVisitor visits source nodes to duplicate the transformation tree @@ -81,7 +80,8 @@ public boolean visit(SourceNode source) { Pair> leftover; // completely consume leftovers while ((leftover = leftovers.consumeValue()) != null) { - context.duplicateContext(source, leftover.getFirst(), leftover.getSecond(), log); + context.duplicateContext(source, leftover.getFirst(), leftover.getSecond(), + log); // XXX is this the place where this should be propagated to // the duplicated source children? // XXX trying it out @@ -89,8 +89,8 @@ public boolean visit(SourceNode source) { Object value = node.getValue(); if (value instanceof Group) { InstanceVisitor instanceVisitor = new InstanceVisitor(null, null, log); - for (SourceNode child : node.getChildren(instanceVisitor - .includeAnnotatedNodes())) { + for (SourceNode child : node + .getChildren(instanceVisitor.includeAnnotatedNodes())) { // annotate children with leftovers child.accept(instanceVisitor); // run the duplication on the children @@ -115,8 +115,8 @@ public boolean includeAnnotatedNodes() { } /** - * Duplicates assignments without connections to source nodes. Should be - * called after all duplication is done. + * Duplicates assignments without connections to source nodes. Should be called + * after all duplication is done. */ public void doAugmentationTrackback() { TargetContext.augmentationTrackback(tree); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/InstanceVisitor.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/InstanceVisitor.java index 837be90bee..8f02574c4f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/InstanceVisitor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/InstanceVisitor.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.visitor; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.Condition; @@ -39,6 +35,9 @@ import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; /** * Visitor that annotates a transformation tree with the values of properties in @@ -94,10 +93,9 @@ public boolean visit(SourceNode source) { // instance does not match filter, don't descend further return false; /* - * XXX What about merged instances? Will this be OK for - * those? A type filter should only apply to the original - * instance if it is merged - but most filters should - * evaluate the same + * XXX What about merged instances? Will this be OK for those? A type filter + * should only apply to the original instance if it is merged - but most filters + * should evaluate the same */ } else { @@ -109,12 +107,10 @@ public boolean visit(SourceNode source) { if (candidateNodes.isEmpty()) { /* - * No node found - but this may be because no - * property of the type is mapped, but there still - * might be child instances (in a Join) that have - * types with associated relations. To prevent those - * being skipped we add an artificial node - * representing the instance. + * No node found - but this may be because no property of the type is + * mapped, but there still might be child instances (in a Join) that + * have types with associated relations. To prevent those being skipped + * we add an artificial node representing the instance. */ candidateNodes = new ArrayList<>(); EntityDefinition entityDef = new TypeEntityDefinition( @@ -148,15 +144,12 @@ public boolean visit(SourceNode source) { } else { /* - * Not sure what this really means if we - * get here. + * Not sure what this really means if we get here. * - * Best guess: Probably that we weren't - * able to determine how the duplication - * of this source can be propagted to - * the target. Thus the duplicated node - * will probably not have any - * connection. + * Best guess: Probably that we weren't able to determine + * how the duplication of this source can be propagted to + * the target. Thus the duplicated node will probably not + * have any connection. */ log.warn(log.createMessage( "No transformation context for duplicated node of source " diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/TreeToGraphVisitor.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/TreeToGraphVisitor.java index 0b4df23df5..535a13ba57 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/TreeToGraphVisitor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/model/transformation/tree/visitor/TreeToGraphVisitor.java @@ -16,15 +16,8 @@ package eu.esdihumboldt.hale.common.align.model.transformation.tree.visitor; -import java.util.Deque; -import java.util.LinkedList; -import java.util.Set; - -import javax.annotation.Nullable; - import com.google.common.collect.HashMultimap; import com.google.common.collect.SetMultimap; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; import eu.esdihumboldt.hale.common.align.model.transformation.tree.CellNode; import eu.esdihumboldt.hale.common.align.model.transformation.tree.SourceNode; @@ -34,6 +27,10 @@ import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationTree; import eu.esdihumboldt.hale.common.align.service.FunctionService; import eu.esdihumboldt.util.CustomIdentifiers; +import java.util.Deque; +import java.util.LinkedList; +import java.util.Set; +import javax.annotation.Nullable; /** * {@link TransformationTree} Visitor for generating parameters to create a diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/FunctionService.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/FunctionService.java index f433fdb505..a8340deadc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/FunctionService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/FunctionService.java @@ -15,13 +15,11 @@ package eu.esdihumboldt.hale.common.align.service; -import java.util.Collection; - -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; import eu.esdihumboldt.hale.common.align.extension.function.PropertyFunctionDefinition; import eu.esdihumboldt.hale.common.align.extension.function.TypeFunctionDefinition; +import java.util.Collection; +import javax.annotation.Nullable; /** * Interface for service resolving functions definitions. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/TransformationFunctionService.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/TransformationFunctionService.java index 1de8915d6c..f40fda5893 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/TransformationFunctionService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/TransformationFunctionService.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.align.service; -import java.util.List; - import eu.esdihumboldt.hale.common.align.extension.transformation.PropertyTransformationFactory; import eu.esdihumboldt.hale.common.align.extension.transformation.TypeTransformationFactory; +import java.util.List; /** * Service for resolving transformation functions. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AbstractDefaultFunctionService.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AbstractDefaultFunctionService.java index 89382af082..3d7653b1c8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AbstractDefaultFunctionService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AbstractDefaultFunctionService.java @@ -15,15 +15,7 @@ package eu.esdihumboldt.hale.common.align.service.impl; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.Set; - import com.google.common.base.Objects; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; import eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition; import eu.esdihumboldt.hale.common.align.extension.function.PropertyFunctionDefinition; @@ -33,6 +25,12 @@ import eu.esdihumboldt.hale.common.align.migrate.CellMigrator; import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.model.CellExplanation; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.Set; /** * Function service that includes dynamic content in addition to the statically diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AbstractDefaultTransformationFunctionService.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AbstractDefaultTransformationFunctionService.java index fb5cbf023f..2fbbadb7cf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AbstractDefaultTransformationFunctionService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AbstractDefaultTransformationFunctionService.java @@ -15,16 +15,15 @@ package eu.esdihumboldt.hale.common.align.service.impl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - import de.fhg.igd.eclipse.util.extension.AbstractObjectFactory; import eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction; import eu.esdihumboldt.hale.common.align.extension.transformation.PropertyTransformationFactory; import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyTransformation; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; /** * Transformation function service that includes dynamic content in addition to @@ -32,18 +31,17 @@ * * @author Simon Templer */ -public abstract class AbstractDefaultTransformationFunctionService extends - StaticTransformationFunctionService implements CustomFunctionIdentifiers { +public abstract class AbstractDefaultTransformationFunctionService + extends StaticTransformationFunctionService implements CustomFunctionIdentifiers { - private static class CustomPropertyFunctionFactory extends - AbstractObjectFactory> implements - PropertyTransformationFactory { + private static class CustomPropertyFunctionFactory + extends AbstractObjectFactory> + implements PropertyTransformationFactory { private final CustomPropertyFunction customFunction; /** - * Create a transformation function factory for the given custom - * function. + * Create a transformation function factory for the given custom function. * * @param customFunction the custom function */ @@ -100,8 +98,8 @@ public String getTypeName() { @Override public List getPropertyTransformations(String functionId) { - List functions = super - .getPropertyTransformations(functionId); + List functions = super.getPropertyTransformations( + functionId); Alignment al = getCurrentAlignment(); if (al != null) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AlignmentTransformationFunctionService.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AlignmentTransformationFunctionService.java index 9fb0b50707..9ba0c24d0f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AlignmentTransformationFunctionService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/AlignmentTransformationFunctionService.java @@ -22,8 +22,8 @@ * * @author Simon Templer */ -public class AlignmentTransformationFunctionService extends - AbstractDefaultTransformationFunctionService { +public class AlignmentTransformationFunctionService + extends AbstractDefaultTransformationFunctionService { private final Alignment alignment; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/StaticFunctionService.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/StaticFunctionService.java index de0fac211f..0eb25ec331 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/StaticFunctionService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/StaticFunctionService.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.align.service.impl; -import java.util.Collection; - import eu.esdihumboldt.hale.common.align.extension.function.AbstractFunction; import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; import eu.esdihumboldt.hale.common.align.extension.function.PropertyFunctionDefinition; @@ -24,6 +22,7 @@ import eu.esdihumboldt.hale.common.align.extension.function.TypeFunctionDefinition; import eu.esdihumboldt.hale.common.align.extension.function.TypeFunctionExtension; import eu.esdihumboldt.hale.common.align.service.FunctionService; +import java.util.Collection; /** * Function service implementation using only statically defined functions. @@ -71,7 +70,8 @@ public Collection getTypeFunctions(String cate } @Override - public Collection getPropertyFunctions(String categoryId) { + public Collection getPropertyFunctions( + String categoryId) { return PropertyFunctionExtension.getInstance().getFunctions(categoryId); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/StaticTransformationFunctionService.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/StaticTransformationFunctionService.java index e709e86a9a..b18c3f395c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/StaticTransformationFunctionService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/service/impl/StaticTransformationFunctionService.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.align.service.impl; -import java.util.List; - import eu.esdihumboldt.hale.common.align.extension.transformation.PropertyTransformationFactory; import eu.esdihumboldt.hale.common.align.extension.transformation.TypeTransformationFactory; import eu.esdihumboldt.hale.common.align.extension.transformation.internal.PropertyTransformationExtension; import eu.esdihumboldt.hale.common.align.extension.transformation.internal.TypeTransformationExtension; import eu.esdihumboldt.hale.common.align.service.TransformationFunctionService; +import java.util.List; /** * Transformation function service implementation using only statically defined diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/ExecutionContext.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/ExecutionContext.java index e2d076c866..68e11253e8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/ExecutionContext.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/ExecutionContext.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.align.transformation.function; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.transformation.function.impl.DefaultTransformationVariables; import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoService; import eu.esdihumboldt.hale.common.core.io.project.ProjectVariables; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.Map; /** * Execution context of a transformation process. The information put into the @@ -37,9 +36,8 @@ public interface ExecutionContext extends ServiceProvider { /** - * Get the execution context for the cell associated to the executed - * function. This context is shared only between function executions - * handling this cell. + * Get the execution context for the cell associated to the executed function. + * This context is shared only between function executions handling this cell. * * When invoking multiple operations on the context map, make sure to use * synchronization if appropriate. @@ -49,8 +47,8 @@ public interface ExecutionContext extends ServiceProvider { public Map getCellContext(); /** - * Get the execution context for the executed function. This context is - * shared between functions of the same type. + * Get the execution context for the executed function. This context is shared + * between functions of the same type. * * When invoking multiple operations on the context map, make sure to use * synchronization if appropriate. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/InstanceHandler.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/InstanceHandler.java index 3d3a29c0a9..7be9f90990 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/InstanceHandler.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/InstanceHandler.java @@ -16,16 +16,14 @@ package eu.esdihumboldt.hale.common.align.transformation.function; -import java.util.Map; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; import eu.esdihumboldt.hale.common.instance.model.FamilyInstance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import java.util.Map; /** * Partitions multiple instances. @@ -44,8 +42,8 @@ public interface InstanceHandler { * execution * @param transformationParameters the transformation parameters, may be * null - * @param executionParameters additional parameters for the execution, may - * be null + * @param executionParameters additional parameters for the execution, may be + * null * @param log the transformation log to report any information about the * execution of the transformation to * @return a resource iterator over partitioned instances instances diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/PropertyTransformation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/PropertyTransformation.java index e1ffa3147a..66a3286d90 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/PropertyTransformation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/PropertyTransformation.java @@ -16,16 +16,14 @@ package eu.esdihumboldt.hale.common.align.transformation.function; -import java.util.Map; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; import eu.esdihumboldt.hale.common.align.transformation.service.PropertyTransformer; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Map; /** * Function that is evaluated based on variables populated by property values. @@ -34,20 +32,20 @@ * * @author Simon Templer */ -public interface PropertyTransformation extends - TransformationFunction { +public interface PropertyTransformation + extends TransformationFunction { /** * Set the property values serving as variables for the function. * - * @param variables the property values, variable names are mapped to - * property values + * @param variables the property values, variable names are mapped to property + * values */ public void setVariables(ListMultimap variables); /** - * Set the target type of the created instance that is to be populated with - * the function result. + * Set the target type of the created instance that is to be populated with the + * function result. * * @param targetType the type of the target instance */ @@ -72,9 +70,9 @@ public interface PropertyTransformation extends public ListMultimap getResults(); /** - * Specifies if the automatic conversion of the execution results according - * to the corresponding property definitions is allowed and therefore should - * be performed by the {@link PropertyTransformer}. + * Specifies if the automatic conversion of the execution results according to + * the corresponding property definitions is allowed and therefore should be + * performed by the {@link PropertyTransformer}. * * @return if automated conversion of the result values is allowed */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/PropertyValue.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/PropertyValue.java index 371b256578..1d7c5e761c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/PropertyValue.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/PropertyValue.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.align.transformation.function; -import org.springframework.core.convert.ConversionException; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; +import org.springframework.core.convert.ConversionException; /** * Represents a property value for use in an {@link PropertyTransformation}. @@ -36,13 +35,13 @@ public interface PropertyValue { /** * - * Get the property value converted to the given type or if the property - * value is an instance, the instance value converted to the given type + * Get the property value converted to the given type or if the property value + * is an instance, the instance value converted to the given type * * @param type the type the value should be converted to * @return the converted property value or the converted instance value - * @throws ConversionException if the conversion service is not available or - * the conversion fails or is not supported + * @throws ConversionException if the conversion service is not available or the + * conversion fails or is not supported */ public abstract T getValueAs(Class type) throws ConversionException; diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TransformationFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TransformationFunction.java index 1144182ec1..2a9e520880 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TransformationFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TransformationFunction.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.common.align.transformation.function; -import java.util.Map; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; +import java.util.Map; /** * Common interface for all transformation functions @@ -44,8 +42,7 @@ public interface TransformationFunction { /** * Set the execution context. * - * @param executionContext the execution context of the transformation - * process + * @param executionContext the execution context of the transformation process */ public void setExecutionContext(ExecutionContext executionContext); @@ -55,8 +52,8 @@ public interface TransformationFunction { * @param transformationIdentifier the transformation function identifier * @param engine the transformation engine that may be used for the function * execution - * @param executionParameters additional parameters for the execution, may - * be null + * @param executionParameters additional parameters for the execution, may be + * null * @param log the transformation log to report any information about the * execution of the transformation to * @param cell the cell for this function diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TransformationVariables.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TransformationVariables.java index 1776799180..639ef39db6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TransformationVariables.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TransformationVariables.java @@ -48,9 +48,8 @@ default public String replaceVariables(String input) { * Replace variable references in a String by variable values. * * @param input the input string - * @param failUnresolved true if the replacement should fail - * with an exception if a variable was identifier but cannot be - * resolved + * @param failUnresolved true if the replacement should fail with + * an exception if a variable was identifier but cannot be resolved * @return the input string w/ variable references replaced by values * @throws IllegalStateException if a variable cannot be resolved and * failUnresolved was passed as true @@ -59,8 +58,7 @@ public String replaceVariables(String input, boolean failUnresolved) throws IllegalStateException; /** - * Replace variable references in a string-represented value by variable - * values. + * Replace variable references in a string-represented value by variable values. * * @param input the input value * @return the input value w/ variable references replaced by values, if diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TypeTransformation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TypeTransformation.java index ee9db44a57..e1e23f13fe 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TypeTransformation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/TypeTransformation.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.align.transformation.function; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Type; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; @@ -32,13 +31,13 @@ * * @author Simon Templer */ -public interface TypeTransformation extends - TransformationFunction { +public interface TypeTransformation + extends TransformationFunction { /** - * Set the property transformer to publish the source/target instance pairs - * to. Type transformations have no result, instead they must publish the - * instance pairs created during + * Set the property transformer to publish the source/target instance pairs to. + * Type transformations have no result, instead they must publish the instance + * pairs created during * {@link #execute(String, TransformationEngine, java.util.Map, TransformationLog, eu.esdihumboldt.hale.common.align.model.Cell)} * ion to the property transformer using * {@link PropertyTransformer#publish(FamilyInstance, MutableInstance, TransformationLog, eu.esdihumboldt.hale.common.align.model.Cell)} diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractPropertyTransformation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractPropertyTransformation.java index de9348aa12..cfa4ea1748 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractPropertyTransformation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractPropertyTransformation.java @@ -16,11 +16,8 @@ package eu.esdihumboldt.hale.common.align.transformation.function.impl; -import java.util.Map; - import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -30,6 +27,7 @@ import eu.esdihumboldt.hale.common.align.transformation.function.TransformationFunction; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Map; /** * Base class for implementing {@link PropertyTransformation}s @@ -38,8 +36,8 @@ * * @author Simon Templer */ -public abstract class AbstractPropertyTransformation extends - AbstractTransformationFunction implements PropertyTransformation { +public abstract class AbstractPropertyTransformation + extends AbstractTransformationFunction implements PropertyTransformation { private ListMultimap results; private ListMultimap variables; @@ -57,8 +55,8 @@ public void setTargetType(TypeDefinition targetType) { } /** - * Get the target type of the instance that is to be populated with the - * function result. + * Get the target type of the instance that is to be populated with the function + * result. * * @return the target instance type */ @@ -121,8 +119,8 @@ protected Cell getCell() { * @param variables the input variables * @param resultNames the expected results (names associated with the * corresponding entity definitions) - * @param executionParameters additional parameters for the execution, may - * be null + * @param executionParameters additional parameters for the execution, may be + * null * @param log the transformation log to report any information about the * execution of the transformation to * @return the evaluation result diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractSingleTargetPropertyTransformation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractSingleTargetPropertyTransformation.java index 1d0fd71c3e..747468e254 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractSingleTargetPropertyTransformation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractSingleTargetPropertyTransformation.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.hale.common.align.transformation.function.impl; -import java.util.Map; -import java.util.Map.Entry; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationException; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; +import java.util.Map; +import java.util.Map.Entry; /** * Abstract property transformation implementation for functions with a single @@ -40,9 +38,8 @@ public abstract class AbstractSingleTargetPropertyTransformation { /** - * @see AbstractPropertyTransformation#evaluate(String, - * TransformationEngine, ListMultimap, ListMultimap, Map, - * TransformationLog) + * @see AbstractPropertyTransformation#evaluate(String, TransformationEngine, + * ListMultimap, ListMultimap, Map, TransformationLog) */ @Override protected ListMultimap evaluate(String transformationIdentifier, E engine, @@ -74,8 +71,8 @@ protected ListMultimap evaluate(String transformationIdentifier, * @param resultName the name of the result * @param resultProperty the property entity definition associated with the * result - * @param executionParameters additional parameters for the execution, may - * be null + * @param executionParameters additional parameters for the execution, may be + * null * @param log the transformation log to report any information about the * execution of the transformation to * @return the evaluation result diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractSingleTypeTransformation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractSingleTypeTransformation.java index 7eea0abbfc..13ae9633bd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractSingleTypeTransformation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractSingleTypeTransformation.java @@ -26,8 +26,8 @@ * * @author Simon Templer */ -public abstract class AbstractSingleTypeTransformation extends - AbstractTypeTransformation { +public abstract class AbstractSingleTypeTransformation + extends AbstractTypeTransformation { /** * Get the source instance. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractTransformationFunction.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractTransformationFunction.java index 47ed71bfbf..7339f87f97 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractTransformationFunction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractTransformationFunction.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.hale.common.align.transformation.function.impl; -import java.text.MessageFormat; - import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.ExecutionContext; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationException; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationFunction; import eu.esdihumboldt.hale.common.core.io.Value; +import java.text.MessageFormat; /** * Transformation function base class @@ -35,8 +33,8 @@ * * @author Simon Templer */ -public abstract class AbstractTransformationFunction implements - TransformationFunction { +public abstract class AbstractTransformationFunction + implements TransformationFunction { private ListMultimap parameters; private ExecutionContext executionContext; @@ -46,8 +44,8 @@ public abstract class AbstractTransformationFunction parameters) { - this.parameters = (parameters == null) ? (null) : (Multimaps - .unmodifiableListMultimap(parameters)); + this.parameters = (parameters == null) ? (null) + : (Multimaps.unmodifiableListMultimap(parameters)); } /** @@ -77,8 +75,8 @@ public ExecutionContext getExecutionContext() { } /** - * Checks if a certain parameter is defined at least a given number of - * times. Throws a {@link TransformationException} otherwise. + * Checks if a certain parameter is defined at least a given number of times. + * Throws a {@link TransformationException} otherwise. * * @param parameterName the parameter name * @param minCount the minimum count the parameter must be present @@ -89,8 +87,8 @@ public void checkParameter(String parameterName, int minCount) throws Transforma if (parameters == null || parameters.get(parameterName) == null || parameters.get(parameterName).size() < minCount) { if (minCount == 1) { - throw new TransformationException(MessageFormat.format( - "Mandatory parameter {0} not defined", parameterName)); + throw new TransformationException( + MessageFormat.format("Mandatory parameter {0} not defined", parameterName)); } else { throw new TransformationException(MessageFormat.format( @@ -105,14 +103,14 @@ public void checkParameter(String parameterName, int minCount) throws Transforma * * @param parameterName the parameter name * @return the parameter value - * @throws TransformationException if a parameter with the given name - * doesn't exist + * @throws TransformationException if a parameter with the given name doesn't + * exist */ public ParameterValue getParameterChecked(String parameterName) throws TransformationException { if (getParameters() == null || getParameters().get(parameterName) == null || getParameters().get(parameterName).isEmpty()) { - throw new TransformationException(MessageFormat.format( - "Mandatory parameter {0} not defined", parameterName)); + throw new TransformationException( + MessageFormat.format("Mandatory parameter {0} not defined", parameterName)); } return getParameters().get(parameterName).get(0); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractTypeTransformation.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractTypeTransformation.java index cf67e9dfc3..12dceab35e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractTypeTransformation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/AbstractTypeTransformation.java @@ -18,7 +18,6 @@ import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.hale.common.align.model.Type; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.InstanceHandler; @@ -35,8 +34,8 @@ * * @author Simon Templer */ -public abstract class AbstractTypeTransformation extends - AbstractTransformationFunction implements TypeTransformation { +public abstract class AbstractTypeTransformation + extends AbstractTransformationFunction implements TypeTransformation { private PropertyTransformer propertyTransformer; private ListMultimap target; @@ -51,8 +50,7 @@ public void setPropertyTransformer(PropertyTransformer propertyTransformer) { } /** - * Get the property transformer to publish any source/target instance pair - * to + * Get the property transformer to publish any source/target instance pair to * * @return the property transformer */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/DefaultTransformationVariables.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/DefaultTransformationVariables.java index 1d66378ba2..497330a24a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/DefaultTransformationVariables.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/DefaultTransformationVariables.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.common.align.transformation.function.impl; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationVariableScope; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationVariables; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.project.ProjectVariables; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Default implementation of transformation variables provided to transformation diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/FamilyInstanceImpl.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/FamilyInstanceImpl.java index 4ec8ce8790..cd11404fd5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/FamilyInstanceImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/FamilyInstanceImpl.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.align.transformation.function.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; - import eu.esdihumboldt.hale.common.instance.model.FamilyInstance; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.impl.IdentifiableInstanceDecorator; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; /** * Decorate a given instance with family function. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/PropertyValueImpl.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/PropertyValueImpl.java index a9a7c2a51a..cd9da6fd8f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/PropertyValueImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/function/impl/PropertyValueImpl.java @@ -16,14 +16,13 @@ package eu.esdihumboldt.hale.common.align.transformation.function.impl; -import org.springframework.core.convert.ConversionException; -import org.springframework.core.convert.ConversionService; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; import eu.esdihumboldt.hale.common.convert.ConversionServiceNotAvailableException; import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.instance.model.Instance; +import org.springframework.core.convert.ConversionException; +import org.springframework.core.convert.ConversionService; /** * Default {@link PropertyValue} implementation. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/TransformationReporter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/TransformationReporter.java index 95c2bc5818..35179c92d7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/TransformationReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/TransformationReporter.java @@ -23,8 +23,8 @@ * * @author Simon Templer */ -public interface TransformationReporter extends TransformationReport, - Reporter { +public interface TransformationReporter + extends TransformationReport, Reporter { // concrete typed interface diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/CellLog.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/CellLog.java index 1020233948..f27d236567 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/CellLog.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/CellLog.java @@ -16,13 +16,13 @@ package eu.esdihumboldt.hale.common.align.transformation.report.impl; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationMessage; import eu.esdihumboldt.hale.common.core.report.Message; import eu.esdihumboldt.hale.common.core.report.Report; import eu.esdihumboldt.hale.common.core.report.ReportLog; +import net.jcip.annotations.Immutable; /** * Transformation log for a fixed cell. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/DefaultTransformationReporter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/DefaultTransformationReporter.java index 158f2e3ba5..c04b40cac8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/DefaultTransformationReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/DefaultTransformationReporter.java @@ -16,15 +16,9 @@ package eu.esdihumboldt.hale.common.align.transformation.report.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - import com.google.common.collect.LinkedHashMultiset; import com.google.common.collect.Multiset; import com.google.common.collect.Multiset.Entry; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationMessage; @@ -33,6 +27,10 @@ import eu.esdihumboldt.hale.common.core.report.Report; import eu.esdihumboldt.hale.common.core.report.ReportLog; import eu.esdihumboldt.hale.common.core.report.impl.AbstractReporter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; /** * Reporter for transformation messages @@ -43,14 +41,13 @@ public class DefaultTransformationReporter extends AbstractReporter= 0 && msgs.elementSet().size() >= MESSAGE_CAP) { } /** - * Get the collected messages, if applicable extended with the message - * count. + * Get the collected messages, if applicable extended with the message count. * * @return the messages */ @@ -260,8 +255,8 @@ public boolean hasMessages() { /** * Create an empty report. It is set to not successful by default. But you - * should call {@link #setSuccess(boolean)} nonetheless to update the - * timestamp after the task has finished. + * should call {@link #setSuccess(boolean)} nonetheless to update the timestamp + * after the task has finished. * * @param taskName the name of the task the report is related to * @param doLog if added messages shall also be logged using {@link ALogger} diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/PreparedTransformationReporter.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/PreparedTransformationReporter.java index 46e66050aa..07d8153b4a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/PreparedTransformationReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/PreparedTransformationReporter.java @@ -32,8 +32,8 @@ public class PreparedTransformationReporter extends DefaultReporter { +public class TransformationMessageImplDefinition + extends AbstractMessageDefinition { private static final ALogger _log = ALoggerFactory.getLogger(TransformationMessage.class); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/TransformationReportImplDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/TransformationReportImplDefinition.java index f4c09a631b..b46b63e4f4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/TransformationReportImplDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/report/impl/TransformationReportImplDefinition.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.align.transformation.report.impl; -import java.util.Properties; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationReport; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationReporter; import eu.esdihumboldt.hale.common.core.report.impl.AbstractReportDefinition; +import java.util.Properties; /** * Object definition for {@link TransformationReport}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/PropertyTransformer.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/PropertyTransformer.java index 86d7e962c2..8c06a9420a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/PropertyTransformer.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/PropertyTransformer.java @@ -40,8 +40,8 @@ public void publish(FamilyInstance source, MutableInstance target, Transformatio Cell typeCell); /** - * Join with the property transformer and wait for its completion, e.g. if - * the property transformer executes tasks in worker threads. + * Join with the property transformer and wait for its completion, e.g. if the + * property transformer executes tasks in worker threads. * * @param cancel if still pending transformations should be canceled */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/TransformationSchemas.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/TransformationSchemas.java index efef9a2888..ec1a81a7a8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/TransformationSchemas.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/TransformationSchemas.java @@ -29,8 +29,8 @@ public interface TransformationSchemas { /** * Get the source or target schema space. * - * @param spaceID the schema space ID, either {@link SchemaSpaceID#SOURCE} - * or {@link SchemaSpaceID#TARGET} + * @param spaceID the schema space ID, either {@link SchemaSpaceID#SOURCE} or + * {@link SchemaSpaceID#TARGET} * @return the schema space */ public SchemaSpace getSchemas(SchemaSpaceID spaceID); diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/impl/DefaultInstanceSink.java b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/impl/DefaultInstanceSink.java index e923451945..a62cb4d145 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/impl/DefaultInstanceSink.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/src/eu/esdihumboldt/hale/common/align/transformation/service/impl/DefaultInstanceSink.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.align.transformation.service.impl; +import eu.esdihumboldt.hale.common.align.transformation.service.InstanceSink; +import eu.esdihumboldt.hale.common.instance.model.Instance; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import eu.esdihumboldt.hale.common.align.transformation.service.InstanceSink; -import eu.esdihumboldt.hale.common.instance.model.Instance; - /** * Default instance sink backed by a list * diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/CastorAlignmentIOTest.java b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/CastorAlignmentIOTest.java index 5fba665acd..c58d0bb857 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/CastorAlignmentIOTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/CastorAlignmentIOTest.java @@ -15,16 +15,15 @@ package eu.esdihumboldt.hale.common.align.io; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URI; - import eu.esdihumboldt.hale.common.align.io.impl.CastorAlignmentIO; import eu.esdihumboldt.hale.common.align.model.MutableAlignment; import eu.esdihumboldt.hale.common.core.io.PathUpdate; import eu.esdihumboldt.hale.common.core.io.report.impl.DefaultIOReporter; import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; /** * Alignment I/O tests based on {@link CastorAlignmentIO}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/DefaultAlignmentIOTest.java b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/DefaultAlignmentIOTest.java index 1b75b6933d..4b4090c658 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/DefaultAlignmentIOTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/DefaultAlignmentIOTest.java @@ -22,29 +22,9 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.LinkedListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.BaseAlignmentCell; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.ChildContext; @@ -74,6 +54,22 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchema; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; import eu.esdihumboldt.hale.common.test.TestUtil; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import javax.xml.namespace.QName; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; /** * Test saving and loading an alignment @@ -119,22 +115,22 @@ public void testSaveLoad() throws Exception { ListMultimap source1 = ArrayListMultimap.create(); QName source1TypeName; String source1EntityName; - TypeDefinition sourceType1 = new DefaultTypeDefinition(source1TypeName = new QName( - "source1Type")); + TypeDefinition sourceType1 = new DefaultTypeDefinition( + source1TypeName = new QName("source1Type")); String filterText = "someproperty > 12"; Filter filter = new FilterGeoCqlImpl(filterText); - source1.put(source1EntityName = null, new DefaultType(new TypeEntityDefinition(sourceType1, - SchemaSpaceID.SOURCE, filter))); + source1.put(source1EntityName = null, new DefaultType( + new TypeEntityDefinition(sourceType1, SchemaSpaceID.SOURCE, filter))); cell1.setSource(source1); source.addType(sourceType1); ListMultimap target1 = ArrayListMultimap.create(); QName target1TypeName; String target1EntityName; - TypeDefinition targetType1 = new DefaultTypeDefinition(target1TypeName = new QName( - "http://some.name.space/t1", "target1Type")); - target1.put(target1EntityName = "Some name", new DefaultType(new TypeEntityDefinition( - targetType1, SchemaSpaceID.TARGET, null))); + TypeDefinition targetType1 = new DefaultTypeDefinition( + target1TypeName = new QName("http://some.name.space/t1", "target1Type")); + target1.put(target1EntityName = "Some name", + new DefaultType(new TypeEntityDefinition(targetType1, SchemaSpaceID.TARGET, null))); cell1.setTarget(target1); target.addType(targetType1); @@ -163,8 +159,8 @@ public void testSaveLoad() throws Exception { ListMultimap target2 = ArrayListMultimap.create(); TypeDefinition targetType2 = new DefaultTypeDefinition(new QName("target2Type")); - target2.put("Some other name", new DefaultType(new TypeEntityDefinition(targetType2, - SchemaSpaceID.TARGET, null))); + target2.put("Some other name", + new DefaultType(new TypeEntityDefinition(targetType2, SchemaSpaceID.TARGET, null))); cell2.setTarget(target2); target.addType(targetType2); @@ -281,20 +277,20 @@ public void testSaveLoad() throws Exception { public void testIDSaveLoad() throws Exception { DefaultAlignment alignment = new DefaultAlignment(); - Schema schema = TestUtil.loadSchema(getClass().getResource("/testdata/simple/t1.xsd") - .toURI()); + Schema schema = TestUtil + .loadSchema(getClass().getResource("/testdata/simple/t1.xsd").toURI()); DefaultCell cell = new DefaultCell(); cell.setTransformationIdentifier("trans1"); ListMultimap source = ArrayListMultimap.create(); - source.put(null, new DefaultType(new TypeEntityDefinition(schema.getMappingRelevantTypes() - .iterator().next(), SchemaSpaceID.SOURCE, null))); + source.put(null, new DefaultType(new TypeEntityDefinition( + schema.getMappingRelevantTypes().iterator().next(), SchemaSpaceID.SOURCE, null))); cell.setSource(source); ListMultimap target = ArrayListMultimap.create(); - target.put(null, new DefaultType(new TypeEntityDefinition(schema.getMappingRelevantTypes() - .iterator().next(), SchemaSpaceID.TARGET, null))); + target.put(null, new DefaultType(new TypeEntityDefinition( + schema.getMappingRelevantTypes().iterator().next(), SchemaSpaceID.TARGET, null))); cell.setTarget(target); // add cell and check id generation @@ -325,8 +321,8 @@ public void testBaseAlignmentSaveLoad() throws Exception { DefaultAlignment baseAlignment = new DefaultAlignment(); MutableAlignment alignment = new DefaultAlignment(); - Schema schema = TestUtil.loadSchema(getClass().getResource("/testdata/simple/t1.xsd") - .toURI()); + Schema schema = TestUtil + .loadSchema(getClass().getResource("/testdata/simple/t1.xsd").toURI()); Iterator iter = schema.getMappingRelevantTypes().iterator(); TypeDefinition t = iter.next(); if (!t.getName().getLocalPart().equals("T1")) { @@ -351,13 +347,13 @@ public void testBaseAlignmentSaveLoad() throws Exception { PropertyDefinition child = DefinitionUtil.getChild(t, new QName("a1")).asProperty(); childContext.add(new ChildContext(child)); ListMultimap source2 = ArrayListMultimap.create(); - source2.put(null, new DefaultProperty(new PropertyEntityDefinition(t, childContext, - SchemaSpaceID.SOURCE, null))); + source2.put(null, new DefaultProperty( + new PropertyEntityDefinition(t, childContext, SchemaSpaceID.SOURCE, null))); cell2.setSource(source2); ListMultimap target2 = ArrayListMultimap.create(); - target2.put(null, new DefaultProperty(new PropertyEntityDefinition(t, childContext, - SchemaSpaceID.TARGET, null))); + target2.put(null, new DefaultProperty( + new PropertyEntityDefinition(t, childContext, SchemaSpaceID.TARGET, null))); cell2.setTarget(target2); // add cell1 to base alignment @@ -366,8 +362,8 @@ public void testBaseAlignmentSaveLoad() throws Exception { // save base alignment File baseAlignmentFile = tmp.newFile("alignment_base.xml"); System.out.println(baseAlignmentFile.getAbsolutePath()); - saveAlignment(baseAlignment, new BufferedOutputStream(new FileOutputStream( - baseAlignmentFile))); + saveAlignment(baseAlignment, + new BufferedOutputStream(new FileOutputStream(baseAlignmentFile))); // add as base alignment to extended alignment addBaseAlignment(alignment, baseAlignmentFile.toURI(), schema, schema); @@ -375,8 +371,8 @@ public void testBaseAlignmentSaveLoad() throws Exception { String usedPrefix = alignment.getBaseAlignments().keySet().iterator().next(); assertEquals(1, alignment.getCells().size()); - assertEquals(usedPrefix + ":" + cell1.getId(), alignment.getCells().iterator().next() - .getId()); + assertEquals(usedPrefix + ":" + cell1.getId(), + alignment.getCells().iterator().next().getId()); // add cell2 to extended alignment alignment.addCell(cell2); @@ -398,7 +394,8 @@ public void testBaseAlignmentSaveLoad() throws Exception { assertTrue(typeCell instanceof BaseAlignmentCell); assertEquals(usedPrefix + ":" + cell1.getId(), typeCell.getId()); assertEquals(1, alignment2.getPropertyCells(typeCell).size()); - assertFalse(alignment2.getPropertyCells(typeCell).iterator().next() instanceof BaseAlignmentCell); + assertFalse(alignment2.getPropertyCells(typeCell).iterator() + .next() instanceof BaseAlignmentCell); } /** @@ -411,8 +408,8 @@ public void testCellDisableSaveLoad() throws Exception { DefaultAlignment baseAlignment = new DefaultAlignment(); MutableAlignment alignment = new DefaultAlignment(); - Schema schema = TestUtil.loadSchema(getClass().getResource("/testdata/simple/t1.xsd") - .toURI()); + Schema schema = TestUtil + .loadSchema(getClass().getResource("/testdata/simple/t1.xsd").toURI()); Iterator iter = schema.getMappingRelevantTypes().iterator(); TypeDefinition t = iter.next(); @@ -439,13 +436,13 @@ public void testCellDisableSaveLoad() throws Exception { PropertyDefinition child2 = DefinitionUtil.getChild(t, new QName("a1")).asProperty(); childContext2.add(new ChildContext(child2)); ListMultimap source2 = ArrayListMultimap.create(); - source2.put(null, new DefaultProperty(new PropertyEntityDefinition(t, childContext2, - SchemaSpaceID.SOURCE, null))); + source2.put(null, new DefaultProperty( + new PropertyEntityDefinition(t, childContext2, SchemaSpaceID.SOURCE, null))); cell2.setSource(source2); ListMultimap target2 = ArrayListMultimap.create(); - target2.put(null, new DefaultProperty(new PropertyEntityDefinition(t, childContext2, - SchemaSpaceID.TARGET, null))); + target2.put(null, new DefaultProperty( + new PropertyEntityDefinition(t, childContext2, SchemaSpaceID.TARGET, null))); cell2.setTarget(target2); DefaultCell cell3 = new DefaultCell(); @@ -455,13 +452,13 @@ public void testCellDisableSaveLoad() throws Exception { PropertyDefinition child3 = DefinitionUtil.getChild(t, new QName("b1")).asProperty(); childContext3.add(new ChildContext(child3)); ListMultimap source3 = ArrayListMultimap.create(); - source3.put(null, new DefaultProperty(new PropertyEntityDefinition(t, childContext3, - SchemaSpaceID.SOURCE, null))); + source3.put(null, new DefaultProperty( + new PropertyEntityDefinition(t, childContext3, SchemaSpaceID.SOURCE, null))); cell3.setSource(source3); ListMultimap target3 = ArrayListMultimap.create(); - target3.put(null, new DefaultProperty(new PropertyEntityDefinition(t, childContext3, - SchemaSpaceID.TARGET, null))); + target3.put(null, new DefaultProperty( + new PropertyEntityDefinition(t, childContext3, SchemaSpaceID.TARGET, null))); cell3.setTarget(target3); baseAlignment.addCell(cell1); @@ -485,8 +482,8 @@ public void testCellDisableSaveLoad() throws Exception { // save base alignment File baseAlignmentFile = tmp.newFile("alignment_base.xml"); System.out.println(baseAlignmentFile.getAbsolutePath()); - saveAlignment(baseAlignment, new BufferedOutputStream(new FileOutputStream( - baseAlignmentFile))); + saveAlignment(baseAlignment, + new BufferedOutputStream(new FileOutputStream(baseAlignmentFile))); // load base alignment MutableAlignment baseAlignment2 = loadAlignment(new FileInputStream(baseAlignmentFile), @@ -538,7 +535,8 @@ public void testCellDisableSaveLoad() throws Exception { assertTrue(extendedDisableCell instanceof BaseAlignmentCell); assertEquals(1, extendedDisableCell.getDisabledFor().size()); assertEquals(0, ((BaseAlignmentCell) extendedDisableCell).getBaseDisabledFor().size()); - assertEquals(1, ((BaseAlignmentCell) extendedDisableCell).getAdditionalDisabledFor().size()); + assertEquals(1, + ((BaseAlignmentCell) extendedDisableCell).getAdditionalDisabledFor().size()); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/JaxbAlignmentIOTest.java b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/JaxbAlignmentIOTest.java index c702d05346..37def91564 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/JaxbAlignmentIOTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/io/JaxbAlignmentIOTest.java @@ -15,16 +15,15 @@ package eu.esdihumboldt.hale.common.align.io; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URI; - import eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentIO; import eu.esdihumboldt.hale.common.align.model.MutableAlignment; import eu.esdihumboldt.hale.common.core.io.PathUpdate; import eu.esdihumboldt.hale.common.core.io.report.impl.DefaultIOReporter; import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; /** * Alignment I/O tests based on {@link JaxbAlignmentIO}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameterTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameterTest.groovy index 8d45f987d6..f15a0340cc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameterTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/model/functions/join/JoinParameterTest.groovy @@ -15,11 +15,7 @@ package eu.esdihumboldt.hale.common.align.model.functions.join -import org.junit.Test - -import javax.xml.namespace.QName - -import org.w3c.dom.Element +import static org.junit.Assert.* import eu.esdihumboldt.hale.common.align.io.LoadAlignmentContext import eu.esdihumboldt.hale.common.align.io.impl.internal.LoadAlignmentContextImpl @@ -31,8 +27,9 @@ import eu.esdihumboldt.hale.common.schema.SchemaSpaceID import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.schema.model.TypeDefinition - -import static org.junit.Assert.* +import javax.xml.namespace.QName +import org.junit.Test +import org.w3c.dom.Element /** * Tests for {@link JoinParameter} diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/MarkdownCellExplanationTest.java b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/MarkdownCellExplanationTest.java index 96f7da595e..3ebddf3b66 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/MarkdownCellExplanationTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.align/test/eu/esdihumboldt/hale/common/align/model/impl/mdexpl/MarkdownCellExplanationTest.java @@ -18,22 +18,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.util.HashSet; -import java.util.Locale; -import java.util.Optional; -import java.util.Set; - -import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Ignore; -import org.junit.Test; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Iterables; import com.google.common.collect.LinkedListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.MutableCell; import eu.esdihumboldt.hale.common.align.model.ParameterValue; @@ -47,7 +35,15 @@ import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; +import eu.esdihumboldt.util.test.AbstractPlatformTest; import groovy.text.Template; +import java.util.HashSet; +import java.util.Locale; +import java.util.Optional; +import java.util.Set; +import javax.xml.namespace.QName; +import org.junit.Ignore; +import org.junit.Test; /** * Tests for {@link MarkdownCellExplanation}. @@ -58,8 +54,7 @@ public class MarkdownCellExplanationTest extends AbstractPlatformTest { /** - * Test if different templates for different languages are retrieved - * properly. + * Test if different templates for different languages are retrieved properly. */ @Test public void testTemplate() { diff --git a/common/plugins/eu.esdihumboldt.hale.common.app/src/eu/esdihumboldt/hale/common/app/AbstractApplication.java b/common/plugins/eu.esdihumboldt.hale.common.app/src/eu/esdihumboldt/hale/common/app/AbstractApplication.java index 5f04240828..35ee5d6f0a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.app/src/eu/esdihumboldt/hale/common/app/AbstractApplication.java +++ b/common/plugins/eu.esdihumboldt.hale.common.app/src/eu/esdihumboldt/hale/common/app/AbstractApplication.java @@ -39,8 +39,8 @@ public Object start(IApplicationContext context) throws Exception { * @param args the application arguments * @param appContext the application context * @return the return value of the application - * @throws Exception if an unrecoverable error occurs processing the - * arguments or running the application + * @throws Exception if an unrecoverable error occurs processing the arguments + * or running the application * * @see IApplication#start(IApplicationContext) */ @@ -118,8 +118,7 @@ protected void processFlag(String arg, C executionContext) { * @param param the parameter name * @param value the parameter value * @param executionContext the execution context to configure - * @throws Exception if an unrecoverable error occurs processing the - * parameter + * @throws Exception if an unrecoverable error occurs processing the parameter */ protected void processParameter(String param, String value, C executionContext) throws Exception { diff --git a/common/plugins/eu.esdihumboldt.hale.common.app/src/eu/esdihumboldt/hale/common/app/ApplicationUtil.java b/common/plugins/eu.esdihumboldt.hale.common.app/src/eu/esdihumboldt/hale/common/app/ApplicationUtil.java index 70a5029be0..e7e6e3accf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.app/src/eu/esdihumboldt/hale/common/app/ApplicationUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.app/src/eu/esdihumboldt/hale/common/app/ApplicationUtil.java @@ -15,10 +15,10 @@ package eu.esdihumboldt.hale.common.app; +import eu.esdihumboldt.hale.common.app.internal.Activator; import java.util.HashMap; import java.util.List; import java.util.Map; - import org.eclipse.equinox.app.IApplication; import org.eclipse.equinox.app.IApplicationContext; import org.osgi.framework.Bundle; @@ -29,8 +29,6 @@ import org.osgi.service.application.ApplicationHandle; import org.osgi.util.tracker.ServiceTracker; -import eu.esdihumboldt.hale.common.app.internal.Activator; - /** * Utilities for launching applications. * @@ -48,8 +46,8 @@ public class ApplicationUtil { */ public static Object launchSyncApplication(IApplication application, final List argList) throws Exception { - String[] args = argList.size() == 0 ? null : (String[]) argList.toArray(new String[argList - .size()]); + String[] args = argList.size() == 0 ? null + : (String[]) argList.toArray(new String[argList.size()]); final Map launchArgs = new HashMap<>(1); if (args != null) { launchArgs.put(IApplicationContext.APPLICATION_ARGS, args); @@ -116,8 +114,8 @@ public void applicationRunning() { * @param argList the arguments * @return the application return value * @throws ApplicationException if the application cannot be launched - * @throws InterruptedException if the thread was interrupted while waiting - * for the application termination + * @throws InterruptedException if the thread was interrupted while waiting for + * the application termination */ public static Object launchApplication(String appId, List argList) throws ApplicationException, InterruptedException { @@ -133,8 +131,8 @@ public static Object launchApplication(String appId, List argList) throw new IllegalStateException("\"" + appId + "\" does not exist or is ambigous."); //$NON-NLS-1$ //$NON-NLS-2$ } else { - String[] args = argList.size() == 0 ? null : (String[]) argList - .toArray(new String[argList.size()]); + String[] args = argList.size() == 0 ? null + : (String[]) argList.toArray(new String[argList.size()]); try { Map launchArgs = new HashMap<>(1); if (args != null) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.cache/src/eu/esdihumboldt/hale/common/cache/Request.java b/common/plugins/eu.esdihumboldt.hale.common.cache/src/eu/esdihumboldt/hale/common/cache/Request.java index 755f608ada..52eb5270b2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.cache/src/eu/esdihumboldt/hale/common/cache/Request.java +++ b/common/plugins/eu.esdihumboldt.hale.common.cache/src/eu/esdihumboldt/hale/common/cache/Request.java @@ -16,6 +16,20 @@ package eu.esdihumboldt.hale.common.cache; +import com.google.common.io.ByteStreams; +import de.fhg.igd.osgi.util.OsgiUtils; +import de.fhg.igd.osgi.util.configuration.IConfigurationService; +import de.fhg.igd.osgi.util.configuration.JavaPreferencesConfigurationService; +import de.fhg.igd.osgi.util.configuration.NamespaceConfigurationServiceDecorator; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.util.PlatformUtil; +import eu.esdihumboldt.util.http.ProxyUtil; +import eu.esdihumboldt.util.http.client.ClientProxyUtil; +import eu.esdihumboldt.util.http.client.ClientUtil; +import eu.esdihumboldt.util.io.InputStreamDecorator; +import groovy.text.SimpleTemplateEngine; +import groovy.text.Template; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -30,7 +44,9 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; - +import net.sf.ehcache.Cache; +import net.sf.ehcache.Element; +import net.sf.ehcache.store.MemoryStoreEvictionPolicy; import org.apache.http.HttpEntity; import org.apache.http.HttpStatus; import org.apache.http.client.config.RequestConfig; @@ -40,25 +56,6 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -import com.google.common.io.ByteStreams; - -import de.fhg.igd.osgi.util.OsgiUtils; -import de.fhg.igd.osgi.util.configuration.IConfigurationService; -import de.fhg.igd.osgi.util.configuration.JavaPreferencesConfigurationService; -import de.fhg.igd.osgi.util.configuration.NamespaceConfigurationServiceDecorator; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.util.PlatformUtil; -import eu.esdihumboldt.util.http.ProxyUtil; -import eu.esdihumboldt.util.http.client.ClientProxyUtil; -import eu.esdihumboldt.util.http.client.ClientUtil; -import eu.esdihumboldt.util.io.InputStreamDecorator; -import groovy.text.SimpleTemplateEngine; -import groovy.text.Template; -import net.sf.ehcache.Cache; -import net.sf.ehcache.Element; -import net.sf.ehcache.store.MemoryStoreEvictionPolicy; - /** * This class manages requests and caching for remote files. * @@ -370,10 +367,9 @@ private synchronized CloseableHttpClient getClient(Proxy proxy) { // socket timeout /* - * Unclear when this setting would apply (doc says for non-blocking - * I/O operations), it does not seem to be applied for requests as - * done in openStream (instead the value in - * RequestConfig.socketTimeout is used) + * Unclear when this setting would apply (doc says for non-blocking I/O + * operations), it does not seem to be applied for requests as done in + * openStream (instead the value in RequestConfig.socketTimeout is used) */ SocketConfig socketconfig = SocketConfig.custom().setSoTimeout(socketTimeout).build(); // connection and socket timeout diff --git a/common/plugins/eu.esdihumboldt.hale.common.cache/test/eu/esdihumboldt/hale/common/cache/RequestTest.java b/common/plugins/eu.esdihumboldt.hale.common.cache/test/eu/esdihumboldt/hale/common/cache/RequestTest.java index 28c14a131b..f32ab81e8e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.cache/test/eu/esdihumboldt/hale/common/cache/RequestTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.cache/test/eu/esdihumboldt/hale/common/cache/RequestTest.java @@ -19,7 +19,6 @@ import static org.junit.Assert.fail; import java.net.URI; - import org.junit.AfterClass; import org.junit.Test; @@ -31,8 +30,7 @@ public class RequestTest { /** - * Test retrieving online resources using {@link Request} with cache - * enabled. + * Test retrieving online resources using {@link Request} with cache enabled. */ @Test public void testRequestCache() { @@ -40,8 +38,7 @@ public void testRequestCache() { } /** - * Test retrieving online resources using {@link Request} with cache - * disabled. + * Test retrieving online resources using {@link Request} with cache disabled. */ @Test public void testRequestNoCache() { diff --git a/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/HaleCLIUtil.groovy b/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/HaleCLIUtil.groovy index f2a84c9767..9d3cac0489 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/HaleCLIUtil.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/HaleCLIUtil.groovy @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.common.cli -import org.joda.time.Period -import org.joda.time.format.PeriodFormat - import eu.esdihumboldt.hale.common.core.report.Report import eu.esdihumboldt.hale.common.core.report.ReportHandler import eu.esdihumboldt.hale.common.headless.report.ReportFile import groovy.cli.picocli.CliBuilder import groovy.cli.picocli.OptionAccessor import groovy.transform.CompileStatic +import org.joda.time.Period +import org.joda.time.format.PeriodFormat class HaleCLIUtil { diff --git a/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/project/AbstractProjectCommand.groovy b/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/project/AbstractProjectCommand.groovy index 77b2d3cba0..3ab3d304f0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/project/AbstractProjectCommand.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/project/AbstractProjectCommand.groovy @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.common.cli.project -import java.nio.file.Files -import java.nio.file.Path - import eu.esdihumboldt.hale.common.cli.HaleCLIUtil import eu.esdihumboldt.hale.common.core.report.ReportHandler import eu.esdihumboldt.util.cli.CLIUtil @@ -28,6 +25,8 @@ import groovy.cli.picocli.CliBuilder import groovy.cli.picocli.OptionAccessor import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import java.nio.file.Files +import java.nio.file.Path /** * Base class for commands working on projects. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/project/ListProjectsCommand.groovy b/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/project/ListProjectsCommand.groovy index c1dc479480..ba5d93488e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/project/ListProjectsCommand.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.cli/src/eu/esdihumboldt/hale/common/cli/project/ListProjectsCommand.groovy @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.common.cli.project -import java.nio.file.Path -import java.nio.file.Paths - import eu.esdihumboldt.hale.common.core.report.ReportHandler import eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment import eu.esdihumboldt.util.cli.CommandContext import groovy.cli.picocli.OptionAccessor import groovy.transform.CompileStatic +import java.nio.file.Path +import java.nio.file.Paths @CompileStatic class ListProjectsCommand extends AbstractProjectEnvironmentCommand { diff --git a/common/plugins/eu.esdihumboldt.hale.common.codelist.validator/src/eu/esdihumboldt/hale/common/codelist/validator/CodeListValidator.java b/common/plugins/eu.esdihumboldt.hale.common.codelist.validator/src/eu/esdihumboldt/hale/common/codelist/validator/CodeListValidator.java index 1a5ba519d5..63f6209dda 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.codelist.validator/src/eu/esdihumboldt/hale/common/codelist/validator/CodeListValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.codelist.validator/src/eu/esdihumboldt/hale/common/codelist/validator/CodeListValidator.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.codelist.validator; -import java.text.MessageFormat; - -import javax.annotation.Nullable; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; @@ -36,6 +32,8 @@ import eu.esdihumboldt.hale.common.instancevalidator.InstanceModelValidator; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; +import java.text.MessageFormat; +import javax.annotation.Nullable; /** * Instance validator checking values w/ associated code lists. diff --git a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/CodeList.java b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/CodeList.java index de074e29b3..979437b575 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/CodeList.java +++ b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/CodeList.java @@ -90,8 +90,8 @@ public String getNamespace() { /** * Get the code list entries * - * @return the code list entries, changes to the returned collection will - * not be reflected in the code list + * @return the code list entries, changes to the returned collection will not be + * reflected in the code list */ public Collection getEntries(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/CodeListAssociations.groovy b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/CodeListAssociations.groovy index 026d1518fb..b860a40582 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/CodeListAssociations.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/CodeListAssociations.groovy @@ -15,8 +15,8 @@ package eu.esdihumboldt.hale.common.codelist.config; -import eu.esdihumboldt.hale.common.align.model.EntityDefinition; -import eu.esdihumboldt.hale.common.codelist.CodeList; +import eu.esdihumboldt.hale.common.align.model.EntityDefinition +import eu.esdihumboldt.hale.common.codelist.CodeList /** * Configuration object holding code list associations. diff --git a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/CodeListAssociationsType.groovy b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/CodeListAssociationsType.groovy index ac539f7fc8..b0b8134cb9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/CodeListAssociationsType.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/CodeListAssociationsType.groovy @@ -15,16 +15,13 @@ package eu.esdihumboldt.hale.common.codelist.config; -import javax.xml.namespace.QName - -import org.w3c.dom.Element - import com.google.common.collect.HashMultimap import com.google.common.collect.Multimap - import eu.esdihumboldt.hale.common.core.io.ComplexValueType import groovy.xml.DOMBuilder import groovy.xml.dom.DOMCategory +import javax.xml.namespace.QName +import org.w3c.dom.Element /** * Converts {@link CodeListAssociations} configuration from DOM to object and back. diff --git a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/DummyEntityKey.java b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/DummyEntityKey.java index a87f894d12..854616e56a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/DummyEntityKey.java +++ b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/config/DummyEntityKey.java @@ -15,15 +15,12 @@ package eu.esdihumboldt.hale.common.codelist.config; -import java.util.List; - -import javax.xml.namespace.QName; - import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList.Builder; - import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; +import java.util.List; +import javax.xml.namespace.QName; /** * Immutable key representing an entity definition only by its type and child @@ -38,8 +35,8 @@ public class DummyEntityKey { /** * Create an entity key from a list of names. * - * @param names list of names, the first name is the type name, the - * following are child names + * @param names list of names, the first name is the type name, the following + * are child names */ public DummyEntityKey(Iterable names) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/service/CodeListRegistry.java b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/service/CodeListRegistry.java index 70306bc9a0..6c25351584 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/service/CodeListRegistry.java +++ b/common/plugins/eu.esdihumboldt.hale.common.codelist/src/eu/esdihumboldt/hale/common/codelist/service/CodeListRegistry.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.codelist.service; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.codelist.CodeList; import eu.esdihumboldt.hale.common.codelist.config.CodeListReference; +import javax.annotation.Nullable; /** * Service providing information on code lists. diff --git a/common/plugins/eu.esdihumboldt.hale.common.config/src/eu/esdihumboldt/hale/common/config/ConfigValue.groovy b/common/plugins/eu.esdihumboldt.hale.common.config/src/eu/esdihumboldt/hale/common/config/ConfigValue.groovy index 96aa5c5db5..4060fb69ad 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.config/src/eu/esdihumboldt/hale/common/config/ConfigValue.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.config/src/eu/esdihumboldt/hale/common/config/ConfigValue.groovy @@ -90,5 +90,4 @@ class ConfigValue { // XXX use different kind of representation? value.as(String) } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.config/test/eu/esdihumboldt/hale/common/config/ConfigValueTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.config/test/eu/esdihumboldt/hale/common/config/ConfigValueTest.groovy index ac01fa6d13..1bf5b98eb6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.config/test/eu/esdihumboldt/hale/common/config/ConfigValueTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.config/test/eu/esdihumboldt/hale/common/config/ConfigValueTest.groovy @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.common.config -import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper -import org.junit.BeforeClass - import static org.junit.Assert.* -import org.junit.Test - import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.util.config.Config +import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper +import org.junit.BeforeClass +import org.junit.Test /** * Tests for Config to/from Value conversion. diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/AbstractStringToDateTimeTypeConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/AbstractStringToDateTimeTypeConverter.java index c30df148d7..3446ab21b4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/AbstractStringToDateTimeTypeConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/AbstractStringToDateTimeTypeConverter.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.convert.core; -import org.springframework.core.convert.converter.Converter; - import com.google.common.collect.ImmutableSet; +import org.springframework.core.convert.converter.Converter; /** * Abstract base class for classes that convert a String to some form of date, diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/CalendarToDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/CalendarToDateConverter.java index bd06d2b893..7b83c24fad 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/CalendarToDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/CalendarToDateConverter.java @@ -18,7 +18,6 @@ import java.util.Calendar; import java.util.Date; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/CalendarToJodaDateTimeConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/CalendarToJodaDateTimeConverter.java index ad3ed66543..19837ddc52 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/CalendarToJodaDateTimeConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/CalendarToJodaDateTimeConverter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.convert.core; import java.util.Calendar; - import org.joda.time.DateTime; import org.springframework.core.convert.converter.Converter; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToInstantConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToInstantConverter.java index 2695b6b0d6..5bef2ee4db 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToInstantConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToInstantConverter.java @@ -17,7 +17,6 @@ import java.time.Instant; import java.util.Date; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToJodaDateTimeConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToJodaDateTimeConverter.java index 2e9d4c1eb5..ce35ebb23a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToJodaDateTimeConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToJodaDateTimeConverter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.convert.core; import java.util.Date; - import org.joda.time.DateTime; import org.springframework.core.convert.converter.Converter; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToLocalDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToLocalDateConverter.java index 4a5d488780..b689105b77 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToLocalDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToLocalDateConverter.java @@ -19,7 +19,6 @@ import java.time.LocalDate; import java.time.ZoneId; import java.util.Date; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlDateConverter.java index abbe998971..80d193db1c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlDateConverter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.convert.core; import java.util.Date; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlTimeConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlTimeConverter.java index 52366f82fc..4b56dac25a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlTimeConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlTimeConverter.java @@ -18,7 +18,6 @@ import java.sql.Time; import java.util.Date; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlTimestampConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlTimestampConverter.java index d900bb593f..78e5151793 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlTimestampConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/DateToSqlTimestampConverter.java @@ -18,7 +18,6 @@ import java.sql.Timestamp; import java.util.Date; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/GStringImplToURIConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/GStringImplToURIConverter.java index 25806a6ccc..a5fb9071b3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/GStringImplToURIConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/GStringImplToURIConverter.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.convert.core; import java.net.URI; - import org.codehaus.groovy.runtime.GStringImpl; import org.springframework.core.convert.converter.Converter; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToDateConverter.java index 055193dbbf..78b1f5d67f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToDateConverter.java @@ -17,7 +17,6 @@ import java.time.Instant; import java.util.Date; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToSqlDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToSqlDateConverter.java index 3a4ed174ea..4a1ffb9213 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToSqlDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToSqlDateConverter.java @@ -17,7 +17,6 @@ import java.sql.Date; import java.time.Instant; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToSqlTimestampConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToSqlTimestampConverter.java index c00b65967e..48f01d57af 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToSqlTimestampConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/InstantToSqlTimestampConverter.java @@ -17,7 +17,6 @@ import java.sql.Timestamp; import java.time.Instant; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToDateConverter.java index 091a39647a..30fb949820 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToDateConverter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.convert.core; import java.util.Date; - import org.joda.time.DateTime; import org.springframework.core.convert.converter.Converter; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToSqlDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToSqlDateConverter.java index f9d62986f8..0990955278 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToSqlDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToSqlDateConverter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.convert.core; import java.sql.Date; - import org.joda.time.DateTime; import org.springframework.core.convert.converter.Converter; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToSqlTimestampConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToSqlTimestampConverter.java index a196e8426d..5ac1b14427 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToSqlTimestampConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/JodaDateTimeToSqlTimestampConverter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.convert.core; import java.sql.Timestamp; - import org.joda.time.DateTime; import org.springframework.core.convert.converter.Converter; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToDateConverter.java index 9d029762c8..ee2a676afb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToDateConverter.java @@ -18,7 +18,6 @@ import java.time.LocalDate; import java.time.ZoneId; import java.util.Date; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToSqlDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToSqlDateConverter.java index b67a975fda..8b09217df1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToSqlDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToSqlDateConverter.java @@ -18,7 +18,6 @@ import java.sql.Date; import java.time.LocalDate; import java.time.ZoneId; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToSqlTimestampConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToSqlTimestampConverter.java index d2d43a7513..7a5324d170 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToSqlTimestampConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/LocalDateToSqlTimestampConverter.java @@ -18,7 +18,6 @@ import java.sql.Timestamp; import java.time.LocalDate; import java.time.ZoneId; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlDateToJodaDateTimeConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlDateToJodaDateTimeConverter.java index faf92e189a..0eb3c2cc03 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlDateToJodaDateTimeConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlDateToJodaDateTimeConverter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.convert.core; import java.sql.Date; - import org.joda.time.DateTime; import org.springframework.core.convert.converter.Converter; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlTimestampToJodaDateTimeConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlTimestampToJodaDateTimeConverter.java index 86ebc22c62..76b6bbcecf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlTimestampToJodaDateTimeConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlTimestampToJodaDateTimeConverter.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.convert.core; import java.sql.Timestamp; - import org.joda.time.DateTime; import org.springframework.core.convert.converter.Converter; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlTimestampToSqlDateConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlTimestampToSqlDateConverter.java index cde7a8d270..531525e4bd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlTimestampToSqlDateConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/SqlTimestampToSqlDateConverter.java @@ -17,7 +17,6 @@ import java.sql.Date; import java.sql.Timestamp; - import org.springframework.core.convert.converter.Converter; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToGeometry.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToGeometry.java index ec9dba26e3..4df02a5986 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToGeometry.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToGeometry.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.convert.wkt; -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.convert.wkt.internal.AbstractGeometryConverter; +import org.locationtech.jts.geom.Geometry; /** * Converts Strings to Geometries diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToGeometryCollection.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToGeometryCollection.java index c8696131e1..8ae6f67ee1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToGeometryCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToGeometryCollection.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.convert.wkt; -import org.locationtech.jts.geom.GeometryCollection; - import eu.esdihumboldt.hale.common.convert.wkt.internal.AbstractGeometryConverter; +import org.locationtech.jts.geom.GeometryCollection; /** * Converts Strings to GeometryCollections diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToLineString.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToLineString.java index e7378aeacf..274ec0fea6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToLineString.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToLineString.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.convert.wkt; -import org.locationtech.jts.geom.LineString; - import eu.esdihumboldt.hale.common.convert.wkt.internal.AbstractGeometryConverter; +import org.locationtech.jts.geom.LineString; /** * Converts Strings to LineString diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToLinearRing.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToLinearRing.java index 0c95acfa94..41c591b754 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToLinearRing.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToLinearRing.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.convert.wkt; -import org.locationtech.jts.geom.LinearRing; - import eu.esdihumboldt.hale.common.convert.wkt.internal.AbstractGeometryConverter; +import org.locationtech.jts.geom.LinearRing; /** * Converts Strings to LinearRings diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultiLineString.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultiLineString.java index 790c2b14e6..1a5e7f4886 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultiLineString.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultiLineString.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.convert.wkt; -import org.locationtech.jts.geom.MultiLineString; - import eu.esdihumboldt.hale.common.convert.wkt.internal.AbstractGeometryConverter; +import org.locationtech.jts.geom.MultiLineString; /** * Converts Strings to MultiLineStrings diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultiPoint.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultiPoint.java index 0ced6b66fb..4742bb45cf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultiPoint.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultiPoint.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.convert.wkt; -import org.locationtech.jts.geom.MultiPoint; - import eu.esdihumboldt.hale.common.convert.wkt.internal.AbstractGeometryConverter; +import org.locationtech.jts.geom.MultiPoint; /** * Converts Strings to MultiPoints diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultipolygon.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultipolygon.java index 69249b5f1f..adfd1cc01b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultipolygon.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToMultipolygon.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.convert.wkt; -import org.locationtech.jts.geom.MultiPolygon; - import eu.esdihumboldt.hale.common.convert.wkt.internal.AbstractGeometryConverter; +import org.locationtech.jts.geom.MultiPolygon; /** * Converts Strings to MultiPolygons diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToPoint.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToPoint.java index e9730c0e35..d030e4dd23 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToPoint.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToPoint.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.convert.wkt; -import org.locationtech.jts.geom.Point; - import eu.esdihumboldt.hale.common.convert.wkt.internal.AbstractGeometryConverter; +import org.locationtech.jts.geom.Point; /** * Converts a Strings to Points diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToPolygon.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToPolygon.java index ec332469e2..b54ac00e87 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToPolygon.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/StringToPolygon.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.convert.wkt; -import org.locationtech.jts.geom.Polygon; - import eu.esdihumboldt.hale.common.convert.wkt.internal.AbstractGeometryConverter; +import org.locationtech.jts.geom.Polygon; /** * Converts Strings to Polygons diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/internal/AbstractGeometryConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/internal/AbstractGeometryConverter.java index a122abfb7a..57f7f6d398 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/internal/AbstractGeometryConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/src/eu/esdihumboldt/hale/common/convert/wkt/internal/AbstractGeometryConverter.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.convert.wkt.internal; -import org.springframework.core.convert.converter.Converter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.io.ParseException; import org.locationtech.jts.io.WKTReader; +import org.springframework.core.convert.converter.Converter; /** * Converts strings to geometries @@ -28,7 +27,8 @@ * @author Kevin Mais * @param Geometry Type to convert to */ -public abstract class AbstractGeometryConverter implements Converter { +public abstract class AbstractGeometryConverter + implements Converter { private static WKTReader reader; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/CachingConversionService.java b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/CachingConversionService.java index 88809e4c97..c58a0b005a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/CachingConversionService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/CachingConversionService.java @@ -17,7 +17,6 @@ import java.util.HashMap; import java.util.Map; - import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.ConverterFactory; diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConversionServiceFactory.java b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConversionServiceFactory.java index 62e314d7cb..6e5d6ea86a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConversionServiceFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConversionServiceFactory.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.common.convert; -import org.springframework.core.convert.ConversionService; -import org.springframework.core.convert.converter.ConverterRegistry; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.convert.extension.ConverterExtension; import eu.esdihumboldt.hale.common.convert.extension.ConverterInfo; import eu.esdihumboldt.hale.common.core.service.ServiceFactory; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import org.springframework.core.convert.ConversionService; +import org.springframework.core.convert.converter.ConverterRegistry; /** * Conversion service factory. diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConversionUtil.java b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConversionUtil.java index 46cdb61f8c..865097793b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConversionUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConversionUtil.java @@ -16,15 +16,13 @@ package eu.esdihumboldt.hale.common.convert; +import eu.esdihumboldt.hale.common.core.HalePlatform; import java.util.ArrayList; import java.util.Collection; import java.util.List; - import org.springframework.core.convert.ConversionException; import org.springframework.core.convert.ConversionService; -import eu.esdihumboldt.hale.common.core.HalePlatform; - /** * Conversion utilities. * @@ -65,8 +63,8 @@ public static T getAs(Object value, Class targetType) throws ConversionEx * @param targetType the target element type * @param flatten if the collection shall be flattened, i.e. if it in turn * contains a collection instead the converted values are added - * @return the collection of converted values, an empty list if the value - * was null or an empty collection + * @return the collection of converted values, an empty list if the value was + * null or an empty collection * @throws ConversionException if the conversion fails */ public static List getAsList(Object value, Class targetType, boolean flatten) diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConverterPackageFactoryBean.java b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConverterPackageFactoryBean.java index 79cb288192..4618f13c19 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConverterPackageFactoryBean.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/ConverterPackageFactoryBean.java @@ -16,10 +16,12 @@ package eu.esdihumboldt.hale.common.convert; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.util.reflection.ReflectionHelper; import java.io.IOException; import java.lang.reflect.Modifier; import java.util.List; - import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; @@ -28,17 +30,13 @@ import org.springframework.core.convert.converter.ConverterRegistry; import org.springframework.core.convert.converter.GenericConverter; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.util.reflection.ReflectionHelper; - /** * Factory bean for adding a converter to a converter registry * * @author Simon Templer */ -public class ConverterPackageFactoryBean implements FactoryBean, BeanClassLoaderAware, - InitializingBean { +public class ConverterPackageFactoryBean + implements FactoryBean, BeanClassLoaderAware, InitializingBean { private static final ALogger log = ALoggerFactory.getLogger(ConverterPackageFactoryBean.class); @@ -91,8 +89,8 @@ public void afterPropertiesSet() throws Exception { } /** - * Register all converters and converter factories in a given package with - * the given registry. + * Register all converters and converter factories in a given package with the + * given registry. * * @param registry the converter registry * @param classLoader the class loader diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/extension/ConverterExtension.java b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/extension/ConverterExtension.java index 555fa69724..4e6e71155a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/extension/ConverterExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/extension/ConverterExtension.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.convert.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Converter extension. diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/extension/ConverterInfo.java b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/extension/ConverterInfo.java index 8029ed45c9..f9bbe4679e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/extension/ConverterInfo.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert/src/eu/esdihumboldt/hale/common/convert/extension/ConverterInfo.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.convert.extension; -import org.eclipse.core.runtime.IConfigurationElement; -import org.springframework.core.convert.converter.Converter; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; +import org.eclipse.core.runtime.IConfigurationElement; +import org.springframework.core.convert.converter.Converter; /** * Converter information object. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/HalePlatform.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/HalePlatform.java index 037d28caf8..e84a74172f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/HalePlatform.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/HalePlatform.java @@ -15,16 +15,6 @@ package eu.esdihumboldt.hale.common.core; -import java.net.URL; -import java.util.jar.Attributes; -import java.util.jar.Manifest; - -import javax.annotation.Nullable; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.content.IContentTypeManager; -import org.osgi.framework.Version; - import de.fhg.igd.osgi.util.OsgiUtils; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; @@ -33,6 +23,13 @@ import eu.esdihumboldt.hale.common.core.service.ServiceManager; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.util.nonosgi.NonOsgiPlatform; +import java.net.URL; +import java.util.jar.Attributes; +import java.util.jar.Manifest; +import javax.annotation.Nullable; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.content.IContentTypeManager; +import org.osgi.framework.Version; /** * Helper methods for the Hale platform. @@ -66,8 +63,8 @@ public T getService(Class serviceInterface) { private static final ServiceProvider serviceProvider = new PlatformServiceProvider(); /** - * Get the content type manager. Uses the default Eclipse content type - * manager if running in OSGi, otherwise an adapted version. + * Get the content type manager. Uses the default Eclipse content type manager + * if running in OSGi, otherwise an adapted version. * * @return the content type manager */ @@ -81,9 +78,9 @@ public static IContentTypeManager getContentTypeManager() { } /** - * Get a service based on it's interface type. The service provided here - * have global scope, services that are UI-specific are not included, use - * HaleUI instead to access those services. + * Get a service based on it's interface type. The service provided here have + * global scope, services that are UI-specific are not included, use HaleUI + * instead to access those services. * * @param serviceClass the service class * @return the service instance or null @@ -138,8 +135,8 @@ public static Version getCoreVersion() { /** * Determine if the HALE core bundle/library is a SNAPSHOT version. * - * @return true if the HALE core bundle/library used is - * verified to be a SNAPSHOT version, false otherwise + * @return true if the HALE core bundle/library used is verified to + * be a SNAPSHOT version, false otherwise */ public static boolean isSnapshotVersion() { String qualifier = getCoreVersion().getQualifier(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/internal/CoreBundle.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/internal/CoreBundle.java index 73d5e088c1..2ad23ffe7a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/internal/CoreBundle.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/internal/CoreBundle.java @@ -16,17 +16,14 @@ package eu.esdihumboldt.hale.common.core.internal; +import eu.esdihumboldt.hale.common.core.service.cleanup.CleanupService; +import eu.esdihumboldt.hale.common.core.service.cleanup.impl.CleanupServiceImpl; import java.util.Hashtable; - import javax.annotation.Nullable; - import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; -import eu.esdihumboldt.hale.common.core.service.cleanup.CleanupService; -import eu.esdihumboldt.hale.common.core.service.cleanup.impl.CleanupServiceImpl; - /** * Bundle activator * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/DOMValueUtil.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/DOMValueUtil.groovy index 6fa5bc7ea7..da14f07fb3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/DOMValueUtil.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/DOMValueUtil.groovy @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.core.io -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.core.io.impl.ElementValue import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import eu.esdihumboldt.util.groovy.xml.NSDOMCategory +import org.w3c.dom.Element /** @@ -89,5 +88,4 @@ class DOMValueUtil { builder(tagName, [value: value.stringRepresentation]) } } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ExportProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ExportProvider.java index 843d0219d7..dff6d46a3e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ExportProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ExportProvider.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.core.io; -import java.io.OutputStream; - import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; +import java.io.OutputStream; /** * Base interface for export providers diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/HaleIO.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/HaleIO.java index 7299dea99e..e5bcbacf13 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/HaleIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/HaleIO.java @@ -16,25 +16,7 @@ package eu.esdihumboldt.hale.common.core.io; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.eclipse.core.runtime.content.IContentType; -import org.eclipse.core.runtime.content.IContentTypeManager; -import org.w3c.dom.Element; - import com.google.common.base.Preconditions; - import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactoryCollection; import de.fhg.igd.eclipse.util.extension.FactoryFilter; import de.fhg.igd.slf4jplus.ALogger; @@ -48,6 +30,20 @@ import eu.esdihumboldt.util.Pair; import eu.esdihumboldt.util.io.InputSupplier; import eu.esdihumboldt.util.resource.Resources; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; +import org.eclipse.core.runtime.content.IContentType; +import org.eclipse.core.runtime.content.IContentTypeManager; +import org.w3c.dom.Element; /** * Hale I/O utilities @@ -67,8 +63,8 @@ public abstract class HaleIO { /** * Tests whether a InputStream to the given URI can be opened.
- * In case of a file it instead tests File.isFile and File.canRead() because - * it is a lot faster. + * In case of a file it instead tests File.isFile and File.canRead() because it + * is a lot faster. * * @param uri the URI to test * @param allowResource allow resolving through {@link Resources} @@ -127,10 +123,9 @@ public static List filterFactories( * Filter I/O provider factories by configuration content type * * @param factories the I/O provider factories - * @param configurationContentType the configuration content type the - * factories must support - * @return provider factories that support the given configuration content - * type + * @param configurationContentType the configuration content type the factories + * must support + * @return provider factories that support the given configuration content type */ public static List filterFactoriesByConfigurationType( Collection factories, IContentType configurationContentType) { @@ -152,8 +147,7 @@ public static List filterFactoriesByConfigurationType( } /** - * Find all content types that are of the same kind as the given content - * type. + * Find all content types that are of the same kind as the given content type. * * @param candidates Content types to search * @param kind Parent content type @@ -166,8 +160,7 @@ public static List findContentTypesOfKind(IContentType[] candidate } /** - * Find all content types that are of the same kind as the given content - * type. + * Find all content types that are of the same kind as the given content type. * * @param candidates Content types to search * @param kind Parent content type @@ -196,10 +189,10 @@ public static List findContentTypesOfKind(Collection * type and only use the input supplier if absolutely needed. * * @param types the types to match - * @param in the input supplier to use for testing, may be null - * if the file name is not null - * @param filename the file name, may be null if the input - * supplier is not null + * @param in the input supplier to use for testing, may be null if + * the file name is not null + * @param filename the file name, may be null if the input supplier + * is not null * @return the matched content types */ public static List findContentTypesFor(Collection types, @@ -260,16 +253,14 @@ public static List findContentTypesFor(Collection ty InputStream is = in.getInput(); /* - * IContentTypeManager.findContentTypes seems to return all kind - * of content types that match in any way, but ordered by - * relevance - so if all but the allowed types are removed, the - * remaining types may be very irrelevant and not a match that - * actually was determined based on the input stream. + * IContentTypeManager.findContentTypes seems to return all kind of content + * types that match in any way, but ordered by relevance - so if all but the + * allowed types are removed, the remaining types may be very irrelevant and not + * a match that actually was determined based on the input stream. * - * Thus findContentTypesFor should not be used or only relied - * upon the single best match that is returned. It is now only - * used as fall-back if there is no result for - * findContentTypeFor. + * Thus findContentTypesFor should not be used or only relied upon the single + * best match that is returned. It is now only used as fall-back if there is no + * result for findContentTypeFor. */ // instead use findContentTypeFor IContentType candidate = ctm.findContentTypeFor(is, null); @@ -284,8 +275,8 @@ public static List findContentTypesFor(Collection ty if (results.isEmpty()) { /* - * Fall-back to findContentTypesFor if there was no valid result - * for findContentTypeFor. + * Fall-back to findContentTypesFor if there was no valid result for + * findContentTypeFor. */ try (InputStream is = in.getInput()) { IContentType[] candidates = ctm.findContentTypesFor(is, filename); @@ -302,10 +293,9 @@ public static List findContentTypesFor(Collection ty if (results.isEmpty() && extensionResults != null) { /* - * If there was no valid result for the stream check, but for - * the extension checks, use those results. This may happen for - * instance for generic XML files, that have no specific root - * element. + * If there was no valid result for the stream check, but for the extension + * checks, use those results. This may happen for instance for generic XML + * files, that have no specific root element. */ results.addAll(extensionResults); } @@ -347,8 +337,8 @@ public boolean acceptCollection( * @param providerType the provider type, usually an interface * @param contentType the content type the provider must match, may be * null if providerId is set - * @param providerId the id of the provider to use, may be null - * if contentType is set + * @param providerId the id of the provider to use, may be null if + * contentType is set * @return the I/O provider factory or null if no matching I/O * provider factory is found */ @@ -389,10 +379,10 @@ public static

IOProviderDescriptor findIOProviderFactory( * @param providerType the provider type, usually an interface * @param contentType the content type the provider must match, may be * null if providerId is set - * @param providerId the id of the provider to use, may be null - * if contentType is set - * @return the I/O provider preconfigured with the content type if it was - * given or null if no matching I/O provider is found + * @param providerId the id of the provider to use, may be null if + * contentType is set + * @return the I/O provider preconfigured with the content type if it was given + * or null if no matching I/O provider is found */ @SuppressWarnings("unchecked") public static

P createIOProvider(Class

providerType, @@ -418,12 +408,12 @@ public static

P createIOProvider(Class

providerType, * @param

the provider interface type * * @param providerType the provider type, usually an interface - * @param in the input supplier to use for testing, may be null - * if the file name is not null - * @param filename the file name, may be null if the input - * supplier is not null - * @return the content type or null if no matching content type - * is found + * @param in the input supplier to use for testing, may be null if + * the file name is not null + * @param filename the file name, may be null if the input supplier + * is not null + * @return the content type or null if no matching content type is + * found */ public static

IContentType findContentType(Class

providerType, InputSupplier in, String filename) { @@ -452,12 +442,12 @@ public static

IContentType findContentType(Class

provi * @param

the provider interface type * * @param providerType the provider type, usually an interface - * @param in the input supplier to use for testing, may be null - * if the file name is not null - * @param filename the file name, may be null if the input - * supplier is not null - * @return the I/O provider or null if no matching I/O provider - * is found + * @param in the input supplier to use for testing, may be null if + * the file name is not null + * @param filename the file name, may be null if the input supplier + * is not null + * @return the I/O provider or null if no matching I/O provider is + * found */ public static

P findIOProvider(Class

providerType, InputSupplier in, String filename) { @@ -475,12 +465,12 @@ public static

P findIOProvider(Class

providerType, * @param the provider interface type * * @param providerType the provider type, usually an interface - * @param in the input supplier to use for testing, may be null - * if the file name is not null - * @param filename the file name, may be null if the input - * supplier is not null - * @return a pair with the I/O provider and the corresponding identifier, - * both are null if no matching I/O provider was found + * @param in the input supplier to use for testing, may be null if + * the file name is not null + * @param filename the file name, may be null if the input supplier + * is not null + * @return a pair with the I/O provider and the corresponding identifier, both + * are null if no matching I/O provider was found */ @SuppressWarnings("unchecked") public static Pair findIOProviderAndId(Class providerType, @@ -506,8 +496,8 @@ public static Pair findIOProviderAndId(Class T findImportProvider(Class type, Inp * * @param parentType the parent content type * @param valueType the value content type - * @return if the value content type is compatible with the parent content - * type + * @return if the value content type is compatible with the parent content type */ public static boolean isCompatibleContentType(IContentType parentType, IContentType valueType) { return valueType.isKindOf(parentType); @@ -620,9 +609,8 @@ public static T getComplexValue(Element element, Class expectedType, Obje * * @param value the complex value * @return the DOM representation - * @throws IllegalStateException if the value is neither a DOM element nor - * can be converted to one using the - * {@link ComplexValueExtension} + * @throws IllegalStateException if the value is neither a DOM element nor can + * be converted to one using the {@link ComplexValueExtension} */ public static Element getComplexElement(Object value) { if (value instanceof Element) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOAction.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOAction.java index 1a383c7b90..08f8463de3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOAction.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOAction.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.core.io; -import java.util.Set; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; +import java.util.Set; /** * Represents an I/O action @@ -51,8 +50,8 @@ public interface IOAction extends Identifiable { /** * Get the dependencies of the action. * - * @return the list of identifiers of other actions the action depends on - * for sequential execution, e.g. when loading a project + * @return the list of identifiers of other actions the action depends on for + * sequential execution, e.g. when loading a project */ public Set getDependencies(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOAdvisor.java index 458da0e185..45e9205475 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOAdvisor.java @@ -44,8 +44,8 @@ public interface IOAdvisor { public void setActionId(String actionId); /** - * Set the service provider through which the advisor can access services in - * the current context. This method must be called before + * Set the service provider through which the advisor can access services in the + * current context. This method must be called before * {@link #prepareProvider(IOProvider)}, * {@link #updateConfiguration(IOProvider)} or * {@link #handleResults(IOProvider)} is called @@ -55,8 +55,8 @@ public interface IOAdvisor { public void setServiceProvider(ServiceProvider serviceProvider); /** - * Prepare the I/O provider when it is created. This may be executed even if - * for the provider no execution takes place.
+ * Prepare the I/O provider when it is created. This may be executed even if for + * the provider no execution takes place.
*
* This for instance allows configuration pages on IOWizards to base on this * preparation. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOProvider.java index 4675be2bb7..7030a0643e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/IOProvider.java @@ -16,20 +16,17 @@ package eu.esdihumboldt.hale.common.core.io; +import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueExtension; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import java.io.IOException; import java.nio.charset.Charset; import java.util.Map; import java.util.Set; - import javax.annotation.Nullable; - import org.eclipse.core.runtime.content.IContentType; -import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueExtension; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.service.ServiceProvider; - /** * Interface for I/O providers * @@ -118,16 +115,16 @@ public IOReport execute(ProgressIndicator progress) public IContentType getContentType(); /** - * Set the character set that should be used for encoding/decoding. There - * might be I/O providers thought, that don't respect this setting. + * Set the character set that should be used for encoding/decoding. There might + * be I/O providers thought, that don't respect this setting. * * @param charset the character set */ public void setCharset(Charset charset); /** - * Get the configured character set. Implementations may fall back to a - * default character set if none is configured. + * Get the configured character set. Implementations may fall back to a default + * character set if none is configured. * * @return the character set or null */ @@ -151,9 +148,8 @@ public IOReport execute(ProgressIndicator progress) * Set a parameter * * @param name the parameter name - * @param value the parameter value, it is either a string, a DOM elements - * or a complex value types defined in the - * {@link ComplexValueExtension} + * @param value the parameter value, it is either a string, a DOM elements or a + * complex value types defined in the {@link ComplexValueExtension} */ public void setParameter(String name, Value value); @@ -161,8 +157,8 @@ public IOReport execute(ProgressIndicator progress) * Get the value for the given parameter name * * @param name the parameter name - * @return the parameter value or the NULL value, the value is either a - * string, a DOM elements or a complex value types defined in the + * @return the parameter value or the NULL value, the value is either a string, + * a DOM elements or a complex value types defined in the * {@link ComplexValueExtension} */ public Value getParameter(String name); @@ -170,8 +166,8 @@ public IOReport execute(ProgressIndicator progress) /** * Load the configuration from a map of key/value pairs * - * @param configuration the configuration to load, values are either - * strings, DOM elements or complex value types defined in the + * @param configuration the configuration to load, values are either strings, + * DOM elements or complex value types defined in the * {@link ComplexValueExtension} */ public void loadConfiguration(Map configuration); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ImportProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ImportProvider.java index b373aec270..52b9eeae74 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ImportProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ImportProvider.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.core.io; -import java.io.IOException; -import java.io.InputStream; - import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import java.io.IOException; +import java.io.InputStream; /** * Base interface for import providers @@ -56,12 +55,12 @@ public interface ImportProvider extends IOProvider { public LocatableInputSupplier getSource(); /** - * Get the resource identifier. The identifier serves to uniquely identify - * the resource represented by the import provider. It is either generated - * on execute or loaded from a stored configuration. + * Get the resource identifier. The identifier serves to uniquely identify the + * resource represented by the import provider. It is either generated on + * execute or loaded from a stored configuration. * - * @return the resource identifier, may be null if the provider - * was not executed yet + * @return the resource identifier, may be null if the provider was + * not executed yet */ public String getResourceIdentifier(); @@ -69,20 +68,20 @@ public interface ImportProvider extends IOProvider { * This method executes the I/O provider. It is a special case of * IOProvider.execute(ProgressIndicator progress) and used when * importing multiple schemas or instances. The method is overloaded with - * resourceIdentifier because for every file selected by the user a new - * resource identifier has to be generated so that every schema + * resourceIdentifier because for every file selected by the user a new resource + * identifier has to be generated so that every schema * in @link{SchemaServiceImpl} gets a new ID for the selected schema. * * @param progress the progress indicator, may be null - * @param resourceIdentifier identifier of the provided resource. Null if a - * new resource id needs to be generated. + * @param resourceIdentifier identifier of the provided resource. Null if a new + * resource id needs to be generated. * @return the execution report * * @throws IOProviderConfigurationException if the I/O provider was not * configured properly * @throws IOException if an I/O operation fails - * @throws UnsupportedOperationException if the operation to load multiple - * files is not supported. + * @throws UnsupportedOperationException if the operation to load multiple files + * is not supported. */ public IOReport execute(ProgressIndicator progress, String resourceIdentifier) throws IOProviderConfigurationException, IOException, UnsupportedOperationException; diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/JsonValueUtil.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/JsonValueUtil.groovy index 3165e7cd19..d4aba838a9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/JsonValueUtil.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/JsonValueUtil.groovy @@ -155,5 +155,4 @@ class JsonValueUtil { new JsonSlurper().parseText('{"v":' + json + '}').v } } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/PathUpdate.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/PathUpdate.java index d08740c4f6..0130c7cae2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/PathUpdate.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/PathUpdate.java @@ -16,19 +16,17 @@ package eu.esdihumboldt.hale.common.core.io; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.util.io.IOUtils; +import eu.esdihumboldt.util.resource.Resources; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; import java.net.URLEncoder; import java.text.MessageFormat; - import org.apache.commons.io.FilenameUtils; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.util.io.IOUtils; -import eu.esdihumboldt.util.resource.Resources; - /** * Updater class for a path. * @@ -48,18 +46,18 @@ public class PathUpdate { * Create a path updater based on a pair of known old and new locations. * * @param oldLocation the old location of a file, may be null - * @param newLocation the new location of the same file (though the file - * name may be different), may be null + * @param newLocation the new location of the same file (though the file name + * may be different), may be null */ public PathUpdate(URI oldLocation, URI newLocation) { super(); this.oldLocation = oldLocation; this.newLocation = newLocation; /* - * analyze paths (w/o file name) of both URIs to find out which of the - * later parts are equal, to determine which part of the old location - * has to be replaced by which part of the new location for other files - * that have been moved in a similar way to the analyzed file. + * analyze paths (w/o file name) of both URIs to find out which of the later + * parts are equal, to determine which part of the old location has to be + * replaced by which part of the new location for other files that have been + * moved in a similar way to the analyzed file. */ if (oldLocation != null && newLocation != null && !oldLocation.equals(newLocation)) analysePaths(oldLocation, newLocation); @@ -76,19 +74,19 @@ public PathUpdate(URI oldLocation, URI newLocation) { * *

  • if the URI is absolute: *
      - *
    • if an old and a new location is available it is transformed in the - * same way
    • + *
    • if an old and a new location is available it is transformed in the same + * way
    • *
    • the URI is used as is
    • *
    *
  • * * If none of the applicable cases results in a valid, existing URI and - * tryFallback is true {@link #updatePathFallback(URI)} is returned, - * otherwise null is returned. + * tryFallback is true {@link #updatePathFallback(URI)} is returned, otherwise + * null is returned. * * @param uri the URI in question - * @param tryFallback whether to use {@link #updatePathFallback(URI)} in the - * end or not + * @param tryFallback whether to use {@link #updatePathFallback(URI)} in the end + * or not * @param allowResource whether to allow resolving through {@link Resources} * @return a valid, existing URI or null */ @@ -107,25 +105,25 @@ public URI findLocation(URI uri, boolean tryFallback, boolean allowResource) { * *
  • if the URI is absolute: *
      - *
    • if an old and a new location is available it is transformed in the - * same way
    • + *
    • if an old and a new location is available it is transformed in the same + * way
    • *
    • the URI is used as is
    • *
    *
  • * * If none of the applicable cases results in a valid, existing URI and - * tryFallback is true {@link #updatePathFallback(URI)} is returned, - * otherwise null is returned. + * tryFallback is true {@link #updatePathFallback(URI)} is returned, otherwise + * null is returned. * * @param uri the URI in question - * @param tryFallback whether to use {@link #updatePathFallback(URI)} in the - * end or not + * @param tryFallback whether to use {@link #updatePathFallback(URI)} in the end + * or not * @param allowResource whether to allow resolving through {@link Resources} * @param keepRelative If the URI is relative to the new location and * keepRelative is set, the URI is returned as is.
    * Also, if the URI is relative to the old location and it is - * possible to construct a relative path to the new location, - * that is returned + * possible to construct a relative path to the new location, that is + * returned * @return a valid, existing URI or null */ public URI findLocation(URI uri, boolean tryFallback, boolean allowResource, @@ -197,9 +195,9 @@ public URI findLocation(URI uri, boolean tryFallback, boolean allowResource, } /** - * Create an alternative path for the given location if it matches changes - * from old to new location. If either old or new location is null, or the - * given URI wasn't changed in the same way, this method has no effect. + * Create an alternative path for the given location if it matches changes from + * old to new location. If either old or new location is null, or the given URI + * wasn't changed in the same way, this method has no effect. * * @param oldSource path where the file was saved to * @return the new URI diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ProgressIndicator.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ProgressIndicator.java index aac790002c..d462e5d833 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ProgressIndicator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ProgressIndicator.java @@ -34,8 +34,8 @@ public interface ProgressIndicator { * Start the progress tracking * * @param taskName the main task name - * @param totalWork the total work units for the progress indicator, if - * unknown use {@link #UNKNOWN} + * @param totalWork the total work units for the progress indicator, if unknown + * use {@link #UNKNOWN} */ public void begin(String taskName, int totalWork); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ProgressMonitorIndicator.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ProgressMonitorIndicator.java index c51d119398..50c75aa584 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ProgressMonitorIndicator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ProgressMonitorIndicator.java @@ -44,7 +44,8 @@ public ProgressMonitorIndicator(IProgressMonitor monitor) { @Override public void begin(String taskName, int totalWork) { monitor.beginTask(taskName, - (totalWork == ProgressIndicator.UNKNOWN) ? (IProgressMonitor.UNKNOWN) : (totalWork)); + (totalWork == ProgressIndicator.UNKNOWN) ? (IProgressMonitor.UNKNOWN) + : (totalWork)); } /** @@ -72,11 +73,11 @@ public void setCurrentTask(String taskName) { monitor.subTask(taskName); } catch (Error e) { /* - * Catch SWTErrors that may occur because an update on the monitor - * is not triggered from the same thread as it was created in. This - * may happen in conjunction with ThreadProgressMonitor, where a - * progress dialog may be shared between different tasks. In that - * case the offending call is in Dialog.shortenText (JFace). + * Catch SWTErrors that may occur because an update on the monitor is not + * triggered from the same thread as it was created in. This may happen in + * conjunction with ThreadProgressMonitor, where a progress dialog may be shared + * between different tasks. In that case the offending call is in + * Dialog.shortenText (JFace). */ if (!"org.eclipse.swt.SWTError".equals(e.getClass().getName())) { throw e; diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ResourceAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ResourceAdvisor.java index 51508ae001..02bd781d33 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ResourceAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ResourceAdvisor.java @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.common.core.io; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; - import org.eclipse.core.runtime.content.IContentType; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; - /** * Advisor for handling specific resources. * @@ -36,15 +34,15 @@ public interface ResourceAdvisor { * * @param resource the resource to copy * @param target the target location, usually a file - * @param resourceType the resource content type, may be null - * if unknown + * @param resourceType the resource content type, may be null if + * unknown * @param includeRemote specifies if auxiliary resources associated to the - * resource that are available in a remote location should be - * copied too - * @param reporter the reporter of the I/O process any errors should be - * reported to - * @throws IOException if copying the resource fails or copying the resource - * is not possible + * resource that are available in a remote location should be copied + * too + * @param reporter the reporter of the I/O process any errors should be reported + * to + * @throws IOException if copying the resource fails or copying the resource is + * not possible */ public void copyResource(LocatableInputSupplier resource, Path target, IContentType resourceType, boolean includeRemote, IOReporter reporter) diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/Value.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/Value.java index 14bc297d7e..223343f871 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/Value.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/Value.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.common.core.io; -import java.io.Serializable; -import java.util.Objects; - -import org.w3c.dom.Element; - import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueDefinition; import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueExtension; import eu.esdihumboldt.hale.common.core.io.impl.ComplexValue; import eu.esdihumboldt.hale.common.core.io.impl.SimpleValue; import eu.esdihumboldt.hale.common.core.io.impl.StringValue; +import java.io.Serializable; +import java.util.Objects; +import org.w3c.dom.Element; /** * A simple or complex value with either a {@link String} or DOM {@link Element} @@ -159,9 +157,9 @@ public static Value complex(Object value) { } /** - * Create a value from an object. If a complex value representation is found - * in {@link ComplexValueExtension} a complex value is created, otherwise a - * simple value. + * Create a value from an object. If a complex value representation is found in + * {@link ComplexValueExtension} a complex value is created, otherwise a simple + * value. * * @see #complex(Object) * @see #simple(Object) @@ -190,22 +188,21 @@ public static Value of(Object object) { * @param expectedType the expected value type, this must be either * {@link String}, DOM {@link Element} or a complex value type * defined in the {@link ComplexValueExtension} - * @return the value as the expected type or null if it could - * not be created/converted + * @return the value as the expected type or null if it could not + * be created/converted */ public abstract T as(Class expectedType); /** - * Get the value as the expected type if possible, a default value - * otherwise. + * Get the value as the expected type if possible, a default value otherwise. * * @param expectedType the expected value type, this must be either * {@link String}, DOM {@link Element} or a complex value type * defined in the {@link ComplexValueExtension} - * @param defValue the default value to use if the value is - * null or cannot be converted to the expected type - * @return the value as the expected type or the given default value if it - * could not be created/converted + * @param defValue the default value to use if the value is null or + * cannot be converted to the expected type + * @return the value as the expected type or the given default value if it could + * not be created/converted */ public abstract T as(Class expectedType, T defValue); @@ -213,8 +210,7 @@ public static Value of(Object object) { * Get the value as the given type. * * @param type the type to convert the value to - * @return the value converted to the type or null for a null - * value + * @return the value converted to the type or null for a null value * @throws IllegalArgumentException if the value cannot be converted to the * given type */ @@ -249,15 +245,15 @@ public T asType(Class type) { /** * Determines if the value is empty. * - * @return true if the value is null or another - * kind of empty (e.g. empty string) depending on the value type, + * @return true if the value is null or another kind + * of empty (e.g. empty string) depending on the value type, * false otherwise */ public abstract boolean isEmpty(); /** - * Determines if the value is represented as DOM {@link Element} for - * serializing it. + * Determines if the value is represented as DOM {@link Element} for serializing + * it. * * @return if the value can be represented as {@link Element} * @see #getDOMRepresentation() @@ -266,8 +262,7 @@ public T asType(Class type) { public abstract boolean isRepresentedAsDOM(); /** - * Convenience method to determine if this value has a simple - * representation. + * Convenience method to determine if this value has a simple representation. * * @return if this value has a simple representation */ @@ -276,8 +271,7 @@ public boolean isSimple() { } /** - * Convenience method to determine if this value has a complex - * representation. + * Convenience method to determine if this value has a complex representation. * * @return if this value has a complex representation */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueAlias.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueAlias.java index d6462ccf82..4497935f44 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueAlias.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueAlias.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; +import org.eclipse.core.runtime.IConfigurationElement; /** * {@link ComplexValueDefinition} alias. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueAliasExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueAliasExtension.java index cf39e0a9f8..4df7ac0fa0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueAliasExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueAliasExtension.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension point for {@link ComplexValueDefinition} aliases. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueDefinition.java index 03a1fb11da..2dca5273f7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueDefinition.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import javax.annotation.Nullable; -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.core.io.ComplexValueJson; import eu.esdihumboldt.hale.common.core.io.ComplexValueType; +import javax.annotation.Nullable; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; /** * Represents a complex value type registered with the extension point. @@ -53,8 +51,8 @@ public class ComplexValueDefinition implements Identifiable, ComplexValueTypenull * @param valueType the complex value type - * @throws IllegalAccessException if access to the default constructor of - * the descriptor class is not allowed + * @throws IllegalAccessException if access to the default constructor of the + * descriptor class is not allowed * @throws InstantiationException if the descriptor object cannot be created */ @SuppressWarnings("rawtypes") @@ -129,8 +127,7 @@ public Class getContextType() { * @return the JSON converter or null */ @SuppressWarnings("unchecked") - public @Nullable - ComplexValueJson getJsonConverter() { + public @Nullable ComplexValueJson getJsonConverter() { return jsonConverter; } diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueExtension.java index a66968873a..bdd4f2feb1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueExtension.java @@ -15,19 +15,16 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.ComplexValueJson; import eu.esdihumboldt.hale.common.core.io.ComplexValueType; +import java.util.HashMap; +import java.util.Map; +import javax.xml.namespace.QName; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for complex parameter types. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueJsonDescriptor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueJsonDescriptor.java index 99588c6098..5a023fa68d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueJsonDescriptor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueJsonDescriptor.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import javax.annotation.Nonnull; -import javax.annotation.concurrent.Immutable; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.core.io.ComplexValueJson; +import javax.annotation.Nonnull; +import javax.annotation.concurrent.Immutable; /** * Descriptor for extensions providing augmented JSON converters for existing diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueJsonExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueJsonExtension.java index bb3aea0cee..fbbf0df7cf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueJsonExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ComplexValueJsonExtension.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.ComplexValueJson; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for JSON converters for complex parameter types. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOActionExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOActionExtension.java index 45effbbbed..75b66a4ef3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOActionExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOActionExtension.java @@ -16,16 +16,14 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import eu.esdihumboldt.hale.common.core.io.IOAction; import eu.esdihumboldt.hale.common.core.io.IOProvider; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link IOAction} definitions diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOAdvisorExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOAdvisorExtension.java index e2a104111b..662665ea64 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOAdvisorExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOAdvisorExtension.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import java.text.MessageFormat; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionObjectDefinition; @@ -32,6 +27,9 @@ import eu.esdihumboldt.hale.common.core.io.IOAdvisor; import eu.esdihumboldt.hale.common.core.io.IOAdvisorRegister; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.List; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link IOAdvisor}s diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOAdvisorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOAdvisorFactory.java index acf86cb3fa..eaef3287c9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOAdvisorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOAdvisorFactory.java @@ -42,8 +42,8 @@ public interface IOAdvisorFactory extends ExtensionObjectFactory> { * Create an I/O advisor with the given service provider. * * @param actionId the action identifier - * @param serviceProvider the service provider the advisor will use to - * access services + * @param serviceProvider the service provider the advisor will use to access + * services * @return the I/O advisor * @throws Exception if instantiating the I/O advisor fails */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderAlias.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderAlias.java index ad1a5f7ad4..fd85ba34ba 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderAlias.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderAlias.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.core.io.IOProvider; +import org.eclipse.core.runtime.IConfigurationElement; /** * {@link IOProvider} alias. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderAliasExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderAliasExtension.java index d8b78cc1e8..5132e2546c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderAliasExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderAliasExtension.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import eu.esdihumboldt.hale.common.core.io.IOProvider; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension point for {@link IOProvider} aliases. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderDescriptor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderDescriptor.java index 4760e80c45..49d32abf6d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderDescriptor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderDescriptor.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import java.util.Set; - -import org.eclipse.core.runtime.content.IContentType; - import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.parameter.IOProviderParameter; +import java.util.Set; +import org.eclipse.core.runtime.content.IContentType; /** * Descriptor and factory for an {@link IOProvider} @@ -69,8 +67,8 @@ public interface IOProviderDescriptor extends ExtensionObjectFactory /** * States if loading duplicate resources with this provider is allowed. * - * @return true if loading duplicate resources with this - * provider is allowed, false otherwise + * @return true if loading duplicate resources with this provider + * is allowed, false otherwise */ public boolean allowDuplicateResource(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderDescriptorDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderDescriptorDecorator.java index 82158b937d..af4d32e471 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderDescriptorDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderDescriptorDecorator.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import java.net.URL; -import java.util.Set; - -import org.eclipse.core.runtime.content.IContentType; - import de.fhg.igd.eclipse.util.extension.ExtensionObjectDefinition; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.parameter.IOProviderParameter; +import java.net.URL; +import java.util.Set; +import org.eclipse.core.runtime.content.IContentType; /** * Decorator for an {@link IOProviderDescriptor}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderExtension.java index 23732be992..1686f64f3b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderExtension.java @@ -16,15 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import java.text.MessageFormat; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.Set; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.content.IContentType; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionObjectDefinition; @@ -36,6 +27,13 @@ import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.parameter.IOProviderParameter; +import java.text.MessageFormat; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Set; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.content.IContentType; /** * Extension for {@link IOProvider}s diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderFactory.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderFactory.java index 483b305557..7052229875 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/IOProviderFactory.java @@ -24,8 +24,8 @@ * * @author Simon Templer */ -public interface IOProviderFactory extends - ExtensionObjectFactoryCollection { +public interface IOProviderFactory + extends ExtensionObjectFactoryCollection { // concrete typed interface diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ResourceAdvisorDescriptor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ResourceAdvisorDescriptor.java index 131adb1327..52e29ded48 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ResourceAdvisorDescriptor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ResourceAdvisorDescriptor.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import java.util.Set; - -import org.eclipse.core.runtime.content.IContentType; - import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; import eu.esdihumboldt.hale.common.core.io.ResourceAdvisor; +import java.util.Set; +import org.eclipse.core.runtime.content.IContentType; /** * Descriptor and factory for a {@link ResourceAdvisor} diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ResourceAdvisorExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ResourceAdvisorExtension.java index 9102705a04..fd6789692f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ResourceAdvisorExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/extension/ResourceAdvisorExtension.java @@ -16,14 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.extension; -import java.text.MessageFormat; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.content.IContentType; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionObjectDefinition; @@ -33,14 +25,20 @@ import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.core.io.ResourceAdvisor; import eu.esdihumboldt.hale.common.core.io.impl.DefaultResourceAdvisor; +import java.text.MessageFormat; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.content.IContentType; /** * Extension for {@link ResourceAdvisor}s * * @author Simon Templer */ -public class ResourceAdvisorExtension extends - AbstractExtension { +public class ResourceAdvisorExtension + extends AbstractExtension { /** * {@link ResourceAdvisor} factory based on a {@link IConfigurationElement} @@ -95,8 +93,8 @@ public Set getAssociatedTypes() { result.add(ct); } else { - log.error(MessageFormat.format( - "Content type with ID {0} not known by the platform", id)); + log.error(MessageFormat + .format("Content type with ID {0} not known by the platform", id)); } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractExportProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractExportProvider.java index 0b675d7214..723815fcbb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractExportProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractExportProvider.java @@ -16,12 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import java.io.File; -import java.io.OutputStream; -import java.net.URI; -import java.text.MessageFormat; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.ExportProvider; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -30,6 +24,11 @@ import eu.esdihumboldt.hale.common.core.io.report.impl.DefaultIOReporter; import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; +import java.io.File; +import java.io.OutputStream; +import java.net.URI; +import java.text.MessageFormat; +import java.util.Map; /** * Abstract {@link ExportProvider} implementation diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractGroovyValueJson.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractGroovyValueJson.java index dfcb7915e5..5b6f22105f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractGroovyValueJson.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractGroovyValueJson.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import java.io.IOException; -import java.io.Reader; -import java.io.Writer; - import eu.esdihumboldt.hale.common.core.io.ComplexValueJson; import groovy.json.JsonBuilder; import groovy.json.JsonSlurper; +import java.io.IOException; +import java.io.Reader; +import java.io.Writer; /** * Base class for {@link ComplexValueJson} implementations based on Groovy Json diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractIOProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractIOProvider.java index 320f870684..e7cdf2cf3e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractIOProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractIOProvider.java @@ -16,6 +16,14 @@ package eu.esdihumboldt.hale.common.core.io.impl; +import eu.esdihumboldt.hale.common.core.HalePlatform; +import eu.esdihumboldt.hale.common.core.io.IOProvider; +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -25,18 +33,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; - import org.eclipse.core.runtime.content.IContentType; -import eu.esdihumboldt.hale.common.core.HalePlatform; -import eu.esdihumboldt.hale.common.core.io.IOProvider; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.service.ServiceProvider; - /** * Abstract base class for implementing {@link IOProvider}s * @@ -163,8 +161,7 @@ public void validate() throws IOProviderConfigurationException { /** * Uses {@link #setParameter(String, Value)} to load the configuration. For - * changing the behavior please override - * {@link #setParameter(String, Value)} + * changing the behavior please override {@link #setParameter(String, Value)} * * @see IOProvider#loadConfiguration(Map) */ @@ -177,8 +174,8 @@ public final void loadConfiguration(Map configuration) { /** * Stores all parameters that were set using - * {@link #setParameter(String, Value)} in the configuration. For changing - * the behavior please override this method. + * {@link #setParameter(String, Value)} in the configuration. For changing the + * behavior please override this method. * * @see IOProvider#storeConfiguration(Map) */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractImportProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractImportProvider.java index 1fcffccf3f..aeb86bd463 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractImportProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractImportProvider.java @@ -16,13 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.text.MessageFormat; -import java.util.Map; -import java.util.UUID; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ImportProvider; @@ -33,6 +26,12 @@ import eu.esdihumboldt.hale.common.core.io.report.impl.DefaultIOReporter; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.text.MessageFormat; +import java.util.Map; +import java.util.UUID; /** * Abstract {@link ImportProvider} implementation diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractStreamValueJson.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractStreamValueJson.java index 3808be2970..2677b53abe 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractStreamValueJson.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractStreamValueJson.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; - import eu.esdihumboldt.hale.common.core.io.ComplexValueJson; import groovy.json.JsonBuilder; import groovy.json.JsonSlurper; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; /** * Base class for {@link ComplexValueJson} implementations based on readers and diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ComplexValue.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ComplexValue.java index 7a8882634d..eb485f99c4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ComplexValue.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ComplexValue.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import org.w3c.dom.Element; - import eu.esdihumboldt.hale.common.core.io.HaleIO; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueExtension; +import org.w3c.dom.Element; /** * Complex value represented as DOM {@link Element} as defined by the @@ -37,8 +36,8 @@ public class ComplexValue extends Value { * Create a complex value. * * @param value the value, must be of a type registered with the - * {@link ComplexValueExtension} (though this is not checked in - * the constructor) + * {@link ComplexValueExtension} (though this is not checked in the + * constructor) */ public ComplexValue(Object value) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ConfigurationIOAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ConfigurationIOAdvisor.java index aa0e51777f..aba5c44305 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ConfigurationIOAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ConfigurationIOAdvisor.java @@ -33,9 +33,8 @@ public class ConfigurationIOAdvisor extends AbstractIOAdvi private IOConfiguration conf; /** - * Create an I/O advisor based on I/O configurations that have to be set - * using {@link #setConfiguration(IOConfiguration)} before using the - * advisor. + * Create an I/O advisor based on I/O configurations that have to be set using + * {@link #setConfiguration(IOConfiguration)} before using the advisor. */ public ConfigurationIOAdvisor() { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/DefaultIOAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/DefaultIOAdvisor.java index 433347f986..a83a08839d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/DefaultIOAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/DefaultIOAdvisor.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import java.net.URI; - import eu.esdihumboldt.hale.common.core.io.IOAdvisor; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoAware; import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoService; +import java.net.URI; /** * Base class for {@link IOAdvisor}s that implement {@link ProjectInfoAware}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/DefaultResourceAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/DefaultResourceAdvisor.java index f355ce0b2a..424cfc0b70 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/DefaultResourceAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/DefaultResourceAdvisor.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.hale.common.core.io.impl; +import eu.esdihumboldt.hale.common.core.io.ResourceAdvisor; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; - import org.eclipse.core.runtime.content.IContentType; -import eu.esdihumboldt.hale.common.core.io.ResourceAdvisor; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; - /** * Default resource advisor viable for most resources. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ElementValue.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ElementValue.java index 38c3d29aa0..afbcd8038e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ElementValue.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ElementValue.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import org.w3c.dom.Element; - import eu.esdihumboldt.hale.common.core.io.HaleIO; import eu.esdihumboldt.hale.common.core.io.Value; +import org.w3c.dom.Element; /** * Value based on a DOM {@link Element}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledExport.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledExport.java index d310bf5988..3142e1baee 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledExport.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledExport.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.hale.common.core.io.impl; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; +import eu.esdihumboldt.hale.common.core.io.util.GZipContentDescriber; import java.io.BufferedOutputStream; import java.io.IOException; import java.io.OutputStream; import java.net.URI; import java.util.zip.GZIPOutputStream; - import org.eclipse.core.runtime.content.IContentType; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; -import eu.esdihumboldt.hale.common.core.io.util.GZipContentDescriber; - /** * Export provider that supports GZiped output based on the content type. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledImport.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledImport.java index 1334e7c60f..96fd30d36a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledImport.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledImport.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.hale.common.core.io.impl; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import eu.esdihumboldt.hale.common.core.io.util.GZipContentDescriber; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.util.zip.GZIPInputStream; - import org.eclipse.core.runtime.content.IContentType; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; -import eu.esdihumboldt.hale.common.core.io.util.GZipContentDescriber; - /** * Import provider that supports GZiped input based on the content type. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/LogProgressIndicator.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/LogProgressIndicator.java index 53f2b049e9..f3cd1e50e7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/LogProgressIndicator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/LogProgressIndicator.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import java.text.MessageFormat; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import java.text.MessageFormat; /** * Progress indicator that writes to the console @@ -34,7 +33,7 @@ public class LogProgressIndicator implements ProgressIndicator { private static final ALogger log = ALoggerFactory.getMaskingLogger(LogProgressIndicator.class, null); - private String currentTask = null; //$NON-NLS-1$ + private String currentTask = null; // $NON-NLS-1$ private int totalWork = UNKNOWN; @@ -62,9 +61,10 @@ public void advance(int workUnits) { private void trigger() { if (totalWork > 0 && totalWork != UNKNOWN) { - log.info(MessageFormat.format((currentTask == null) ? ("{0} - {1,number,percent}") - : ("{0} - {1,number,percent} - {2}"), mainTaskName, (float) worked - / (float) totalWork), currentTask); + log.info(MessageFormat.format( + (currentTask == null) ? ("{0} - {1,number,percent}") + : ("{0} - {1,number,percent} - {2}"), + mainTaskName, (float) worked / (float) totalWork), currentTask); } else { log.info(currentTask); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/QNameType.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/QNameType.groovy index 0afd66fc4a..62857c7d35 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/QNameType.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/QNameType.groovy @@ -17,18 +17,16 @@ package eu.esdihumboldt.hale.common.core.io.impl; +import eu.esdihumboldt.hale.common.core.io.ComplexValueType +import eu.esdihumboldt.hale.common.core.io.HaleIO +import groovy.transform.CompileStatic +import groovy.transform.TypeCheckingMode import javax.xml.namespace.QName import javax.xml.parsers.DocumentBuilderFactory import javax.xml.parsers.ParserConfigurationException - import org.w3c.dom.Document import org.w3c.dom.Element -import eu.esdihumboldt.hale.common.core.io.ComplexValueType -import eu.esdihumboldt.hale.common.core.io.HaleIO -import groovy.transform.CompileStatic -import groovy.transform.TypeCheckingMode - /** * XML serialization for {@link QName}. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/SimpleValue.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/SimpleValue.java index 517f1f2b98..83ceb5363e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/SimpleValue.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/SimpleValue.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import org.springframework.core.convert.ConversionService; -import org.w3c.dom.Element; - import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.core.io.Value; +import org.springframework.core.convert.ConversionService; +import org.w3c.dom.Element; /** * Simple value represented as string. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/StringValue.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/StringValue.java index 84e47eb379..41d9e31a5b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/StringValue.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/StringValue.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.core.io.impl; -import org.springframework.core.convert.ConversionService; -import org.w3c.dom.Element; - import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.core.io.Value; +import org.springframework.core.convert.ConversionService; +import org.w3c.dom.Element; /** * Simple value represented as string. @@ -43,9 +42,8 @@ public StringValue(String value) { } /** - * Create a new string value from an arbitrary value. The value is converted - * to string using the {@link ConversionService} or with - * toString(). + * Create a new string value from an arbitrary value. The value is converted to + * string using the {@link ConversionService} or with toString(). * * @param value the value */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/TextType.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/TextType.java index 6087a570a4..8684569466 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/TextType.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/TextType.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.common.core.io.impl; +import eu.esdihumboldt.hale.common.core.io.ComplexValueType; +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.common.core.io.Text; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; - import org.w3c.dom.Document; import org.w3c.dom.Element; -import eu.esdihumboldt.hale.common.core.io.ComplexValueType; -import eu.esdihumboldt.hale.common.core.io.HaleIO; -import eu.esdihumboldt.hale.common.core.io.Text; - /** * Text XML serialization. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValueListType.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValueListType.groovy index fccf859893..ea781fb282 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValueListType.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValueListType.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.core.io.impl -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.core.io.ComplexValueType import eu.esdihumboldt.hale.common.core.io.DOMValueUtil import eu.esdihumboldt.hale.common.core.io.HaleIO @@ -26,6 +24,7 @@ import eu.esdihumboldt.hale.common.core.io.ValueList import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import eu.esdihumboldt.util.groovy.xml.NSDOMCategory import groovy.transform.CompileStatic +import org.w3c.dom.Element /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValueMapType.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValueMapType.groovy index 38531c3a37..2189676d64 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValueMapType.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValueMapType.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.core.io.impl -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.core.io.ComplexValueType import eu.esdihumboldt.hale.common.core.io.DOMValueUtil import eu.esdihumboldt.hale.common.core.io.HaleIO @@ -28,6 +26,7 @@ import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import eu.esdihumboldt.util.groovy.xml.NSDOMCategory import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import org.w3c.dom.Element /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValuePropertiesType.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValuePropertiesType.groovy index d173c48698..643da30356 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValuePropertiesType.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/ValuePropertiesType.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.core.io.impl -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.core.io.ComplexValueType import eu.esdihumboldt.hale.common.core.io.DOMValueUtil import eu.esdihumboldt.hale.common.core.io.HaleIO @@ -27,6 +25,7 @@ import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import eu.esdihumboldt.util.groovy.xml.NSDOMCategory import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import org.w3c.dom.Element /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/DOMProjectHelper.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/DOMProjectHelper.java index e5918c4f4d..711984bca3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/DOMProjectHelper.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/DOMProjectHelper.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.common.core.io.project; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; @@ -34,6 +28,10 @@ import jakarta.xml.bind.Marshaller; import jakarta.xml.bind.Unmarshaller; import jakarta.xml.bind.helpers.DefaultValidationEventHandler; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; /** * Helper class for converting {@link IOConfiguration} to DOM (and back) using diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/FixedProjectInfoService.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/FixedProjectInfoService.java index f6260865f6..85d3aa4e76 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/FixedProjectInfoService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/FixedProjectInfoService.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.core.io.project; -import java.net.URI; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.project.model.Project; +import java.net.URI; /** * {@link ProjectInfoService} implementation with a fixed associated project. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectIO.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectIO.java index 3692cd1c56..a6be4e0973 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectIO.java @@ -16,16 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.project; -import java.io.File; -import java.io.FileFilter; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.runtime.content.IContentType; - import de.fhg.igd.osgi.util.configuration.AbstractConfigurationService; import de.fhg.igd.osgi.util.configuration.IConfigurationService; import eu.esdihumboldt.hale.common.core.io.HaleIO; @@ -37,6 +27,14 @@ import eu.esdihumboldt.hale.common.core.io.project.model.ProjectFile; import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.io.File; +import java.io.FileFilter; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import org.eclipse.core.runtime.content.IContentType; /** * Common utilities and constants regarding project I/O @@ -121,11 +119,11 @@ public Value getProperty(String name) { public static final String PROJECT_ARCHIVE_CONTENT_TYPE_ID = "eu.esdihumboldt.hale.io.project.hale25.zip"; /** - * Create a set of default project files for use with {@link ProjectReader} - * and {@link ProjectWriter} + * Create a set of default project files for use with {@link ProjectReader} and + * {@link ProjectWriter} * - * @param serviceProvider the service provider to use for eventual I/O - * advisors created + * @param serviceProvider the service provider to use for eventual I/O advisors + * created * @return the default project files */ public static Map createDefaultProjectFiles( @@ -152,8 +150,8 @@ public static ComplexConfigurationService createProjectConfigService(final Proje } /** - * Find the HALE project file in a directory. If there are multiple it will - * only find one. + * Find the HALE project file in a directory. If there are multiple it will only + * find one. * * @param projectDir the project directory * @return the name of the project file candidate in that directory, @@ -164,8 +162,8 @@ public static String findProjectFile(File projectDir) { } /** - * Find the HALE project file in a directory. If there are multiple it will - * only find one. + * Find the HALE project file in a directory. If there are multiple it will only + * find one. * * @param projectDir the project directory * @param supportedExtensions the set of supported extensions, each with a diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfo.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfo.java index 419615c6d7..b8f3b09128 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfo.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfo.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.common.core.io.project; +import eu.esdihumboldt.hale.common.core.io.Value; import java.util.Date; - import org.osgi.framework.Version; -import eu.esdihumboldt.hale.common.core.io.Value; - /** * General information on a project * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfoAware.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfoAware.java index a6e6a75c50..4c899e364b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfoAware.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfoAware.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.core.io.project; -import java.net.URI; - import eu.esdihumboldt.hale.common.core.io.IOProvider; +import java.net.URI; /** * Interface for {@link ProjectInfo} aware objects, e.g. {@link IOProvider}s @@ -31,16 +30,16 @@ public interface ProjectInfoAware { /** * Set information about the current project. * - * @param projectInfo the project information, may be null if - * no project is available + * @param projectInfo the project information, may be null if no + * project is available */ public void setProjectInfo(ProjectInfo projectInfo); /** * Set the location the project was loaded from. * - * @param location the project location or null if it was not - * saved yet + * @param location the project location or null if it was not saved + * yet */ public void setProjectLocation(URI location); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfoService.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfoService.java index 4700e3a7e3..15a5d77362 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfoService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectInfoService.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.core.io.project; -import java.net.URI; - import eu.esdihumboldt.hale.common.core.io.Value; +import java.net.URI; /** * Service providing project information. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectReader.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectReader.java index de96fab1f7..d268676086 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectReader.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.core.io.project; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.ImportProvider; import eu.esdihumboldt.hale.common.core.io.project.model.Project; import eu.esdihumboldt.hale.common.core.io.project.model.ProjectFile; +import java.util.Map; /** * Provides support for loading projects @@ -32,8 +31,8 @@ public interface ProjectReader extends ImportProvider { /** * Set the project files to read if applicable. * - * @param projectFiles the project files to read (file name mapped to - * project file) + * @param projectFiles the project files to read (file name mapped to project + * file) */ public void setProjectFiles(Map projectFiles); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectVariableReplacer.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectVariableReplacer.java index df06c99cee..69a9fe7968 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectVariableReplacer.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectVariableReplacer.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.core.io.project; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.core.io.util.AbstractScopedVariableReplacer; +import javax.annotation.Nullable; /** * Project variable replacer. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectVariables.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectVariables.java index 747c89a82d..ee2ae4d8f7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectVariables.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectVariables.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.core.io.project; -import javax.annotation.Nullable; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueProperties; +import javax.annotation.Nullable; /** * Accessor for project variables. Project variable values may be overriden by @@ -151,8 +150,8 @@ public String getStringOpt(String name) { * * @param name the variable name * @return the project variable value if set - * @throws IllegalArgumentException if the project variable with the given - * name is not set + * @throws IllegalArgumentException if the project variable with the given name + * is not set */ public String getString(String name) { String value = getString(name, null); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectWriter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectWriter.java index 38cb27f3e4..f537bcd9c7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/ProjectWriter.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.core.io.project; -import java.net.URI; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.ExportProvider; import eu.esdihumboldt.hale.common.core.io.project.model.Project; import eu.esdihumboldt.hale.common.core.io.project.model.ProjectFile; +import java.net.URI; +import java.util.Map; /** * Provides support for saving projects @@ -37,14 +36,14 @@ public interface ProjectWriter extends ExportProvider { */ public enum ProjectWriterMode { /** - * The project is saved to a target location and the save configuration - * is updated accordingly + * The project is saved to a target location and the save configuration is + * updated accordingly */ SAVE, /** - * The project is exported to a target location but the save - * configuration is not updated + * The project is exported to a target location but the save configuration is + * not updated */ EXPORT } @@ -52,8 +51,8 @@ public enum ProjectWriterMode { /** * Set the additional project files to write. * - * @param projectFiles the project files to write (file name mapped to - * project file) + * @param projectFiles the project files to write (file name mapped to project + * file) */ public void setProjectFiles(Map projectFiles); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/UnmodifiableComplexConfigurationService.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/UnmodifiableComplexConfigurationService.java index b62115aede..85d763b011 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/UnmodifiableComplexConfigurationService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/UnmodifiableComplexConfigurationService.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.core.io.project; -import java.util.List; - import de.fhg.igd.osgi.util.configuration.ConfigurationItem; import eu.esdihumboldt.hale.common.core.io.Value; +import java.util.List; /** * Unmodifiable complex configuration service. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/extension/ProjectFileExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/extension/ProjectFileExtension.java index 46d8f7eddb..e937f1b7a8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/extension/ProjectFileExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/extension/ProjectFileExtension.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.core.io.project.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import eu.esdihumboldt.hale.common.core.io.project.extension.internal.ActionFileFactory; import eu.esdihumboldt.hale.common.core.io.project.extension.internal.CustomFileFactory; import eu.esdihumboldt.hale.common.core.io.project.model.ProjectFile; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link ProjectFile}s @@ -41,8 +40,8 @@ public class ProjectFileExtension extends IdentifiableExtensionnull to use auto-detection - * @param loadParameters the parameters for the I/O provider used for - * loading the file + * @param loadProviderId the provider identifier to use for loading the file, + * may be null to use auto-detection + * @param loadParameters the parameters for the I/O provider used for loading + * the file * @param saveActionId the action identifier for saving the file * @param saveProviderId the provider identifier to use for saving the file - * @param saveParameters the parameters for the I/O provider used for saving - * the file - * @param serviceProvider the service provider the I/O advisor should - * retrieve services through + * @param saveParameters the parameters for the I/O provider used for saving the + * file + * @param serviceProvider the service provider the I/O advisor should retrieve + * services through */ public ActionProjectFile(String loadActionId, String loadProviderId, Map loadParameters, String saveActionId, String saveProviderId, diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/extension/internal/CustomFileFactory.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/extension/internal/CustomFileFactory.java index 8b79cefc48..8f2deb6ccb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/extension/internal/CustomFileFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/extension/internal/CustomFileFactory.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.core.io.project.extension.internal; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.core.io.project.extension.ProjectFileFactory; import eu.esdihumboldt.hale.common.core.io.project.model.ProjectFile; +import org.eclipse.core.runtime.IConfigurationElement; /** * Factory for a custom {@link ProjectFile} diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/AbstractProjectReader.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/AbstractProjectReader.java index a432e40bc7..d5a731f2d8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/AbstractProjectReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/AbstractProjectReader.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.project.impl; -import java.text.MessageFormat; -import java.util.Map; - -import org.osgi.framework.Version; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.HalePlatform; @@ -33,6 +28,9 @@ import eu.esdihumboldt.hale.common.core.io.project.model.ProjectFile; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import java.text.MessageFormat; +import java.util.Map; +import org.osgi.framework.Version; /** * Abstract project reader with information on project and projectfiles @@ -45,8 +43,7 @@ public abstract class AbstractProjectReader extends AbstractImportProvider private static final ALogger log = ALoggerFactory.getLogger(AbstractProjectReader.class); /** - * The additional project files, file names are mapped to project file - * objects + * The additional project files, file names are mapped to project file objects */ private Map projectFiles; diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/AbstractProjectWriter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/AbstractProjectWriter.java index 196200ada3..2116b0926e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/AbstractProjectWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/AbstractProjectWriter.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.project.impl; -import java.net.URI; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.impl.AbstractExportProvider; @@ -27,6 +24,8 @@ import eu.esdihumboldt.hale.common.core.io.project.ProjectWriter; import eu.esdihumboldt.hale.common.core.io.project.model.Project; import eu.esdihumboldt.hale.common.core.io.project.model.ProjectFile; +import java.net.URI; +import java.util.Map; /** * Abstract project writer with information on project and projectfiles @@ -37,8 +36,7 @@ public abstract class AbstractProjectWriter extends AbstractExportProvider implements ProjectWriter { /** - * The additional project files, file names are mapped to project file - * objects + * The additional project files, file names are mapped to project file objects */ private Map projectFiles; diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectImport.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectImport.java index 9c2fe78840..17b598baff 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectImport.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectImport.java @@ -16,15 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.project.impl; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -34,6 +25,14 @@ import eu.esdihumboldt.hale.common.core.io.project.ProjectIO; import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; /** * Load project from a zip-archive (created by {@link ArchiveProjectWriter}) @@ -61,8 +60,8 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) if (!baseFile.exists()) { /* - * If the archive was not saved as project archive but manually - * created, the file name may not be correct. + * If the archive was not saved as project archive but manually created, the + * file name may not be correct. */ // TODO detect project file location?! diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectReader.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectReader.java index 538e479e4a..7155f5b390 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectReader.java @@ -16,14 +16,7 @@ package eu.esdihumboldt.hale.common.core.io.project.impl; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.text.MessageFormat; -import java.util.Collections; - import com.google.common.io.Files; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.HaleIO; @@ -40,6 +33,11 @@ import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import eu.esdihumboldt.hale.common.core.service.cleanup.TemporaryFiles; import eu.esdihumboldt.util.io.IOUtils; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.text.MessageFormat; +import java.util.Collections; /** * Load project from a zip-archive (created by {@link ArchiveProjectWriter}) @@ -98,8 +96,8 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) if (readProject != null) { /* - * Because the original source is only available here, update the - * project's resource paths here. + * Because the original source is only available here, update the project's + * resource paths here. * * The only drawback is that the UILocationUpdater cannot be used. */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectWriter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectWriter.java index 41e685b6dc..7b958492d8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/ArchiveProjectWriter.java @@ -16,26 +16,7 @@ package eu.esdihumboldt.hale.common.core.io.project.impl; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.zip.ZipOutputStream; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; -import org.eclipse.core.runtime.content.IContentType; - import com.google.common.io.Files; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.HalePlatform; @@ -61,6 +42,22 @@ import eu.esdihumboldt.hale.common.core.service.cleanup.CleanupContext; import eu.esdihumboldt.hale.common.core.service.cleanup.CleanupService; import eu.esdihumboldt.util.io.IOUtils; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipOutputStream; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.FilenameUtils; +import org.eclipse.core.runtime.content.IContentType; /** * Save projects (including all related resources) as an archive (zip) diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/DefaultProjectReader.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/DefaultProjectReader.java index 36ccef4f7f..782b3b8513 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/DefaultProjectReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/DefaultProjectReader.java @@ -16,15 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.project.impl; -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.MessageFormat; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - import eu.esdihumboldt.hale.common.core.io.ExportProvider; import eu.esdihumboldt.hale.common.core.io.HaleIO; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -40,6 +31,14 @@ import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; import eu.esdihumboldt.util.io.InputStreamDecorator; +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.MessageFormat; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; /** * Reads a project file @@ -235,14 +234,14 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) // clear project infos /* - * XXX was there any particular reason why this was done? I suspect it - * was done so when saving the project this information is not saved - * again as-is, but on the basis of actual files written. However, this - * case is handled in the project writer already. + * XXX was there any particular reason why this was done? I suspect it was done + * so when saving the project this information is not saved again as-is, but on + * the basis of actual files written. However, this case is handled in the + * project writer already. * - * As this information is in fact necessary when trying to identify - * certain files like the alignment, clearing the list of project files - * was commented out. + * As this information is in fact necessary when trying to identify certain + * files like the alignment, clearing the list of project files was commented + * out. */ // getProject().getProjectFiles().clear(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/DefaultProjectWriter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/DefaultProjectWriter.java index e813fa3d80..cae9c01af8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/DefaultProjectWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/impl/DefaultProjectWriter.java @@ -16,17 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.project.impl; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URI; -import java.util.Map; -import java.util.Map.Entry; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ImportProvider; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -44,6 +33,16 @@ import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; import eu.esdihumboldt.util.io.EntryOutputStream; import eu.esdihumboldt.util.io.IOUtils; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.URI; +import java.util.Map; +import java.util.Map.Entry; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; /** * Writes a project file diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/IOConfiguration.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/IOConfiguration.java index 3ecdc1655d..adce6dea61 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/IOConfiguration.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/IOConfiguration.java @@ -16,14 +16,13 @@ package eu.esdihumboldt.hale.common.core.io.project.model; -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.CachingImportProvider; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueExtension; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; /** * Object holding all information necessary to reproduce an {@link IOProvider} @@ -40,8 +39,8 @@ public class IOConfiguration implements Serializable, Cloneable { private String providerId; /** - * Value that optionally stores cached information or the cached resource - * and may be updated when the {@link IOConfiguration} is executed. + * Value that optionally stores cached information or the cached resource and + * may be updated when the {@link IOConfiguration} is executed. * * @see CachingImportProvider */ @@ -105,9 +104,8 @@ public void setProviderId(String providerId) { /** * Get the I/O provider configuration. * - * @return the provider configuration, values are either strings, DOM - * elements or complex value types defined in the - * {@link ComplexValueExtension} + * @return the provider configuration, values are either strings, DOM elements + * or complex value types defined in the {@link ComplexValueExtension} */ public Map getProviderConfiguration() { return providerConfiguration; diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/IOConfigurationResource.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/IOConfigurationResource.java index 89afbcdbaf..f9203f7775 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/IOConfigurationResource.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/IOConfigurationResource.java @@ -15,13 +15,11 @@ package eu.esdihumboldt.hale.common.core.io.project.model; -import java.net.URI; - -import org.eclipse.core.runtime.content.IContentType; - import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.core.io.ImportProvider; import eu.esdihumboldt.hale.common.core.io.Value; +import java.net.URI; +import org.eclipse.core.runtime.content.IContentType; /** * Immutable resource wrapper for an I/O configuration. @@ -38,9 +36,9 @@ public class IOConfigurationResource implements Resource { * Create a new resource. * * @param config the I/O configuration to wrap - * @param projectLocation the location of the project relative URIs should - * be resolved against, should be null only if there - * are no relative resources + * @param projectLocation the location of the project relative URIs should be + * resolved against, should be null only if there are no + * relative resources */ public IOConfigurationResource(IOConfiguration config, URI projectLocation) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/Project.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/Project.java index 51139531cf..5b887b39bf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/Project.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/Project.java @@ -16,6 +16,10 @@ package eu.esdihumboldt.hale.common.core.io.project.model; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueExtension; +import eu.esdihumboldt.hale.common.core.io.project.ProjectInfo; +import eu.esdihumboldt.hale.common.core.io.project.model.internal.JaxbProjectIO; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; @@ -24,14 +28,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.TreeMap; - import org.osgi.framework.Version; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueExtension; -import eu.esdihumboldt.hale.common.core.io.project.ProjectInfo; -import eu.esdihumboldt.hale.common.core.io.project.model.internal.JaxbProjectIO; - /** * Represents a project. * @@ -240,9 +238,8 @@ public void setModified(Date modified) { } /** - * @return the project properties, values are either strings, DOM elements - * or complex value types defined in the - * {@link ComplexValueExtension} + * @return the project properties, values are either strings, DOM elements or + * complex value types defined in the {@link ComplexValueExtension} */ public Map getProperties() { return properties; diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/ProjectFile.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/ProjectFile.java index 79e47542c1..bd7cf9f269 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/ProjectFile.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/ProjectFile.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.core.io.project.model; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; import java.io.InputStream; import java.io.OutputStream; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; - /** * File associated/stored with a project. Implementations must have a default * constructor if they shall be used in a project. @@ -39,8 +38,8 @@ public interface ProjectFile { public void load(InputStream in) throws Exception; /** - * Reset the file when a project is loaded but no data for the file was - * present or loading the file failed. + * Reset the file when a project is loaded but no data for the file was present + * or loading the file failed. * * @see #apply() */ @@ -48,8 +47,8 @@ public interface ProjectFile { /** * Apply the (loaded) configuration. Is called even if - * {@link #load(InputStream)} or {@link #apply()} haven't been called after - * the main project file has been loaded. + * {@link #load(InputStream)} or {@link #apply()} haven't been called after the + * main project file has been loaded. */ public void apply(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/Resource.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/Resource.java index ca03336269..ea62dcfd7e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/Resource.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/Resource.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.project.model; import java.net.URI; - import org.eclipse.core.runtime.content.IContentType; /** @@ -69,9 +68,8 @@ public interface Resource { /** * Copy the resource I/O configuration. * - * @param absolute true if an absolute URI should be used for - * the source if possible, false if the copy should - * be exact + * @param absolute true if an absolute URI should be used for the + * source if possible, false if the copy should be exact * @return the configuration copy */ public IOConfiguration copyConfiguration(boolean absolute); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/impl/PredefinedProjectFile.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/impl/PredefinedProjectFile.java index 08fde29645..68c3c0508c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/impl/PredefinedProjectFile.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/impl/PredefinedProjectFile.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.core.io.project.model.impl; -import java.io.InputStream; -import java.io.OutputStream; - import com.google.common.io.ByteStreams; - import eu.esdihumboldt.hale.common.core.io.project.model.ProjectFile; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; import eu.esdihumboldt.util.io.InputSupplier; +import java.io.InputStream; +import java.io.OutputStream; /** * Project file that takes its content from an existing source. This kind of @@ -36,8 +34,8 @@ public class PredefinedProjectFile implements ProjectFile { private final InputSupplier source; /** - * Create a pre-defined project file with the given input supplier - * specifying the file content. + * Create a pre-defined project file with the given input supplier specifying + * the file content. * * @param source the file content source */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/JaxbProjectIO.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/JaxbProjectIO.java index 4c9fe48d74..a86cef08c4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/JaxbProjectIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/JaxbProjectIO.java @@ -16,12 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.project.model.internal; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import javax.xml.transform.stream.StreamSource; - import eu.esdihumboldt.hale.common.core.io.project.model.Project; import eu.esdihumboldt.hale.common.core.io.project.model.internal.generated.ObjectFactory; import eu.esdihumboldt.hale.common.core.io.project.model.internal.generated.ProjectType; @@ -30,6 +24,10 @@ import jakarta.xml.bind.JAXBException; import jakarta.xml.bind.Marshaller; import jakarta.xml.bind.Unmarshaller; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import javax.xml.transform.stream.StreamSource; /** * Save or load a project diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/JaxbToProject.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/JaxbToProject.java index 5a4f5c4016..8ae12581a8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/JaxbToProject.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/JaxbToProject.java @@ -15,14 +15,6 @@ package eu.esdihumboldt.hale.common.core.io.project.model.internal; -import java.net.URI; -import java.util.Date; -import java.util.Map; - -import javax.xml.datatype.XMLGregorianCalendar; - -import org.osgi.framework.Version; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.impl.ElementValue; import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; @@ -36,6 +28,11 @@ import eu.esdihumboldt.hale.common.core.io.project.model.internal.generated.PropertyType; import eu.esdihumboldt.hale.common.core.io.project.model.internal.generated.ValueType; import jakarta.xml.bind.JAXBElement; +import java.net.URI; +import java.util.Date; +import java.util.Map; +import javax.xml.datatype.XMLGregorianCalendar; +import org.osgi.framework.Version; /** * Converts a JAXB {@link ProjectType} to a {@link Project}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/OsgiClassFieldHandler.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/OsgiClassFieldHandler.java index 9bd8c8a126..94cbfe2446 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/OsgiClassFieldHandler.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/OsgiClassFieldHandler.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.core.io.project.model.internal; -import org.exolab.castor.mapping.GeneralizedFieldHandler; - import de.fhg.igd.osgi.util.OsgiUtils; +import org.exolab.castor.mapping.GeneralizedFieldHandler; /** * Field handler for {@link Class}es in an OSGi context. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/ProjectToJaxb.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/ProjectToJaxb.java index 71cbeb9c42..5158bd73df 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/ProjectToJaxb.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/ProjectToJaxb.java @@ -15,14 +15,6 @@ package eu.esdihumboldt.hale.common.core.io.project.model.internal; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.Map.Entry; - -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.XMLGregorianCalendar; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; import eu.esdihumboldt.hale.common.core.io.project.model.Project; @@ -35,6 +27,12 @@ import eu.esdihumboldt.hale.common.core.io.project.model.internal.generated.ProjectType; import eu.esdihumboldt.hale.common.core.io.project.model.internal.generated.PropertyType; import eu.esdihumboldt.hale.common.core.io.project.model.internal.generated.ValueType; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.Map.Entry; +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.XMLGregorianCalendar; /** * Convert a {@link Project} to a JAXB {@link ProjectType}. @@ -139,8 +137,8 @@ public static IOConfigurationType toIOConfigurationType(IOConfiguration config) result.getAbstractSetting().add(of.createSetting((PropertyType) property)); } else if (property instanceof ComplexPropertyType) { - result.getAbstractSetting().add( - of.createComplexSetting((ComplexPropertyType) property)); + result.getAbstractSetting() + .add(of.createComplexSetting((ComplexPropertyType) property)); } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/URIFieldHandler.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/URIFieldHandler.java index 5fa22f66e9..724d4a29ef 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/URIFieldHandler.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/model/internal/URIFieldHandler.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.core.io.project.model.internal; import java.net.URI; - import org.exolab.castor.mapping.GeneralizedFieldHandler; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/LocationUpdater.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/LocationUpdater.java index c3b98f1db9..dd9a3f76e0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/LocationUpdater.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/LocationUpdater.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.hale.common.core.io.project.util; -import java.net.URI; -import java.util.List; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.ExportProvider; import eu.esdihumboldt.hale.common.core.io.ImportProvider; import eu.esdihumboldt.hale.common.core.io.PathUpdate; @@ -27,6 +23,9 @@ import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; import eu.esdihumboldt.hale.common.core.io.project.model.Project; import eu.esdihumboldt.hale.common.core.io.project.model.ProjectFileInfo; +import java.net.URI; +import java.util.List; +import java.util.Map; /** * Updates locations in a project's I/O configurations that are not accessible, @@ -41,17 +40,19 @@ public class LocationUpdater extends PathUpdate { /** * Default constructor.
    - * If either project, the save configuration of project or newLocation is - * null all calls on this object will have no effect. + * If either project, the save configuration of project or newLocation is null + * all calls on this object will have no effect. * * @param project the project to update * @param newLocation the new location of the project file */ public LocationUpdater(Project project, URI newLocation) { // sorry about that... - super(project == null ? null : ((project.getSaveConfiguration() == null) ? null : URI - .create(project.getSaveConfiguration().getProviderConfiguration() - .get(ExportProvider.PARAM_TARGET).toString())), newLocation); + super(project == null ? null + : ((project.getSaveConfiguration() == null) ? null + : URI.create(project.getSaveConfiguration().getProviderConfiguration() + .get(ExportProvider.PARAM_TARGET).toString())), + newLocation); this.project = project; } @@ -59,8 +60,8 @@ public LocationUpdater(Project project, URI newLocation) { /** * Update locations in the given project. * - * @param keepRelative whether to keep working relative URIs as is or make - * them absolute + * @param keepRelative whether to keep working relative URIs as is or make them + * absolute */ public void updateProject(boolean keepRelative) { if (project == null || getOldLocation() == null || getNewLocation() == null) @@ -92,9 +93,9 @@ public void updateProject(boolean keepRelative) { /* * Project files should always be next to the project file. * - * Fallback wouldn't have an effect here because as it is used - * currently in the project service, project files are already - * loaded in the DefaultProjectReader. + * Fallback wouldn't have an effect here because as it is used currently in the + * project service, project files are already loaded in the + * DefaultProjectReader. */ URI resolved = findLocation(location, false, false, keepRelative); if (resolved != null) diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLAlignmentUpdater.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLAlignmentUpdater.java index 20946add28..f976e024fe 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLAlignmentUpdater.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLAlignmentUpdater.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.core.io.project.util; +import eu.esdihumboldt.hale.common.core.io.project.impl.ArchiveProjectWriter; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import java.io.File; import java.io.IOException; import java.net.URI; -import eu.esdihumboldt.hale.common.core.io.project.impl.ArchiveProjectWriter; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; - /** * Class for updating alignment in the {@link ArchiveProjectWriter}.
    * Resolves the included base alignments, copies them next to the given @@ -38,22 +37,22 @@ public class XMLAlignmentUpdater { private final static String CASTOR_AND_JAXB = CASTOR + " | " + JAXB; /** - * Reads the given alignment (resource) and searches for included base - * alignment in the file. If these files are local, the function tries to - * copy the resources into a new directory next to the given alignment and - * adapts the dependencies in it. The oldFile is the path of the alignment - * before it was copied to its new directory (eg. temporary directory). The - * oldFile is left untouched. Resource has to be a copy of oldFile. + * Reads the given alignment (resource) and searches for included base alignment + * in the file. If these files are local, the function tries to copy the + * resources into a new directory next to the given alignment and adapts the + * dependencies in it. The oldFile is the path of the alignment before it was + * copied to its new directory (eg. temporary directory). The oldFile is left + * untouched. Resource has to be a copy of oldFile. * * @see XMLSchemaUpdater#update(File, URI, boolean, IOReporter) * @see XMLPathUpdater#update(File, URI, String, boolean, IOReporter) * @param resource the file of the new resource (will be adapted) * @param oldFile the file of the old resource (will be untouched), may be * null in case it didn't exist before - * @param includeWebResources true if web resources should be copied and - * updated too otherwise false - * @param reporter the reporter of the current I/O process where errors - * should be reported to + * @param includeWebResources true if web resources should be copied and updated + * too otherwise false + * @param reporter the reporter of the current I/O process where errors should + * be reported to * @throws IOException if file can not be updated */ public static void update(File resource, URI oldFile, boolean includeWebResources, diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLPathUpdater.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLPathUpdater.java index 90b2ef1e95..66bea28fe8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLPathUpdater.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLPathUpdater.java @@ -16,6 +16,13 @@ package eu.esdihumboldt.hale.common.core.io.project.util; +import com.google.common.io.ByteStreams; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; +import eu.esdihumboldt.util.io.IOUtils; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -26,7 +33,6 @@ import java.net.URI; import java.util.HashMap; import java.util.Map; - import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -40,7 +46,6 @@ import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; - import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -48,15 +53,6 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import com.google.common.io.ByteStreams; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; -import eu.esdihumboldt.util.io.IOUtils; - /** * Class for updating location values in XML files.
    * Loads a XML file, searches for specified nodes with location values, resolves @@ -74,26 +70,24 @@ public class XMLPathUpdater { /** * Updates the specified resource file.
    *
    - * The specified file xmlResource, which was originally placed - * at oldFile gets updated. All node values found by the XPath + * The specified file xmlResource, which was originally placed at + * oldFile gets updated. All node values found by the XPath * expression locationXPath get copied (and the node values are * updated accordingly) to a new relative path (except for web resources if - * includeWebResources is false). The copied files are then - * checked the same way.
    - * Resources (identified by their absolute URI) will be copied only once. - * Note however, that this is only true for a single call of this method. So - * if this method is called multiple times for the same file and some - * referenced resources are present in both calls, they are copied multiple - * times. You should select your XPath expression accordingly.
    + * includeWebResources is false). The copied files are then checked + * the same way.
    + * Resources (identified by their absolute URI) will be copied only once. Note + * however, that this is only true for a single call of this method. So if this + * method is called multiple times for the same file and some referenced + * resources are present in both calls, they are copied multiple times. You + * should select your XPath expression accordingly.
    * Example:
    - * resource file is 'C:/Local/Temp/1348138164029-0/watercourse/wfs_va.xsd' - *
    + * resource file is 'C:/Local/Temp/1348138164029-0/watercourse/wfs_va.xsd'
    * oldFile is 'C:/igd/hale/watercourse/wfs_va.xsd'.
    * wfs_va.xsd has one schema import with location * 'C:/igd/hale/watercourse/schemas/feature.xsd'
    - * So feature.xsd is copied into - * 'C:/Local/Temp/1348138164029-0/watercourse/' (or a sub-directory) and the - * import location in wfs_va.xsd will be adapted. + * So feature.xsd is copied into 'C:/Local/Temp/1348138164029-0/watercourse/' + * (or a sub-directory) and the import location in wfs_va.xsd will be adapted. * * @param xmlResource the XML resource file that gets updated * @param oldPath its original location, may be null in case it @@ -102,8 +96,8 @@ public class XMLPathUpdater { * processed * @param includeWebResources whether web resources should be copied and * updates, too - * @param reporter the reporter of the current IO process where errors - * should be reported to + * @param reporter the reporter of the current IO process where errors should be + * reported to * @throws IOException if an IO exception occurs */ public static void update(File xmlResource, URI oldPath, String locationXPath, @@ -121,11 +115,10 @@ public static void update(File xmlResource, URI oldPath, String locationXPath, * processed * @param includeWebResources whether web resources should be copied and * updates, too - * @param reporter the reporter of the current IO process where errors - * should be reported to - * @param updates a map of already copied files which is used and gets - * filled by this method. Needed for multiple updates on the same - * file. + * @param reporter the reporter of the current IO process where errors should be + * reported to + * @param updates a map of already copied files which is used and gets filled by + * this method. Needed for multiple updates on the same file. * @throws IOException if an IO exception occurs */ private static void update(File xmlResource, URI oldPath, String locationXPath, diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLSchemaUpdater.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLSchemaUpdater.java index 0c2c7a7606..a59e7e88e4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLSchemaUpdater.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/project/util/XMLSchemaUpdater.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.core.io.project.util; +import eu.esdihumboldt.hale.common.core.io.project.impl.ArchiveProjectWriter; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import java.io.File; import java.io.IOException; import java.net.URI; -import eu.esdihumboldt.hale.common.core.io.project.impl.ArchiveProjectWriter; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; - /** * Class for updating XML schemas in the {@link ArchiveProjectWriter}.
    * Resolves the imported/included xml schemas, copies them next to the given @@ -39,32 +38,30 @@ public class XMLSchemaUpdater { private final static String IMPORT_AND_INCLUDE = IMPORT + " | " + INCLUDE; /** - * Reads the given xml schema (resource) and searches for included and - * imported schemas in the file. If these files are local, the function - * tries to copy the resources into a new directory next to the given schema - * (resource) and adapts the dependencies in the resource. The oldFile is - * the path of the xml schema before it was copied to his new directory (eg. - * temporary directory). The oldFile keeps untouched. Resource has to be a - * copy of oldFile.
    + * Reads the given xml schema (resource) and searches for included and imported + * schemas in the file. If these files are local, the function tries to copy the + * resources into a new directory next to the given schema (resource) and adapts + * the dependencies in the resource. The oldFile is the path of the xml schema + * before it was copied to his new directory (eg. temporary directory). The + * oldFile keeps untouched. Resource has to be a copy of oldFile.
    *
    * Example:
    * resource file is 'C:/Local/Temp/1348138164029-0/watercourse/wfs_va.xsd'
    * oldFile is 'C:/igd/hale/watercourse/wfs_va.xsd'.
    * wfs_va.xsd has one schema import with location * 'C:/igd/hale/watercourse/schemas/hydro.xsd'
    - * So hydro.xsd is copied into 'C:/Local/Temp/1348138164029-0/watercourse/' - * (or a subdirectory) and the import location in wfs_va.xsd will be - * adapted.
    + * So hydro.xsd is copied into 'C:/Local/Temp/1348138164029-0/watercourse/' (or + * a subdirectory) and the import location in wfs_va.xsd will be adapted.
    * Resources only will be copied once. In this case the schema location is * solved relative to the originally schema. * * @see XMLPathUpdater#update(File, URI, String, boolean, IOReporter) * @param resource the file of the new resource (will be adapted) * @param oldFile the file of the old resource (will be untouched) - * @param includeWebResources true if web resources should be copied and - * updated too otherwise false - * @param reporter the reporter of the current I/O process where errors - * should be reported to + * @param includeWebResources true if web resources should be copied and updated + * too otherwise false + * @param reporter the reporter of the current I/O process where errors should + * be reported to * @throws IOException if file can not be updated */ public static void update(File resource, URI oldFile, boolean includeWebResources, diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/IOReporter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/IOReporter.java index f83e2eaf1f..7aa7444e54 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/IOReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/IOReporter.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.core.io.report; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.core.report.Reporter; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import javax.annotation.Nullable; /** * Reporter for I/O providers diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/DefaultIOReporter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/DefaultIOReporter.java index 2c14f3f127..c16c557040 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/DefaultIOReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/DefaultIOReporter.java @@ -37,9 +37,9 @@ public class DefaultIOReporter extends DefaultReporter private Locatable target; /** - * Create an empty I/O report. It is set to not successful by default. But - * you should call {@link #setSuccess(boolean)} nonetheless to update the - * timestamp after the task has finished. + * Create an empty I/O report. It is set to not successful by default. But you + * should call {@link #setSuccess(boolean)} nonetheless to update the timestamp + * after the task has finished. * * @see DefaultReporter#DefaultReporter(String, String, Class, boolean) * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOMessageImpl.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOMessageImpl.java index 024421325d..fb590a983d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOMessageImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOMessageImpl.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.core.io.report.impl; -import java.text.MessageFormat; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.core.io.report.IOMessage; import eu.esdihumboldt.hale.common.core.report.impl.MessageImpl; +import java.text.MessageFormat; +import net.jcip.annotations.Immutable; /** * Default {@link IOMessage} implementation diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOMessageImplDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOMessageImplDefinition.java index f2a8afc4dc..521eafa6ac 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOMessageImplDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOMessageImplDefinition.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.core.io.report.impl; -import java.util.Properties; - import eu.esdihumboldt.hale.common.core.report.impl.AbstractMessageDefinition; +import java.util.Properties; /** * Object definition for {@link IOMessageImpl} @@ -51,8 +50,8 @@ public IOMessageImplDefinition() { protected IOMessageImpl createMessage(Properties props) { return new IOMessageImpl(props.getProperty(KEY_MESSAGE), null, props.getProperty(KEY_STACK_TRACE), - Integer.parseInt(props.getProperty(KEY_IO_LINE)), Integer.parseInt(props - .getProperty(KEY_IO_COLUMN))); + Integer.parseInt(props.getProperty(KEY_IO_LINE)), + Integer.parseInt(props.getProperty(KEY_IO_COLUMN))); } /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOReportImplDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOReportImplDefinition.java index 498126d9fc..bccd7b6e87 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOReportImplDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/report/impl/IOReportImplDefinition.java @@ -16,15 +16,14 @@ package eu.esdihumboldt.hale.common.core.io.report.impl; -import java.net.URI; -import java.util.Properties; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; import eu.esdihumboldt.hale.common.core.report.impl.AbstractReportDefinition; +import java.net.URI; +import java.util.Properties; /** * Object definition for {@link IOReporter}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/DefaultInputSupplier.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/DefaultInputSupplier.java index 733af52a74..40728d5828 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/DefaultInputSupplier.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/DefaultInputSupplier.java @@ -16,15 +16,14 @@ package eu.esdihumboldt.hale.common.core.io.supplier; +import eu.esdihumboldt.hale.common.cache.Request; +import eu.esdihumboldt.util.io.InputSupplier; +import eu.esdihumboldt.util.resource.Resources; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URI; -import eu.esdihumboldt.hale.common.cache.Request; -import eu.esdihumboldt.util.io.InputSupplier; -import eu.esdihumboldt.util.resource.Resources; - /** * Default I/O supplier based on an URI * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FileIOSupplier.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FileIOSupplier.java index 8f9a954d3d..71f896829b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FileIOSupplier.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FileIOSupplier.java @@ -16,6 +16,8 @@ package eu.esdihumboldt.hale.common.core.io.supplier; +import eu.esdihumboldt.util.io.InputSupplier; +import eu.esdihumboldt.util.io.OutputSupplier; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; @@ -26,9 +28,6 @@ import java.io.OutputStream; import java.net.URI; -import eu.esdihumboldt.util.io.InputSupplier; -import eu.esdihumboldt.util.io.OutputSupplier; - /** * I/O supplier based on a {@link File} * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FilesIOSupplier.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FilesIOSupplier.java index 7db7976c2c..8f3c7a7a81 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FilesIOSupplier.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FilesIOSupplier.java @@ -15,6 +15,8 @@ package eu.esdihumboldt.hale.common.core.io.supplier; +import eu.esdihumboldt.util.io.InputSupplier; +import eu.esdihumboldt.util.io.OutputSupplier; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; @@ -28,9 +30,6 @@ import java.util.List; import java.util.stream.Collectors; -import eu.esdihumboldt.util.io.InputSupplier; -import eu.esdihumboldt.util.io.OutputSupplier; - /** * I/O supplier based on a {@link File} and used when importing multiple schemas * or instances. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/LocatableInputSupplier.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/LocatableInputSupplier.java index f75e9df88c..152aa85143 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/LocatableInputSupplier.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/LocatableInputSupplier.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.core.io.supplier; -import java.net.URI; - import eu.esdihumboldt.util.io.InputSupplier; +import java.net.URI; /** * Locatable {@link InputSupplier} providing an URI as location @@ -36,8 +35,8 @@ public interface LocatableInputSupplier extends InputSupplier, Locatable { /** * Returns the used location, which may be relative. * - * @return the used location; either the same as {@link #getLocation()}, or - * a relative URI + * @return the used location; either the same as {@link #getLocation()}, or a + * relative URI */ public URI getUsedLocation(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/LookupStreamResource.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/LookupStreamResource.java index 68066c2db6..56242020cb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/LookupStreamResource.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/LookupStreamResource.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.common.core.io.supplier; +import com.google.common.io.ByteStreams; +import com.google.common.io.CountingInputStream; import java.io.BufferedInputStream; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URI; -import com.google.common.io.ByteStreams; -import com.google.common.io.CountingInputStream; - /** * Provides input supplier based on a single input stream, that allow to consume * it multiple times up to a limit in read bytes (see @@ -84,8 +83,8 @@ public boolean markSupported() { * @param input the input stream * @param location the location represented by the input stream, may be * null - * @param lookupLimit the limit of bytes that may be read from a lookup - * input stream + * @param lookupLimit the limit of bytes that may be read from a lookup input + * stream */ public LookupStreamResource(InputStream input, URI location, int lookupLimit) { super(); @@ -101,10 +100,9 @@ public LookupStreamResource(InputStream input, URI location, int lookupLimit) { /** * Get an input supplier that supplies streams that may only be read to a - * certain amount of bytes. Only one instance of such a stream may be used - * at a time (as they are all backed by the same stream) and the instance - * should be closed before the stream is retrieved through - * {@link #getInputSupplier()}. + * certain amount of bytes. Only one instance of such a stream may be used at a + * time (as they are all backed by the same stream) and the instance should be + * closed before the stream is retrieved through {@link #getInputSupplier()}. * * @return the input supplier */ @@ -139,8 +137,8 @@ public URI getUsedLocation() { } /** - * Get an input supplier that supplies the underlying stream, which can be - * fully consumed only once. + * Get an input supplier that supplies the underlying stream, which can be fully + * consumed only once. * * @return the input supplier */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/AbstractScopedVariableReplacer.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/AbstractScopedVariableReplacer.java index 3027fc9a37..de5c3d285c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/AbstractScopedVariableReplacer.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/AbstractScopedVariableReplacer.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.core.io.util; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import java.util.regex.Matcher; import java.util.regex.Pattern; - import javax.annotation.Nullable; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; - /** * Default base class for variable replaces where variables are placed in double * curly braces and may have a scope. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/DebugInputStream.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/DebugInputStream.java index 95c0008dc6..2a43bd8fcb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/DebugInputStream.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/DebugInputStream.java @@ -15,16 +15,15 @@ package eu.esdihumboldt.hale.common.core.io.util; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.util.io.InputStreamDecorator; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.util.io.InputStreamDecorator; - /** * Input stream for debugging purposes. Writes read bytes to a file so it can be * reproduced what was read. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/ExportProviderDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/ExportProviderDecorator.java index 60b3ffe31e..b637bc2449 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/ExportProviderDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/ExportProviderDecorator.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.core.io.util; -import java.io.OutputStream; - import eu.esdihumboldt.hale.common.core.io.ExportProvider; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; +import java.io.OutputStream; /** * Decorator for {@link ExportProvider}s. @@ -27,7 +26,7 @@ * @author Simon Templer */ public abstract class ExportProviderDecorator - extends IOProviderDecoratorimplements ExportProvider { + extends IOProviderDecorator implements ExportProvider { /** * @see IOProviderDecorator#IOProviderDecorator(eu.esdihumboldt.hale.common.core.io.IOProvider) diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/GZipContentDescriber.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/GZipContentDescriber.java index 8fd2157099..d3ef8cb99b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/GZipContentDescriber.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/GZipContentDescriber.java @@ -19,7 +19,6 @@ import java.io.InputStream; import java.io.PushbackInputStream; import java.util.zip.GZIPInputStream; - import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExecutableExtension; @@ -51,11 +50,10 @@ public GZipContentDescriber() { } /** - * Constructor using an internal content describer for the uncompressed - * content. + * Constructor using an internal content describer for the uncompressed content. * - * @param internalContentDescriber the content describer for the - * uncompressed content + * @param internalContentDescriber the content describer for the uncompressed + * content */ public GZipContentDescriber(IContentDescriber internalContentDescriber) { super(); @@ -106,8 +104,8 @@ public QualifiedName[] getSupportedOptions() { * Determines if the given content type is a GZip content type. * * @param contentType the content type - * @return true if the content type is the GZip content type or - * it extends the GZip content type + * @return true if the content type is the GZip content type or it + * extends the GZip content type */ public static boolean isGZipContentType(IContentType contentType) { if (contentType == null) { @@ -126,8 +124,8 @@ public static boolean isGZipContentType(IContentType contentType) { * String, Object) */ @Override - public void setInitializationData(IConfigurationElement config, String propertyName, Object data) - throws CoreException { + public void setInitializationData(IConfigurationElement config, String propertyName, + Object data) throws CoreException { if (internalContentDescriber instanceof IExecutableExtension) { // forward initialization data for internal configuration ((IExecutableExtension) internalContentDescriber).setInitializationData(config, diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/IOProviderDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/IOProviderDecorator.java index 8e87aaa03c..25ae390e31 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/IOProviderDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/IOProviderDecorator.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.common.core.io.util; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.runtime.content.IContentType; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -29,6 +22,11 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.Map; +import java.util.Set; +import org.eclipse.core.runtime.content.IContentType; /** * Decorator for {@link IOProvider}s. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/ImportProviderDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/ImportProviderDecorator.java index c393d7abca..d9587ab2a6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/ImportProviderDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/util/ImportProviderDecorator.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.core.io.util; -import java.io.InputStream; - import eu.esdihumboldt.hale.common.core.io.ImportProvider; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import java.io.InputStream; /** * Decorator for {@link ImportProvider}s. @@ -26,8 +25,8 @@ * @param the provider type * @author Stefano Costa, GeoSolutions */ -public abstract class ImportProviderDecorator extends - IOProviderDecorator implements ImportProvider { +public abstract class ImportProviderDecorator + extends IOProviderDecorator implements ImportProvider { /** * @see IOProviderDecorator#IOProviderDecorator(eu.esdihumboldt.hale.common.core.io.IOProvider) diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/AbstractCommonParameter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/AbstractCommonParameter.java index 79091bb4cd..132ab1ae85 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/AbstractCommonParameter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/AbstractCommonParameter.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.core.parameter; import net.jcip.annotations.Immutable; - import org.eclipse.core.runtime.IConfigurationElement; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/AbstractParameterValueDescriptor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/AbstractParameterValueDescriptor.java index 4853aeb6d3..ecab498546 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/AbstractParameterValueDescriptor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/AbstractParameterValueDescriptor.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.core.parameter; +import eu.esdihumboldt.hale.common.core.io.Value; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import eu.esdihumboldt.hale.common.core.io.Value; - /** * Base class for simple parameter value descriptors. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/IOProviderParameter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/IOProviderParameter.java index 485d357ac1..3200d13113 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/IOProviderParameter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/IOProviderParameter.java @@ -16,9 +16,7 @@ package eu.esdihumboldt.hale.common.core.parameter; import java.util.List; - import javax.annotation.Nullable; - import org.eclipse.core.runtime.IConfigurationElement; /** @@ -60,8 +58,8 @@ public IOProviderParameter(IConfigurationElement conf) { } /** - * Returns the binding class for this function parameter or null if there is - * an enumeration present. + * Returns the binding class for this function parameter or null if there is an + * enumeration present. * * @return the binding */ @@ -75,14 +73,13 @@ public Class getBinding() { * * @return the validator or null */ - public @Nullable - Validator getValidator() { + public @Nullable Validator getValidator() { return validator; } /** - * Returns the enumeration of allowed values for this function parameter or - * null if there is a binding present. + * Returns the enumeration of allowed values for this function parameter or null + * if there is a binding present. * * @return the enumeration */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/NamedDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/NamedDefinition.java index b9a78e6687..0f4c79dbbe 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/NamedDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/NamedDefinition.java @@ -28,9 +28,9 @@ public interface NamedDefinition { public abstract String getName(); /** - * Get the display name for the parameter. If present the parameter label - * will be used, otherwise the parameter name is returned. In case the - * parameter name is null an empty string is returned. + * Get the display name for the parameter. If present the parameter label will + * be used, otherwise the parameter name is returned. In case the parameter name + * is null an empty string is returned. * * @return the parameter display name */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/ParameterUtil.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/ParameterUtil.java index 8e1a68ed39..e0b1861ada 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/ParameterUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/ParameterUtil.java @@ -15,24 +15,20 @@ package eu.esdihumboldt.hale.common.core.parameter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.annotation.Nullable; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueDefinition; import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueExtension; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.annotation.Nullable; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; /** * Parameter definition utilities. @@ -140,8 +136,7 @@ public String getDefaultDescription() { public static final String CONF_PARAMETER_ENUMERATION = "parameterEnumeration"; /** - * Name of the configuration element defining a class binding for a - * parameter. + * Name of the configuration element defining a class binding for a parameter. */ public static final String CONF_PARAMETER_BINDING = "parameterBinding"; @@ -162,8 +157,7 @@ public String getDefaultDescription() { * @param parameterConf the configuration element defining the parameter * @return the binding class or null */ - public static @Nullable - Class getBinding(IConfigurationElement parameterConf) { + public static @Nullable Class getBinding(IConfigurationElement parameterConf) { IConfigurationElement[] bindingElement = parameterConf.getChildren(CONF_PARAMETER_BINDING); IConfigurationElement[] enumerationElement = parameterConf .getChildren(CONF_PARAMETER_ENUMERATION); @@ -202,8 +196,8 @@ else if (complexValueElement.length > 0) { * @param parameterConf the configuration element defining the parameter * @return the complex value definition or null */ - public static @Nullable - ComplexValueDefinition getComplexValueDefinition(IConfigurationElement parameterConf) { + public static @Nullable ComplexValueDefinition getComplexValueDefinition( + IConfigurationElement parameterConf) { IConfigurationElement[] complexValueElement = parameterConf .getChildren(CONF_PARAMETER_COMPLEX_VALUE); if (complexValueElement.length > 0) { @@ -220,12 +214,12 @@ ComplexValueDefinition getComplexValueDefinition(IConfigurationElement parameter /** * Get the value descriptor of a defined parameter. * - * @param parameterConf the configuration element defining the parameter, it - * can describe a providerParameter or functionParameter. + * @param parameterConf the configuration element defining the parameter, it can + * describe a providerParameter or functionParameter. * @return the value descriptor or null */ - public static @Nullable - ParameterValueDescriptor getValueDescriptor(IConfigurationElement parameterConf) { + public static @Nullable ParameterValueDescriptor getValueDescriptor( + IConfigurationElement parameterConf) { ParameterValueDescriptor pv = null; if (parameterConf != null @@ -256,8 +250,7 @@ ParameterValueDescriptor getValueDescriptor(IConfigurationElement parameterConf) * @param parameterConf the configuration element defining the parameter * @return the list of values or null */ - public static @Nullable - List getEnumeration(IConfigurationElement parameterConf) { + public static @Nullable List getEnumeration(IConfigurationElement parameterConf) { IConfigurationElement[] enumerationElement = parameterConf .getChildren(CONF_PARAMETER_ENUMERATION); if (enumerationElement.length > 0) { @@ -281,8 +274,7 @@ List getEnumeration(IConfigurationElement parameterConf) { * @param parameterConf the configuration element defining the parameter * @return the validator or null */ - public static @Nullable - Validator getValidator(IConfigurationElement parameterConf) { + public static @Nullable Validator getValidator(IConfigurationElement parameterConf) { IConfigurationElement[] bindingElement = parameterConf.getChildren(CONF_PARAMETER_BINDING); IConfigurationElement[] enumerationElement = parameterConf .getChildren(CONF_PARAMETER_ENUMERATION); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/ParameterValueDescriptor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/ParameterValueDescriptor.java index 7b9c127ddb..f3dd807c76 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/ParameterValueDescriptor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/ParameterValueDescriptor.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.core.parameter; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.core.io.Value; +import javax.annotation.Nullable; /** * {@link ParameterValueDescriptor} interface for parameter (e.g. provider @@ -36,15 +35,15 @@ public interface ParameterValueDescriptor { public Value getDefaultValue(); /** - * @return description of the default value or general description - * concerning defaults, may be null + * @return description of the default value or general description concerning + * defaults, may be null */ @Nullable public String getDefaultDescription(); /** - * @return the sample data of the parameter or null if no - * sample value is provided + * @return the sample data of the parameter or null if no sample + * value is provided */ @Nullable public Value getSampleData(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/QNameParameterValueDescriptor.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/QNameParameterValueDescriptor.java index 52e25383f0..189b7b4c75 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/QNameParameterValueDescriptor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/QNameParameterValueDescriptor.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.core.parameter; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.Value; +import javax.xml.namespace.QName; /** * Parameter value descriptor for a list of qualified names. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/Validator.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/Validator.java index c14e6a675b..50ae1411e8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/Validator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/parameter/Validator.java @@ -29,8 +29,7 @@ public interface Validator { * Checks whether the given value is valid. * * @param value the value to check - * @return null, if the value is valid, otherwise the reason why it's - * invalid + * @return null, if the value is valid, otherwise the reason why it's invalid */ public String validate(String value); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/LogAware.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/LogAware.java index bd082e1910..90a06f1e88 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/LogAware.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/LogAware.java @@ -25,9 +25,9 @@ public interface LogAware { /** * Set the log. * - * A null log can be set to indicate that an operation is - * finished. In that case the log aware object should return to it's - * internal default regarding logging. + * A null log can be set to indicate that an operation is finished. + * In that case the log aware object should return to it's internal default + * regarding logging. * * @param log the log, may be null */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/MessageFactory.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/MessageFactory.java index 09ecc92611..833158fa17 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/MessageFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/MessageFactory.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.hale.common.core.report; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.util.definition.AbstractObjectFactory; +import java.util.ArrayList; +import java.util.List; +import org.eclipse.core.runtime.IConfigurationElement; /** * Factory for messages diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/Report.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/Report.java index d502349771..6e754e2057 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/Report.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/Report.java @@ -67,8 +67,8 @@ public interface Report { /** * Get the start time of the report. This is optional. If a start time is - * present the {@link #getTimestamp()} can be seen as an end time and used - * to compute a duration. + * present the {@link #getTimestamp()} can be seen as an end time and used to + * compute a duration. * * @return the start time or null */ @@ -99,8 +99,8 @@ default int getTotalWarnings() { public Collection getErrors(); /** - * Get the total number of errors. This may be more than the number of - * errors actually listed with {@link #getErrors()}. + * Get the total number of errors. This may be more than the number of errors + * actually listed with {@link #getErrors()}. * * @return the number of warnings */ @@ -116,8 +116,8 @@ default int getTotalErrors() { public Collection getInfos(); /** - * Get the total number of info messages. This may be more than the number - * of messages actually listed with {@link #getInfos()}. + * Get the total number of info messages. This may be more than the number of + * messages actually listed with {@link #getInfos()}. * * @return the number of warnings */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportFactory.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportFactory.java index df7b5df8eb..407af4aa58 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportFactory.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.hale.common.core.report; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.util.definition.AbstractObjectFactory; +import java.util.ArrayList; +import java.util.List; +import org.eclipse.core.runtime.IConfigurationElement; /** * Factory for Reports. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportLog.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportLog.java index 3559fb1bc5..5f8636a4b5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportLog.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportLog.java @@ -28,8 +28,8 @@ public interface ReportLog { /** - * Adds a warning to the report. If configured accordingly a log message - * will also be created. + * Adds a warning to the report. If configured accordingly a log message will + * also be created. * * @param message the warning message */ @@ -44,8 +44,8 @@ public interface ReportLog { public void error(T message); /** - * Adds an info to the report. If configured accordingly a log message will - * also be created. + * Adds an info to the report. If configured accordingly a log message will also + * be created. * * @param message the info message */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportSession.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportSession.java index 0b4aa5435b..eb13299c37 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportSession.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/ReportSession.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.core.report; -import java.util.HashMap; -import java.util.Map; - import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; +import java.util.HashMap; +import java.util.Map; /** * A {@link ReportSession} contains all {@link Report}s from a session, which is @@ -68,8 +67,8 @@ public long getId() { @SuppressWarnings("unchecked") public > void addReport(R report) { // get all reports for this messageType - Multimap>, Report> reportMap = getReports(report - .getMessageType()); + Multimap>, Report> reportMap = getReports( + report.getMessageType()); // add the report to temporary map reportMap.put((Class>) report.getClass(), report); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/Reporter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/Reporter.java index 7c2a9f8b96..b4c4023bda 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/Reporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/Reporter.java @@ -54,8 +54,8 @@ public interface Reporter extends Report, ReportLog, St /** * Set the start time of the report. This is optional. If a start time is - * present the {@link #getTimestamp()} can be seen as an end time and used - * to compute a duration. + * present the {@link #getTimestamp()} can be seen as an end time and used to + * compute a duration. * * @param starttime the starttime */ @@ -72,8 +72,8 @@ public interface Reporter extends Report, ReportLog, St void countError(int number); /** - * Add an error w/o a message, e.g. if no message is available or the reason - * is not known. + * Add an error w/o a message, e.g. if no message is available or the reason is + * not known. */ default void countError() { countError(1); @@ -87,16 +87,15 @@ default void countError() { void countWarning(int number); /** - * Add a warning w/o a message, e.g. if no message is available or the - * reason is not known. + * Add a warning w/o a message, e.g. if no message is available or the reason is + * not known. */ default void countWarning() { countError(1); } /** - * Add a number of info messages w/o message, e.g. if no message is - * available. + * Add a number of info messages w/o message, e.g. if no message is available. * * @param number the number of info messages */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/SimpleLog.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/SimpleLog.java index d9ce458e9a..07715f2436 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/SimpleLog.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/SimpleLog.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.core.report; import java.text.MessageFormat; - import org.slf4j.Logger; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/SimpleLogContext.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/SimpleLogContext.java index 943cd9b7ae..90ab440ec4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/SimpleLogContext.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/SimpleLogContext.java @@ -36,19 +36,18 @@ protected Deque initialValue() { }; /** - * Get the log associated to the current thread. If there is none, a logger - * is returned that does not log any messages. + * Get the log associated to the current thread. If there is none, a logger is + * returned that does not log any messages. * - * @return the log associated to the current thread or - * {@link SimpleLog#NO_LOG} + * @return the log associated to the current thread or {@link SimpleLog#NO_LOG} */ public static SimpleLog getLog() { return getLog(SimpleLog.NO_LOG); } /** - * Get the log associated to the current thread. If there is none, returns - * the provided default logger. + * Get the log associated to the current thread. If there is none, returns the + * provided default logger. * * @param def the default logger * @return the log associated to the current thread or the default log @@ -62,8 +61,8 @@ public static SimpleLog getLog(SimpleLog def) { } /** - * Get the log associated to the current thread. If there is none, returns - * the provided default logger. + * Get the log associated to the current thread. If there is none, returns the + * provided default logger. * * @param def the default logger * @return the log associated to the current thread or the default log @@ -77,8 +76,8 @@ public static SimpleLog getLog(Supplier def) { } /** - * Associate the given log with the current thread while the given function - * is called. + * Associate the given log with the current thread while the given function is + * called. * * @param log the log to associated to the thread * @param fun the function to execute @@ -98,8 +97,8 @@ public static X withLog(final SimpleLog log, Supplier fun) { } /** - * Associate the given log with the current thread while the given function - * is called. + * Associate the given log with the current thread while the given function is + * called. * * @param log the log to associated to the thread * @param fun the function to execute diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractMessageDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractMessageDefinition.java index 49788022b1..87f2d66593 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractMessageDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractMessageDefinition.java @@ -16,16 +16,15 @@ package eu.esdihumboldt.hale.common.core.report.impl; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.Properties; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.Message; import eu.esdihumboldt.hale.common.core.report.MessageDefinition; import eu.esdihumboldt.util.definition.ObjectDefinition; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; /** * Abstract message definition @@ -132,9 +131,8 @@ public String asString(T message) { } /** - * Get a {@link Properties} representation of the given message that can be - * used to create a new message instance using - * {@link #createMessage(Properties)}. + * Get a {@link Properties} representation of the given message that can be used + * to create a new message instance using {@link #createMessage(Properties)}. * * @param message the message * @return the properties representing the message diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractReportDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractReportDefinition.java index c1aa45816b..c88d7b17ed 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractReportDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractReportDefinition.java @@ -16,18 +16,17 @@ package eu.esdihumboldt.hale.common.core.report.impl; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.Date; -import java.util.Properties; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.Report; import eu.esdihumboldt.hale.common.core.report.ReportDefinition; import eu.esdihumboldt.hale.common.core.report.Reporter; import eu.esdihumboldt.hale.common.core.report.Statistics; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Date; +import java.util.Properties; /** * Abstract report definition. @@ -254,9 +253,8 @@ public String asString(T report) { } /** - * Get a {@link Properties} representation of the given report that can be - * used to create a new report instance using - * {@link #createReport(Properties)}. + * Get a {@link Properties} representation of the given report that can be used + * to create a new report instance using {@link #createReport(Properties)}. * * @param report the message * @return the properties representing the report diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractReporter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractReporter.java index fe661b3653..c2348f07e0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AbstractReporter.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.core.report.impl; -import java.util.Date; - import eu.esdihumboldt.hale.common.core.report.Message; import eu.esdihumboldt.hale.common.core.report.Report; import eu.esdihumboldt.hale.common.core.report.Reporter; import eu.esdihumboldt.util.groovy.collector.StatsCollector; +import java.util.Date; /** * Abstract report implementation @@ -52,8 +51,8 @@ public abstract class AbstractReporter implements Reporter /** * Create an empty report. It is set to not successful by default. But you - * should call {@link #setSuccess(boolean)} nonetheless to update the - * timestamp after the task has finished. + * should call {@link #setSuccess(boolean)} nonetheless to update the timestamp + * after the task has finished. * * @param taskName the name of the task the report is related to * @param taskType the identifier of the task type diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AllInMemoryReporter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AllInMemoryReporter.java index 900ae2cebd..074ba61c89 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AllInMemoryReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/AllInMemoryReporter.java @@ -16,17 +16,16 @@ package eu.esdihumboldt.hale.common.core.report.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.Message; import eu.esdihumboldt.hale.common.core.report.Report; import eu.esdihumboldt.hale.common.core.report.ReportLog; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; /** * Former default report implementation @@ -66,14 +65,13 @@ public class AllInMemoryReporter extends AbstractReporter /** * Create an empty report. It is set to not successful by default. But you - * should call {@link #setSuccess(boolean)} nonetheless to update the - * timestamp after the task has finished. + * should call {@link #setSuccess(boolean)} nonetheless to update the timestamp + * after the task has finished. * * @param taskName the name of the task the report is related to * @param taskType the identifier of the task type * @param messageType the message type - * @param doLog if added messages shall also be logged using the provided - * logger + * @param doLog if added messages shall also be logged using the provided logger * @param log the log to use if doLog is enabled */ public AllInMemoryReporter(String taskName, String taskType, Class messageType, @@ -85,8 +83,8 @@ public AllInMemoryReporter(String taskName, String taskType, Class messageTyp /** * Create an empty report. It is set to not successful by default. But you - * should call {@link #setSuccess(boolean)} nonetheless to update the - * timestamp after the task has finished. + * should call {@link #setSuccess(boolean)} nonetheless to update the timestamp + * after the task has finished. * * @param taskName the name of the task the report is related to * @param taskType the identifier of the task type @@ -100,8 +98,8 @@ public AllInMemoryReporter(String taskName, String taskType, Class messageTyp } /** - * Adds a warning to the report. If configured accordingly a log message - * will also be created. + * Adds a warning to the report. If configured accordingly a log message will + * also be created. * * @param message the warning message */ @@ -166,9 +164,8 @@ public Collection getInfos() { } /** - * Add all messages of the given report to this report. This method will - * never log the messages (because the original report may have logged them - * already. + * Add all messages of the given report to this report. This method will never + * log the messages (because the original report may have logged them already. * * @see ReportLog#importMessages(Report) */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/DefaultReporter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/DefaultReporter.java index 428d361670..13f7c9858a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/DefaultReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/DefaultReporter.java @@ -33,8 +33,8 @@ public class DefaultReporter extends AllInMemoryReporter { private static final ALogger logger = ALoggerFactory.getLogger(DefaultReporter.class); /** - * Maximum number of messages per message type in a report. Negative values - * mean unlimited messages. + * Maximum number of messages per message type in a report. Negative values mean + * unlimited messages. */ public static final int MESSAGE_CAP = getMessageCap(); @@ -44,8 +44,8 @@ public class DefaultReporter extends AllInMemoryReporter { /** * Create an empty report. It is set to not successful by default. But you - * should call {@link #setSuccess(boolean)} nonetheless to update the - * timestamp after the task has finished. + * should call {@link #setSuccess(boolean)} nonetheless to update the timestamp + * after the task has finished. * * @param taskName the name of the task the report is related to * @param taskType the identifier of the task type @@ -58,8 +58,8 @@ public DefaultReporter(String taskName, String taskType, Class messageType, b } /** - * Determine message cap from system property or environment variable, - * otherwise return a default value. + * Determine message cap from system property or environment variable, otherwise + * return a default value. * * @return the message cap */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/MessageImpl.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/MessageImpl.java index 02f1bdfe9c..1fb06844be 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/MessageImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/MessageImpl.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.core.report.impl; +import eu.esdihumboldt.hale.common.core.report.Message; import java.io.PrintWriter; import java.io.StringWriter; - import net.jcip.annotations.Immutable; -import eu.esdihumboldt.hale.common.core.report.Message; /** * Default message implementation diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/MessageImplDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/MessageImplDefinition.java index 99f0951388..a04a59d6fe 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/MessageImplDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/MessageImplDefinition.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.core.report.impl; -import java.util.Properties; - import eu.esdihumboldt.hale.common.core.report.Message; +import java.util.Properties; /** * Object definition for {@link MessageImpl} diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/ReportImplDefintion.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/ReportImplDefintion.java index 60c42ffb8e..5a90515280 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/ReportImplDefintion.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/ReportImplDefintion.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.core.report.impl; -import java.util.Properties; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.Message; import eu.esdihumboldt.hale.common.core.report.Report; import eu.esdihumboldt.hale.common.core.report.Reporter; +import java.util.Properties; /** * Object definition for {@link DefaultReporter}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/SimpleReporter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/SimpleReporter.java index 57a52f964c..f76f35b59c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/SimpleReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/impl/SimpleReporter.java @@ -28,8 +28,8 @@ public class SimpleReporter extends DefaultReporter implements SimpleLo /** * Create an empty report. It is set to not successful by default. But you - * should call {@link #setSuccess(boolean)} nonetheless to update the - * timestamp after the task has finished. + * should call {@link #setSuccess(boolean)} nonetheless to update the timestamp + * after the task has finished. * * @param taskName the name of the task the report is related to * @param taskType the identifier of the task type diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/util/StatisticsHelper.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/util/StatisticsHelper.groovy index f096819aa6..91b26e4ef9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/util/StatisticsHelper.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/util/StatisticsHelper.groovy @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.core.report.util -import java.util.concurrent.TimeUnit - import eu.esdihumboldt.hale.common.core.io.report.IOReport import eu.esdihumboldt.hale.common.core.report.Report import eu.esdihumboldt.hale.common.core.report.Statistics import eu.esdihumboldt.util.groovy.collector.StatsCollector import groovy.transform.CompileStatic +import java.util.concurrent.TimeUnit /** * Report statistics helper. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/util/StatsMerge.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/util/StatsMerge.groovy index 64dc3f18d2..50e0816eb7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/util/StatsMerge.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/util/StatsMerge.groovy @@ -124,7 +124,6 @@ class StatsMerge { combined.add(a) combined.addAll(b) combined - } } else { @@ -160,6 +159,4 @@ class StatsMerge { } } } - } - diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/writer/ReportReader.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/writer/ReportReader.java index 69f5e08b35..0407e56d78 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/writer/ReportReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/writer/ReportReader.java @@ -16,13 +16,6 @@ package eu.esdihumboldt.hale.common.core.report.writer; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.Message; @@ -31,6 +24,12 @@ import eu.esdihumboldt.hale.common.core.report.ReportFactory; import eu.esdihumboldt.hale.common.core.report.ReportLog; import eu.esdihumboldt.hale.common.core.report.ReportSession; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; /** * This is the ReportReader which extracts {@link Report}s and their diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/writer/ReportWriter.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/writer/ReportWriter.java index c3f168b557..980019f967 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/writer/ReportWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/report/writer/ReportWriter.java @@ -16,21 +16,19 @@ package eu.esdihumboldt.hale.common.core.report.writer; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import java.util.Collection; - import com.google.common.collect.Lists; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.Message; import eu.esdihumboldt.hale.common.core.report.MessageFactory; import eu.esdihumboldt.hale.common.core.report.Report; import eu.esdihumboldt.hale.common.core.report.ReportFactory; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.Collection; /** * Writes reports to a file. @@ -62,7 +60,8 @@ private ReportWriter() { * * @throws IOException if IO fails */ - public static boolean write(File file, boolean append, Report... reports) throws IOException { + public static boolean write(File file, boolean append, Report... reports) + throws IOException { return write(file, Lists.newArrayList(reports), append); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/DelegateServiceProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/DelegateServiceProvider.java index 9c5e2df382..5020f15ad8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/DelegateServiceProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/DelegateServiceProvider.java @@ -27,8 +27,7 @@ public class DelegateServiceProvider implements ServiceProvider { private final ServiceProvider serviceProvider; /** - * Constructs a new DelegateServiceProvider with the specified - * ServiceProvider. + * Constructs a new DelegateServiceProvider with the specified ServiceProvider. * * @param serviceProvider the underlying ServiceProvider to delegate to */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceFactory.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceFactory.java index 2c1e6edde2..591ade2991 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceFactory.java @@ -26,8 +26,7 @@ public interface ServiceFactory { * Create a new instance of a service. * * @param serviceInterface the service interface - * @param serviceLocator the service provider for accessing dependency - * services + * @param serviceLocator the service provider for accessing dependency services * @return the new service instance */ public T createService(Class serviceInterface, ServiceProvider serviceLocator); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceManager.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceManager.java index a41ddda605..a198f58791 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceManager.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceManager.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.common.core.service; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ListMultimap; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.service.internal.ServiceFactoryDefinition; import eu.esdihumboldt.hale.common.core.service.internal.ServiceFactoryExtension; +import java.util.Collection; +import java.util.Collections; +import java.util.List; /** * Manages HALE service instances. @@ -131,8 +129,7 @@ protected ServiceProvider getServiceLocator() { /** * Get the scope of services provided by the manager. * - * @return the service scope name or null representing all - * scopes + * @return the service scope name or null representing all scopes */ public String getServiceScope() { return serviceScope; diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceProvider.java index a13c47473a..4a9dd21b74 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/ServiceProvider.java @@ -26,8 +26,8 @@ public interface ServiceProvider { * Get the service of the given type if available. * * @param serviceInterface the service interface or type - * @return the service instance in the current context or null - * if no such service exists + * @return the service instance in the current context or null if + * no such service exists */ public T getService(Class serviceInterface); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/cleanup/CleanupService.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/cleanup/CleanupService.java index 90d1b76429..5cd85cceda 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/cleanup/CleanupService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/cleanup/CleanupService.java @@ -31,8 +31,8 @@ public interface CleanupService { /** - * Add a cleaner that shall perform a clean up of resources associated with - * the given context. + * Add a cleaner that shall perform a clean up of resources associated with the + * given context. * * @param context the clean up context * @param cleaner the cleaner performing the clean up @@ -40,8 +40,8 @@ public interface CleanupService { public void addCleaner(CleanupContext context, Cleanup cleaner); /** - * Add temporary files associated with the given context, that should be - * deleted if the context is no longer valid. + * Add temporary files associated with the given context, that should be deleted + * if the context is no longer valid. * * @param context the clean up context * @param files the temporary files diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/cleanup/impl/CleanupServiceImpl.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/cleanup/impl/CleanupServiceImpl.java index dace2c0a5f..c4519eb103 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/cleanup/impl/CleanupServiceImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/cleanup/impl/CleanupServiceImpl.java @@ -15,20 +15,17 @@ package eu.esdihumboldt.hale.common.core.service.cleanup.impl; -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; - -import org.apache.commons.io.FileUtils; - import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.service.cleanup.Cleanup; import eu.esdihumboldt.hale.common.core.service.cleanup.CleanupContext; import eu.esdihumboldt.hale.common.core.service.cleanup.CleanupService; +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import org.apache.commons.io.FileUtils; /** * Default cleanup service implementation. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/internal/ServiceFactoryDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/internal/ServiceFactoryDefinition.java index 46811be868..1348eae6a7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/internal/ServiceFactoryDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/internal/ServiceFactoryDefinition.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.common.core.service.internal; -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.core.service.ServiceFactory; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; /** * Definition of a service factory from the extension point. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/internal/ServiceFactoryExtension.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/internal/ServiceFactoryExtension.java index b08ac482e6..5b8442e608 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/internal/ServiceFactoryExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/service/internal/ServiceFactoryExtension.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.core.service.internal; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for service factories. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/PathUpdateTest.java b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/PathUpdateTest.java index f6fa5c7725..ab751bd52d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/PathUpdateTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/PathUpdateTest.java @@ -18,11 +18,8 @@ import static org.junit.Assert.*; import java.net.URI; - import org.junit.Test; -import eu.esdihumboldt.hale.common.core.io.PathUpdate; - /** * Testing class for {@link PathUpdate} * @@ -37,10 +34,10 @@ public class PathUpdateTest { public void testSimple() { String orgPath = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1t2.hale"; String path = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/t1t2.hale"; - PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), URI.create("file:/" - + path)); - URI file = URI - .create("file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1.xsd"); + PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), + URI.create("file:/" + path)); + URI file = URI.create( + "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1.xsd"); String correct = "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/t1.xsd"; String newpath = update.changePath(file).toString(); assertEquals(correct, newpath); @@ -53,10 +50,10 @@ public void testSimple() { public void testProjectSubfolder() { String orgPath = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/project/t1t2.hale"; String path = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/project/t1t2_alt.hale"; - PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), URI.create("file:/" - + path)); - URI file = URI - .create("file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1.xsd"); + PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), + URI.create("file:/" + path)); + URI file = URI.create( + "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1.xsd"); String correct = "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/t1.xsd"; String newpath = update.changePath(file).toString(); assertEquals(correct, newpath); @@ -67,11 +64,12 @@ public void testProjectSubfolder() { */ @Test public void testSubfolder() { - PathUpdate update = new PathUpdate( - URI.create("file:/C:/Users/sitemple/Entwicklung/humboldt2/_testdata/watercourse%20-%20Kopie/test.hale"), - URI.create("file:/C:/Users/sitemple/Entwicklung/humboldt2/_testdata/wva2/test.hale")); - URI file = URI - .create("file:/C:/Users/sitemple/Entwicklung/humboldt2/_testdata/watercourse%20-%20Kopie/inspire3/HydroPhysicalWaters.xsd"); + PathUpdate update = new PathUpdate(URI.create( + "file:/C:/Users/sitemple/Entwicklung/humboldt2/_testdata/watercourse%20-%20Kopie/test.hale"), + URI.create( + "file:/C:/Users/sitemple/Entwicklung/humboldt2/_testdata/wva2/test.hale")); + URI file = URI.create( + "file:/C:/Users/sitemple/Entwicklung/humboldt2/_testdata/watercourse%20-%20Kopie/inspire3/HydroPhysicalWaters.xsd"); String correct = "file:/C:/Users/sitemple/Entwicklung/humboldt2/_testdata/wva2/inspire3/HydroPhysicalWaters.xsd"; String newpath = update.changePath(file).toString(); assertEquals(correct, newpath); @@ -84,27 +82,26 @@ public void testSubfolder() { public void testSubfolder2() { String orgPath = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1t2.hale"; String path = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/t1t2_alt.hale"; - PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), URI.create("file:/" - + path)); - URI file = URI - .create("file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/schemas/t1.xsd"); + PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), + URI.create("file:/" + path)); + URI file = URI.create( + "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/schemas/t1.xsd"); String correct = "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/schemas/t1.xsd"; String newpath = update.changePath(file).toString(); assertEquals(correct, newpath); } /** - * Extended real world example - project file renamed, but in the same - * folder + * Extended real world example - project file renamed, but in the same folder */ @Test public void testSame() { String orgPath = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1t2.hale"; String path = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1t2_alt.hale"; - PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), URI.create("file:/" - + path)); - URI file = URI - .create("file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/schemas/t1.xsd"); + PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), + URI.create("file:/" + path)); + URI file = URI.create( + "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/schemas/t1.xsd"); String correct = "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/schemas/t1.xsd"; String newpath = update.changePath(file).toString(); assertEquals(correct, newpath); @@ -117,10 +114,10 @@ public void testSame() { public void testSubfolder3() { String orgPath = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1t2.hale"; String path = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/t1t2.hale"; - PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), URI.create("file:/" - + path)); - URI file = URI - .create("file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/source/schemas/t1.xsd"); + PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), + URI.create("file:/" + path)); + URI file = URI.create( + "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/source/schemas/t1.xsd"); String correct = "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/source/schemas/t1.xsd"; String newpath = update.changePath(file).toString(); assertEquals(correct, newpath); @@ -133,17 +130,17 @@ public void testSubfolder3() { public void testReuse() { String orgPath = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1t2.hale"; String path = "C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/t1t2.hale"; - PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), URI.create("file:/" - + path)); - URI file = URI - .create("file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1.xsd"); + PathUpdate update = new PathUpdate(URI.create("file:/" + orgPath), + URI.create("file:/" + path)); + URI file = URI.create( + "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/t1.xsd"); String correct = "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/t1.xsd"; String newpath = update.changePath(file).toString(); assertEquals(correct, newpath); // reuse PathUpdate with the same settings - file = URI - .create("file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/schemas/t1.xsd"); + file = URI.create( + "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/unification/schemas/t1.xsd"); correct = "file:/C:/Users/sitemple/Entwicklung/hale/cst/plugins/eu.esdihumboldt.cst.test/src/testdata/propmerge/schemas/t1.xsd"; newpath = update.changePath(file).toString(); assertEquals(correct, newpath); diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/TextTypeJsonTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/TextTypeJsonTest.groovy index d6c7847976..b34fa7bda0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/TextTypeJsonTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/TextTypeJsonTest.groovy @@ -15,11 +15,11 @@ package eu.esdihumboldt.hale.common.core.io.impl +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.core.io.Text import org.junit.Test -import static org.junit.Assert.* - /** * Tests {@link Text} / JSON conversion. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValueListTypeTest.java b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValueListTypeTest.java index 2469efd12f..93327859f6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValueListTypeTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValueListTypeTest.java @@ -17,23 +17,20 @@ import static org.junit.Assert.assertEquals; +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.core.io.ValueList; +import groovy.json.JsonBuilder; import java.io.ByteArrayInputStream; import java.io.StringReader; import java.io.StringWriter; - import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; - import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper; import org.junit.BeforeClass; import org.junit.Test; import org.w3c.dom.Element; -import eu.esdihumboldt.hale.common.core.io.HaleIO; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.ValueList; -import groovy.json.JsonBuilder; - /** * Tests {@link ValueList} serialization. * @@ -77,8 +74,8 @@ public void testRead() throws Exception { } /** - * Test if a simple list containing only {@link StringValue}s is the same - * when converted to DOM and back again. + * Test if a simple list containing only {@link StringValue}s is the same when + * converted to DOM and back again. */ @Test public void testStringValueList() { @@ -104,8 +101,8 @@ public void testStringValueList() { } /** - * Test if a simple list containing only {@link StringValue}s is the same - * when converted to JSON and back again. + * Test if a simple list containing only {@link StringValue}s is the same when + * converted to JSON and back again. * * @throws Exception if an error occurs */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValueMapTypeTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValueMapTypeTest.groovy index 3850fc8661..43c0bc2dc3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValueMapTypeTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValueMapTypeTest.groovy @@ -15,17 +15,16 @@ package eu.esdihumboldt.hale.common.core.io.impl -import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper -import org.junit.BeforeClass -import org.junit.Test -import org.w3c.dom.Element +import static org.junit.Assert.* import eu.esdihumboldt.hale.common.core.io.HaleIO import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.core.io.ValueList import eu.esdihumboldt.hale.common.core.io.ValueMap - -import static org.junit.Assert.* +import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper +import org.junit.BeforeClass +import org.junit.Test +import org.w3c.dom.Element /** * Tests XML serialization of {@link ValueMap}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValuePropertiesTypeTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValuePropertiesTypeTest.groovy index f56679ceff..82b74d2b56 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValuePropertiesTypeTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/impl/ValuePropertiesTypeTest.groovy @@ -15,17 +15,16 @@ package eu.esdihumboldt.hale.common.core.io.impl -import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper -import org.junit.BeforeClass -import org.junit.Test -import org.w3c.dom.Element +import static org.junit.Assert.* import eu.esdihumboldt.hale.common.core.io.HaleIO import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.core.io.ValueList import eu.esdihumboldt.hale.common.core.io.ValueProperties - -import static org.junit.Assert.* +import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper +import org.junit.BeforeClass +import org.junit.Test +import org.w3c.dom.Element /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/project/ProjectTest.java b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/project/ProjectTest.java index 8569fffac4..5c011c5d0b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/project/ProjectTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/project/ProjectTest.java @@ -20,12 +20,14 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; +import eu.esdihumboldt.hale.common.core.io.project.model.Project; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.Date; import java.util.Iterator; - import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper; import org.junit.BeforeClass; import org.junit.Rule; @@ -33,10 +35,6 @@ import org.junit.rules.TemporaryFolder; import org.osgi.framework.Version; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; -import eu.esdihumboldt.hale.common.core.io.project.model.Project; - /** * Test saving and loading a project * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/project/util/XMLPathUpdaterTest.java b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/project/util/XMLPathUpdaterTest.java index 18f5f2d6b0..a55698b367 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/project/util/XMLPathUpdaterTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/project/util/XMLPathUpdaterTest.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.hale.common.core.io.project.util; +import eu.esdihumboldt.hale.common.cache.Request; import java.io.File; import java.io.InputStream; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; - import org.junit.Ignore; import org.junit.Test; -import eu.esdihumboldt.hale.common.cache.Request; - /** * Tests for {@link XMLPathUpdater} / {@link XMLSchemaUpdater}. * @@ -34,8 +32,8 @@ public class XMLPathUpdaterTest { /** - * Test for retrieving and updating this schema was added because this lead - * to a deadlock due to HTTP connections that were not released. + * Test for retrieving and updating this schema was added because this lead to a + * deadlock due to HTTP connections that were not released. * * @throws Exception if any error occurs during the test */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/supplier/LookupStreamResourceTest.java b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/supplier/LookupStreamResourceTest.java index 0d51ee5443..9662f88cbb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/supplier/LookupStreamResourceTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/test/eu/esdihumboldt/hale/common/core/io/supplier/LookupStreamResourceTest.java @@ -22,7 +22,6 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; - import org.junit.Test; /** @@ -32,7 +31,8 @@ */ public class LookupStreamResourceTest { - private static byte[] data = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; + private static byte[] data = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16 }; private static short previewLimit = 6; /** @@ -188,8 +188,8 @@ public void testInputLookupAndConsume() throws IOException { /** * Read the input stream up to the preview limit {@link #previewLimit}. * - * @param in the input stream where the first {@link #data} bytes can be - * read from + * @param in the input stream where the first {@link #data} bytes can be read + * from * @throws IOException if reading the stream fails */ private void preview(InputStream in) throws IOException { diff --git a/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/AbstractGeotoolsFilter.java b/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/AbstractGeotoolsFilter.java index 99bdb283a2..a755be220e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/AbstractGeotoolsFilter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/AbstractGeotoolsFilter.java @@ -16,22 +16,11 @@ package eu.esdihumboldt.hale.common.filter; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import org.geotools.filter.FilterAttributeExtractor; -import org.geotools.filter.text.cql2.CQLException; -import org.opengis.filter.Filter; -import org.opengis.filter.expression.PropertyName; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.groovy.accessor.EntityAccessor; -import eu.esdihumboldt.hale.common.align.groovy.accessor.path.PathElement; import eu.esdihumboldt.hale.common.align.groovy.accessor.internal.EntityAccessorUtil; +import eu.esdihumboldt.hale.common.align.groovy.accessor.path.PathElement; import eu.esdihumboldt.hale.common.align.instance.EntityAwareFilter; import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; @@ -40,6 +29,14 @@ import eu.esdihumboldt.hale.common.instance.helper.PropertyResolver; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.util.groovy.paths.Path; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; +import org.geotools.filter.FilterAttributeExtractor; +import org.geotools.filter.text.cql2.CQLException; +import org.opengis.filter.Filter; +import org.opengis.filter.expression.PropertyName; /** * Geotools based filter. Two filters are seen as equal if they are based on the @@ -226,8 +223,8 @@ private Optional resolveProperty(PropertyName name, EntityDefi Path selected = candidates.get(0); /* - * XXX dirty hack to work around conditions in AdV - * GeographicalNames alignment not being defined properly + * XXX dirty hack to work around conditions in AdV GeographicalNames alignment + * not being defined properly */ if (candidates.size() > 1) { // prefer next candidate if this one is name in gml diff --git a/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/definition/CQLFilterDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/definition/CQLFilterDefinition.java index cf90fbf11f..315c7240ca 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/definition/CQLFilterDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/definition/CQLFilterDefinition.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.filter.definition; -import org.geotools.filter.text.cql2.CQLException; - import eu.esdihumboldt.hale.common.filter.FilterGeoCqlImpl; import eu.esdihumboldt.hale.common.instance.extension.filter.FilterDefinition; import eu.esdihumboldt.util.definition.ObjectDefinition; +import org.geotools.filter.text.cql2.CQLException; /** * Object definition for CQL filters. diff --git a/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/definition/ECQLFilterDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/definition/ECQLFilterDefinition.java index 57b27c8a19..63b2a08f70 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/definition/ECQLFilterDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/definition/ECQLFilterDefinition.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.filter.definition; -import org.geotools.filter.text.cql2.CQLException; - import eu.esdihumboldt.hale.common.filter.FilterGeoECqlImpl; import eu.esdihumboldt.hale.common.instance.extension.filter.FilterDefinition; import eu.esdihumboldt.util.definition.ObjectDefinition; +import org.geotools.filter.text.cql2.CQLException; /** * Object definition for ECQL filters. diff --git a/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/internal/EntityReplacementVisitor.java b/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/internal/EntityReplacementVisitor.java index 6e3c5cf736..63ad942daa 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/internal/EntityReplacementVisitor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.filter/src/eu/esdihumboldt/hale/common/filter/internal/EntityReplacementVisitor.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.common.filter.internal; +import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; +import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; +import eu.esdihumboldt.hale.common.align.model.EntityDefinition; +import eu.esdihumboldt.hale.common.core.report.SimpleLog; import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; - import org.geotools.filter.visitor.DuplicatingFilterVisitor; import org.opengis.filter.expression.PropertyName; -import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; -import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; -import eu.esdihumboldt.hale.common.align.model.EntityDefinition; -import eu.esdihumboldt.hale.common.core.report.SimpleLog; - /** * Filter visitor that replaces entities in filters with their * {@link AlignmentMigration} replacement. diff --git a/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/AbstractFilterTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/AbstractFilterTest.groovy index d7fcbfc9a6..f1f09b8f5a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/AbstractFilterTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/AbstractFilterTest.groovy @@ -17,14 +17,6 @@ package eu.esdihumboldt.hale.common.filter; import static org.junit.Assert.* -import java.text.SimpleDateFormat - -import org.junit.Before - -import org.locationtech.jts.geom.Coordinate -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.GeometryFactory - import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder @@ -32,6 +24,11 @@ import eu.esdihumboldt.hale.common.instance.model.Instance import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.schema.model.TypeDefinition +import java.text.SimpleDateFormat +import org.junit.Before +import org.locationtech.jts.geom.Coordinate +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.GeometryFactory /** * Base class for filter tests providing test instances. @@ -55,7 +52,8 @@ abstract class AbstractFilterTest { def lineString = gf.createLineString([ new Coordinate(0, 0), new Coordinate(1, 1), - new Coordinate(1, 0)] as Coordinate[]) + new Coordinate(1, 0) + ] as Coordinate[]) def lineGeom = new DefaultGeometryProperty(new CodeDefinition("EPSG:4326", null), lineString) def poly = gf.createPolygon([ @@ -63,7 +61,8 @@ abstract class AbstractFilterTest { new Coordinate(1, 0), new Coordinate(1, 1), new Coordinate(0, 1), - new Coordinate(0, 0)] as Coordinate[]) + new Coordinate(0, 0) + ] as Coordinate[]) def polyGeom = new DefaultGeometryProperty(new CodeDefinition("EPSG:4326", null), poly) def poly2 = gf.createPolygon([ @@ -71,7 +70,8 @@ abstract class AbstractFilterTest { new Coordinate(11, 10), new Coordinate(11, 11), new Coordinate(10, 11), - new Coordinate(10, 10)] as Coordinate[]) + new Coordinate(10, 10) + ] as Coordinate[]) def polyGeom2 = new DefaultGeometryProperty(new CodeDefinition("EPSG:4326", null), poly2) def dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); @@ -134,5 +134,4 @@ abstract class AbstractFilterTest { // build instance max = new InstanceBuilder(types: schema).Person(createMax) } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/CQLFilterTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/CQLFilterTest.groovy index ee07397854..cf0c920e9c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/CQLFilterTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/CQLFilterTest.groovy @@ -17,11 +17,10 @@ package eu.esdihumboldt.hale.common.filter; import static org.junit.Assert.* -import org.junit.Ignore -import org.junit.Test - import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition import groovy.transform.CompileStatic +import org.junit.Ignore +import org.junit.Test /** * Tests for CQL filter. diff --git a/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/FilterTest.java b/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/FilterTest.java index 358fd2ff9a..66db8cd6c1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/FilterTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.filter/test/eu/esdihumboldt/hale/common/filter/FilterTest.java @@ -21,18 +21,6 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.IOException; -import java.net.URI; -import java.nio.file.Path; - -import javax.xml.namespace.QName; - -import org.geotools.filter.text.cql2.CQLException; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; @@ -56,6 +44,15 @@ import eu.esdihumboldt.hale.io.shp.reader.internal.ShapeSchemaReader; import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader; import eu.esdihumboldt.util.io.IOUtils; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Path; +import javax.xml.namespace.QName; +import org.geotools.filter.text.cql2.CQLException; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; /** * TODO Type description @@ -209,16 +206,14 @@ public void testLoadShiporderCQL() throws Exception { @Test public void testComplexInstancesCQL() throws Exception { /* - * SchemaReader reader = new XmlSchemaReader(); - * reader.setSharedTypes(null); reader.setSource(new - * DefaultInputSupplier + * SchemaReader reader = new XmlSchemaReader(); reader.setSharedTypes(null); + * reader.setSource(new DefaultInputSupplier * ((getClass().getResource("/testdata/inspire3/HydroPhysicalWaters.xsd" * ).toURI()))); IOReport report = reader.execute(null); * assertTrue(report.isSuccess()); Schema schema = reader.getSchema(); * * StreamGmlReader instanceReader = new GmlInstanceReader(); - * instanceReader.setSource(new - * DefaultInputSupplier(getClass().getResource + * instanceReader.setSource(new DefaultInputSupplier(getClass().getResource * ("/testdata/out/transformWrite_ERM_HPW.gml").toURI())); * instanceReader.setSourceSchema(schema); * @@ -287,8 +282,8 @@ public void testComplexInstancesCQL() throws Exception { foundIt3 = true; } /* - * if(cqlfilter4.match(inst)){ foundIt4 = true; } - * if(cqlfilter5.match(inst)){ foundIt5 = true; } + * if(cqlfilter4.match(inst)){ foundIt4 = true; } if(cqlfilter5.match(inst)){ + * foundIt5 = true; } */ } @@ -483,16 +478,14 @@ public void testLoadShiporderECQL() throws Exception { @Test public void testComplexInstancesECQL() throws Exception { /* - * SchemaReader reader = new XmlSchemaReader(); - * reader.setSharedTypes(null); reader.setSource(new - * DefaultInputSupplier + * SchemaReader reader = new XmlSchemaReader(); reader.setSharedTypes(null); + * reader.setSource(new DefaultInputSupplier * ((getClass().getResource("/testdata/inspire3/HydroPhysicalWaters.xsd" * ).toURI()))); IOReport report = reader.execute(null); * assertTrue(report.isSuccess()); Schema schema = reader.getSchema(); * * StreamGmlReader instanceReader = new GmlInstanceReader(); - * instanceReader.setSource(new - * DefaultInputSupplier(getClass().getResource + * instanceReader.setSource(new DefaultInputSupplier(getClass().getResource * ("/testdata/out/transformWrite_ERM_HPW.gml").toURI())); * instanceReader.setSourceSchema(schema); * diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless.orient/src/eu/esdihumboldt/hale/common/headless/orient/OrientTransformationSink.java b/common/plugins/eu.esdihumboldt.hale.common.headless.orient/src/eu/esdihumboldt/hale/common/headless/orient/OrientTransformationSink.java index 9d278b98d9..8876eb36e4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless.orient/src/eu/esdihumboldt/hale/common/headless/orient/OrientTransformationSink.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless.orient/src/eu/esdihumboldt/hale/common/headless/orient/OrientTransformationSink.java @@ -15,14 +15,6 @@ package eu.esdihumboldt.hale.common.headless.orient; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.headless.transform.AbstractTransformationSink; @@ -41,6 +33,13 @@ import eu.esdihumboldt.hale.common.instance.orient.storage.OrientInstanceReference; import eu.esdihumboldt.hale.common.instance.orient.storage.OrientInstanceSink; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; /** * Reiterable transformation sink based on OrientDB. @@ -176,8 +175,8 @@ public OrientTransformationSink() { this.orientSink = new OrientInstanceSink(database, false); /* - * create limbo sink (for first iteration while data it still stored in - * the Orient database) + * create limbo sink (for first iteration while data it still stored in the + * Orient database) */ this.limboSink = new LimboInstanceSink(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless.test/src/eu/esdihumboldt/hale/common/headless/test/AbstractProjectTest.java b/common/plugins/eu.esdihumboldt.hale.common.headless.test/src/eu/esdihumboldt/hale/common/headless/test/AbstractProjectTest.java index 149f63cf0a..577507b01a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless.test/src/eu/esdihumboldt/hale/common/headless/test/AbstractProjectTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless.test/src/eu/esdihumboldt/hale/common/headless/test/AbstractProjectTest.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.common.headless.test; -import java.io.IOException; -import java.net.URI; -import java.net.URL; - import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; - import eu.esdihumboldt.hale.common.cli.HaleCLIUtil; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; import eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment; import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.io.IOException; +import java.net.URI; +import java.net.URL; /** * Base class for tests working with loaded transformation projects. diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/EnvironmentService.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/EnvironmentService.java index 50516dcebf..5cfefd2b92 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/EnvironmentService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/EnvironmentService.java @@ -32,12 +32,11 @@ public interface EnvironmentService { public Collection getEnvironments(); /** - * Get the transformation environment with the given identifier, if it - * exists. + * Get the transformation environment with the given identifier, if it exists. * * @param id the identifier - * @return the environment matching the identifier or null if - * there is none + * @return the environment matching the identifier or null if there + * is none */ public TransformationEnvironment getEnvironment(String id); diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/HeadlessIO.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/HeadlessIO.java index 7034274d81..0d739963dc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/HeadlessIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/HeadlessIO.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.common.headless; -import java.io.IOException; -import java.text.MessageFormat; -import java.util.List; -import java.util.Map; - import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactoryCollection; import de.fhg.igd.eclipse.util.extension.FactoryFilter; import de.fhg.igd.slf4jplus.ALogger; @@ -40,6 +35,10 @@ import eu.esdihumboldt.hale.common.core.report.ReportHandler; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment; +import java.io.IOException; +import java.text.MessageFormat; +import java.util.List; +import java.util.Map; /** * Utilities for headless execution of I/O configurations and providers. @@ -52,8 +51,8 @@ public abstract class HeadlessIO { .getLogger(ProjectTransformationEnvironment.class); /** - * Execute a set of I/O configurations. Configurations for which no advisor - * is provided are ignored. + * Execute a set of I/O configurations. Configurations for which no advisor is + * provided are ignored. * * @param configurations the I/O configurations * @param advisors map of advisors, action ID mapped to responsible advisor @@ -86,9 +85,9 @@ public static void executeConfigurations(final List configurati } /** - * Execute a single I/O configuration. If no matching advisor is given for - * the configuration, first the extension point is queried for an advisor, - * if not found it is ignored. + * Execute a single I/O configuration. If no matching advisor is given for the + * configuration, first the extension point is queried for an advisor, if not + * found it is ignored. * * @param conf the I/O configuration * @param advisors map of advisors, action ID mapped to responsible advisor @@ -160,12 +159,11 @@ public boolean acceptCollection( } /** - * Load and configure the I/O provider specified by the given I/O - * configuration. + * Load and configure the I/O provider specified by the given I/O configuration. * * @param conf the I/O configuration - * @return the provider or null if it was not found or could - * not be created + * @return the provider or null if it was not found or could not be + * created */ public static IOProvider loadProvider(IOConfiguration conf) { IOProvider provider = null; diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/TransformationEnvironment.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/TransformationEnvironment.java index 315cb3e445..c2298182a9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/TransformationEnvironment.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/TransformationEnvironment.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.headless; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.model.AlignmentProvider; import eu.esdihumboldt.hale.common.core.io.project.ProjectInfo; import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; +import java.util.Map; /** * Represents a loaded alignment and possible configuration for loading source @@ -62,17 +61,15 @@ public interface TransformationEnvironment extends ServiceProvider, AlignmentPro /** * Get the export presets configured for the project. * - * @return copies of the export presets, fully configured except for the - * target + * @return copies of the export presets, fully configured except for the target */ public Map getExportPresets(); /** - * Get export templates compatible to the target schema, not fully - * configured. + * Get export templates compatible to the target schema, not fully configured. * - * @return copies of the export templates, configured at least with the - * action and provider ID + * @return copies of the export templates, configured at least with the action + * and provider ID */ public Map getExportTemplates(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/WorkspaceService.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/WorkspaceService.java index 6b95002f49..0c1e4da4a2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/WorkspaceService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/WorkspaceService.java @@ -19,7 +19,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.Map; - import org.joda.time.DateTime; import org.joda.time.ReadableDuration; @@ -51,8 +50,7 @@ public interface WorkspaceService { public File getWorkspaceFolder(String id) throws FileNotFoundException; /** - * Get the lease end date and time of the workspace with the given - * identifier. + * Get the lease end date and time of the workspace with the given identifier. * * @param workspaceId the workspace identifier * @return the lease end, if the workspace exists @@ -72,8 +70,8 @@ public interface WorkspaceService { * * @see #set(String, String, String) */ - public Map getSettings(String workspaceId) throws FileNotFoundException, - IOException; + public Map getSettings(String workspaceId) + throws FileNotFoundException, IOException; /** * Change a workspace setting. @@ -87,8 +85,8 @@ public Map getSettings(String workspaceId) throws FileNotFoundEx * * @see #getSettings(String) */ - public void set(String workspaceId, String setting, String value) throws FileNotFoundException, - IOException; + public void set(String workspaceId, String setting, String value) + throws FileNotFoundException, IOException; /** * Delete the workspace with the given identifier. diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/CodeListAdvisor.groovy b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/CodeListAdvisor.groovy index b7d83fc013..c1bffd55cc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/CodeListAdvisor.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/CodeListAdvisor.groovy @@ -15,11 +15,11 @@ package eu.esdihumboldt.hale.common.headless.impl; -import eu.esdihumboldt.hale.common.codelist.CodeList; -import eu.esdihumboldt.hale.common.codelist.config.CodeListReference; -import eu.esdihumboldt.hale.common.codelist.io.CodeListReader; -import eu.esdihumboldt.hale.common.codelist.service.CodeListRegistry; -import eu.esdihumboldt.hale.common.core.io.impl.AbstractIOAdvisor; +import eu.esdihumboldt.hale.common.codelist.CodeList +import eu.esdihumboldt.hale.common.codelist.config.CodeListReference +import eu.esdihumboldt.hale.common.codelist.io.CodeListReader +import eu.esdihumboldt.hale.common.codelist.service.CodeListRegistry +import eu.esdihumboldt.hale.common.core.io.impl.AbstractIOAdvisor import groovy.transform.CompileStatic /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/EnvironmentManagerImpl.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/EnvironmentManagerImpl.java index b42a7d97fd..5a5a293460 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/EnvironmentManagerImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/EnvironmentManagerImpl.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.common.headless.impl; +import eu.esdihumboldt.hale.common.headless.EnvironmentManager; +import eu.esdihumboldt.hale.common.headless.TransformationEnvironment; import java.util.ArrayList; import java.util.Collection; import java.util.Map; import java.util.TreeMap; -import eu.esdihumboldt.hale.common.headless.EnvironmentManager; -import eu.esdihumboldt.hale.common.headless.TransformationEnvironment; - /** * Manages the set of active {@link TransformationEnvironment}s. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/HeadlessProjectAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/HeadlessProjectAdvisor.java index 82cb433c28..6fe9d61ae8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/HeadlessProjectAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/HeadlessProjectAdvisor.java @@ -15,14 +15,6 @@ package eu.esdihumboldt.hale.common.headless.impl; -import java.io.IOException; -import java.net.URI; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.io.AlignmentIO; import eu.esdihumboldt.hale.common.align.io.AlignmentReader; import eu.esdihumboldt.hale.common.align.model.Alignment; @@ -48,6 +40,13 @@ import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.io.SchemaIO; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; /** * Advisor for loading a project headless. Only loads schemas and alignment, and @@ -136,8 +135,8 @@ public Alignment getAlignment() { /** * Default constructor * - * @param reportHandler the report handler to use when executing contained - * I/O configurations, may be null + * @param reportHandler the report handler to use when executing contained I/O + * configurations, may be null * @param serviceProvider the service provider in the current context */ public HeadlessProjectAdvisor(ReportHandler reportHandler, ServiceProvider serviceProvider) { @@ -147,8 +146,8 @@ public HeadlessProjectAdvisor(ReportHandler reportHandler, ServiceProvider servi /** * Default constructor * - * @param reportHandler the report handler to use when executing contained - * I/O configurations, may be null + * @param reportHandler the report handler to use when executing contained I/O + * configurations, may be null * @param serviceProvider the service provider in the current context * @param additionalAdvisors a map with additional I/O advisors, action ID * mapped to advisor, may be null @@ -198,7 +197,7 @@ public void updateConfiguration(ProjectReader provider) { null, null, null, this) // give null for save related // parts // (should not be called) - { + { @Override protected IOAdvisor getLoadAdvisor(String loadActionId, @@ -255,8 +254,8 @@ public X getService(Class serviceInterface) { } /** - * Get the loaded project. Can be retrieved after the project was - * successfully loaded. + * Get the loaded project. Can be retrieved after the project was successfully + * loaded. * * @return the project */ @@ -265,8 +264,8 @@ public Project getProject() { } /** - * Get the alignment between source and target schemas. Can be retrieved - * after the project was successfully loaded. + * Get the alignment between source and target schemas. Can be retrieved after + * the project was successfully loaded. * * @return the alignment */ @@ -275,8 +274,8 @@ public Alignment getAlignment() { } /** - * Get the source schemas. Can be retrieved after the project was - * successfully loaded. + * Get the source schemas. Can be retrieved after the project was successfully + * loaded. * * @return the source schemas */ @@ -285,8 +284,8 @@ public SchemaSpace getSourceSchema() { } /** - * Get the target schemas. Can be retrieved after the project was - * successfully loaded. + * Get the target schemas. Can be retrieved after the project was successfully + * loaded. * * @return the target schemas */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/LoadSchemaAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/LoadSchemaAdvisor.java index 807395a51b..0511193fbd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/LoadSchemaAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/LoadSchemaAdvisor.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.common.headless.impl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.impl.AbstractIOAdvisor; import eu.esdihumboldt.hale.common.core.io.project.model.Project; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; @@ -29,6 +23,11 @@ import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; import eu.esdihumboldt.hale.common.schema.model.impl.ResourceSchemaSpace; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * Loads schemas and stores them in the advisor. As such an advisor instance may diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/ProjectTransformationEnvironment.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/ProjectTransformationEnvironment.java index a7f1e1c166..4b64351a95 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/ProjectTransformationEnvironment.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/ProjectTransformationEnvironment.java @@ -15,17 +15,7 @@ package eu.esdihumboldt.hale.common.headless.impl; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - import com.google.common.base.Strings; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.model.Alignment; @@ -60,6 +50,14 @@ import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; import eu.esdihumboldt.hale.io.haleconnect.HaleConnectUrnBuilder; import eu.esdihumboldt.hale.io.haleconnect.project.SimpleProjectReader; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; /** * Transformation environment based on a {@link Project}. @@ -271,8 +269,8 @@ protected ProjectTransformationEnvironment(Project project, String id, SchemaSpa } /** - * Create a copy of the transformation environment with the alignment - * replaced by the given alignment. + * Create a copy of the transformation environment with the alignment replaced + * by the given alignment. * * @param alignment the alignment to use for the copy * @return the transformation environment diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/WorkspaceServiceImpl.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/WorkspaceServiceImpl.java index c703519ead..37fe17bce1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/WorkspaceServiceImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/WorkspaceServiceImpl.java @@ -15,6 +15,11 @@ package eu.esdihumboldt.hale.common.headless.impl; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.headless.WorkspaceService; +import eu.esdihumboldt.util.PlatformUtil; +import eu.esdihumboldt.util.PropertiesFile; import java.io.File; import java.io.FileFilter; import java.io.FileNotFoundException; @@ -23,17 +28,10 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; - import org.apache.commons.io.FileUtils; import org.joda.time.DateTime; import org.joda.time.ReadableDuration; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.headless.WorkspaceService; -import eu.esdihumboldt.util.PlatformUtil; -import eu.esdihumboldt.util.PropertiesFile; - /** * Default implementation of the {@link WorkspaceService}. * @@ -42,8 +40,7 @@ public class WorkspaceServiceImpl implements WorkspaceService { /** - * Prefix of property names that are part of the external workspace - * settings. + * Prefix of property names that are part of the external workspace settings. */ private static final String PROPERTY_SETTING_PREFIX = "setting_"; @@ -66,9 +63,9 @@ public class WorkspaceServiceImpl implements WorkspaceService { /** * Create a workspace service instance. * - * @param workspacesDir the base directory for workspaces, if the location - * does not exist or is not accessible, a default location inside - * the platform instance location is used + * @param workspacesDir the base directory for workspaces, if the location does + * not exist or is not accessible, a default location inside the + * platform instance location is used */ public WorkspaceServiceImpl(File workspacesDir) { if (workspacesDir == null || !workspacesDir.exists()) { @@ -217,8 +214,8 @@ public void deleteWorkspace(String id) { } /** - * Triggers the service scanning for workspace folders where the lease time - * has ended and deletes them. + * Triggers the service scanning for workspace folders where the lease time has + * ended and deletes them. */ public void trigger() { for (File candidate : parentDir.listFiles(new FileFilter() { diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/report/ReportFile.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/report/ReportFile.java index cc6d876ad2..f6927ca21f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/report/ReportFile.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/report/ReportFile.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.common.headless.report; -import java.io.File; -import java.io.IOException; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.Report; import eu.esdihumboldt.hale.common.core.report.ReportHandler; import eu.esdihumboldt.hale.common.core.report.writer.ReportWriter; +import java.io.File; +import java.io.IOException; /** * Represents a report file. diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/AbstractProjectScavenger.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/AbstractProjectScavenger.java index 260eb62ae5..d61861dc56 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/AbstractProjectScavenger.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/AbstractProjectScavenger.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.headless.scavenger; -import java.io.File; - import eu.esdihumboldt.util.scavenger.AbstractResourceScavenger; +import java.io.File; /** * Base class for project scavengers. @@ -26,21 +25,21 @@ * @param the concrete project reference type * @author Simon Templer */ -public abstract class AbstractProjectScavenger> extends - AbstractResourceScavenger { +public abstract class AbstractProjectScavenger> + extends AbstractResourceScavenger { private final C context; /** * Create a new project scavenger. * - * @param scavengeLocation the location to scan, if the location does not - * exist or is not accessible, a default location inside the - * platform instance location is used + * @param scavengeLocation the location to scan, if the location does not exist + * or is not accessible, a default location inside the platform + * instance location is used * @param instanceLocPath the instance location sub-path to use if the * scavengeLocation is invalid or null, may be - * null if the platform instance location should not - * be used as fall-back + * null if the platform instance location should not be + * used as fall-back * @param context the update context */ public AbstractProjectScavenger(File scavengeLocation, String instanceLocPath, C context) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/ProjectProperties.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/ProjectProperties.java index c8e616249a..0806a161ca 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/ProjectProperties.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/ProjectProperties.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.headless.scavenger; +import eu.esdihumboldt.util.SyncedPropertiesFile; import java.io.File; import java.io.IOException; import java.util.Properties; -import eu.esdihumboldt.util.SyncedPropertiesFile; - /** * Basic project configuration properties. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/ProjectReference.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/ProjectReference.java index 59e9ce2d4e..8ea6cd75e2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/ProjectReference.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/scavenger/ProjectReference.java @@ -15,15 +15,6 @@ package eu.esdihumboldt.hale.common.headless.scavenger; -import java.io.File; -import java.io.IOException; -import java.util.Collection; -import java.util.HashSet; -import java.util.Properties; -import java.util.Set; - -import org.eclipse.core.runtime.content.IContentType; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.HaleIO; @@ -36,6 +27,13 @@ import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; import eu.esdihumboldt.hale.common.core.report.ReportHandler; import eu.esdihumboldt.hale.common.headless.report.ReportFile; +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; +import org.eclipse.core.runtime.content.IContentType; /** * Represents a project residing in a specific folder and its configuration. The @@ -54,8 +52,8 @@ public class ProjectReference { public static final String CONFIG_FILE_NAME = "project.properties"; /** - * The name of the log file in the project folder, containing the reports - * from loading the project. + * The name of the log file in the project folder, containing the reports from + * loading the project. */ public static final String REPORT_FILE_NAME = "project-load.log"; @@ -81,11 +79,11 @@ public class ProjectReference { /** * @param projectFolder the project folder - * @param overrideProjectFile the name of the project file if it should - * override the configuration, otherwise null + * @param overrideProjectFile the name of the project file if it should override + * the configuration, otherwise null * @param projectId the project identifier - * @param defaultSettings the properties with default project settings, may - * be null + * @param defaultSettings the properties with default project settings, may be + * null * @throws IOException if accessing the project configuration file failed */ public ProjectReference(final File projectFolder, final String overrideProjectFile, @@ -112,8 +110,8 @@ public void forceUpdate(C context) { /** * Updates the project status from the configuration and if needed loads the - * project and transformation environment and adds or removes the - * transformation environment. + * project and transformation environment and adds or removes the transformation + * environment. * * @param context the update context */ @@ -154,19 +152,17 @@ public void update(C context) { } /** - * States if the report file should be deleted in {@link #update(Object)} - * even if the project info is already loaded. + * States if the report file should be deleted in {@link #update(Object)} even + * if the project info is already loaded. * - * @return if the report file should be deleted for an already loaded - * project + * @return if the report file should be deleted for an already loaded project */ protected boolean isForceClearReports() { return false; } /** - * Called when the project was successfully loaded in - * {@link #update(Object)}. + * Called when the project was successfully loaded in {@link #update(Object)}. * * @param context the update context * @param projectId the project identifier @@ -240,21 +236,20 @@ public File getLoadReportFile() { * * @param projectFile the project file * @param reportHandler the report handler - * @return the project info or null if the project file could - * not be loaded + * @return the project info or null if the project file could not + * be loaded */ protected Project loadProjectInfo(File projectFile, ReportHandler reportHandler) { FileIOSupplier in = new FileIOSupplier(projectFile); - ProjectReader reader = HaleIO - .findIOProvider(ProjectReader.class, in, projectFile.getName()); + ProjectReader reader = HaleIO.findIOProvider(ProjectReader.class, in, + projectFile.getName()); reader.setSource(in); try { IOReport report = reader.execute(null); reportHandler.publishReport(report); } catch (Exception e) { - log.error( - "Failed to load project information for project at " - + projectFile.getAbsolutePath(), e); + log.error("Failed to load project information for project at " + + projectFile.getAbsolutePath(), e); return null; } return reader.getProject(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/AbstractTransformationJob.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/AbstractTransformationJob.java index 0e179dd5b2..b62c77f9c8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/AbstractTransformationJob.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/AbstractTransformationJob.java @@ -16,9 +16,7 @@ package eu.esdihumboldt.hale.common.headless.transform; import java.io.Serializable; - import javax.annotation.concurrent.Immutable; - import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/AbstractTransformationSink.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/AbstractTransformationSink.java index 8f5b7dd7be..728df3aa23 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/AbstractTransformationSink.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/AbstractTransformationSink.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.headless.transform; -import java.util.concurrent.CopyOnWriteArrayList; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.headless.transform.validate.TransformedInstanceValidator; import eu.esdihumboldt.hale.common.instance.model.Instance; +import java.util.concurrent.CopyOnWriteArrayList; /** * Base class for transformation sinks handling validation of incoming diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/ExportJob.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/ExportJob.java index d3b3c877aa..4f238d7148 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/ExportJob.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/ExportJob.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.headless.transform; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import de.fhg.igd.slf4jplus.ATransaction; @@ -29,6 +25,9 @@ import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.core.report.ReportHandler; import eu.esdihumboldt.hale.common.instance.io.InstanceWriter; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; /** * Job for exporting transformed data supplied in a {@link TransformationSink}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/LimboInstanceSink.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/LimboInstanceSink.java index 4c1482925c..53ceb1fb91 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/LimboInstanceSink.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/LimboInstanceSink.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.hale.common.headless.transform; -import java.util.NoSuchElementException; -import java.util.concurrent.BlockingDeque; -import java.util.concurrent.LinkedBlockingDeque; - import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; @@ -29,6 +25,9 @@ import eu.esdihumboldt.hale.common.instance.model.impl.FilteredInstanceCollection; import eu.esdihumboldt.hale.common.instance.model.impl.PseudoInstanceReference; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.util.NoSuchElementException; +import java.util.concurrent.BlockingDeque; +import java.util.concurrent.LinkedBlockingDeque; /** * Sink that holds instances in a limbo, to be collected through the offered @@ -169,9 +168,9 @@ public void close() { } /** - * Simple internal instance collection, does not support remove and filter - * and uses {@link PseudoInstanceReference}s and - * {@link TargetResourceIterator}. Only one iterator may be created. + * Simple internal instance collection, does not support remove and filter and + * uses {@link PseudoInstanceReference}s and {@link TargetResourceIterator}. + * Only one iterator may be created. * * @author Kai Schwierczek */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/StatsCountInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/StatsCountInstanceCollection.java index a2e155e978..4c9d853397 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/StatsCountInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/StatsCountInstanceCollection.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.headless.transform; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.report.Message; import eu.esdihumboldt.hale.common.core.report.ReportHandler; import eu.esdihumboldt.hale.common.core.report.Reporter; @@ -28,6 +26,7 @@ import eu.esdihumboldt.hale.common.instance.model.ext.helper.InstanceCollectionDecorator; import eu.esdihumboldt.hale.common.instance.model.ext.helper.InstanceIteratorDecorator; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import javax.xml.namespace.QName; /** * Instance collection that collects stats on the read instances. diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/Transformation.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/Transformation.java index 639599a20d..cfcf119aad 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/Transformation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/Transformation.java @@ -15,27 +15,11 @@ package eu.esdihumboldt.hale.common.headless.transform; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.annotation.Nullable; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.IJobChangeEvent; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.core.runtime.jobs.JobChangeAdapter; - import com.google.common.base.Function; import com.google.common.collect.Lists; import com.google.common.io.Files; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.model.Alignment; @@ -74,6 +58,18 @@ import eu.esdihumboldt.hale.common.instance.orient.storage.LocalOrientDB; import eu.esdihumboldt.hale.common.instance.orient.storage.StoreInstancesJob; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.annotation.Nullable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.IJobChangeEvent; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.core.runtime.jobs.JobChangeAdapter; /** * Utility class for handling batch transformation. Uses {@link ExportJob} and @@ -97,12 +93,11 @@ public class Transformation { * @param processId the identifier for the transformation process, may be * null if grouping the jobs to a job family is not * necessary - * @param validators the instance validator, may be null or - * empty + * @param validators the instance validator, may be null or empty * @param settings the transformation settings * @return the future representing the successful completion of the - * transformation (note that a successful completion doesn't - * necessary mean there weren't any internal transformation errors) + * transformation (note that a successful completion doesn't necessary + * mean there weren't any internal transformation errors) */ public static ListenableFuture transform(List sources, InstanceWriter target, final TransformationEnvironment environment, @@ -126,8 +121,8 @@ public static ListenableFuture transform(List sources, * necessary * @param settings the transformation settings * @return the future representing the successful completion of the - * transformation (note that a successful completion doesn't - * necessary mean there weren't any internal transformation errors) + * transformation (note that a successful completion doesn't necessary + * mean there weren't any internal transformation errors) */ public static ListenableFuture transform(List sources, InstanceWriter target, final TransformationEnvironment environment, @@ -146,14 +141,13 @@ public static ListenableFuture transform(List sources, * @param processId the identifier for the transformation process, may be * null if grouping the jobs to a job family is not * necessary - * @param validators the instance validators, may be null or - * empty - * @param filterDefinition {@link InstanceFilterDefinition} object as a - * filter may be null + * @param validators the instance validators, may be null or empty + * @param filterDefinition {@link InstanceFilterDefinition} object as a filter + * may be null * @param settings the transformation settings * @return the future representing the successful completion of the - * transformation (note that a successful completion doesn't - * necessary mean there weren't any internal transformation errors) + * transformation (note that a successful completion doesn't necessary + * mean there weren't any internal transformation errors) */ public static ListenableFuture transform(List sources, InstanceWriter target, final TransformationEnvironment environment, @@ -168,8 +162,8 @@ public static ListenableFuture transform(List sources, } /** - * Transform the instances provided by the given instance collection and - * supply the result to the given instance writer. + * Transform the instances provided by the given instance collection and supply + * the result to the given instance writer. * * @param sources the source instance collction * @param target the target instance writer @@ -178,12 +172,11 @@ public static ListenableFuture transform(List sources, * @param processId the identifier for the transformation process, may be * null if grouping the jobs to a job family is not * necessary - * @param validators the instance validators, may be null or - * empty + * @param validators the instance validators, may be null or empty * @param settings the transformation settings * @return the future representing the successful completion of the - * transformation (note that a successful completion doesn't - * necessary mean there weren't any internal transformation errors) + * transformation (note that a successful completion doesn't necessary + * mean there weren't any internal transformation errors) */ public static ListenableFuture transform(InstanceCollection sources, InstanceWriter target, final TransformationEnvironment environment, @@ -267,8 +260,8 @@ public void updateConfiguration(InstanceReader provider) { if (environment instanceof ProjectTransformationEnvironment) { // set project CRS manager as CRS provider /* - * Resource based CRS settings will however not work, as the - * resource identifiers will not match + * Resource based CRS settings will however not work, as the resource + * identifiers will not match */ provider.setCRSProvider(new ProjectCRSManager(provider, null, ((ProjectTransformationEnvironment) environment).getProject())); @@ -313,8 +306,8 @@ public InstanceCollection apply(@Nullable InstanceReader input) { * necessary * @param settings the transformation settings * @return the future representing the successful completion of the - * transformation (note that a successful completion doesn't - * necessary mean there weren't any internal transformation errors) + * transformation (note that a successful completion doesn't necessary + * mean there weren't any internal transformation errors) */ public static ListenableFuture transform(InstanceCollection sources, final TransformationSink targetSink, final ExportJob exportJob, @@ -334,9 +327,8 @@ public static ListenableFuture transform(InstanceCollection sources, for (Cell cell : alignment.getActiveTypeCells()) { /* - * XXX right now the source is read for each type transformation - * - does it makes sense to use the DB if there is a certain - * number of type transformations? + * XXX right now the source is read for each type transformation - does it makes + * sense to use the DB if there is a certain number of type transformations? */ if (!isStreamingTypeTransformation(cell.getTransformationIdentifier())) { @@ -580,8 +572,8 @@ public void done(IJobChangeEvent event) { } /** - * Determine if a function is streaming capable (and does not need an index - * to be built). + * Determine if a function is streaming capable (and does not need an index to + * be built). * * @param transformationIdentifier the function ID * @return true if the function is streaming capable, @@ -604,8 +596,7 @@ private static boolean isStreamingTypeTransformation(String transformationIdenti private static void failure(SettableFuture result, IJobChangeEvent event) { // signal if was canceled /* - * XXX disabled as the transform job will cancel the export job if it - * fails + * XXX disabled as the transform job will cancel the export job if it fails */ // if (event.getResult().matches(IStatus.CANCEL)) { // result.cancel(false); diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationSettings.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationSettings.java index 786aa4fd9b..3ecff25122 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationSettings.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationSettings.java @@ -25,8 +25,8 @@ public interface TransformationSettings { /** - * If present, states if the temporary database should be used. If not - * present, default behavior should be used. + * If present, states if the temporary database should be used. If not present, + * default behavior should be used. * * @return if the temporary database should be used */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationSink.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationSink.java index ce2451ec6d..ae9aeaa653 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationSink.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationSink.java @@ -46,8 +46,8 @@ public interface TransformationSink extends InstanceSink { public void done(boolean cancel); /** - * Returns the associated instance collection, whose iterator will receive - * the instances that are added to the instance sink. + * Returns the associated instance collection, whose iterator will receive the + * instances that are added to the instance sink. * * @return the instance collection for this sink */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationWorkspace.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationWorkspace.java index 106236100a..f644319eee 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationWorkspace.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/TransformationWorkspace.java @@ -15,23 +15,10 @@ package eu.esdihumboldt.hale.common.headless.transform; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.OutputStream; -import java.util.List; -import java.util.Map; - -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.content.IContentType; -import org.joda.time.Duration; -import org.joda.time.ReadableDuration; - import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.HalePlatform; @@ -46,6 +33,16 @@ import eu.esdihumboldt.hale.common.headless.report.ReportFile; import eu.esdihumboldt.hale.common.instance.io.InstanceReader; import eu.esdihumboldt.hale.common.instance.io.InstanceWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import org.apache.commons.io.FileUtils; +import org.eclipse.core.runtime.content.IContentType; +import org.joda.time.Duration; +import org.joda.time.ReadableDuration; /** * A transformation workspace based on {@link WorkspaceService} and @@ -63,20 +60,18 @@ public class TransformationWorkspace { private static final String WORKSPACE_REPORT_FILE = "reports.log"; /** - * Name of the folder containing the source files in a transformation - * workspace. + * Name of the folder containing the source files in a transformation workspace. */ private static final String WORKSPACE_SOURCE_FOLDER = "source"; /** - * Name of the folder containing the target files in a transformation - * workspace. + * Name of the folder containing the target files in a transformation workspace. */ private static final String WORKSPACE_TARGET_FOLDER = "target"; /** - * Name of the workspace setting that holds information about the completion - * of the transformation. + * Name of the workspace setting that holds information about the completion of + * the transformation. */ private static final String SETTING_TRANSFORMATION_SUCCESS = "transformationSuccess"; @@ -128,11 +123,11 @@ public TransformationWorkspace(String workspaceId) { /** * Create a new workspace or use an existing one. * - * @param workspaceId the workspace identifier if this object should - * represent an existing workspace, may be null if - * leaseDuration is set. - * @param leaseDuration the lease duration of a new workspace to create, may - * be null if workspaceId is set + * @param workspaceId the workspace identifier if this object should represent + * an existing workspace, may be null if leaseDuration + * is set. + * @param leaseDuration the lease duration of a new workspace to create, may be + * null if workspaceId is set * @throws IllegalStateException if the {@link WorkspaceService} is not * available or the workspace with the given identifier does not * exist @@ -168,15 +163,15 @@ protected TransformationWorkspace(final String workspaceId, ReadableDuration lea } /** - * Transform the instances provided through the given instance readers and - * store the result in the {@link #getTargetFolder()}. + * Transform the instances provided through the given instance readers and store + * the result in the {@link #getTargetFolder()}. * * @param envId the environment ID * @param sources the instance readers * @param target the configuration of the target instance writer * @return the future representing the successful completion of the - * transformation (note that a successful completion doesn't - * necessary mean there weren't any internal transformation errors) + * transformation (note that a successful completion doesn't necessary + * mean there weren't any internal transformation errors) * @throws Exception if launching the transformation fails */ public ListenableFuture transform(String envId, List sources, @@ -196,8 +191,8 @@ public ListenableFuture transform(String envId, List so } /** - * Transform the instances provided through the given instance readers and - * by default stores the result in the {@link #getTargetFolder()}. + * Transform the instances provided through the given instance readers and by + * default stores the result in the {@link #getTargetFolder()}. * * @param env the transformation environment * @param sources the instance readers @@ -206,8 +201,8 @@ public ListenableFuture transform(String envId, List so * null to use the default target in thet * {@link #getTargetFolder()} * @return the future representing the successful completion of the - * transformation (note that a successful completion doesn't - * necessary mean there weren't any internal transformation errors) + * transformation (note that a successful completion doesn't necessary + * mean there weren't any internal transformation errors) * @throws Exception if launching the transformation fails */ public ListenableFuture transform(TransformationEnvironment env, @@ -276,12 +271,12 @@ public boolean isTransformationFinished() { /** * Determines if a previously with * {@link #transform(String, List, IOConfiguration)} started transformation - * process was complete successfully. Note that a successful completion - * doesn't necessary mean there weren't any internal transformation errors. - * The {@link #getReportFile()} holds more detailed information.
    + * process was complete successfully. Note that a successful completion doesn't + * necessary mean there weren't any internal transformation errors. The + * {@link #getReportFile()} holds more detailed information.
    *
    - * This method may only be called of the transformation is finished, - * otherwise an {@link IllegalStateException} will be thrown. + * This method may only be called of the transformation is finished, otherwise + * an {@link IllegalStateException} will be thrown. * * @return if the transformation was completed successfully * @throws IllegalStateException if the transformation is not finished @@ -303,9 +298,8 @@ public boolean isTransformationSuccessful() throws IllegalStateException { } /** - * Set if the transformation was successfully completed. Must be called when - * the transformation is finished. Also deletes the source folder in the - * workspace. + * Set if the transformation was successfully completed. Must be called when the + * transformation is finished. Also deletes the source folder in the workspace. * * @param success if the transformation was completed successfully * @throws FileNotFoundException if the workspace does not exist @@ -398,8 +392,8 @@ public File getWorkspace() { } /** - * Get the target folder. This folder holds the transformation results after - * the transformation is finished and successful. + * Get the target folder. This folder holds the transformation results after the + * transformation is finished and successful. * * @return the target folder * @@ -411,8 +405,8 @@ public File getTargetFolder() { } /** - * Get the source folder. Files placed in this folder will be deleted after - * the transformation has finished. + * Get the source folder. Files placed in this folder will be deleted after the + * transformation has finished. * * @return the source folder */ @@ -421,8 +415,7 @@ public File getSourceFolder() { } /** - * Get the report file. It holds information about the finished - * transformation. + * Get the report file. It holds information about the finished transformation. * * @return the report file * diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/ValidationJob.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/ValidationJob.java index 1553af7e6c..0f6a6b0fe8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/ValidationJob.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/ValidationJob.java @@ -15,16 +15,6 @@ package eu.esdihumboldt.hale.common.headless.transform; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.annotation.Nullable; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import de.fhg.igd.slf4jplus.ATransaction; @@ -37,6 +27,13 @@ import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.instance.io.InstanceValidator; import eu.esdihumboldt.hale.common.instance.io.InstanceWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.annotation.Nullable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; /** * Job for validating transformed instances. diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/extension/TransformationSinkExtension.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/extension/TransformationSinkExtension.java index fe44951e8d..25c92c53ed 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/extension/TransformationSinkExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/extension/TransformationSinkExtension.java @@ -15,27 +15,25 @@ package eu.esdihumboldt.hale.common.headless.transform.extension; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactoryCollection; import de.fhg.igd.eclipse.util.extension.FactoryFilter; import eu.esdihumboldt.hale.common.headless.transform.TransformationSink; +import java.util.List; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension point for transformation sinks. * * @author Simon Templer */ -public class TransformationSinkExtension extends - AbstractExtension { +public class TransformationSinkExtension + extends AbstractExtension { - private static class ConfigurationDescriptor extends - AbstractConfigurationFactory implements - TransformationSinkDescriptor { + private static class ConfigurationDescriptor + extends AbstractConfigurationFactory + implements TransformationSinkDescriptor { /** * Creates a new descriptor. @@ -118,19 +116,20 @@ protected TransformationSinkDescriptor createFactory(IConfigurationElement conf) * @throws Exception if no applicable transformation sink can be created */ public TransformationSink createSink(final boolean reiterable) throws Exception { - List candidates = getFactories(new FactoryFilter() { - - @Override - public boolean acceptFactory(TransformationSinkDescriptor factory) { - return factory.isReiterable() == reiterable; - } - - @Override - public boolean acceptCollection( - ExtensionObjectFactoryCollection collection) { - return true; - } - }); + List candidates = getFactories( + new FactoryFilter() { + + @Override + public boolean acceptFactory(TransformationSinkDescriptor factory) { + return factory.isReiterable() == reiterable; + } + + @Override + public boolean acceptCollection( + ExtensionObjectFactoryCollection collection) { + return true; + } + }); if (!candidates.isEmpty()) { return candidates.get(0).createExtensionObject(); // TODO try other candidates? diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/filter/InstanceFilterDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/filter/InstanceFilterDefinition.java index c84e15beb8..63caad2a30 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/filter/InstanceFilterDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/filter/InstanceFilterDefinition.java @@ -15,18 +15,8 @@ package eu.esdihumboldt.hale.common.headless.transform.filter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; - import eu.esdihumboldt.hale.common.instance.extension.filter.FilterDefinitionManager; import eu.esdihumboldt.hale.common.instance.model.ContextAwareFilter; import eu.esdihumboldt.hale.common.instance.model.Filter; @@ -34,6 +24,13 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.xml.namespace.QName; /** * Filter definition is a group of filters, applied on {@link Instance}s one by @@ -56,8 +53,7 @@ public class InstanceFilterDefinition implements Filter, ContextAwareFilter { private final List unconditionalFilters; /** - * Filters applicable for any instance that can mark instances to be - * excluded. + * Filters applicable for any instance that can mark instances to be excluded. */ private final List excludeFilters = new ArrayList<>(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/validate/impl/DefaultTransformedInstanceValidator.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/validate/impl/DefaultTransformedInstanceValidator.java index 47cc64e16b..ad1edcfacb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/validate/impl/DefaultTransformedInstanceValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/transform/validate/impl/DefaultTransformedInstanceValidator.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.hale.common.headless.transform.validate.impl; -import java.util.ArrayList; - -import javax.annotation.Nullable; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.report.ReportHandler; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.instance.extension.validation.InstanceValidationContext; import eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationReporter; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instancevalidator.InstanceValidator; +import java.util.ArrayList; +import javax.annotation.Nullable; +import javax.xml.namespace.QName; /** * Validator for transformed instances based on {@link InstanceValidator}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/apps/templates/GenerateTemplates.groovy b/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/apps/templates/GenerateTemplates.groovy index cdf518b0fe..ffee28c132 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/apps/templates/GenerateTemplates.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/apps/templates/GenerateTemplates.groovy @@ -15,15 +15,7 @@ package eu.esdihumboldt.hale.common.inspire.apps.templates; -import java.util.regex.Matcher - -import javax.xml.XMLConstants - -import org.eclipse.core.runtime.content.IContentType -import org.osgi.framework.Version - import com.google.common.collect.Multimap - import de.fhg.igd.slf4jplus.ALogger import de.fhg.igd.slf4jplus.ALoggerFactory import eu.esdihumboldt.hale.common.align.groovy.accessor.EntityAccessor @@ -61,6 +53,10 @@ import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode import groovy.xml.StreamingMarkupBuilder import groovy.xml.XmlUtil +import java.util.regex.Matcher +import javax.xml.XMLConstants +import org.eclipse.core.runtime.content.IContentType +import org.osgi.framework.Version /** * Generate INSPIRE mapping templates. diff --git a/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/apps/templates/GenerateTemplatesApplication.java b/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/apps/templates/GenerateTemplatesApplication.java index f3d6f1a859..563ad1e046 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/apps/templates/GenerateTemplatesApplication.java +++ b/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/apps/templates/GenerateTemplatesApplication.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.common.inspire.apps.templates; +import eu.esdihumboldt.hale.common.app.AbstractApplication; import java.io.File; - import org.eclipse.equinox.app.IApplicationContext; -import eu.esdihumboldt.hale.common.app.AbstractApplication; - /** * Application that generates a mapping of default values. * @@ -29,7 +27,8 @@ public class GenerateTemplatesApplication extends AbstractApplication { @Override - protected Object run(GenerateTemplatesContext executionContext, IApplicationContext appContext) { + protected Object run(GenerateTemplatesContext executionContext, + IApplicationContext appContext) { new GenerateTemplates(executionContext).generate(); return EXIT_OK; diff --git a/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/codelists/RegistryCodeLists.groovy b/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/codelists/RegistryCodeLists.groovy index ec6b26dbe1..b0a3f34c0c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/codelists/RegistryCodeLists.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/codelists/RegistryCodeLists.groovy @@ -15,19 +15,16 @@ package eu.esdihumboldt.hale.common.inspire.codelists; -import java.lang.ref.SoftReference - -import org.w3c.dom.Document - import com.google.common.collect.ArrayListMultimap import com.google.common.collect.Multimap - import de.fhg.igd.slf4jplus.ALogger import de.fhg.igd.slf4jplus.ALoggerFactory import eu.esdihumboldt.hale.io.codelist.inspire.reader.INSPIRECodeListReader import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode import groovy.xml.dom.DOMCategory +import java.lang.ref.SoftReference +import org.w3c.dom.Document /** * Provides access to code lists in INSPIRE registry. diff --git a/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/schemas/ApplicationSchemas.groovy b/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/schemas/ApplicationSchemas.groovy index a1d20c5b0b..06bedba9c8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/schemas/ApplicationSchemas.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.inspire/src/eu/esdihumboldt/hale/common/inspire/schemas/ApplicationSchemas.groovy @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.common.inspire.schemas -import java.lang.ref.SoftReference - import com.google.common.collect.ArrayListMultimap import com.google.common.collect.Multimap - import de.fhg.igd.slf4jplus.ALogger import de.fhg.igd.slf4jplus.ALoggerFactory import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import java.lang.ref.SoftReference /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/IdentityReferenceInspector.java b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/IdentityReferenceInspector.java index 69ba3cc71e..3caef2c8cf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/IdentityReferenceInspector.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/IdentityReferenceInspector.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.common.instance.graph.reference; +import eu.esdihumboldt.hale.common.instance.model.Instance; import java.util.Set; - import javax.annotation.Nullable; -import eu.esdihumboldt.hale.common.instance.model.Instance; - /** * Determines identities and references/assocations for an instance. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/ReferenceGraph.java b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/ReferenceGraph.java index 00eee91861..f39a551b05 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/ReferenceGraph.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/ReferenceGraph.java @@ -15,28 +15,12 @@ package eu.esdihumboldt.hale.common.instance.graph.reference; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Queue; -import java.util.Set; - -import javax.annotation.Nullable; - import com.tinkerpop.blueprints.Direction; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.impls.tg.TinkerGraph; import com.tinkerpop.gremlin.java.GremlinPipeline; import com.tinkerpop.pipes.PipeFunction; import com.tinkerpop.pipes.branch.LoopPipe.LoopBundle; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.SimpleLog; @@ -45,6 +29,19 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Queue; +import java.util.Set; +import javax.annotation.Nullable; /** * Graph with associations between instances. @@ -55,11 +52,11 @@ public class ReferenceGraph { /** - * Custom tinker graph that allows fast access to a random contained vertex - * and to the information if the graph has any vertices. + * Custom tinker graph that allows fast access to a random contained vertex and + * to the information if the graph has any vertices. * - * This class was created because the call to - * {@link TinkerGraph#getVertices()} is very expensive for large graphs. + * This class was created because the call to {@link TinkerGraph#getVertices()} + * is very expensive for large graphs. */ public class CustomTinkerGraph extends TinkerGraph { @@ -99,8 +96,8 @@ public class PartitionIterator implements Iterator { private final SimpleLog log; /** - * @param maxObjects the guiding value for the maximum number of objects - * in a part + * @param maxObjects the guiding value for the maximum number of objects in a + * part * @param log the operation log */ public PartitionIterator(int maxObjects, SimpleLog log) { @@ -111,8 +108,8 @@ public PartitionIterator(int maxObjects, SimpleLog log) { @Override public boolean hasNext() { /* - * There are additional parts if there are candidates in the queue - * and/or vertices left in the graph. + * There are additional parts if there are candidates in the queue and/or + * vertices left in the graph. */ return !candidates.isEmpty() || verticesLeft(); } @@ -216,8 +213,7 @@ private List getNextAtomicPart() { } else { /** - * Example for the Groovy console - getting all associated - * vertices. + * Example for the Groovy console - getting all associated vertices. * g = TinkerGraphFactory.createTinkerGraph() * x = new LinkedHashSet() * g.v(1).as('ref').aggregate(x).both.loop('ref', { !x.contains(it.object) }) @@ -305,8 +301,8 @@ public void remove() { * * @param inspector the instance inspector to use * @param instances the - * @param handleFirst the ID of the first instance to handle, optional and - * can be null + * @param handleFirst the ID of the first instance to handle, optional and can + * be null */ public ReferenceGraph(IdentityReferenceInspector inspector, InstanceCollection instances, T handleFirst) { @@ -369,8 +365,8 @@ protected void addInstance(Instance instance, InstanceReference ref) { * Partition the collected instances in parts that respectively contain all * referenced instances. * - * @param maxObjects the guiding value for the maximum number of objects in - * a part + * @param maxObjects the guiding value for the maximum number of objects in a + * part * @param log the operation log * @return an iterator of instance collections, each instance collection * represents a part @@ -388,8 +384,8 @@ public Iterator partition(int maxObjects, SimpleLog log) { * Partition the collected instances in parts that respectively contain all * referenced instances. * - * @param maxObjects the guiding value for the maximum number of objects in - * a part + * @param maxObjects the guiding value for the maximum number of objects in a + * part * @return an iterator of instance collections, each instance collection * represents a part */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/impl/XMLInspector.java b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/impl/XMLInspector.java index cd876f76b5..3c6bda11e3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/impl/XMLInspector.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/impl/XMLInspector.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.common.instance.graph.reference.impl; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.instance.graph.reference.IdentityReferenceInspector; import eu.esdihumboldt.hale.common.instance.helper.DepthFirstInstanceTraverser; import eu.esdihumboldt.hale.common.instance.helper.InstanceTraversalCallback; @@ -30,6 +23,11 @@ import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; /** * Identity and reference inspector for XML IDs and local XLink references. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/internal/ReferencesInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/internal/ReferencesInstanceCollection.java index 3668f105a4..abaa38b4c6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/internal/ReferencesInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/src/eu/esdihumboldt/hale/common/instance/graph/reference/internal/ReferencesInstanceCollection.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.common.instance.graph.reference.internal; -import java.util.Iterator; -import java.util.List; - import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.instance.model.impl.FilteredInstanceCollection; +import java.util.Iterator; +import java.util.List; /** * An instance collection based on a collection of instance references. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/test/eu/esdihumboldt/hale/common/instance/graph/test/ReferenceGraphTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/test/eu/esdihumboldt/hale/common/instance/graph/test/ReferenceGraphTest.groovy index c69a758783..821423d526 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/test/eu/esdihumboldt/hale/common/instance/graph/test/ReferenceGraphTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/test/eu/esdihumboldt/hale/common/instance/graph/test/ReferenceGraphTest.groovy @@ -2,9 +2,6 @@ package eu.esdihumboldt.hale.common.instance.graph.test import static org.junit.Assert.* -import org.junit.BeforeClass -import org.junit.Test - import eu.esdihumboldt.hale.common.instance.graph.reference.ReferenceGraph import eu.esdihumboldt.hale.common.instance.graph.reference.impl.XMLInspector import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder @@ -12,6 +9,8 @@ import eu.esdihumboldt.hale.common.instance.model.Instance import eu.esdihumboldt.hale.common.instance.model.InstanceCollection import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.test.TestUtil +import org.junit.BeforeClass +import org.junit.Test class ReferenceGraphTest { @@ -409,5 +408,4 @@ class ReferenceGraphTest { assertEquals('Unexpected combined part size', 50, collections[0].size() + collections[1].size() + collections[2].size()) assertTrue('Part with 21 instances not found', collections[0].size() == 21 || collections[1].size() == 21 || collections[2].size() == 21) } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceAccessor.groovy b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceAccessor.groovy index 9e34557157..c3fdcaa963 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceAccessor.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceAccessor.groovy @@ -15,12 +15,9 @@ package eu.esdihumboldt.hale.common.instance.groovy; -import javax.xml.namespace.QName - import com.google.common.base.Function import com.google.common.collect.ImmutableList import com.google.common.collect.Lists - import eu.esdihumboldt.hale.common.instance.model.Group import eu.esdihumboldt.hale.common.instance.model.Instance import eu.esdihumboldt.hale.common.schema.model.Definition @@ -30,6 +27,7 @@ import eu.esdihumboldt.util.groovy.paths.Path import eu.esdihumboldt.util.groovy.paths.PathImpl import eu.esdihumboldt.util.groovy.paths.PathWithNulls import groovy.transform.CompileStatic +import javax.xml.namespace.QName /** * Property accessor for {@link Instance}s. @@ -262,5 +260,4 @@ class InstanceAccessor extends AbstractAccessor { public List values() { list(false) } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceBuilder.groovy b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceBuilder.groovy index 0942a3aec7..7dceca08a1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceBuilder.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceBuilder.groovy @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.instance.groovy -import javax.xml.namespace.QName - -import org.springframework.core.convert.ConversionException - import de.fhg.igd.slf4jplus.ALogger import de.fhg.igd.slf4jplus.ALoggerFactory import eu.esdihumboldt.hale.common.convert.ConversionUtil @@ -44,6 +40,8 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag import eu.esdihumboldt.util.groovy.builder.BuilderBase import eu.esdihumboldt.util.groovy.paths.Path import groovy.transform.CompileStatic +import javax.xml.namespace.QName +import org.springframework.core.convert.ConversionException /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceFamilyAccessor.groovy b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceFamilyAccessor.groovy index a6052e9a15..50f322ddac 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceFamilyAccessor.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/InstanceFamilyAccessor.groovy @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.common.instance.groovy; -import javax.xml.namespace.QName - import com.google.common.base.Function import com.google.common.collect.ImmutableList import com.google.common.collect.Lists - import eu.esdihumboldt.hale.common.instance.model.FamilyInstance import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.util.groovy.paths.AbstractAccessor import eu.esdihumboldt.util.groovy.paths.Path import eu.esdihumboldt.util.groovy.paths.PathImpl import groovy.transform.CompileStatic +import javax.xml.namespace.QName /** * Accessor linked instances of a {@link FamilyInstance}s. @@ -209,5 +207,4 @@ class InstanceFamilyAccessor extends AbstractAccessor { public InstanceAccessor getProperties() { accessor() } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/meta/InstanceFamilyAccessorMetaClass.java b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/meta/InstanceFamilyAccessorMetaClass.java index c719c7dde3..a87e9eab87 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/meta/InstanceFamilyAccessorMetaClass.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/src/eu/esdihumboldt/hale/common/instance/groovy/meta/InstanceFamilyAccessorMetaClass.java @@ -48,7 +48,8 @@ public InstanceFamilyAccessorMetaClass(MetaClass delegate) { @Override public Object getProperty(Object object, String property) { - if (object instanceof FamilyInstance && ("links".equals(property) || "l".equals(property))) { + if (object instanceof FamilyInstance + && ("links".equals(property) || "l".equals(property))) { return new InstanceFamilyAccessor((FamilyInstance) object); } return super.getProperty(object, property); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/test/eu/esdihumboldt/hale/common/instance/groovy/InstanceBuilderTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/test/eu/esdihumboldt/hale/common/instance/groovy/InstanceBuilderTest.groovy index 77a5fec1d5..ce15b5e019 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/test/eu/esdihumboldt/hale/common/instance/groovy/InstanceBuilderTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/test/eu/esdihumboldt/hale/common/instance/groovy/InstanceBuilderTest.groovy @@ -15,11 +15,7 @@ package eu.esdihumboldt.hale.common.instance.groovy -import eu.esdihumboldt.util.test.AbstractPlatformTest -import org.junit.Before -import org.junit.Test - -import javax.xml.namespace.QName +import static org.junit.Assert.* import eu.esdihumboldt.hale.common.instance.model.Group import eu.esdihumboldt.hale.common.instance.model.Instance @@ -28,9 +24,11 @@ import eu.esdihumboldt.hale.common.instance.model.ResourceIterator import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.test.TestUtil +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.transform.CompileStatic - -import static org.junit.Assert.* +import javax.xml.namespace.QName +import org.junit.Before +import org.junit.Test /** * Tests for {@link InstanceBuilder}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/DeepIterableKey.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/DeepIterableKey.java index 53fd411cfb..fd9f7def5e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/DeepIterableKey.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/DeepIterableKey.java @@ -16,19 +16,16 @@ package eu.esdihumboldt.hale.common.instance.index; +import com.google.common.collect.Lists; +import eu.esdihumboldt.hale.common.instance.model.Group; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.util.StructuredEquals; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.LinkedList; import java.util.List; - import javax.xml.namespace.QName; - -import com.google.common.collect.Lists; - -import eu.esdihumboldt.hale.common.instance.model.Group; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.util.StructuredEquals; import net.jcip.annotations.Immutable; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/HaleInstanceIndex.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/HaleInstanceIndex.java index 47b1a61f74..41a99fc841 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/HaleInstanceIndex.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/HaleInstanceIndex.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.instance.index; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; import java.util.Collection; import java.util.List; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; - /** * Interface for an {@link Instance} indexes for hale studio * @@ -32,8 +30,7 @@ public interface HaleInstanceIndex extends InstanceIndex, PropertyEntityDefinitionMapping, ResolvableInstanceReference> { /** - * Retrieve instance references from the index grouped by the given - * properties. + * Retrieve instance references from the index grouped by the given properties. * * @param keyProperties Properties to group by * @return Grouped instance references diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/IndexedPropertyValue.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/IndexedPropertyValue.java index 65489298dc..108c3d0205 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/IndexedPropertyValue.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/IndexedPropertyValue.java @@ -15,20 +15,17 @@ package eu.esdihumboldt.hale.common.instance.index; +import com.google.common.collect.Lists; +import eu.esdihumboldt.hale.common.instance.model.Group; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.util.StructuredEquals; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.LinkedList; import java.util.List; - import javax.xml.namespace.QName; -import com.google.common.collect.Lists; - -import eu.esdihumboldt.hale.common.instance.model.Group; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.util.StructuredEquals; - /** * Tuple of a property {@link QName} and its associated values * diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndex.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndex.java index e2512e1fc1..32d94be4ca 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndex.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndex.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.instance.index; -import java.util.Collection; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; +import java.util.Collection; +import java.util.List; +import javax.xml.namespace.QName; /** * Interface for {@link Instance} indexes diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexContribution.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexContribution.java index bc8eb4f6b0..9a9b819ccc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexContribution.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexContribution.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.instance.index; -import java.util.Collection; -import java.util.List; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; +import java.util.Collection; +import java.util.List; /** * Interface for transformation functions that use an {@link InstanceIndex} and @@ -30,9 +29,9 @@ public interface InstanceIndexContribution { /** - * Provides a collection of groups of properties that need to be included in - * the instance index. Every property group (i.e. the properties grouped - * together in the inner lists) form a combined key in the index. + * Provides a collection of groups of properties that need to be included in the + * instance index. Every property group (i.e. the properties grouped together in + * the inner lists) form a combined key in the index. * * @param cell Cell to analyze * @return The property groups to be indexed diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexService.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexService.java index c64052e1dd..878b354ecc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexService.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.common.instance.index; -import java.util.Collection; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; @@ -27,6 +22,9 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; +import java.util.Collection; +import java.util.List; +import javax.xml.namespace.QName; /** * Service for maintaining an instance index. @@ -60,8 +58,8 @@ public interface InstanceIndexService { void add(InstanceReference reference, InstanceCollection instances); /** - * Add properties whose values will be indexed in a combined key (may be - * single property) + * Add properties whose values will be indexed in a combined key (may be single + * property) * * @param properties Properties to index */ @@ -84,8 +82,7 @@ public interface InstanceIndexService { void removePropertyMapping(List properties); /** - * Retrieve instance references from the index grouped by the given - * properties. + * Retrieve instance references from the index grouped by the given properties. * * @param typeName Type that contains the properties * @param properties Properties to group by @@ -126,8 +123,8 @@ Collection> groupBy(QName typeName, * * @param typeName Type of instances to search * @param propertyPath Property to search - * @param values Values that the instance must have in the property - * specified by propertyPath + * @param values Values that the instance must have in the property specified by + * propertyPath * @return References to matching instances */ Collection getInstancesByValue(QName typeName, diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexServiceImpl.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexServiceImpl.java index 2bebae063e..ed95ea93c5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexServiceImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexServiceImpl.java @@ -15,18 +15,6 @@ package eu.esdihumboldt.hale.common.instance.index; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.align.extension.transformation.TransformationFunctionUtil; import eu.esdihumboldt.hale.common.align.extension.transformation.TypeTransformationFactory; import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; @@ -41,6 +29,16 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstanceCollection; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; /** * Maintains instance indexes @@ -251,9 +249,8 @@ public List getInstancePropertyValues(QName typeName, // Because only the indexed values of a single property are of interest // here, find all IndexedPropertyValues where the propertyPath matches // and flatten the result into a 1-D list - List matches = values.stream() - .filter(ipvs -> ipvs.stream() - .anyMatch(ipv -> propertyPath.equals(ipv.getPropertyPath()))) + List matches = values.stream().filter( + ipvs -> ipvs.stream().anyMatch(ipv -> propertyPath.equals(ipv.getPropertyPath()))) .flatMap(List::stream).collect(Collectors.toList()); return matches; diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexUtil.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexUtil.java index 6dc1c93938..d3113f7dc5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/InstanceIndexUtil.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.common.instance.index; +import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; +import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; import java.math.BigDecimal; import java.math.BigInteger; import java.net.URI; import java.net.URL; import java.util.Collection; -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; - /** * Utility class for {@link InstanceIndex}es * @@ -32,8 +31,7 @@ public abstract class InstanceIndexUtil { /** - * Test if two collections contain the same elements (independent of - * ordering) + * Test if two collections contain the same elements (independent of ordering) * * @param c1 First collection * @param c2 Second collection @@ -48,16 +46,16 @@ public static boolean collectionEquals(Collection c1, Collection c2) { * * @param value the value * @param property the entity definition the value is associated to - * @return the processed value, possibly wrapped or replaced through a - * different representation + * @return the processed value, possibly wrapped or replaced through a different + * representation */ public static Object processValue(Object value, PropertyEntityDefinition property) { // extract the identifier from a reference value = property.getDefinition().getConstraint(Reference.class).extractId(value); /* - * This is done so values will be classified as equal even if they are - * of different types, e.g. Long and Integer or Integer and String. + * This is done so values will be classified as equal even if they are of + * different types, e.g. Long and Integer or Integer and String. */ /* diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/LocalizableInstanceReference.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/LocalizableInstanceReference.java index b602b3aa15..0b031e2e21 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/LocalizableInstanceReference.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/LocalizableInstanceReference.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.instance.index; -import java.util.Objects; - import de.fhg.igd.geom.BoundingBox; import de.fhg.igd.geom.Localizable; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.impl.InstanceReferenceDecorator; +import java.util.Objects; /** * A decorator for {@link InstanceReference}s adding the {@link Localizable} @@ -34,8 +33,8 @@ public class LocalizableInstanceReference extends InstanceReferenceDecorator private final BoundingBox box; /** - * Constructs a decorator for the given {@link InstanceReference} and - * associates it the given {@link BoundingBox}. + * Constructs a decorator for the given {@link InstanceReference} and associates + * it the given {@link BoundingBox}. * * @param reference decoratee * @param boundingBox bounding box diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/MultimapInstanceIndex.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/MultimapInstanceIndex.java index 47fb61ef8f..deb54aeac8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/MultimapInstanceIndex.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/MultimapInstanceIndex.java @@ -17,6 +17,10 @@ import static eu.esdihumboldt.hale.common.instance.index.InstanceIndexUtil.collectionEquals; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -25,15 +29,8 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; - import javax.xml.namespace.QName; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; - -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; - /** * Simple implementation of an instance index based on {@link Multimap}s * diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/PropertyEntityDefinitionMapping.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/PropertyEntityDefinitionMapping.java index fb0d3a0eb3..c3f19f12f2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/PropertyEntityDefinitionMapping.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/PropertyEntityDefinitionMapping.java @@ -15,20 +15,17 @@ package eu.esdihumboldt.hale.common.instance.index; +import com.google.common.collect.Multiset; +import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; +import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; +import eu.esdihumboldt.hale.common.instance.model.Instance; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; - import javax.xml.namespace.QName; -import com.google.common.collect.Multiset; - -import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; -import eu.esdihumboldt.hale.common.instance.model.Instance; - /** * Mapping definition between {@link Instance} and {@link IndexedPropertyValue} * based on a {@link PropertyEntityDefinition}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/RTreeSpatialIndexService.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/RTreeSpatialIndexService.java index e569e93b01..46874ff111 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/RTreeSpatialIndexService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/RTreeSpatialIndexService.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.common.instance.index.spatial; -import java.util.Collection; -import java.util.stream.Collectors; - import de.fhg.igd.geom.BoundingBox; import de.fhg.igd.geom.Localizable; import de.fhg.igd.geom.Verifier; @@ -25,6 +22,8 @@ import eu.esdihumboldt.hale.common.instance.index.Typed; import eu.esdihumboldt.hale.common.instance.model.impl.InstanceReferenceDecorator; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collection; +import java.util.stream.Collectors; /** * Spatial index service using an {@link RTree} to maintain the index. @@ -36,9 +35,8 @@ public class RTreeSpatialIndexService implements SpatialIndexService index; /** - * Verifier to determine whether the bounding box of a given - * {@link Localizable} has any spatial relation to another - * {@link BoundingBox}. + * Verifier to determine whether the bounding box of a given {@link Localizable} + * has any spatial relation to another {@link BoundingBox}. */ public static final Verifier ANY_RELATION_VERIFIER = new Verifier() { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/SpatialIndexInstanceProcessor.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/SpatialIndexInstanceProcessor.java index a55f3765f7..c13763fc30 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/SpatialIndexInstanceProcessor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/SpatialIndexInstanceProcessor.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.common.instance.index.spatial; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import org.locationtech.jts.geom.Geometry; - import de.fhg.igd.geom.BoundingBox; import de.fhg.igd.geom.Localizable; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; @@ -34,6 +27,11 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.processing.AbstractInstanceProcessor; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import org.locationtech.jts.geom.Geometry; /** * Instance processor to populate the spatial index provided by the @@ -85,9 +83,8 @@ public void close() throws IOException { /** * @return the spatial index service - * @throws IllegalStateException thrown if there is no - * {@link ServiceProvider} or no {@link SpatialIndexService} - * provided + * @throws IllegalStateException thrown if there is no {@link ServiceProvider} + * or no {@link SpatialIndexService} provided */ private SpatialIndexService getSpatialIndexService() { final ServiceProvider serviceProvider = Optional.ofNullable(this.getServiceProvider()) diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/SpatialIndexService.java b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/SpatialIndexService.java index 547550ba06..5ad1a140b5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/SpatialIndexService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/src/eu/esdihumboldt/hale/common/instance/index/spatial/SpatialIndexService.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.instance.index.spatial; -import java.util.Collection; - import de.fhg.igd.geom.Localizable; import de.fhg.igd.geom.Verifier; import eu.esdihumboldt.hale.common.instance.index.Typed; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collection; /** * Service for maintaining a spatial index. @@ -42,20 +41,20 @@ public interface SpatialIndexService retrieve(K spatialQuery); /** * Retrieves objects that match the given spatial query and the type filter. - * Type matching is supported for {@link Localizable}s that also implement - * the {@link Typed} interface. + * Type matching is supported for {@link Localizable}s that also implement the + * {@link Typed} interface. * * @param spatialQuery spatial query, e.g. a bounding box * @param typeFilter types to include in result - * @return Objects that match the query or an empty Collection if there are - * no matches + * @return Objects that match the query or an empty Collection if there are no + * matches */ Collection retrieve(K spatialQuery, Collection typeFilter); @@ -64,10 +63,10 @@ public interface SpatialIndexService retrieve(K spatialQuery, Verifier verifier); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/OGroup.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/OGroup.java index 385435df69..b4a628ee82 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/OGroup.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/OGroup.java @@ -16,16 +16,6 @@ package eu.esdihumboldt.hale.common.instance.orient; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Set; - -import javax.xml.namespace.QName; - import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.record.ODatabaseRecord; import com.orientechnologies.orient.core.metadata.schema.OSchema; @@ -33,7 +23,6 @@ import com.orientechnologies.orient.core.record.ORecordAbstract; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.storage.OStorage.CLUSTER_TYPE; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.SimpleLog; @@ -48,6 +37,14 @@ import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Set; +import javax.xml.namespace.QName; /** * Group implementation based on {@link ODocument}s @@ -133,8 +130,8 @@ private void configureDocument(ORecordAbstract document, ODatabaseRecord db, // reset class name ODocument doc = (ODocument) document; /* - * Attention: Two long class names cause problems as file names will - * be based on them. + * Attention: Two long class names cause problems as file names will be based on + * them. */ String className = null; if (definition != null) { @@ -232,8 +229,8 @@ public OGroup(ODocument document, DefinitionGroup definition, ODatabaseRecord db } /** - * Copy constructor. Creates a group based on the properties and values of - * the given group. + * Copy constructor. Creates a group based on the properties and values of the + * given group. * * @param org the instance to copy */ @@ -278,8 +275,9 @@ protected void addProperty(QName propertyName, Object value, ODocument document) // default: use list List valueList = new ArrayList(); valueList.add(value); - document.field(pName, valueList, (isInstanceDocument) - ? (getCollectionType(propertyName)) : (OType.EMBEDDEDLIST)); + document.field(pName, valueList, + (isInstanceDocument) ? (getCollectionType(propertyName)) + : (OType.EMBEDDEDLIST)); } else if (oldValue instanceof Collection) { // add value to collection @@ -291,8 +289,9 @@ else if (oldValue.getClass().isArray()) { Object[] values = new Object[oldArray.length + 1]; System.arraycopy(oldArray, 0, values, 0, oldArray.length); values[oldArray.length] = value; - document.field(pName, values, (isInstanceDocument) - ? (getCollectionType(propertyName)) : (OType.EMBEDDEDLIST)); + document.field(pName, values, + (isInstanceDocument) ? (getCollectionType(propertyName)) + : (OType.EMBEDDEDLIST)); } } else { @@ -331,8 +330,8 @@ else if (child.asGroup() != null) { } /** - * Converts {@link Group}s and {@link Instance}s to {@link ODocument} but - * leaves other objects untouched. + * Converts {@link Group}s and {@link Instance}s to {@link ODocument} but leaves + * other objects untouched. * * @param value the object to convert * @return the converted object diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/OInstance.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/OInstance.java index 05b808939b..b521071d78 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/OInstance.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/OInstance.java @@ -16,25 +16,22 @@ package eu.esdihumboldt.hale.common.instance.orient; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - import com.google.common.base.Preconditions; import com.orientechnologies.orient.core.db.record.ODatabaseRecord; import com.orientechnologies.orient.core.record.impl.ODocument; - import eu.esdihumboldt.hale.common.instance.model.DataSet; import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.hale.common.instance.model.Identifiable; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.MutableInstance; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; /** * Instance implementation based on {@link ODocument}s @@ -55,8 +52,7 @@ public class OInstance extends OGroup implements MutableInstance, Identifiable { public static final String FIELD_METADATA = "___metadata___"; /** - * Name for the special field indicating if the instance was inserted - * directly. + * Name for the special field indicating if the instance was inserted directly. */ public static final String FIELD_INSERTED = "___insert___"; @@ -103,8 +99,8 @@ public OInstance(ODocument document, TypeDefinition typeDef, ODatabaseRecord db, } /** - * Copy constructor. Creates an instance based on the properties and values - * of the given instance. + * Copy constructor. Creates an instance based on the properties and values of + * the given instance. * * @param org the instance to copy */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/ONameUtil.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/ONameUtil.java index c9fbe0467e..afe00dad30 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/ONameUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/ONameUtil.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.common.instance.orient; +import com.google.common.base.Charsets; +import com.orientechnologies.orient.core.record.impl.ODocument; import java.util.BitSet; - import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.net.URLCodec; -import com.google.common.base.Charsets; -import com.orientechnologies.orient.core.record.impl.ODocument; - /** * Utilities for name encoding and decoding * @@ -54,8 +52,7 @@ public class ONameUtil { } /** - * Encode text to a string that is a valid name for {@link ODocument} - * fields. + * Encode text to a string that is a valid name for {@link ODocument} fields. * * @param text the text to encode * @return the encoded name diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ExtendedWKBReader.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ExtendedWKBReader.java index ac05bb76fd..1a914b4f81 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ExtendedWKBReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ExtendedWKBReader.java @@ -34,7 +34,6 @@ package eu.esdihumboldt.hale.common.instance.orient.internal; import java.io.IOException; - import org.locationtech.jts.geom.CoordinateSequence; import org.locationtech.jts.geom.CoordinateSequenceFactory; import org.locationtech.jts.geom.CoordinateSequences; @@ -64,8 +63,8 @@ public class ExtendedWKBReader { /** - * Converts a hexadecimal string to a byte array. The hexadecimal digit - * symbols are case-insensitive. + * Converts a hexadecimal string to a byte array. The hexadecimal digit symbols + * are case-insensitive. * * @param hex a string containing hex digits * @return an array of bytes with the value of the hex string @@ -329,8 +328,8 @@ private CoordinateSequence readCoordinateSequenceRing(int size) } /** - * Reads a coordinate value with the specified dimensionality. Makes the X - * and Y ordinates precise according to the precision model in use. + * Reads a coordinate value with the specified dimensionality. Makes the X and Y + * ordinates precise according to the precision model in use. * * @throws IOException if an error occurs reading the coordinate */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ExtendedWKBWriter.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ExtendedWKBWriter.java index 8d929ab211..9f72c36af3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ExtendedWKBWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ExtendedWKBWriter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.instance.orient.internal; import java.io.IOException; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.CoordinateSequence; import org.locationtech.jts.geom.Geometry; diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ONamespaceMap.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ONamespaceMap.java index 4d0f645714..6d85a777dd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ONamespaceMap.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/ONamespaceMap.java @@ -16,15 +16,13 @@ package eu.esdihumboldt.hale.common.instance.orient.internal; -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; - -import org.apache.commons.codec.DecoderException; - import eu.esdihumboldt.hale.common.instance.orient.OGroup; import eu.esdihumboldt.hale.common.instance.orient.OInstance; import eu.esdihumboldt.hale.common.instance.orient.ONameUtil; import eu.esdihumboldt.util.Identifiers; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; +import org.apache.commons.codec.DecoderException; /** * Temporary static namespace map for storing {@link OInstance}s/{@link OGroup}s @@ -67,9 +65,8 @@ public static String encode(QName org) { } /** - * Determine the original namespace of the given qualified name with a - * namespace previously mapped with {@link #map(QName)} and return the - * original name. + * Determine the original namespace of the given qualified name with a namespace + * previously mapped with {@link #map(QName)} and return the original name. * * @param mapped the adapted qualified name * @return the original qualified name diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/OSerializationHelper.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/OSerializationHelper.java index 259fc105d7..ee48ed278b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/OSerializationHelper.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/internal/OSerializationHelper.java @@ -16,6 +16,22 @@ package eu.esdihumboldt.hale.common.instance.orient.internal; +import com.orientechnologies.orient.core.metadata.schema.OType; +import com.orientechnologies.orient.core.record.ORecordAbstract; +import com.orientechnologies.orient.core.record.impl.ODocument; +import com.orientechnologies.orient.core.record.impl.ORecordBytes; +import de.fhg.igd.osgi.util.OsgiUtils; +import eu.esdihumboldt.hale.common.core.HalePlatform; +import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; +import eu.esdihumboldt.hale.common.instance.model.Group; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.instance.orient.OGroup; +import eu.esdihumboldt.hale.common.instance.orient.OInstance; +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; +import eu.esdihumboldt.util.Identifiers; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -30,33 +46,13 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Set; - import javax.xml.namespace.QName; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.io.ParseException; import org.locationtech.jts.io.WKBWriter; import org.springframework.core.convert.ConversionService; -import com.orientechnologies.orient.core.metadata.schema.OType; -import com.orientechnologies.orient.core.record.ORecordAbstract; -import com.orientechnologies.orient.core.record.impl.ODocument; -import com.orientechnologies.orient.core.record.impl.ORecordBytes; - -import de.fhg.igd.osgi.util.OsgiUtils; -import eu.esdihumboldt.hale.common.core.HalePlatform; -import eu.esdihumboldt.hale.common.core.report.SimpleLog; -import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; -import eu.esdihumboldt.hale.common.instance.model.Group; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.instance.orient.OGroup; -import eu.esdihumboldt.hale.common.instance.orient.OInstance; -import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; -import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; -import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; -import eu.esdihumboldt.util.Identifiers; - /** * Serialization helper for storing values not support by OrientDB. Serializes * geometries as WKB and holds a runtime cache for CRSs. @@ -256,8 +252,8 @@ else if (Double.class.isAssignableFrom(type) || Float.class.isAssignableFrom(typ } // date /* - * XXX OrientDB strips time information from dates. To avoid information - * loss, we serialize dates and derivatives manually instead + * XXX OrientDB strips time information from dates. To avoid information loss, + * we serialize dates and derivatives manually instead */ // else if (Date.class.isAssignableFrom(type)) { // return true; @@ -265,8 +261,8 @@ else if (Double.class.isAssignableFrom(type) || Float.class.isAssignableFrom(typ // collections else if (Collection.class.isAssignableFrom(type)) { /* - * XXX OrientDB can't deal with nested collections/lists!(?) as a - * work-around we also serialize collections + * XXX OrientDB can't deal with nested collections/lists!(?) as a work-around we + * also serialize collections */ // return true; } @@ -275,8 +271,8 @@ else if (Collection.class.isAssignableFrom(type)) { } /** - * Prepare a value not supported as field in OrientDB so it can be stored in - * the database. + * Prepare a value not supported as field in OrientDB so it can be stored in the + * database. * * @param value the value to convert * @param log the log @@ -306,8 +302,8 @@ else if (isSupportedFieldType(value.getClass())) { } /** - * Serialize and/or wrap a value not supported as field in OrientDB so it - * can be stored in the database. + * Serialize and/or wrap a value not supported as field in OrientDB so it can be + * stored in the database. * * @param value the value to serialize * @param log the log @@ -315,8 +311,8 @@ else if (isSupportedFieldType(value.getClass())) { */ public static ODocument serialize(Object value, SimpleLog log) { /* - * As collections of ORecordBytes are not supported (or rather of - * records that are no documents, see embeddedCollectionToStream in + * As collections of ORecordBytes are not supported (or rather of records that + * are no documents, see embeddedCollectionToStream in * ORecordSerializerCSVAbstract ~578) they are wrapped in a document. */ ODocument doc = new ODocument(); @@ -422,8 +418,8 @@ else if (value instanceof Set) { } /* - * XXX Class name is set in OGroup.configureDocument, as the class name - * may only bet set after the database was set. + * XXX Class name is set in OGroup.configureDocument, as the class name may only + * bet set after the database was set. */ // doc.setClassName(BINARY_WRAPPER_CLASSNAME); doc.field(BINARY_WRAPPER_FIELD, record); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/BrowseOrientInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/BrowseOrientInstanceCollection.java index 9306b29ddd..c7fe7d7b89 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/BrowseOrientInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/BrowseOrientInstanceCollection.java @@ -16,21 +16,10 @@ package eu.esdihumboldt.hale.common.instance.orient.storage; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.Map; -import java.util.Queue; - -import javax.xml.namespace.QName; - import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.orientechnologies.orient.core.iterator.ORecordIteratorClass; import com.orientechnologies.orient.core.record.impl.ODocument; - import eu.esdihumboldt.hale.common.instance.model.DataSet; import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; @@ -44,6 +33,14 @@ import eu.esdihumboldt.hale.common.instance.orient.internal.ONamespaceMap; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Map; +import java.util.Queue; +import javax.xml.namespace.QName; /** * Instance collection based on a {@link LocalOrientDB} diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/DatabaseHandle.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/DatabaseHandle.java index adbab5e414..7350a7a9c5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/DatabaseHandle.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/DatabaseHandle.java @@ -16,23 +16,20 @@ package eu.esdihumboldt.hale.common.instance.orient.storage; -import java.lang.ref.Reference; -import java.util.Arrays; -import java.util.Set; - -import javax.xml.namespace.QName; - import com.google.common.base.FinalizablePhantomReference; import com.google.common.base.FinalizableReferenceQueue; import com.google.common.collect.Sets; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.impl.GroupDecorator; import eu.esdihumboldt.hale.common.instance.model.impl.IdentifiableInstanceDecorator; +import java.lang.ref.Reference; +import java.util.Arrays; +import java.util.Set; +import javax.xml.namespace.QName; /** * Database handle that manages objects referencing the database object. It will @@ -135,9 +132,8 @@ public void finalizeReferent() { } /** - * Augment an instance and add a reference for the database connection. - * Makes sure child instances or groups also reference the database - * connection. + * Augment an instance and add a reference for the database connection. Makes + * sure child instances or groups also reference the database connection. * * @param instance the instance to augment * @return the augmented instance @@ -153,8 +149,8 @@ public Instance addInstance(Instance instance) { } /** - * Augment a group and add a reference for the database connection. Makes - * sure child instances or groups also reference the database connection. + * Augment a group and add a reference for the database connection. Makes sure + * child instances or groups also reference the database connection. * * @param group the group to augment * @return the augmented group diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/DatabaseReference.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/DatabaseReference.java index 5682a4705a..62c80f641a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/DatabaseReference.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/DatabaseReference.java @@ -37,8 +37,7 @@ public interface DatabaseReference { /** * Dispose the reference when the database object isn't used any more. The * underlying connection is closed.
    - * This should be called in a finally block after using the database - * reference. + * This should be called in a finally block after using the database reference. */ public void dispose(); @@ -46,9 +45,9 @@ public interface DatabaseReference { * Dispose the reference when the database object isn't used any more. This * should be called in a finally block after using the database reference. * - * @param closeConnection if the underlying connection shall be closed, only - * use false here if you are providing other means - * of closing the database + * @param closeConnection if the underlying connection shall be closed, only use + * false here if you are providing other means of + * closing the database */ public void dispose(boolean closeConnection); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/LocalOrientDB.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/LocalOrientDB.java index 08945f7bb0..7853a252a5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/LocalOrientDB.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/LocalOrientDB.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.instance.orient.storage; +import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import java.io.File; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; - /** * Represents a local Orient database * diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/OrientInstanceReference.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/OrientInstanceReference.java index 9f5d7c21b7..dd55cf07a9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/OrientInstanceReference.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/OrientInstanceReference.java @@ -20,7 +20,6 @@ import com.orientechnologies.orient.core.exception.ODatabaseException; import com.orientechnologies.orient.core.id.ORID; import com.orientechnologies.orient.core.record.impl.ODocument; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.instance.model.DataSet; diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/OrientInstanceSink.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/OrientInstanceSink.java index ef912ab38a..36a6ecd00f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/OrientInstanceSink.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/OrientInstanceSink.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.hale.common.instance.orient.storage; -import java.io.Closeable; -import java.io.IOException; - import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.orientechnologies.orient.core.record.impl.ODocument; - import eu.esdihumboldt.hale.common.align.transformation.service.InstanceSink; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.orient.OInstance; +import java.io.Closeable; +import java.io.IOException; /** * Instance sink based on a {@link LocalOrientDB} diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/SQLQueryInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/SQLQueryInstanceCollection.java index a104eae9ea..6f4f8dc00f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/SQLQueryInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/SQLQueryInstanceCollection.java @@ -15,17 +15,10 @@ package eu.esdihumboldt.hale.common.instance.orient.storage; -import java.util.Iterator; - -import javax.xml.namespace.QName; - -import org.apache.commons.codec.DecoderException; - import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; - import eu.esdihumboldt.hale.common.instance.model.DataSet; import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; @@ -37,6 +30,9 @@ import eu.esdihumboldt.hale.common.instance.orient.internal.ONamespaceMap; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.util.Iterator; +import javax.xml.namespace.QName; +import org.apache.commons.codec.DecoderException; /** * OrientDB instance collection based on a SQL query. @@ -74,9 +70,9 @@ private void update() { handle = new DatabaseHandle(ref.getDatabase()); /* - * FIXME use asynchronous query instead, to be able to provide - * instances iteratively instead of retrieving all at once (as - * the query below actually yields a list) + * FIXME use asynchronous query instead, to be able to provide instances + * iteratively instead of retrieving all at once (as the query below actually + * yields a list) */ iterator = (Iterator) ref.getDatabase() .query(new OSQLSynchQuery(sqlQuery, limit)).iterator(); @@ -138,8 +134,8 @@ public void close() { * @param database the database to query * @param sqlQuery the SQL query string (make sure type names are properly * encoded using {@link ONamespaceMap}) - * @param types the type index where type definitions to associate are - * retrieved from + * @param types the type index where type definitions to associate are retrieved + * from * @param dataSet the data set to associated to the instances */ public SQLQueryInstanceCollection(LocalOrientDB database, String sqlQuery, TypeIndex types, diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/SharedDatabaseConnection.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/SharedDatabaseConnection.java index 9d9d594fb7..565fcb93be 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/SharedDatabaseConnection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/SharedDatabaseConnection.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.instance.orient.storage; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; /** * Shared database connection. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/StoreInstancesJob.java b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/StoreInstancesJob.java index 57ac2b2d5c..55f01b2a6d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/StoreInstancesJob.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/src/eu/esdihumboldt/hale/common/instance/orient/storage/StoreInstancesJob.java @@ -16,24 +16,10 @@ package eu.esdihumboldt.hale.common.instance.orient.storage; -import java.text.MessageFormat; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.xml.namespace.QName; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; - import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; import com.orientechnologies.orient.core.record.impl.ODocument; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import de.fhg.igd.slf4jplus.ATransaction; @@ -60,6 +46,16 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import gnu.trove.TObjectIntHashMap; import gnu.trove.TObjectIntProcedure; +import java.text.MessageFormat; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import javax.xml.namespace.QName; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; /** * Store instances in a database @@ -127,8 +123,7 @@ public StoreInstancesJob(String name, LocalOrientDB database, InstanceCollection * processing is disabled * @param reportHandler the report handler, null if no report * should be generated - * @param doProcessing if instance processing should be done on stored - * instances + * @param doProcessing if instance processing should be done on stored instances */ public StoreInstancesJob(String name, LocalOrientDB database, InstanceCollection instances, final ServiceProvider serviceProvider, final ReportHandler reportHandler, @@ -274,7 +269,8 @@ public IStatus run(IProgressMonitor monitor) { monitor.subTask(MessageFormat.format("{0}{1} instances processed", String.valueOf(count.get()), size != InstanceCollection.UNKNOWN_SIZE - ? "/" + String.valueOf(size) : "")); + ? "/" + String.valueOf(size) + : "")); lastUpdate = now; } } @@ -300,11 +296,10 @@ public IStatus run(IProgressMonitor monitor) { trans.end(); /* - * Reset instances to prevent memory leak. It seems Eclipse - * internally holds a reference to the job (in JobInfo and/or - * ProgressMonitorFocusJobDialog) and this results in the instance - * collection not being garbage collected. This is especially bad, - * if an in-memory instance collection is used, e.g. a + * Reset instances to prevent memory leak. It seems Eclipse internally holds a + * reference to the job (in JobInfo and/or ProgressMonitorFocusJobDialog) and + * this results in the instance collection not being garbage collected. This is + * especially bad, if an in-memory instance collection is used, e.g. a * DefaultInstanceCollection that is used when loading a Shapefile. */ instances = null; @@ -376,8 +371,8 @@ public boolean execute(QName typeName, int count) { } /** - * Update an instance before it is converted and saved, e.g. adding - * metadata. The default implementation does nothing and may be overridden. + * Update an instance before it is converted and saved, e.g. adding metadata. + * The default implementation does nothing and may be overridden. * * @param instance the instance */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/filter/FilterDefinitionExtension.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/filter/FilterDefinitionExtension.java index d4cb34a530..51a061ae66 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/filter/FilterDefinitionExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/filter/FilterDefinitionExtension.java @@ -16,18 +16,17 @@ package eu.esdihumboldt.hale.common.instance.extension.filter; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link FilterDefinition}s. * * @author Simon Templer */ -public class FilterDefinitionExtension extends - AbstractExtension, FilterDefinitionFactory> { +public class FilterDefinitionExtension + extends AbstractExtension, FilterDefinitionFactory> { /** * Factory for {@link FilterDefinition} based on an @@ -37,8 +36,8 @@ private static class ConfigurationFactory extends AbstractConfigurationFactory> implements FilterDefinitionFactory { /** - * Create a {@link FilterDefinition} factory based on the given - * configuration element. + * Create a {@link FilterDefinition} factory based on the given configuration + * element. * * @param conf the configuration element */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/filter/FilterDefinitionManager.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/filter/FilterDefinitionManager.java index 6e9cc47ed7..d9ece04bba 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/filter/FilterDefinitionManager.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/filter/FilterDefinitionManager.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.instance.extension.filter; -import java.util.List; - import com.google.common.base.Function; import com.google.common.collect.Lists; - import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.util.definition.AbstractObjectFactory; +import java.util.List; /** * {@link FilterDefinition} manager. @@ -64,7 +62,8 @@ public FilterDefinition apply(FilterDefinitionFactory input) { try { return input.createExtensionObject(); } catch (Exception e) { - throw new IllegalStateException("Could not create filter definition", e); + throw new IllegalStateException("Could not create filter definition", + e); } } }); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataActionExtension.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataActionExtension.java index b72b7c03f9..4e085dcc29 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataActionExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataActionExtension.java @@ -16,25 +16,23 @@ package eu.esdihumboldt.hale.common.instance.extension.metadata; -import java.net.URL; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionObjectDefinition; import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactoryCollection; import de.fhg.igd.eclipse.util.extension.FactoryFilter; +import java.net.URL; +import java.util.List; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link MetadataAction}s * * @author Sebastian Reinhardt */ -public class MetadataActionExtension extends - AbstractExtension { +public class MetadataActionExtension + extends AbstractExtension { /** * {@link MetadataAction} factory based on an {@link IConfigurationElement} @@ -43,8 +41,8 @@ public static class ConfigurationFactory extends AbstractConfigurationFactory getMetadataActions(final String key) { - List factorys = (getFactories(new FactoryFilter() { - - @Override - public boolean acceptCollection( - ExtensionObjectFactoryCollection collection) { - return true; - } - - @Override - public boolean acceptFactory(MetadataActionFactory factory) { - return factory.getKey().equals(key); - } - })); + List factorys = (getFactories( + new FactoryFilter() { + + @Override + public boolean acceptCollection( + ExtensionObjectFactoryCollection collection) { + return true; + } + + @Override + public boolean acceptFactory(MetadataActionFactory factory) { + return factory.getKey().equals(key); + } + })); return factorys; } diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataIdGenerator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataIdGenerator.java index e535829176..64a2ebe670 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataIdGenerator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataIdGenerator.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.instance.extension.metadata; -import java.util.UUID; - import eu.esdihumboldt.hale.common.instance.model.Instance; +import java.util.UUID; /** * UniqueID Generator for Instance Metadatas diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataInfo.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataInfo.java index 69aa73f778..dcbaa5abed 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataInfo.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataInfo.java @@ -16,15 +16,13 @@ package eu.esdihumboldt.hale.common.instance.extension.metadata; +import de.fhg.igd.eclipse.util.extension.ExtensionUtil; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import java.net.URL; - import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; -import de.fhg.igd.eclipse.util.extension.ExtensionUtil; -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; - /** * Represents a declared Metadata Info * diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataInfoExtension.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataInfoExtension.java index 8ca6d6345b..42bafcd82c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataInfoExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataInfoExtension.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.instance.extension.metadata; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension point for metadatas diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataWorker.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataWorker.java index c81136b3e4..6c6cd9436d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataWorker.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/metadata/MetadataWorker.java @@ -16,15 +16,14 @@ package eu.esdihumboldt.hale.common.instance.extension.metadata; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.instance.model.MutableInstance; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.instance.model.MutableInstance; - /** * Worker Class to generate metadatas from extensionpoints into Instances this * class will first generate all Data-Generators and save them for use as long diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ConstraintValidatorExtension.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ConstraintValidatorExtension.java index 7c11a128da..7ad2aa840f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ConstraintValidatorExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ConstraintValidatorExtension.java @@ -16,27 +16,25 @@ package eu.esdihumboldt.hale.common.instance.extension.validation; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for constraint validators. * * @author Kai Schwierczek */ -public class ConstraintValidatorExtension extends - AbstractExtension { +public class ConstraintValidatorExtension + extends AbstractExtension { private static final ALogger log = ALoggerFactory.getLogger(ConstraintValidatorExtension.class); @@ -125,7 +123,8 @@ else if (factory.isGroupPropertyConstraintValidator()) { * @see de.fhg.igd.eclipse.util.extension.AbstractExtension#createFactory(org.eclipse.core.runtime.IConfigurationElement) */ @Override - protected ConstraintValidatorFactory createFactory(IConfigurationElement conf) throws Exception { + protected ConstraintValidatorFactory createFactory(IConfigurationElement conf) + throws Exception { return new ConstraintValidatorFactory(conf); } @@ -148,11 +147,9 @@ public Map, PropertyConstraintValidator> getPropertyCo } /** - * Returns a map with all registered - * {@link GroupPropertyConstraintValidator}. + * Returns a map with all registered {@link GroupPropertyConstraintValidator}. * - * @return a map with all registered - * {@link GroupPropertyConstraintValidator} + * @return a map with all registered {@link GroupPropertyConstraintValidator} */ public Map, GroupPropertyConstraintValidator> getGroupPropertyConstraintValidators() { return groupPropertyValidators; diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ConstraintValidatorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ConstraintValidatorFactory.java index 6a8f0fe9d2..089c9d0f75 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ConstraintValidatorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ConstraintValidatorFactory.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.hale.common.instance.extension.validation; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.ExtensionUtil; +import org.eclipse.core.runtime.IConfigurationElement; /** * Factory for constraint validators. @@ -29,8 +28,8 @@ public class ConstraintValidatorFactory extends AbstractConfigurationFactory { /** - * Create a {@link ConstraintValidator} factory based on the given - * configuration element. + * Create a {@link ConstraintValidator} factory based on the given configuration + * element. * * @param conf the configuration element */ @@ -65,8 +64,7 @@ public String getIdentifier() { /** * Checks whether this factory belongs to a type constraint. * - * @return true, if this factory belongs to a type constraint, false - * otherwise + * @return true, if this factory belongs to a type constraint, false otherwise */ public boolean isTypeConstraintValidator() { return conf.getName().equals("typeConstraintValidator"); @@ -85,8 +83,8 @@ public boolean isPropertyConstraintValidator() { /** * Checks whether this factory belongs to a group property constraint. * - * @return true, if this factory belongs to a group property constraint, - * false otherwise + * @return true, if this factory belongs to a group property constraint, false + * otherwise */ public boolean isGroupPropertyConstraintValidator() { return conf.getName().equals("groupPropertyConstraintValidator"); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/GroupPropertyConstraintValidator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/GroupPropertyConstraintValidator.java index ea411ade74..8e309e6972 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/GroupPropertyConstraintValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/GroupPropertyConstraintValidator.java @@ -27,8 +27,8 @@ public interface GroupPropertyConstraintValidator extends ConstraintValidator { /** - * Validate values against constraint. The - * constraint and the values belong to property. + * Validate values against constraint. The constraint + * and the values belong to property. * * @param values the values to validate, may be null * @param constraint the constraint to validate @@ -36,7 +36,7 @@ public interface GroupPropertyConstraintValidator extends ConstraintValidator { * @param context the validation context * @throws ValidationException if the validation fails */ - public void validateGroupPropertyConstraint(Object[] values, - GroupPropertyConstraint constraint, GroupPropertyDefinition property, - InstanceValidationContext context) throws ValidationException; + public void validateGroupPropertyConstraint(Object[] values, GroupPropertyConstraint constraint, + GroupPropertyDefinition property, InstanceValidationContext context) + throws ValidationException; } diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/InstanceValidationContext.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/InstanceValidationContext.java index ca72e69562..d958c4a51a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/InstanceValidationContext.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/InstanceValidationContext.java @@ -50,12 +50,12 @@ public Object getContext(Class validatorClass) { } /** - * Returns true, if and only if there is a context object present for the - * given validator class. + * Returns true, if and only if there is a context object present for the given + * validator class. * * @param validatorClass the validator class - * @return true, if and only if there is a context object present for the - * given validator class + * @return true, if and only if there is a context object present for the given + * validator class */ public boolean containsContext(Class validatorClass) { return contextMap.containsKey(validatorClass); @@ -67,10 +67,10 @@ public boolean containsContext(Class validatorCla * The object may not be null. * * @param validatorClass the validator class - * @param contextObject the new associated object, may not be - * null + * @param contextObject the new associated object, may not be null */ - public void putContext(Class validatorClass, Object contextObject) { + public void putContext(Class validatorClass, + Object contextObject) { contextMap.put(validatorClass, contextObject); } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/PropertyConstraintValidator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/PropertyConstraintValidator.java index e55ce9cdfd..9c9824ebee 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/PropertyConstraintValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/PropertyConstraintValidator.java @@ -27,8 +27,8 @@ public interface PropertyConstraintValidator extends ConstraintValidator { /** - * Validate values against constraint. The - * constraint and the values belong to property. + * Validate values against constraint. The constraint + * and the values belong to property. * * @param values the values to validate, may be null * @param constraint the constraint to validate diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ValidationLocation.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ValidationLocation.java index 9a7e67c2ff..09c597d047 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ValidationLocation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ValidationLocation.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.common.instance.extension.validation; +import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import java.util.List; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.instance.model.InstanceReference; - /** * Validation location. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ValidatorBase.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ValidatorBase.java index 3bda2651bf..c2bdd6c04c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ValidatorBase.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/ValidatorBase.java @@ -29,8 +29,8 @@ public interface ValidatorBase { * * @param context the validation context * @param reporter the instance validation reporter - * @throws ValidationException if the instances are invalid and the reporter - * is not used to report the problems + * @throws ValidationException if the instances are invalid and the reporter is + * not used to report the problems */ @SuppressWarnings("unused") default void validateContext(InstanceValidationContext context, diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/InstanceValidationMessage.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/InstanceValidationMessage.java index 25d1084364..955fcc7943 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/InstanceValidationMessage.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/InstanceValidationMessage.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.common.instance.extension.validation.report; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.report.Message; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; +import java.util.List; +import javax.xml.namespace.QName; /** * Instance validation message. @@ -31,8 +29,8 @@ public interface InstanceValidationMessage extends Message { /** - * Returns the reference to the instance this message is about. The - * reference is only valid as long as the data set didn't change. + * Returns the reference to the instance this message is about. The reference is + * only valid as long as the data set didn't change. * * @return the reference to the instance this message is about, may be null */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/InstanceValidationReporter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/InstanceValidationReporter.java index 82fb0e1e27..28ca711e64 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/InstanceValidationReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/InstanceValidationReporter.java @@ -23,7 +23,7 @@ * * @author Kai Schwierczek */ -public interface InstanceValidationReporter extends Reporter, - InstanceValidationReport { +public interface InstanceValidationReporter + extends Reporter, InstanceValidationReport { // nothing to add, just for concrete type... } diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/impl/DefaultInstanceValidationMessage.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/impl/DefaultInstanceValidationMessage.java index e31f40f971..d5af0b7252 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/impl/DefaultInstanceValidationMessage.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/impl/DefaultInstanceValidationMessage.java @@ -16,15 +16,13 @@ package eu.esdihumboldt.hale.common.instance.extension.validation.report.impl; -import java.text.MessageFormat; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.report.impl.MessageImpl; import eu.esdihumboldt.hale.common.instance.extension.validation.ValidationLocation; import eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationMessage; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; +import java.text.MessageFormat; +import java.util.List; +import javax.xml.namespace.QName; /** * Default implementation of {@link InstanceValidationMessage}. @@ -42,8 +40,8 @@ public class DefaultInstanceValidationMessage extends MessageImpl /** * Create a new instance validation message. * - * @param instanceReference the instance reference this message is - * associated to, may be null + * @param instanceReference the instance reference this message is associated + * to, may be null * @param type the type's name * @param path the path within the type * @param category the message's category diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/impl/DefaultInstanceValidationReporter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/impl/DefaultInstanceValidationReporter.java index b98f652ca4..de6f5dd30e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/impl/DefaultInstanceValidationReporter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/extension/validation/report/impl/DefaultInstanceValidationReporter.java @@ -31,8 +31,8 @@ public class DefaultInstanceValidationReporter extends DefaultReporter { +public class InstanceValidationReportDefinition + extends AbstractReportDefinition { private static final ALogger log = ALoggerFactory .getLogger(InstanceValidationReportDefinition.class); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionManager.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionManager.java index 9ce4967578..c6b03cc67e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionManager.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionManager.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.instance.geometry; -import java.util.ArrayList; -import java.util.List; - import eu.esdihumboldt.hale.common.instance.geometry.impl.internal.CodeDefinitionFactory; import eu.esdihumboldt.hale.common.instance.geometry.impl.internal.WKTDefinitionFactory; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.util.definition.AbstractObjectFactory; +import java.util.ArrayList; +import java.util.List; /** * Provides support for converting {@link CRSDefinition} to string and vice @@ -31,8 +30,8 @@ * * @author Simon Templer */ -public class CRSDefinitionManager extends - AbstractObjectFactory> { +public class CRSDefinitionManager + extends AbstractObjectFactory> { private CRSDefinitionManager() { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionUtil.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionUtil.java index 4aff37068a..87a65cd581 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionUtil.java @@ -16,11 +16,14 @@ package eu.esdihumboldt.hale.common.instance.geometry; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; +import eu.esdihumboldt.hale.common.instance.geometry.impl.WKTDefinition; +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import java.util.HashMap; import java.util.Map; - import javax.annotation.Nullable; - import org.geotools.gml2.SrsSyntax; import org.geotools.referencing.CRS; import org.geotools.referencing.CRS.AxisOrder; @@ -28,12 +31,6 @@ import org.opengis.referencing.ReferenceIdentifier; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; -import eu.esdihumboldt.hale.common.instance.geometry.impl.WKTDefinition; -import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; - /** * Utility methods related to {@link CRSDefinition}s * @@ -47,8 +44,7 @@ public abstract class CRSDefinitionUtil { private static final Map crsCodes = new HashMap<>(); /** - * Create a {@link CRSDefinition} from an existing coordinate reference - * system. + * Create a {@link CRSDefinition} from an existing coordinate reference system. * * @param crs the coordinate reference system * @param cache the cache for CRS resolving @@ -92,9 +88,8 @@ public static CRSDefinition createDefinition(CoordinateReferenceSystem crs, /** * Try to lookup the given CRS via Geotools. If the CRS can be resolved, the * returned {@link CRSDefinition} will contain a - * {@link CoordinateReferenceSystem} with additional information like - * Bursa-Wolf parameters, otherwise the WKT definition of the input CRS will - * be used as is. + * {@link CoordinateReferenceSystem} with additional information like Bursa-Wolf + * parameters, otherwise the WKT definition of the input CRS will be used as is. * * @param crs The CRS to look up * @return A {@link CodeDefinition} with the resolved CRS or a diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSProvider.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSProvider.java index ba71101db3..78be1d58b7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSProvider.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.instance.geometry; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.List; +import javax.xml.namespace.QName; /** * Interface for classes that provide CRS definitions based on @@ -43,9 +41,8 @@ public interface CRSProvider { CRSDefinition getCRS(TypeDefinition parentType, List propertyPath); /** - * Get the CRS definition for values of the given property definition. If no - * CRS definition can be determined, use the one passed in - * defaultCrs. + * Get the CRS definition for values of the given property definition. If no CRS + * definition can be determined, use the one passed in defaultCrs. * * @param parentType the definition of the type of the parent instance * @param propertyPath the property path in the instance diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSResolveCache.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSResolveCache.java index d8b06b787c..a7db8e4e98 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSResolveCache.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/CRSResolveCache.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.common.instance.geometry; +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import javax.annotation.Nullable; - import org.opengis.referencing.crs.CoordinateReferenceSystem; -import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; - /** * Resolves a CRS to a CRS definition that can't be directly derived from the * CRS. @@ -44,8 +42,8 @@ public interface CRSResolveCache { * {@link CoordinateReferenceSystem} * * @param crs the CRS - * @param crsDef the CRS definition or null to remove the - * cached definition + * @param crsDef the CRS definition or null to remove the cached + * definition */ void reviseCache(CoordinateReferenceSystem crs, CRSDefinition crsDef); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/DefaultGeometryProperty.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/DefaultGeometryProperty.java index 5068a8a00f..06646464b0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/DefaultGeometryProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/DefaultGeometryProperty.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.common.instance.geometry; -import org.opengis.referencing.ReferenceIdentifier; - +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.io.WKTWriter; - -import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; -import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import org.opengis.referencing.ReferenceIdentifier; /** * Default implementation of a {@link GeometryProperty} diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/GeometryFinder.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/GeometryFinder.java index f1af5f3b17..db1ef16c6c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/GeometryFinder.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/GeometryFinder.java @@ -16,20 +16,17 @@ package eu.esdihumboldt.hale.common.instance.geometry; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.instance.helper.InstanceTraversalCallback; import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Geometry; /** * Class to find geometries @@ -43,8 +40,7 @@ public class GeometryFinder implements InstanceTraversalCallback { private CRSDefinition defaultCrsDef = null; /** - * Constructor for GeometryFinder with the - * CoordinateReferenceSystemDefinition + * Constructor for GeometryFinder with the CoordinateReferenceSystemDefinition * * @param crsDef The coordinate reference system definition */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/GeometryUtil.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/GeometryUtil.java index a60898c8d9..d7e60eca5f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/GeometryUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/GeometryUtil.java @@ -16,21 +16,18 @@ package eu.esdihumboldt.hale.common.instance.geometry; +import eu.esdihumboldt.hale.common.instance.model.Group; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Queue; - import javax.xml.namespace.QName; - import org.locationtech.jts.geom.Geometry; -import eu.esdihumboldt.hale.common.instance.model.Group; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; - /** * TODO Type description * @@ -56,7 +53,8 @@ public static Collection> getAllGeometries(Instance instance * will yield no geometries * @return the default geometries or an empty collection if there is none */ - public static Collection> getGeometries(Instance instance, List path) { + public static Collection> getGeometries(Instance instance, + List path) { Collection> geometries = new ArrayList>(); if (path == null) { return geometries; @@ -145,8 +143,7 @@ public static Collection> getGeometries(Instance instance, L * Try to get/create geometry properties from a property value. * * @param value the property value, e.g. a {@link Geometry}, - * {@link GeometryProperty}, a {@link Collection} or - * {@link Instance} + * {@link GeometryProperty}, a {@link Collection} or {@link Instance} * @return the geometry properties or an empty list if none could be created */ @SuppressWarnings({ "unchecked", "rawtypes" }) diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/InterpolationHelper.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/InterpolationHelper.java index 7b7d13c6c3..92cb602145 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/InterpolationHelper.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/InterpolationHelper.java @@ -15,15 +15,6 @@ package eu.esdihumboldt.hale.common.instance.geometry; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.GeometryFactory; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -35,6 +26,13 @@ import eu.esdihumboldt.util.geometry.interpolation.grid.GridInterpolation; import eu.esdihumboldt.util.geometry.interpolation.grid.GridUtil; import eu.esdihumboldt.util.geometry.interpolation.split.SplitInterpolation; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.GeometryFactory; /** * Helper for handling interpolation for instance readers. @@ -129,11 +127,10 @@ public static double getMaxPositionalError(IOProvider instanceReader) { } /** - * Determine if the interpolation algorithm requires all geometries being - * moved to a grid. + * Determine if the interpolation algorithm requires all geometries being moved + * to a grid. * - * @param instanceReader the instance reader w/ the interpolation - * configuration + * @param instanceReader the instance reader w/ the interpolation configuration * @return if geometries should be moved to a grid */ public static boolean requiresGeometriesMovedToGrid(IOProvider instanceReader) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/AbstractCRSManager.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/AbstractCRSManager.java index 265a1888f3..3d6e70dff0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/AbstractCRSManager.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/AbstractCRSManager.java @@ -16,16 +16,14 @@ package eu.esdihumboldt.hale.common.instance.geometry.impl; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.instance.geometry.CRSDefinitionManager; import eu.esdihumboldt.hale.common.instance.geometry.CRSProvider; import eu.esdihumboldt.hale.common.instance.io.InstanceReader; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.List; +import javax.xml.namespace.QName; /** * Base class for CRS managers storing/loading preferences about assigned CRSs. @@ -36,19 +34,19 @@ public abstract class AbstractCRSManager implements CRSProvider { /** * The configuration parameter name for the default CRS definition. - * {@link CRSDefinitionManager#parse(String)} is used to handle any values, - * so {@link CRSDefinitionManager#asString(CRSDefinition)} should be used to - * create them. + * {@link CRSDefinitionManager#parse(String)} is used to handle any values, so + * {@link CRSDefinitionManager#asString(CRSDefinition)} should be used to create + * them. */ public static final String PARAM_DEFAULT_CRS = "defaultCRS"; /** - * The prefix for configuration parameter names for the default CRS - * definition for a property. The configuration parameter is the prefix - * concatenated with the {@link PropertyDefinition} identifier. - * {@link CRSDefinitionManager#parse(String)} is used to handle any values, - * so {@link CRSDefinitionManager#asString(CRSDefinition)} should be used to - * create them. + * The prefix for configuration parameter names for the default CRS definition + * for a property. The configuration parameter is the prefix concatenated with + * the {@link PropertyDefinition} identifier. + * {@link CRSDefinitionManager#parse(String)} is used to handle any values, so + * {@link CRSDefinitionManager#asString(CRSDefinition)} should be used to create + * them. */ public static final String PREFIX_PARAM_CRS = "defaultCRS:"; @@ -60,8 +58,7 @@ public abstract class AbstractCRSManager implements CRSProvider { * Create a CRS manager. * * @param reader the instance reader - * @param provider the internal CRS provider to use, may be - * null + * @param provider the internal CRS provider to use, may be null */ public AbstractCRSManager(InstanceReader reader, CRSProvider provider) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/CodeDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/CodeDefinition.java index d0c8018d27..aa5b83ae64 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/CodeDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/CodeDefinition.java @@ -16,20 +16,16 @@ package eu.esdihumboldt.hale.common.instance.geometry.impl; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; - import org.geotools.gml2.SrsSyntax; import org.geotools.referencing.CRS; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; - -import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; - /** * CRS definition based on a code * @@ -90,8 +86,7 @@ public CodeDefinition(String code) { * Create a code definition with only a code. * * @param code the code - * @param longitudeFirst if the axis order should be assumed as longitude - * first + * @param longitudeFirst if the axis order should be assumed as longitude first */ public CodeDefinition(String code, boolean longitudeFirst) { this.code = code; @@ -220,8 +215,8 @@ public static String extractCode(String candidate, String prefix) { * Try to resolve the CRS with the given code * * @param code CRS code - * @return a resolved CodeDefinition or null if the code could - * not be resolved + * @return a resolved CodeDefinition or null if the code could not + * be resolved */ public static CodeDefinition tryResolve(String code) { CodeDefinition candidate = new CodeDefinition(code, false); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/EPSGResolveCache.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/EPSGResolveCache.java index 7b0e126902..c6a36ec080 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/EPSGResolveCache.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/EPSGResolveCache.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.instance.geometry.impl; -import java.util.HashMap; -import java.util.Map; - -import org.opengis.referencing.crs.CoordinateReferenceSystem; - import eu.esdihumboldt.hale.common.instance.geometry.CRSDefinitionUtil; import eu.esdihumboldt.hale.common.instance.geometry.CRSResolveCache; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; +import java.util.HashMap; +import java.util.Map; +import org.opengis.referencing.crs.CoordinateReferenceSystem; /** * Tries to resolve a CRS against the EPSG database. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/WKTDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/WKTDefinition.java index 297263faef..d62a3ef239 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/WKTDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/geometry/impl/WKTDefinition.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.instance.geometry.impl; +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import org.geotools.referencing.CRS; import org.opengis.referencing.crs.CoordinateReferenceSystem; -import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; - /** * CRS definition based on WKT * diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/BreadthFirstInstanceTraverser.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/BreadthFirstInstanceTraverser.java index a90df82f02..43aeadb964 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/BreadthFirstInstanceTraverser.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/BreadthFirstInstanceTraverser.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.instance.helper; - /** * Instance traverser that traverses the model breadth first. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/DepthFirstInstanceTraverser.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/DepthFirstInstanceTraverser.java index daa68c13e6..6ffef47fff 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/DepthFirstInstanceTraverser.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/DepthFirstInstanceTraverser.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.instance.helper; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; +import javax.xml.namespace.QName; /** * Instance traverser that traverses the model depth first. @@ -41,10 +40,9 @@ public DepthFirstInstanceTraverser() { /** * Creates a depth first instance traverser. * - * @param cancelChildTraversalOnly if when the callback cancels the - * traversal, only the traversal of the children should be - * canceled (meaning traversal is continued but not down from the - * current object) + * @param cancelChildTraversalOnly if when the callback cancels the traversal, + * only the traversal of the children should be canceled (meaning + * traversal is continued but not down from the current object) */ public DepthFirstInstanceTraverser(boolean cancelChildTraversalOnly) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/InstanceTraversalCallback.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/InstanceTraversalCallback.java index 1c54430b3d..4f6bfb014e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/InstanceTraversalCallback.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/InstanceTraversalCallback.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.instance.helper; -import javax.annotation.Nullable; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; +import javax.annotation.Nullable; +import javax.xml.namespace.QName; /** * Callback for {@link InstanceTraverser}s. @@ -34,8 +33,8 @@ public interface InstanceTraversalCallback { * Visit an instance. * * @param instance the instance - * @param name the property name the instance is a value of, - * null if it is the traversal root + * @param name the property name the instance is a value of, null + * if it is the traversal root * @param parent the parent group, if applicable * @return if traversal shall be continued */ @@ -45,8 +44,8 @@ public interface InstanceTraversalCallback { * Visit a group that is not an {@link Instance}. * * @param group the group - * @param name the property name the group is a value of, null - * if it is the traversal root + * @param name the property name the group is a value of, null if + * it is the traversal root * @param parent the parent group, if applicable * @return if traversal shall be continued */ @@ -56,8 +55,8 @@ public interface InstanceTraversalCallback { * Visit a value that is neither {@link Instance} nor {@link Group}. * * @param value the value - * @param name the property name the object is a value of, null - * if it is the traversal root + * @param name the property name the object is a value of, null if + * it is the traversal root * @param parent the parent group, if applicable * @return if traversal shall be continued */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/InstanceTraverser.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/InstanceTraverser.java index 2981b19803..636bd0c08b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/InstanceTraverser.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/InstanceTraverser.java @@ -32,8 +32,8 @@ public interface InstanceTraverser { * * @param instance the instance * @param callback the traversal callback - * @return if traversal shall be continued, can be safely ignored if called - * from outside the traverser + * @return if traversal shall be continued, can be safely ignored if called from + * outside the traverser */ public boolean traverse(Instance instance, InstanceTraversalCallback callback); @@ -42,19 +42,19 @@ public interface InstanceTraverser { * * @param group the group * @param callback the traversal callback - * @return if traversal shall be continued, can be safely ignored if called - * from outside the traverser + * @return if traversal shall be continued, can be safely ignored if called from + * outside the traverser */ public boolean traverse(Group group, InstanceTraversalCallback callback); /** * Traverse the given value. * - * @param value the value, if a {@link Group} or {@link Instance} the call - * must be handed over to the respective traverse methods + * @param value the value, if a {@link Group} or {@link Instance} the call must + * be handed over to the respective traverse methods * @param callback the traversal callback - * @return if traversal shall be continued, can be safely ignored if called - * from outside the traverser + * @return if traversal shall be continued, can be safely ignored if called from + * outside the traverser */ public boolean traverse(Object value, InstanceTraversalCallback callback); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/PropertyResolver.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/PropertyResolver.java index 914e6508b0..f8dbb32857 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/PropertyResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/PropertyResolver.java @@ -16,6 +16,15 @@ package eu.esdihumboldt.hale.common.instance.helper; +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.collect.Collections2; +import eu.esdihumboldt.hale.common.instance.model.DataSet; +import eu.esdihumboldt.hale.common.instance.model.Group; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstance; +import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -25,20 +34,8 @@ import java.util.Map; import java.util.Queue; import java.util.concurrent.ConcurrentHashMap; - import javax.xml.namespace.QName; -import com.google.common.base.Function; -import com.google.common.base.Joiner; -import com.google.common.collect.Collections2; - -import eu.esdihumboldt.hale.common.instance.model.DataSet; -import eu.esdihumboldt.hale.common.instance.model.Group; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstance; -import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * This class provides plubic static methods for resolving propertys from * instances. A cache provides that former accessed propertys are found faster @@ -62,12 +59,11 @@ public class PropertyResolver { private static final ThreadLocal lastQDI = new ThreadLocal(); /** - * Method for retrieving values from instances using a certain path query - * for searching through the instance definitions. Calls methods for - * traversing the definition tree.
    + * Method for retrieving values from instances using a certain path query for + * searching through the instance definitions. Calls methods for traversing the + * definition tree.
    *
    - * If at the end of the path there is an instance, its value will be - * returned. + * If at the end of the path there is an instance, its value will be returned. * * @param instance the instance * @param propertyPath the property path @@ -78,16 +74,16 @@ public static Collection getValues(Instance instance, String propertyPat } /** - * Method for retrieving values from instances using a certain path query - * for searching through the instance definitions. Calls methods for - * traversing the definition tree. + * Method for retrieving values from instances using a certain path query for + * searching through the instance definitions. Calls methods for traversing the + * definition tree. * * @param instance the instance * @param propertyPath the property path - * @param forceValue if this is true, when the object at the - * end of a path is an instance, its value will be returned - * @return the values or instances contained in the instance matching the - * given path, may be null + * @param forceValue if this is true, when the object at the end of + * a path is an instance, its value will be returned + * @return the values or instances contained in the instance matching the given + * path, may be null */ public static Collection getValues(Instance instance, String propertyPath, boolean forceValue) { @@ -237,8 +233,8 @@ public String apply(QName input) { /** * Method for spliting up the path in the given query. The Method splits the - * String when a dot occurs. Are there an URL-parts inside the path, all - * dots inside thos parts are ignored ( checks of "{}" ) + * String when a dot occurs. Are there an URL-parts inside the path, all dots + * inside thos parts are ignored ( checks of "{}" ) * * @param propertyPath The definitionpath part of the query * @return An arraylist of split up parts of the path @@ -320,8 +316,8 @@ private static boolean analyzeDefinition(Instance instance, QueryDefinitionIndex /* * if (qnames.size() == 1) { * - * analyzeSimpleQueryChildDefinition(instance - * .getDefinition().getChildren(), qnames, qdi); + * analyzeSimpleQueryChildDefinition(instance .getDefinition().getChildren(), + * qnames, qdi); * * return !definitioncache.get(qdi).isEmpty(); } * @@ -335,14 +331,13 @@ private static boolean analyzeDefinition(Instance instance, QueryDefinitionIndex } /** - * Determines of the given Instance contains certain definitions questioned - * by a given stringquery. If the cache allready contains this special path - * of the instance-definition-tree, true will be returned, else the method - * calls the analysismethods for searching of the definition-tree + * Determines of the given Instance contains certain definitions questioned by a + * given stringquery. If the cache allready contains this special path of the + * instance-definition-tree, true will be returned, else the method calls the + * analysismethods for searching of the definition-tree * * @param instance the given instance we are searching in - * @param query the given pathquery we are searching inside the - * definition-tree + * @param query the given pathquery we are searching inside the definition-tree * @return true if the path was found, else false */ public static boolean hasProperty(Instance instance, String query) { @@ -364,8 +359,7 @@ public static boolean hasProperty(Instance instance, String query) { * @param typeDef the type definition * @param dataSet the data set * @param query the query - * @return a list of all possible paths matching the query (which may be - * empty) + * @return a list of all possible paths matching the query (which may be empty) */ public static List> getQueryPaths(TypeDefinition typeDef, DataSet dataSet, String query) { @@ -382,11 +376,11 @@ public static List> getQueryPaths(TypeDefinition typeDef, DataSet da * instance-definition-tree (for example "*" queries) the method writes the * found paths into the cache * - * @param children a list of ChildDefinitions from the root definition of - * the instance-definition-tree + * @param children a list of ChildDefinitions from the root definition of the + * instance-definition-tree * @param path the list of QNames split up from the original querypath - * @param qdi the cacheindex produced from the instance root definition and - * the querypath + * @param qdi the cacheindex produced from the instance root definition and the + * querypath */ @SuppressWarnings("unused") private static void analyzeSimpleQueryChildDefinition( @@ -475,10 +469,10 @@ && isProperty(currentItem.getDefinition())) { /** * this method searches for the indices given from the querypath inside the - * instance-definition-tree but only for one iteration. this is used to - * avoid recursion and is used by the analyzeSpecialQueryChild method. the - * indices must be children in order to their appearance in the path. only - * groups may be between them. + * instance-definition-tree but only for one iteration. this is used to avoid + * recursion and is used by the analyzeSpecialQueryChild method. the indices + * must be children in order to their appearance in the path. only groups may be + * between them. * * @param current the current searched index as a QName * @param qudi a queue item of the current found index and its definition @@ -568,14 +562,14 @@ && isProperty(currentItem.getDefinition())) { /** * this method searches for the indices given from the querypath inside the * instance-definition-tree the indices must be children in order to their - * appearance in the path. only groups may be between them. the method - * writes the found paths into the cache + * appearance in the path. only groups may be between them. the method writes + * the found paths into the cache * * @param children a list of Childdefinitions from the rootdefinition of the * instance-definition-tree * @param path the list of QNames split up from the original querypath - * @param qdi the cacheindex produced from the instance root definition and - * the querypath + * @param qdi the cacheindex produced from the instance root definition and the + * querypath */ private static void analyzeSpecialQueryChildDefinition( Collection> children, List path, @@ -684,11 +678,11 @@ else if (!def.asProperty().getPropertyType().getChildren().isEmpty()) { } /** - * Method for easy comparing of two QName objects. The first QName can miss - * the URI part. Then only the local parts getting compared. + * Method for easy comparing of two QName objects. The first QName can miss the + * URI part. Then only the local parts getting compared. * - * @param qname1 the QName (usually from the filterquery), which can miss an - * URI part + * @param qname1 the QName (usually from the filterquery), which can miss an URI + * part * @param qname2 the second QName * @return true, if both are equal or if the first QName doesn't have an URI * part and both localparts are equal. Else false... @@ -715,15 +709,15 @@ else if (qname1.equals(qname2)) { } /** - * Returns possible fully qualified (with namespace) paths for the given - * String which could not contain all namespaces.
    + * Returns possible fully qualified (with namespace) paths for the given String + * which could not contain all namespaces.
    * The path can be splitted using {@link #getQNamesFromPath(String)} * * @param instance the given instance which should contain the definitions * mentioned in the paths * @param query the pathstring from the filterquery - * @return a list of Strings with possible paths inside the definitions of - * the instance + * @return a list of Strings with possible paths inside the definitions of the + * instance */ public static LinkedList getQueryPath(Instance instance, String query) { QueryDefinitionIndex qdi = new QueryDefinitionIndex(instance.getDefinition(), @@ -739,15 +733,14 @@ public static LinkedList getQueryPath(Instance instance, String query) { } /** - * Determines if the last query path was unique. This will only yield a - * reliable result if the last call to - * {@link #hasProperty(Instance, String)} was done from the current thread. - * The information on the last {@link #hasProperty(Instance, String)} call - * will be reset on calling this method. + * Determines if the last query path was unique. This will only yield a reliable + * result if the last call to {@link #hasProperty(Instance, String)} was done + * from the current thread. The information on the last + * {@link #hasProperty(Instance, String)} call will be reset on calling this + * method. * - * @return true if the last query path was unique or if there - * is no information on the last query path, false - * otherwise + * @return true if the last query path was unique or if there is no + * information on the last query path, false otherwise */ public static boolean isLastQueryPathUnique() { QueryDefinitionIndex qdi = lastQDI.get(); @@ -764,8 +757,8 @@ public static boolean isLastQueryPathUnique() { } /** - * Clear the definition cache, e.g. when the type definitions may no longer - * be valid. + * Clear the definition cache, e.g. when the type definitions may no longer be + * valid. * * FIXME cache in service instead? */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/QueueDefinitionItem.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/QueueDefinitionItem.java index 5f65a99fda..7cd1372268 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/QueueDefinitionItem.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/helper/QueueDefinitionItem.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.instance.helper; +import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import java.util.ArrayList; import java.util.List; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; - /** * Objects of these Class are used by the {@link PropertyResolver} in a Queue * for traversing the instance-definition-tree. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/GeoInstanceWriter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/GeoInstanceWriter.java index 6caa2fcb7f..b21c77a149 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/GeoInstanceWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/GeoInstanceWriter.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.hale.common.instance.io; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.instance.io.util.EnumWindingOrderTypes; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; +import javax.annotation.Nullable; /** * Provides support for writing instances @@ -31,8 +30,8 @@ public interface GeoInstanceWriter extends InstanceWriter { /** - * Name of the parameter specifying a target CRS. Support of this parameter - * is optional. + * Name of the parameter specifying a target CRS. Support of this parameter is + * optional. */ public static final String PARAM_TARGET_CRS = "crs"; @@ -48,16 +47,16 @@ public interface GeoInstanceWriter extends InstanceWriter { public static final String PARAM_UNIFY_WINDING_ORDER = "geometry.unifyWindingOrder"; /** - * Set the target CRS for written instances. Note that supporting the target - * CRS conversion is optional for implementations. + * Set the target CRS for written instances. Note that supporting the target CRS + * conversion is optional for implementations. * * @param crs the CRS definition */ public void setTargetCRS(@Nullable CRSDefinition crs); /** - * Get the target CRS to convert instance geometries to. Note that - * supporting the target CRS conversion is optional for implementations. + * Get the target CRS to convert instance geometries to. Note that supporting + * the target CRS conversion is optional for implementations. * * @return the target CRS definition or null */ @@ -67,8 +66,8 @@ public interface GeoInstanceWriter extends InstanceWriter { /** * Set a custom prefix to be used to encode target EPSG CRS codes. * - * @param epsgPrefix the custom EPSG code prefix or null to - * leave the CRS code untouched + * @param epsgPrefix the custom EPSG code prefix or null to leave + * the CRS code untouched */ public void setCustomEPSGPrefix(@Nullable String epsgPrefix); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceIO.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceIO.java index 3e51925887..7c218af4ee 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceIO.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.instance.io; -import org.eclipse.core.runtime.content.IContentType; - import eu.esdihumboldt.hale.common.core.io.HaleIO; +import org.eclipse.core.runtime.content.IContentType; /** * Instance I/O utilities @@ -52,10 +51,10 @@ public abstract class InstanceIO { * * @param contentType the content type the provider must match, may be * null if providerId is set - * @param providerId the id of the provider to use, may be null - * if contentType is set - * @return the I/O provider preconfigured with the content type if it was - * given or null if no matching I/O provider is found + * @param providerId the id of the provider to use, may be null if + * contentType is set + * @return the I/O provider preconfigured with the content type if it was given + * or null if no matching I/O provider is found */ public static InstanceWriter createInstanceWriter(IContentType contentType, String providerId) { return HaleIO.createIOProvider(InstanceWriter.class, contentType, providerId); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceReader.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceReader.java index 65062d082b..4b1f108cd2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceReader.java @@ -42,9 +42,9 @@ public interface InstanceReader extends ImportProvider { public void setSourceSchema(TypeIndex sourceSchema); /** - * Set a CRS provider that is queried if no CRS can be determined for a - * property value and no default CRS is configured for the associated - * property definition. + * Set a CRS provider that is queried if no CRS can be determined for a property + * value and no default CRS is configured for the associated property + * definition. * * @param crsProvider the CRS provider */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceWriter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceWriter.java index 53e4c18c00..43ff21b8f8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/InstanceWriter.java @@ -16,14 +16,13 @@ package eu.esdihumboldt.hale.common.instance.io; -import java.util.List; - import eu.esdihumboldt.hale.common.core.io.ExportProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; +import java.util.List; /** * Provides support for writing instances @@ -65,9 +64,9 @@ public interface InstanceWriter extends ExportProvider { public List getValidationSchemas(); /** - * Validate the basic {@link InstanceWriter} configuration, to determine if - * the target schema (and instances if set) are compatible to the writer. - * Other parameters should be ignored for the check. + * Validate the basic {@link InstanceWriter} configuration, to determine if the + * target schema (and instances if set) are compatible to the writer. Other + * parameters should be ignored for the check. * * @throws IOProviderConfigurationException if the I/O provider was not * configured properly @@ -75,11 +74,10 @@ public interface InstanceWriter extends ExportProvider { public void checkCompatibility() throws IOProviderConfigurationException; /** - * States if the instance writer directly streams the supplied instances in - * one go, i.e. it only acquires the iterator once and consumes it. + * States if the instance writer directly streams the supplied instances in one + * go, i.e. it only acquires the iterator once and consumes it. * - * @return the instance writer directly streams the supplied instances in - * one go + * @return the instance writer directly streams the supplied instances in one go */ public boolean isPassthrough(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/impl/AbstractGeoInstanceWriter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/impl/AbstractGeoInstanceWriter.java index c5cd0ac8a0..45953017eb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/impl/AbstractGeoInstanceWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/impl/AbstractGeoInstanceWriter.java @@ -16,15 +16,6 @@ package eu.esdihumboldt.hale.common.instance.io.impl; -import java.util.Collection; - -import org.geotools.geometry.jts.JTS; -import org.geotools.referencing.CRS; -import org.opengis.referencing.crs.CoordinateReferenceSystem; -import org.opengis.referencing.operation.MathTransform; - -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; @@ -37,6 +28,12 @@ import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import eu.esdihumboldt.util.Pair; import eu.esdihumboldt.util.geometry.WindingOrder; +import java.util.Collection; +import org.geotools.geometry.jts.JTS; +import org.geotools.referencing.CRS; +import org.locationtech.jts.geom.Geometry; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.operation.MathTransform; /** * Abstract {@link GeoInstanceWriter} base implementation @@ -84,8 +81,8 @@ public EnumWindingOrderTypes getWindingOrder() { } /** - * Get default Winding Order. Function is to give functionality to the - * subType to change the default Winding order. + * Get default Winding Order. Function is to give functionality to the subType + * to change the default Winding order. * * @return EnumWindingOrderTypes default Winding order */ @@ -94,15 +91,14 @@ protected EnumWindingOrderTypes getDefaultWindingOrder() { } /** - * Convert the given geometry to the target CRS, if possible (and a target - * CRS is set). + * Convert the given geometry to the target CRS, if possible (and a target CRS + * is set). * * @param geom the geometry to convert * @param sourceCrs the source CRS * @param report the reporter - * @return a pair of geometry and CRS definition, either the converted - * geometry and the target CRS or the given geometry and the source - * CRS + * @return a pair of geometry and CRS definition, either the converted geometry + * and the target CRS or the given geometry and the source CRS */ protected Pair convertGeometry(Geometry geom, CRSDefinition sourceCrs, IOReporter report) { @@ -141,13 +137,13 @@ protected Pair convertGeometry(Geometry geom, CRSDefini } /** - * Returns a pair of geometry and associated CRS definition for the given - * value. The value has to be a Geometry or a GeometryProperty, otherwise + * Returns a pair of geometry and associated CRS definition for the given value. + * The value has to be a Geometry or a GeometryProperty, otherwise * null is returned. * * @param value the value to extract the information from - * @param allowConvert if conversion to the target CRS should be performed - * if applicable + * @param allowConvert if conversion to the target CRS should be performed if + * applicable * @param report the reporter * @return a pair of geometry and CRS definition (latter may be * null), or null if the argument doesn't @@ -164,13 +160,13 @@ protected Pair extractGeometry(Object value, boolean al } /** - * Returns a pair of geometry and associated CRS definition for the given - * value. The value has to be a Geometry or a GeometryProperty, otherwise + * Returns a pair of geometry and associated CRS definition for the given value. + * The value has to be a Geometry or a GeometryProperty, otherwise * null is returned. * * @param value the value to extract the information from - * @param allowConvert if conversion to the target CRS should be performed - * if applicable + * @param allowConvert if conversion to the target CRS should be performed if + * applicable * @param report the reporter * @return a pair of geometry and CRS definition (latter may be * null), or null if the argument doesn't @@ -205,8 +201,8 @@ else if (value instanceof GeometryProperty) { * Returns a pair of unified geometry of given geometry and associated CRS * definition based on Winding order supplied. * - * @param pair A pair of Geometry and CRSDefinition, on which winding - * process will get done. + * @param pair A pair of Geometry and CRSDefinition, on which winding process + * will get done. * @param report the reporter * @return Unified Pair . */ @@ -232,8 +228,7 @@ protected Pair unifyGeometryPair(Pair - extends InstanceWriterDecoratorimplements GeoInstanceWriter { + extends InstanceWriterDecorator implements GeoInstanceWriter { /** * @see ExportProviderDecorator#ExportProviderDecorator(eu.esdihumboldt.hale.common.core.io.ExportProvider) diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/util/InstanceReaderDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/util/InstanceReaderDecorator.java index 870ab30df2..ae851f6f83 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/util/InstanceReaderDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/util/InstanceReaderDecorator.java @@ -27,8 +27,8 @@ * @param the provider type * @author Stefano Costa, GeoSolutions */ -public abstract class InstanceReaderDecorator extends - ImportProviderDecorator implements InstanceReader { +public abstract class InstanceReaderDecorator + extends ImportProviderDecorator implements InstanceReader { /** * @see ImportProviderDecorator#ImportProviderDecorator(eu.esdihumboldt.hale.common.core.io.ImportProvider) diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/util/InstanceWriterDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/util/InstanceWriterDecorator.java index 480f01e286..cc1880ea72 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/util/InstanceWriterDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/io/util/InstanceWriterDecorator.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.common.instance.io.util; -import java.util.List; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; import eu.esdihumboldt.hale.common.core.io.util.ExportProviderDecorator; import eu.esdihumboldt.hale.common.instance.io.InstanceWriter; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; +import java.util.List; /** * Decorator for {@link InstanceWriter}s. @@ -31,7 +30,7 @@ * @author Simon Templer */ public abstract class InstanceWriterDecorator - extends ExportProviderDecoratorimplements InstanceWriter { + extends ExportProviderDecorator implements InstanceWriter { /** * @see ExportProviderDecorator#ExportProviderDecorator(eu.esdihumboldt.hale.common.core.io.ExportProvider) diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ContextAwareFilter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ContextAwareFilter.java index b9ce65e62c..92e1620ec6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ContextAwareFilter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ContextAwareFilter.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.instance.model; import java.util.Map; - import javax.annotation.Nullable; /** @@ -29,8 +28,8 @@ public interface ContextAwareFilter extends Filter { /** * Determines if an instance matches the filter given an iteration context. * - * This method should be called when an iteration context is present, - * instead of the original {@link #match(Instance)} method. + * This method should be called when an iteration context is present, instead of + * the original {@link #match(Instance)} method. * * @param instance the instance to check the filter against * @param context the iteration context diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/DataSet.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/DataSet.java index 3a8cade660..5838d398fb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/DataSet.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/DataSet.java @@ -23,6 +23,7 @@ * application. */ public enum DataSet { + /** The source data set */ SOURCE, /** The transformed data set */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Filter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Filter.java index 7da61bc930..d33938fb91 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Filter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Filter.java @@ -35,9 +35,9 @@ public interface Filter { public boolean match(Instance instance); /* - * XXX it might be a good option to include the information about valid - * instance types in the filter interface, as this would allow an easier - * optimization for filtering instance collections based on types! + * XXX it might be a good option to include the information about valid instance + * types in the filter interface, as this would allow an easier optimization for + * filtering instance collections based on types! */ // public Set getAllowedTypes(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Group.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Group.java index 21a096ab59..6dd59ffef2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Group.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Group.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.instance.model; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; +import javax.xml.namespace.QName; /** * Represents a group of properties @@ -37,9 +36,8 @@ public interface Group { public Object[] getProperty(QName propertyName); /** - * Get the property names for which any values exist. Especially helpful - * when there is (for whatever reason) no type definition associated to the - * instance. + * Get the property names for which any values exist. Especially helpful when + * there is (for whatever reason) no type definition associated to the instance. * * @return the list of property names with associated values */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Identifiable.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Identifiable.java index 4f28fa4504..bcef846212 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Identifiable.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Identifiable.java @@ -39,8 +39,8 @@ default boolean hasId() { * Test if an object is identifiable * * @param o Test subject - * @return true if o implements {@link Identifiable} and - * actually has an ID + * @return true if o implements {@link Identifiable} and actually + * has an ID */ static boolean is(Object o) { return (o instanceof Identifiable && ((Identifiable) o).hasId()); @@ -50,8 +50,8 @@ static boolean is(Object o) { * Return the ID of the given object * * @param o Object to retrieve ID from - * @return The object's ID or null if o is either - * not {@link Identifiable} or doesn't have an ID + * @return The object's ID or null if o is either not + * {@link Identifiable} or doesn't have an ID */ static Object getId(Object o) { if (is(o)) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Instance.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Instance.java index 9c86380bbb..74f47502a0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Instance.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/Instance.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.instance.model; -import java.util.List; -import java.util.Set; - import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.AugmentedValueFlag; import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import java.util.List; +import java.util.Set; /** * Represents an instance of a type @@ -43,14 +42,13 @@ public interface Instance extends Group { /** * Get the instance value.
    *
    - * The value is only present for certain types where the - * {@link HasValueFlag} or {@link AugmentedValueFlag} constraint is enabled. - * The {@link Binding} constraint on the type definition defines the binding - * of the value.
    + * The value is only present for certain types where the {@link HasValueFlag} or + * {@link AugmentedValueFlag} constraint is enabled. The {@link Binding} + * constraint on the type definition defines the binding of the value.
    *
    - * NOTE: This is needed for instance for XML elements with text - * content and attributes. It may only be a simple value (i.e. no - * {@link Group} or {@link Instance}). + * NOTE: This is needed for instance for XML elements with text content + * and attributes. It may only be a simple value (i.e. no {@link Group} or + * {@link Instance}). * * @return the instance value if it is defined, otherwise null */ @@ -67,8 +65,8 @@ public interface Instance extends Group { * Get the metadata the instance my be associated with * * @param key the key to access a certain metadata - * @return A list of objects from the metadata, may be an empty List if the - * key can not be found or there is not metadata associated with the + * @return A list of objects from the metadata, may be an empty List if the key + * can not be found or there is not metadata associated with the * Instance */ public List getMetaData(String key); @@ -76,8 +74,8 @@ public interface Instance extends Group { /** * Get all keys the metadata is associated with * - * @return an Set of String keys, or an empty Set if the data doesn't exist - * or the container is empty, the Set may not be changed + * @return an Set of String keys, or an empty Set if the data doesn't exist or + * the container is empty, the Set may not be changed */ public Set getMetaDataNames(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceCollection.java index 9d8b502d3d..64114ab033 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceCollection.java @@ -28,9 +28,8 @@ public interface InstanceCollection extends InstanceResolver { /** - * Get an iterator over all instances contained in the collection. The - * iterator must be disposed after use (using - * {@link ResourceIterator#close()}). + * Get an iterator over all instances contained in the collection. The iterator + * must be disposed after use (using {@link ResourceIterator#close()}). * * @return an iterator over the instances */ @@ -79,8 +78,7 @@ public interface InstanceCollection extends InstanceResolver { /** * Helper for converting to list of instances. * - * Use with care only in cases where it is clear that the data is not too - * big. + * Use with care only in cases where it is clear that the data is not too big. * * @return a list containing all instances */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceMetadata.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceMetadata.java index 86d7e5343f..34d4003374 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceMetadata.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceMetadata.java @@ -58,8 +58,8 @@ public static void setSourceID(MutableInstance instance, Object... id) { * gets the SourceID of an instance from its metadata * * @param instance the instance to get the SourceID from - * @return he first SourceID of the instance, my be null - * if the instance doesn't contain an id in its meta data + * @return he first SourceID of the instance, my be null if the + * instance doesn't contain an id in its meta data */ public static String getSourceID(Instance instance) { List data = instance.getMetaData(METADATA_SOURCEID); @@ -77,8 +77,8 @@ public static String getSourceID(Instance instance) { * gets the ID of an instance from its metadata * * @param instance the instance with the certain id - * @return the first id of the instance, my be null - * if the instance doesn't contain an id in its meta data + * @return the first id of the instance, my be null if the + * instance doesn't contain an id in its meta data */ public static String getID(Instance instance) { List data = instance.getMetaData(METADATA_ID); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceResolver.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceResolver.java index 897922ad91..ef498835f8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceResolver.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.instance.model; -import java.util.Collection; - import eu.esdihumboldt.hale.common.instance.model.impl.ReferenceInstanceCollection; +import java.util.Collection; /** * Interface for instance resolvers, that allow getting a reference for an @@ -41,16 +40,16 @@ public interface InstanceResolver { * Get the instance referenced by the given reference. * * @param reference the instance reference - * @return the referenced instance or null if it does not exist - * or the reference is invalid + * @return the referenced instance or null if it does not exist or + * the reference is invalid */ public Instance getInstance(InstanceReference reference); /** * Get an instance collection based on the given instance references. * - * This method allows implementors to optimize retrieval of multiple - * references, and to do a lazy resolving. + * This method allows implementors to optimize retrieval of multiple references, + * and to do a lazy resolving. * * The default implementation delegates to * {@link #getInstance(InstanceReference)} in the iterator. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceUtil.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceUtil.java index 5327b53093..2ec66679e1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/InstanceUtil.java @@ -16,16 +16,6 @@ package eu.esdihumboldt.hale.common.instance.model; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import javax.xml.namespace.QName; - import com.google.common.base.Objects; import com.google.common.collect.Iterables; import com.google.common.primitives.Booleans; @@ -36,8 +26,15 @@ import com.google.common.primitives.Ints; import com.google.common.primitives.Longs; import com.google.common.primitives.Shorts; - import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import javax.xml.namespace.QName; /** * Instance utility functions. @@ -51,13 +48,13 @@ private InstanceUtil() { } /** - * Checks whether the two given instances equal each other disregarding - * their data set. + * Checks whether the two given instances equal each other disregarding their + * data set. * * @param a the first instance * @param b the second instance - * @param propertyOrderRelevant whether the order of properties of the same - * name is relevant or not + * @param propertyOrderRelevant whether the order of properties of the same name + * is relevant or not * @return true, iff both instances are equal to each other except for their * data set */ @@ -99,8 +96,8 @@ private static boolean equals(Object o1, Object o2) { else if (g1.getGeometry() != null && g2.getGeometry() != null) { boolean crsEquals; if (g1.getCRSDefinition() != null && g2.getCRSDefinition() != null) { - crsEquals = Objects.equal(g1.getCRSDefinition().getCRS(), g2 - .getCRSDefinition().getCRS()); + crsEquals = Objects.equal(g1.getCRSDefinition().getCRS(), + g2.getCRSDefinition().getCRS()); } else { crsEquals = Objects.equal(g1.getCRSDefinition(), g2.getCRSDefinition()); @@ -157,8 +154,7 @@ private static List arrayToList(Object array) { * * @param instance the instance to test * @param candidates the candidates to compare the instance against - * @return the error message if the check failed, otherwise - * null + * @return the error message if the check failed, otherwise null */ public static String checkInstance(Instance instance, Collection candidates) { boolean found = false; @@ -188,8 +184,8 @@ public static String checkInstance(Instance instance, Collection candi * * @param a the first group * @param b the second group - * @param propertyOrderRelevant whether the order of properties of the same - * name is relevant or not + * @param propertyOrderRelevant whether the order of properties of the same name + * is relevant or not * @return true, if both groups are equal to each */ public static boolean groupEqual(Group a, Group b, boolean propertyOrderRelevant) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/MetaFilter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/MetaFilter.java index 40f41a0ad4..d1e08eb028 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/MetaFilter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/MetaFilter.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.hale.common.instance.model; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; - import javax.annotation.Nonnull; import javax.annotation.Nullable; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Filter that accepts instances based on their instance metadata entries. * @@ -34,9 +32,9 @@ public class MetaFilter implements Filter { /* - * FIXME the type should not be part of this filter - this is done for now - * to be able to easily add support to the OrientDB instance collection and - * to the data view instance selector. + * FIXME the type should not be part of this filter - this is done for now to be + * able to easily add support to the OrientDB instance collection and to the + * data view instance selector. */ private final TypeDefinition type; @@ -49,8 +47,7 @@ public class MetaFilter implements Filter { * * @param type the type of instances to accept, may be null * @param metadataKey the name of the metadata key to check - * @param values the values that should be accepted for the given metadata - * key + * @param values the values that should be accepted for the given metadata key */ public MetaFilter(@Nullable TypeDefinition type, @Nonnull String metadataKey, @Nonnull Collection values) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/MutableInstance.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/MutableInstance.java index c771ad0f15..dfde00cb83 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/MutableInstance.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/MutableInstance.java @@ -42,8 +42,8 @@ public interface MutableInstance extends Instance, MutableGroup { // XXX more manipulation needed? e.g. for transformation? /** - * add Data to the MetaData, which the Instance can be associated with If - * there is no MetaData in the Instance, a new container will be created + * add Data to the MetaData, which the Instance can be associated with If there + * is no MetaData in the Instance, a new container will be created * * @param key a key the data to add will be associated with * @param obj the Data to add, may not be {@link Instance} or {@link Group} @@ -51,8 +51,8 @@ public interface MutableInstance extends Instance, MutableGroup { public void putMetaData(String key, Object obj); /** - * Sets the metadata of a certain key, may also delet or reset the value of - * the key if the values parameter is null or empty + * Sets the metadata of a certain key, may also delet or reset the value of the + * key if the values parameter is null or empty * * @param key the key the data is associated with * @param values the values to set, may not contain {@link Instance} or diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ResolvableInstanceReference.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ResolvableInstanceReference.java index 67e65afc9e..099702f9ed 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ResolvableInstanceReference.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ResolvableInstanceReference.java @@ -44,8 +44,8 @@ public ResolvableInstanceReference(InstanceReference reference, InstanceResolver /** * Resolve this instance reference * - * @return the reoslved instance or null if the instance reference could not - * be resolved + * @return the reoslved instance or null if the instance reference could not be + * resolved */ public Instance resolve() { if (resolver != null) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ResourceIterator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ResourceIterator.java index 90d64c9cbb..a2e001c63a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ResourceIterator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ResourceIterator.java @@ -30,8 +30,8 @@ public interface ResourceIterator extends Iterator, Closeable { /** - * Dispose the iterator. After calling this method {@link #next()} may not - * be called. + * Dispose the iterator. After calling this method {@link #next()} may not be + * called. */ @Override public void close(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/InstanceCollection2.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/InstanceCollection2.java index 75d25bdc46..ccfb6db62f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/InstanceCollection2.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/InstanceCollection2.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.instance.model.ext; -import java.util.Map; - import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Map; /** * Extended instance collection adding fan-out capabilities. @@ -35,11 +34,10 @@ public interface InstanceCollection2 extends InstanceCollection { public boolean supportsFanout(); /** - * Fan-out the instance collection per occurring type. Should only be called - * if {@link #supportsFanout()} yields true. + * Fan-out the instance collection per occurring type. Should only be called if + * {@link #supportsFanout()} yields true. * - * @return the fanned out instance collections per type, or - * null + * @return the fanned out instance collections per type, or null */ public Map fanout(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/InstanceIterator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/InstanceIterator.java index d3aa9e8157..a069725471 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/InstanceIterator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/InstanceIterator.java @@ -33,14 +33,14 @@ public interface InstanceIterator extends ResourceIterator { * Peek at the type of the next instance. May only be called if * {@link #supportsTypePeek()} yields true. * - * @return the type definition of the next instance, may be - * null if there is no next instance + * @return the type definition of the next instance, may be null if + * there is no next instance */ public TypeDefinition typePeek(); /** - * States if the iterator suports peeking at the type of the next instances - * with {@link #typePeek()}. + * States if the iterator suports peeking at the type of the next instances with + * {@link #typePeek()}. * * @return if calls to {@link #typePeek()} are allowed */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/helper/EmptyInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/helper/EmptyInstanceCollection.java index c6301b15f0..3816950ae7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/helper/EmptyInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/helper/EmptyInstanceCollection.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.instance.model.ext.helper; -import java.util.Map; - import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; @@ -25,6 +23,7 @@ import eu.esdihumboldt.hale.common.instance.model.ext.InstanceCollection2; import eu.esdihumboldt.hale.common.instance.model.ext.InstanceIterator; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Map; /** * Empty instance collection. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/helper/InstanceCollectionDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/helper/InstanceCollectionDecorator.java index 56009c26cd..a9cdc957fd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/helper/InstanceCollectionDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/helper/InstanceCollectionDecorator.java @@ -16,8 +16,6 @@ package eu.esdihumboldt.hale.common.instance.model.ext.helper; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.report.LogAware; import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.instance.model.Filter; @@ -27,6 +25,7 @@ import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.instance.model.ext.InstanceCollection2; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Map; /** * Decorator for an instance collection. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/impl/PerTypeInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/impl/PerTypeInstanceCollection.java index d9e4abd480..c60386727d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/impl/PerTypeInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/ext/impl/PerTypeInstanceCollection.java @@ -15,15 +15,7 @@ package eu.esdihumboldt.hale.common.instance.model.ext.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.stream.Collectors; - import com.google.common.collect.ImmutableMap; - import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.TypeFilter; @@ -32,6 +24,12 @@ import eu.esdihumboldt.hale.common.instance.model.impl.MultiInstanceCollection; import eu.esdihumboldt.hale.common.instance.model.impl.SingleTypeInstanceCollection; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.stream.Collectors; /** * Multi instance collection that consists of one instance collection per type. @@ -44,11 +42,10 @@ public class PerTypeInstanceCollection extends MultiInstanceCollection private final Map collections; /** - * Create an instance collection consisting of the given instance - * collections. + * Create an instance collection consisting of the given instance collections. * - * @param collections the instance collections mapped to the type associated - * to the instances they contain + * @param collections the instance collections mapped to the type associated to + * the instances they contain */ public PerTypeInstanceCollection(Map collections) { super(new ArrayList<>(collections.values())); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultGroup.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultGroup.java index 458a9e7175..fbf49b3cda 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultGroup.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultGroup.java @@ -16,19 +16,16 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.Arrays; - -import javax.xml.namespace.QName; - import com.google.common.base.Function; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Collections2; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.MutableGroup; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; +import java.util.Arrays; +import javax.xml.namespace.QName; /** * Group implementation backed by a {@link ListMultimap}. @@ -52,8 +49,8 @@ public DefaultGroup(DefinitionGroup definition) { } /** - * Copy constructor. Creates a group based on the properties and values of - * the given group. + * Copy constructor. Creates a group based on the properties and values of the + * given group. * * @param org the instance to copy */ @@ -112,8 +109,8 @@ private void setPropertyCopy(QName propertyName, Object... values) { @Override public Object apply(Object input) { /* - * If the input is a Group/Instance. This is to prevent - * OInstances/OGroups to live on in a copy. + * If the input is a Group/Instance. This is to prevent OInstances/OGroups + * to live on in a copy. */ if (input instanceof Instance) { return new DefaultInstance((Instance) input); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultInstance.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultInstance.java index 9c328e8f5a..925459b8a6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultInstance.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultInstance.java @@ -16,18 +16,16 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Set; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.instance.model.DataSet; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.MutableInstance; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; /** * Default instance implementation backed by a {@link ListMultimap}. @@ -54,8 +52,8 @@ public DefaultInstance(TypeDefinition definition, DataSet dataSet) { } /** - * Copy constructor. Creates an instance based on the properties and values - * of the given instance. + * Copy constructor. Creates an instance based on the properties and values of + * the given instance. * * @param org the instance to copy */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultInstanceCollection.java index cbf0cb9c0a..f9b23ed44b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/DefaultInstanceCollection.java @@ -16,17 +16,16 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; - import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.InstanceResolver; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; /** * Default instance collection implementation backed by a collection. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/FilterResourceIteratorAdapter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/FilterResourceIteratorAdapter.java index 25c3ae1ff2..5db2a92970 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/FilterResourceIteratorAdapter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/FilterResourceIteratorAdapter.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.instance.model.impl; +import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import java.util.Iterator; import java.util.NoSuchElementException; -import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; - /** * {@link ResourceIterator} adapter for a normal iterator that can perform a * conversion from the iterator elements to a target element type. It filters @@ -79,8 +78,8 @@ public T next() { } /** - * Move {@link #preview} to the next non-null converted item if possible, - * update {@link #previewPresent}. + * Move {@link #preview} to the next non-null converted item if possible, update + * {@link #previewPresent}. */ private void update() { if (updatePreview) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/FilteredInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/FilteredInstanceCollection.java index d4a94c8df2..3f9ee4acee 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/FilteredInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/FilteredInstanceCollection.java @@ -16,14 +16,8 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.NoSuchElementException; - import com.google.common.base.Function; import com.google.common.collect.Maps; - import eu.esdihumboldt.hale.common.instance.model.ContextAwareFilter; import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; @@ -35,6 +29,10 @@ import eu.esdihumboldt.hale.common.instance.model.ext.helper.EmptyInstanceCollection; import eu.esdihumboldt.hale.common.instance.model.ext.helper.InstanceCollectionDecorator; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; /** * Instance collection that wraps an instance collection and represents a diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/GenericResourceIteratorAdapter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/GenericResourceIteratorAdapter.java index b056b8c78f..440a1ee1c6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/GenericResourceIteratorAdapter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/GenericResourceIteratorAdapter.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.Iterator; - import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import java.util.Iterator; /** * {@link ResourceIterator} adapter for a normal iterator that can perform a diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/GroupDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/GroupDecorator.java index b3ad9ed6ec..962f8f342c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/GroupDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/GroupDecorator.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; +import javax.xml.namespace.QName; /** * Group decorator class. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/InstanceDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/InstanceDecorator.java index f1b5f064a9..4c64fb70d8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/InstanceDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/InstanceDecorator.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.instance.model.DataSet; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; /** * Instance decorator class. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/InstanceReferenceDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/InstanceReferenceDecorator.java index 554dc8d881..fd8cd6ccc8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/InstanceReferenceDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/InstanceReferenceDecorator.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.Objects; - import eu.esdihumboldt.hale.common.instance.model.DataSet; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; +import java.util.Objects; /** * InstanceReference decorator class. @@ -56,10 +55,10 @@ public DataSet getDataSet() { } /** - * Determines if a given object is an InstanceReferenceDecorator and itself - * or its original reference is decorated with the given type. If the - * original reference is an InstanceReferenceDecorator itself, the method - * will that object's original reference recursively. + * Determines if a given object is an InstanceReferenceDecorator and itself or + * its original reference is decorated with the given type. If the original + * reference is an InstanceReferenceDecorator itself, the method will that + * object's original reference recursively. * * @param decorator Object to check * @param decoratorType Decorator type to search diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/MultiInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/MultiInstanceCollection.java index a9b2ff904e..1b7b1a839a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/MultiInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/MultiInstanceCollection.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.NoSuchElementException; - import eu.esdihumboldt.hale.common.core.report.LogAware; import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.instance.model.DataSet; @@ -29,6 +24,10 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.NoSuchElementException; /** * An instance collection which consists of multiple instance collections. For @@ -112,8 +111,8 @@ public boolean isEmpty() { @Override public InstanceCollection select(Filter filter) { /* - * Delegate filter to each collection - there may some optimization take - * place, e.g. with type filters + * Delegate filter to each collection - there may some optimization take place, + * e.g. with type filters */ List result = new ArrayList<>(); for (InstanceCollection collection : collections) { @@ -138,9 +137,8 @@ protected MultiInstanceCollection createNew(List filtered) { } /** - * Internal resource iterator iterating over all given instance collections - * in order. Supports {@link #remove()} if the underlying iterator supports - * remove. + * Internal resource iterator iterating over all given instance collections in + * order. Supports {@link #remove()} if the underlying iterator supports remove. * * @author Kai Schwierczek */ @@ -217,8 +215,8 @@ public void close() { } /** - * Internal class for decorating the instances with the index of the - * instance collection list. + * Internal class for decorating the instances with the index of the instance + * collection list. * * @author Kai Schwierczek */ @@ -239,8 +237,8 @@ public MultiInstanceCollectionInstance(Instance instance, int listIndex) { } /** - * Internal class for decorating the references with the index of the - * instance collection list. + * Internal class for decorating the references with the index of the instance + * collection list. * * @author Kai Schwierczek */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/ReferenceInstanceCollection.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/ReferenceInstanceCollection.java index c74c62ae33..3ae2a461a4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/ReferenceInstanceCollection.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/ReferenceInstanceCollection.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.Collection; -import java.util.Iterator; - import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.InstanceResolver; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import java.util.Collection; +import java.util.Iterator; /** * Instance collection based on references. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/ResourceIteratorAdapter.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/ResourceIteratorAdapter.java index 5b8408329f..ee30fe68a3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/ResourceIteratorAdapter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/ResourceIteratorAdapter.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.instance.model.impl; -import java.util.Iterator; - import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import java.util.Iterator; /** * {@link ResourceIterator} adapter for a normal iterator diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/TypeFilteredIterator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/TypeFilteredIterator.java index 3617057af1..0ad4d22b63 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/TypeFilteredIterator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/model/impl/TypeFilteredIterator.java @@ -32,8 +32,8 @@ public class TypeFilteredIterator extends FullInstanceIteratorSupport { /** * Create an iterator that only returns instances of a specific type. * - * @param it the iterator to wrap, if the iterator supports type peeking, - * the type filtered iterator will make use of it + * @param it the iterator to wrap, if the iterator supports type peeking, the + * type filtered iterator will make use of it * @param type the type that instances have to match */ public TypeFilteredIterator(ResourceIterator it, TypeDefinition type) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/AbstractInstanceProcessor.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/AbstractInstanceProcessor.java index 29c92a97a2..b676b07edd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/AbstractInstanceProcessor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/AbstractInstanceProcessor.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.instance.processing; -import java.io.IOException; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; +import java.io.IOException; +import java.util.Map; /** * Convenience base class for {@link InstanceProcessor} implementations diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/InstanceProcessingExtension.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/InstanceProcessingExtension.java index d47b40c826..9eac4374e5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/InstanceProcessingExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/InstanceProcessingExtension.java @@ -15,19 +15,17 @@ package eu.esdihumboldt.hale.common.instance.processing; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.instance.extension.filter.FilterDefinition; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link InstanceProcessor}s @@ -46,11 +44,11 @@ public class InstanceProcessingExtension * {@link IConfigurationElement}. */ private static class ConfigurationFactory extends - AbstractConfigurationFactoryimplements InstanceProcessorFactory { + AbstractConfigurationFactory implements InstanceProcessorFactory { /** - * Create a {@link FilterDefinition} factory based on the given - * configuration element. + * Create a {@link FilterDefinition} factory based on the given configuration + * element. * * @param conf the configuration element */ @@ -82,8 +80,8 @@ public String getDisplayName() { /** * Create the extension * - * @param serviceProvider Service provider that will be passed to the - * created {@link InstanceProcessor}s + * @param serviceProvider Service provider that will be passed to the created + * {@link InstanceProcessor}s */ public InstanceProcessingExtension(ServiceProvider serviceProvider) { super(ID); diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/InstanceProcessor.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/InstanceProcessor.java index cea0fed28c..13e7c7672b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/InstanceProcessor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/processing/InstanceProcessor.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.instance.processing; -import java.io.Closeable; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; +import java.io.Closeable; +import java.util.Map; /** * {@link Instance} processor diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/InstanceCollectionPartitioner.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/InstanceCollectionPartitioner.java index c267f96d6d..b8e3a9d6b8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/InstanceCollectionPartitioner.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/InstanceCollectionPartitioner.java @@ -50,8 +50,8 @@ default boolean requiresImmediateConsumption() { * Partition an instance collection. * * @param instances the instances to partition - * @param maxObjects the maximum objects threshold that should be met for a - * part if possible + * @param maxObjects the maximum objects threshold that should be met for a part + * if possible * @param log the operation log * @return the iterator of the parts */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/impl/NoPartitioner.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/impl/NoPartitioner.java index 64f7098005..6974431d8a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/impl/NoPartitioner.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/impl/NoPartitioner.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.instance.tools.impl; -import java.util.Collections; - import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.instance.model.impl.ResourceIteratorAdapter; import eu.esdihumboldt.hale.common.instance.tools.InstanceCollectionPartitioner; +import java.util.Collections; /** * Partitioner that does no partitioning. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/impl/PartitionIterator.java b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/impl/PartitionIterator.java index efdd976280..6bf2ea7905 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/impl/PartitionIterator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/src/eu/esdihumboldt/hale/common/instance/tools/impl/PartitionIterator.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.instance.tools.impl; -import java.util.NoSuchElementException; - import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; @@ -25,6 +23,7 @@ import eu.esdihumboldt.hale.common.instance.model.ext.InstanceIterator; import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstanceCollection; import eu.esdihumboldt.hale.common.instance.model.impl.FilteredInstanceCollection; +import java.util.NoSuchElementException; /** * Iterator dividing an instance collection. @@ -38,8 +37,8 @@ private class PartIterator implements ResourceIterator { /** * Create an iterator for a part. * - * @param cap the index of the instance up to which (exclusive) the - * iterator will serve instances + * @param cap the index of the instance up to which (exclusive) the iterator + * will serve instances */ public PartIterator(int cap) { this.cap = cap; @@ -163,8 +162,8 @@ public void close() { private PartCollection current; /** - * Create a new iterator that creates partial instance collection from a - * given instance collection. + * Create a new iterator that creates partial instance collection from a given + * instance collection. * * The parts must be consumed in succession to assure a consistent behavior. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionUtilTest.java b/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionUtilTest.java index d33b59ee97..1e3678a7eb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionUtilTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/geometry/CRSDefinitionUtilTest.java @@ -18,7 +18,6 @@ import static org.junit.Assert.assertEquals; import java.text.MessageFormat; - import org.geotools.gml2.SrsSyntax; import org.geotools.referencing.CRS; import org.geotools.referencing.CRS.AxisOrder; diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/helper/PropertyResolverTest.java b/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/helper/PropertyResolverTest.java index db833224ed..24bd3040c9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/helper/PropertyResolverTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/helper/PropertyResolverTest.java @@ -21,16 +21,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.io.IOException; -import java.net.URI; - -import javax.xml.namespace.QName; - -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; -import org.springframework.core.convert.ConversionService; - import de.fhg.igd.osgi.util.OsgiUtils; import de.fhg.igd.osgi.util.OsgiUtils.Condition; import eu.esdihumboldt.hale.common.core.HalePlatform; @@ -51,6 +41,13 @@ import eu.esdihumboldt.hale.io.gml.reader.internal.StreamGmlReader; import eu.esdihumboldt.hale.io.gml.reader.internal.XmlInstanceReader; import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader; +import java.io.IOException; +import java.net.URI; +import javax.xml.namespace.QName; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import org.springframework.core.convert.ConversionService; /** * Tests for {@link PropertyResolver} @@ -82,8 +79,8 @@ public boolean evaluate() { @Test public void testLoadShiporder() throws Exception { InstanceCollection instances = loadXMLInstances( - getClass().getResource("/data/shiporder/shiporder.xsd").toURI(), getClass() - .getResource("/data/shiporder/shiporder.xml").toURI()); + getClass().getResource("/data/shiporder/shiporder.xsd").toURI(), + getClass().getResource("/data/shiporder/shiporder.xml").toURI()); ResourceIterator it = instances.iterator(); try { @@ -96,19 +93,19 @@ public void testLoadShiporder() throws Exception { TypeDefinition test = instance.getDefinition().getChildren().iterator().next() .asProperty().getParentType(); - assertTrue(PropertyResolver - .hasProperty(instance, "{http://www.example.com}orderperson")); + assertTrue( + PropertyResolver.hasProperty(instance, "{http://www.example.com}orderperson")); assertTrue(PropertyResolver.hasProperty(instance, "{http://www.example.com}shipto.{http://www.example.com}city")); assertTrue(PropertyResolver.getQueryPath(instance, - "{http://www.example.com}shipto.{http://www.example.com}city").contains( - "{http://www.example.com}shipto.{http://www.example.com}city")); + "{http://www.example.com}shipto.{http://www.example.com}city") + .contains("{http://www.example.com}shipto.{http://www.example.com}city")); assertTrue(PropertyResolver.hasProperty(instance, "orderperson")); assertTrue(PropertyResolver.hasProperty(instance, "shipto.city")); - assertTrue(PropertyResolver - .hasProperty(instance, "shipto.{http://www.example.com}city")); + assertTrue( + PropertyResolver.hasProperty(instance, "shipto.{http://www.example.com}city")); assertEquals(PropertyResolver.getValues(instance, "shipto.city").iterator().next(), "4000 Stavanger"); @@ -125,8 +122,8 @@ public void testLoadShiporder() throws Exception { @Test public void testLoadShiporderWrapped() throws Exception { InstanceCollection instances = loadXMLInstances( - getClass().getResource("/data/shiporder/shiporder.xsd").toURI(), getClass() - .getResource("/data/shiporder/shiporder.xml").toURI()); + getClass().getResource("/data/shiporder/shiporder.xsd").toURI(), + getClass().getResource("/data/shiporder/shiporder.xml").toURI()); ResourceIterator it = instances.iterator(); try { @@ -139,8 +136,8 @@ public void testLoadShiporderWrapped() throws Exception { MutableInstance wrapperInstance = new DefaultInstance(null, null); wrapperInstance.addProperty(new QName("value"), instance); - assertEquals(PropertyResolver.getValues(wrapperInstance, "value.shipto.city") - .iterator().next(), "4000 Stavanger"); + assertEquals(PropertyResolver.getValues(wrapperInstance, "value.shipto.city").iterator() + .next(), "4000 Stavanger"); } finally { it.close(); } @@ -156,15 +153,15 @@ public void testComplexInstances() throws Exception { SchemaReader reader = new XmlSchemaReader(); reader.setSharedTypes(null); - reader.setSource(new DefaultInputSupplier((getClass().getResource( - "/data/erm/inspire3/HydroPhysicalWaters.xsd").toURI()))); + reader.setSource(new DefaultInputSupplier( + (getClass().getResource("/data/erm/inspire3/HydroPhysicalWaters.xsd").toURI()))); IOReport report = reader.execute(null); assertTrue(report.isSuccess()); Schema schema = reader.getSchema(); StreamGmlReader instanceReader = new GmlInstanceReader(); - instanceReader.setSource(new DefaultInputSupplier(getClass().getResource( - "/data/out/transformWrite_ERM_HPW.gml").toURI())); + instanceReader.setSource(new DefaultInputSupplier( + getClass().getResource("/data/out/transformWrite_ERM_HPW.gml").toURI())); instanceReader.setSourceSchema(schema); instanceReader.validate(); @@ -184,28 +181,21 @@ public void testComplexInstances() throws Exception { assertTrue(PropertyResolver.hasProperty(instance, "boundedBy.Envelope.coordinates")); assertTrue(PropertyResolver.hasProperty(instance, "boundedBy.Envelope.{http://www.opengis.net/gml/3.2}coordinates")); - assertTrue(PropertyResolver - .hasProperty( - instance, - "{http://www.opengis.net/gml/3.2}boundedBy.{http://www.opengis.net/gml/3.2}Envelope.{http://www.opengis.net/gml/3.2}coordinates")); + assertTrue(PropertyResolver.hasProperty(instance, + "{http://www.opengis.net/gml/3.2}boundedBy.{http://www.opengis.net/gml/3.2}Envelope.{http://www.opengis.net/gml/3.2}coordinates")); assertFalse(PropertyResolver.hasProperty(instance, "boundedBy.Envelope.{http://www.opengis.net/gml/3.2}coordinates.description")); assertTrue(PropertyResolver.hasProperty(instance, "location.AbstractSolid.id")); assertTrue(PropertyResolver.hasProperty(instance, "location.CompositeCurve.curveMember.CompositeCurve.curveMember.type")); - assertTrue(PropertyResolver - .hasProperty( - instance, - "{http://www.opengis.net/gml/3.2}location.{http://www.opengis.net/gml/3.2}CompositeCurve.{http://www.opengis.net/gml/3.2}curveMember.{http://www.opengis.net/gml/3.2}CompositeCurve.{http://www.opengis.net/gml/3.2}curveMember.type")); - assertTrue(PropertyResolver - .hasProperty( - instance, - "{http://www.opengis.net/gml/3.2}location.CompositeCurve.{http://www.opengis.net/gml/3.2}curveMember.{http://www.opengis.net/gml/3.2}CompositeCurve.curveMember.type")); - - assertEquals("EPSG:4326", - PropertyResolver.getValues(instance, "geometry.Polygon.srsName").iterator() - .next().toString()); + assertTrue(PropertyResolver.hasProperty(instance, + "{http://www.opengis.net/gml/3.2}location.{http://www.opengis.net/gml/3.2}CompositeCurve.{http://www.opengis.net/gml/3.2}curveMember.{http://www.opengis.net/gml/3.2}CompositeCurve.{http://www.opengis.net/gml/3.2}curveMember.type")); + assertTrue(PropertyResolver.hasProperty(instance, + "{http://www.opengis.net/gml/3.2}location.CompositeCurve.{http://www.opengis.net/gml/3.2}curveMember.{http://www.opengis.net/gml/3.2}CompositeCurve.curveMember.type")); + + assertEquals("EPSG:4326", PropertyResolver + .getValues(instance, "geometry.Polygon.srsName").iterator().next().toString()); // TODO } finally { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/tools/impl/SimplePartitionerTest.java b/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/tools/impl/SimplePartitionerTest.java index d9731e1704..4e8f16df56 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/tools/impl/SimplePartitionerTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/test/eu/esdihumboldt/hale/common/instance/tools/impl/SimplePartitionerTest.java @@ -18,17 +18,15 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import java.util.ArrayList; -import java.util.Collection; - -import org.junit.Test; - import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstance; import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstanceCollection; +import java.util.ArrayList; +import java.util.Collection; +import org.junit.Test; /** * Tests for {@link SimplePartitioner}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/InstanceModelValidator.java b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/InstanceModelValidator.java index 71a69fa34c..7350efb1f2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/InstanceModelValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/InstanceModelValidator.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.instancevalidator; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.instance.extension.validation.InstanceValidationContext; @@ -26,6 +24,7 @@ import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; +import javax.annotation.Nullable; /** * Interface for generic instance validators. @@ -52,7 +51,7 @@ public interface InstanceModelValidator extends ValidatorBase { */ public void validateProperty(Object value, PropertyDefinition property, @Nullable EntityDefinition entity, InstanceValidationContext context) - throws ValidationException; + throws ValidationException; /** * Validate an instance, may be a top instance or a property. @@ -76,7 +75,7 @@ public void validateInstance(Instance instance, @Nullable EntityDefinition entit */ public void validateGroup(Group group, GroupPropertyDefinition property, @Nullable EntityDefinition entity, InstanceValidationContext context) - throws ValidationException; + throws ValidationException; /** * @return the validation category diff --git a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/InstanceValidator.java b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/InstanceValidator.java index 710a1a11f3..65354dc8cc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/InstanceValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/InstanceValidator.java @@ -15,17 +15,6 @@ */ package eu.esdihumboldt.hale.common.instancevalidator; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map.Entry; - -import javax.annotation.Nullable; -import javax.xml.namespace.QName; - -import org.eclipse.core.runtime.IProgressMonitor; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import de.fhg.igd.slf4jplus.ATransaction; @@ -70,6 +59,14 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; import eu.esdihumboldt.hale.common.schema.model.constraint.type.SkipValidation; import eu.esdihumboldt.hale.io.xsd.constraint.XmlAttributeFlag; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map.Entry; +import javax.annotation.Nullable; +import javax.xml.namespace.QName; +import org.eclipse.core.runtime.IProgressMonitor; /** * Validator for instances using constraints. @@ -166,8 +163,8 @@ public InstanceValidationReport validateInstances(InstanceCollection instances, } /** - * Validate the information collected in the instance validation context. - * Should be performed after all instances haven been validated. + * Validate the information collected in the instance validation context. Should + * be performed after all instances haven been validated. * * @param context the validation context * @param reporter the validation reporter @@ -273,8 +270,8 @@ public InstanceValidationReporter validate(Instance instance) { * @param reporter the reporter to report to * @param type the top level type * @param path the current property path - * @param onlyCheckExistingChildren whether to only validate existing - * children (in case of a choice) or not + * @param onlyCheckExistingChildren whether to only validate existing children + * (in case of a choice) or not * @param reference the instance reference * @param context the instance validation context * @param presentIn the child definition this instance is present in, if @@ -323,8 +320,8 @@ public void validateInstance(Instance instance, InstanceValidationReporter repor } /** - * Determines if validation should be skipped for a certain property type - * and value. + * Determines if validation should be skipped for a certain property type and + * value. * * @param typeDef the property type * @param value the property value @@ -343,12 +340,11 @@ protected boolean skipValidation(TypeDefinition typeDef, Object value) { * @param reporter the reporter to report to * @param type the top level type * @param path the current property path - * @param onlyCheckExistingChildren whether to only validate existing - * children (in case of a choice) or not + * @param onlyCheckExistingChildren whether to only validate existing children + * (in case of a choice) or not * @param reference the instance reference * @param context the instance validation context - * @param presentIn the child definition this group is present in, if - * applicable + * @param presentIn the child definition this group is present in, if applicable * @param groupEntity the group's entity definition or null */ private void validateGroupChildren(Group group, InstanceValidationReporter reporter, QName type, @@ -396,13 +392,13 @@ private void validateGroupChildren(Group group, InstanceValidationReporter repor * definition. * * @param group the group to validate - * @param childDefs the pre-determined children to validate (can be all - * children or a subset) + * @param childDefs the pre-determined children to validate (can be all children + * or a subset) * @param reporter the reporter to report to * @param type the top level type * @param path the current property path - * @param onlyCheckExistingChildren whether to only validate existing - * children (in case of a choice) or not + * @param onlyCheckExistingChildren whether to only validate existing children + * (in case of a choice) or not * @param reference the instance reference * @param context the instance validation context * @param parent the parent group's entity definition or null @@ -578,8 +574,8 @@ private void validateGroup(Object[] properties, GroupPropertyDefinition groupDef * @param reporter the reporter to report to * @param type the top level type * @param path the current property path - * @param onlyCheckExistingChildren whether to only validate existing - * children (in case of a choice) or not + * @param onlyCheckExistingChildren whether to only validate existing children + * (in case of a choice) or not * @param reference the instance reference * @param context the instance validation context * @param entity the entity definition related to the property values or @@ -624,9 +620,9 @@ else if (childDef.asProperty() != null) { // no property value /* - * Special case: No property value, but a combination of minimum - * cardinality greater than zero and NillableFlag is set. Then there - * can be sub-properties that are required. + * Special case: No property value, but a combination of minimum cardinality + * greater than zero and NillableFlag is set. Then there can be sub-properties + * that are required. * * Applicable for XML (simple) types with mandatory attributes. */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/extension/InstanceModelValidatorExtension.java b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/extension/InstanceModelValidatorExtension.java index da103c5a84..f995359322 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/extension/InstanceModelValidatorExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/extension/InstanceModelValidatorExtension.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.instancevalidator.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractExtension; import eu.esdihumboldt.hale.common.instancevalidator.InstanceModelValidator; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for instance model based validators. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/extension/InstanceModelValidatorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/extension/InstanceModelValidatorFactory.java index 1cbb505cca..eed29b8b08 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/extension/InstanceModelValidatorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/extension/InstanceModelValidatorFactory.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.instancevalidator.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import eu.esdihumboldt.hale.common.instancevalidator.InstanceModelValidator; +import org.eclipse.core.runtime.IConfigurationElement; /** * Factory for instance model based validators. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/CardinalityValidator.java b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/CardinalityValidator.java index dc4ff80fa5..4dfbff7f7c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/CardinalityValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/CardinalityValidator.java @@ -46,7 +46,7 @@ public void validatePropertyConstraint(Object[] values, PropertyConstraint const @Override public void validateGroupPropertyConstraint(Object[] values, GroupPropertyConstraint constraint, GroupPropertyDefinition property, InstanceValidationContext context) - throws ValidationException { + throws ValidationException { validateConstraint(values, (Cardinality) constraint, false); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/ChoiceFlagValidator.java b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/ChoiceFlagValidator.java index 80c40650aa..72d4cb1a5d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/ChoiceFlagValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/ChoiceFlagValidator.java @@ -15,10 +15,6 @@ */ package eu.esdihumboldt.hale.common.instancevalidator.validators; -import java.util.Iterator; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.instance.extension.validation.GroupPropertyConstraintValidator; import eu.esdihumboldt.hale.common.instance.extension.validation.InstanceValidationContext; import eu.esdihumboldt.hale.common.instance.extension.validation.ValidationException; @@ -26,6 +22,8 @@ import eu.esdihumboldt.hale.common.schema.model.GroupPropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.property.ChoiceFlag; +import java.util.Iterator; +import javax.xml.namespace.QName; /** * Validator for {@link ChoiceFlag}. @@ -35,9 +33,9 @@ public class ChoiceFlagValidator implements GroupPropertyConstraintValidator { @Override - public void validateGroupPropertyConstraint(Object[] values, - GroupPropertyConstraint constraint, GroupPropertyDefinition property, - InstanceValidationContext context) throws ValidationException { + public void validateGroupPropertyConstraint(Object[] values, GroupPropertyConstraint constraint, + GroupPropertyDefinition property, InstanceValidationContext context) + throws ValidationException { if (((ChoiceFlag) constraint).isEnabled() && values != null) { for (Object value : values) { if (value instanceof Group) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/UniqueValidator.java b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/UniqueValidator.java index 5c492ed2df..ee683ec2ba 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/UniqueValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/UniqueValidator.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.hale.common.instancevalidator.validators; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - import eu.esdihumboldt.hale.common.instance.extension.validation.InstanceValidationContext; import eu.esdihumboldt.hale.common.instance.extension.validation.PropertyConstraintValidator; import eu.esdihumboldt.hale.common.instance.extension.validation.ValidationException; @@ -28,6 +23,10 @@ import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.property.Unique; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; /** * Validator for {@link Unique}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/ValidationConstraintValidator.java b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/ValidationConstraintValidator.java index eecce54069..17290d75fc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/ValidationConstraintValidator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/src/eu/esdihumboldt/hale/common/instancevalidator/validators/ValidationConstraintValidator.java @@ -36,10 +36,10 @@ public class ValidationConstraintValidator implements TypeConstraintValidator { @Override public void validateTypeConstraint(Instance instance, TypeConstraint constraint, InstanceValidationContext context) throws ValidationException { - String result = ((ValidationConstraint) constraint).getValidator().validate( - instance.getValue()); + String result = ((ValidationConstraint) constraint).getValidator() + .validate(instance.getValue()); if (result != null) - throw new ValidationException("Validation of the value (" + instance.getValue() - + ") failed: " + result); + throw new ValidationException( + "Validation of the value (" + instance.getValue() + ") failed: " + result); } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/LookupService.java b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/LookupService.java index 704c8f8028..254ee64ccb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/LookupService.java +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/LookupService.java @@ -46,8 +46,8 @@ public interface LookupService { * Remove the lookup table with the given identifier. * * @param id the resource ID identifying the lookup table to remove - * @return true if the lookup table was present and - * successfully removed, false otherwise + * @return true if the lookup table was present and successfully + * removed, false otherwise */ public boolean removeTable(String id); diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/LookupTable.java b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/LookupTable.java index fa6a0d9c71..5e9f983ba8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/LookupTable.java +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/LookupTable.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.common.lookup; -import java.util.Map; -import java.util.Set; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.core.io.Value; +import java.util.Map; +import java.util.Set; /** * Lookup table interface. @@ -45,8 +43,8 @@ public interface LookupTable { public Set getKeys(); /** - * Get the reverse of the lookup. Note that in the reverse representation - * there may be multiple values for a key. + * Get the reverse of the lookup. Note that in the reverse representation there + * may be multiple values for a key. * * @return the reverse representation of the lookup table */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/AbstractLookupExport.java b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/AbstractLookupExport.java index 892bd8ff5d..e54cabdc1b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/AbstractLookupExport.java +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/AbstractLookupExport.java @@ -24,8 +24,8 @@ * * @author Patrick Lieb */ -public abstract class AbstractLookupExport extends AbstractExportProvider implements - LookupTableExport { +public abstract class AbstractLookupExport extends AbstractExportProvider + implements LookupTableExport { private LookupTableInfo lookupTable; diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/AbstractLookupImport.java b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/AbstractLookupImport.java index b3129ffd0a..67341a85af 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/AbstractLookupImport.java +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/AbstractLookupImport.java @@ -15,19 +15,18 @@ package eu.esdihumboldt.hale.common.lookup.impl; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider; import eu.esdihumboldt.hale.common.lookup.LookupTableImport; +import java.util.Map; /** * TODO Type description * * @author simon */ -public abstract class AbstractLookupImport extends AbstractImportProvider implements - LookupTableImport { +public abstract class AbstractLookupImport extends AbstractImportProvider + implements LookupTableImport { private String name; diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/LookupTableImpl.java b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/LookupTableImpl.java index 999c9ad859..caa116fde4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/LookupTableImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/LookupTableImpl.java @@ -15,21 +15,18 @@ package eu.esdihumboldt.hale.common.lookup.impl; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import net.jcip.annotations.Immutable; - import com.google.common.base.Predicates; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Maps; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.lookup.LookupTable; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import net.jcip.annotations.Immutable; /** * Simple lookup table implementation based on a {@link Map}. @@ -49,7 +46,8 @@ public class LookupTableImpl implements LookupTable { public LookupTableImpl(Map table) { super(); // ignore null values, so their entries don't show up in any methods - this.table = new LinkedHashMap(Maps.filterValues(table, Predicates.notNull())); + this.table = new LinkedHashMap( + Maps.filterValues(table, Predicates.notNull())); } @Override diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/LookupTableParameterValue.java b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/LookupTableParameterValue.java index d241e78d54..4a401af286 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/LookupTableParameterValue.java +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/impl/LookupTableParameterValue.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.lookup.impl; -import java.util.LinkedHashMap; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.parameter.ParameterValueDescriptor; +import java.util.LinkedHashMap; +import java.util.Map; /** * Implementation of the LookupTable parameter representation diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/internal/LookupServiceImpl.java b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/internal/LookupServiceImpl.java index 758e1cf910..dacda1eb5a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/internal/LookupServiceImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/internal/LookupServiceImpl.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.common.lookup.internal; +import eu.esdihumboldt.hale.common.lookup.LookupService; +import eu.esdihumboldt.hale.common.lookup.LookupTableInfo; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import eu.esdihumboldt.hale.common.lookup.LookupService; -import eu.esdihumboldt.hale.common.lookup.LookupTableInfo; - /** * Default lookup service implementation. * @@ -33,7 +32,8 @@ public class LookupServiceImpl implements LookupService { private final Map tables = new HashMap(); @Override - public void registerTable(String id, LookupTableInfo tableInfo) throws IllegalArgumentException { + public void registerTable(String id, LookupTableInfo tableInfo) + throws IllegalArgumentException { synchronized (tables) { if (tables.containsKey(id)) throw new IllegalArgumentException("Lookup table identifier already taken."); diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/internal/LookupTableType.groovy b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/internal/LookupTableType.groovy index 4d4fc764e3..116f118c08 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/internal/LookupTableType.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/src/eu/esdihumboldt/hale/common/lookup/internal/LookupTableType.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.lookup.internal -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.core.io.ComplexValueType import eu.esdihumboldt.hale.common.core.io.DOMValueUtil import eu.esdihumboldt.hale.common.core.io.JsonValueUtil @@ -27,6 +25,7 @@ import eu.esdihumboldt.hale.common.lookup.impl.LookupTableImpl import eu.esdihumboldt.util.groovy.json.JsonStreamBuilder import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import groovy.xml.dom.DOMCategory +import org.w3c.dom.Element /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/test/eu/esdihumboldt/hale/common/lookup/internal/LookupTableTypeTest.java b/common/plugins/eu.esdihumboldt.hale.common.lookup/test/eu/esdihumboldt/hale/common/lookup/internal/LookupTableTypeTest.java index e838c3c8f1..84af8ad215 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/test/eu/esdihumboldt/hale/common/lookup/internal/LookupTableTypeTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/test/eu/esdihumboldt/hale/common/lookup/internal/LookupTableTypeTest.java @@ -18,25 +18,22 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import com.google.common.collect.Sets; +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.lookup.LookupTable; +import eu.esdihumboldt.hale.common.lookup.impl.LookupTableImpl; +import groovy.json.JsonBuilder; import java.io.StringReader; import java.io.StringWriter; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; - import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper; import org.junit.BeforeClass; import org.junit.Test; import org.w3c.dom.Element; -import com.google.common.collect.Sets; - -import eu.esdihumboldt.hale.common.core.io.HaleIO; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.lookup.LookupTable; -import eu.esdihumboldt.hale.common.lookup.impl.LookupTableImpl; -import groovy.json.JsonBuilder; - /** * Tests for {@link LookupTable} complex value conversion. * @@ -51,8 +48,8 @@ public static void init() { } /** - * Test if a simple lookup table containing only string values is the same - * when converted to DOM and back again. + * Test if a simple lookup table containing only string values is the same when + * converted to DOM and back again. */ @Test public void testStringLookup() { @@ -70,8 +67,8 @@ public void testStringLookup() { } /** - * Test if a simple lookup table containing only string values is the same - * when converted to JSON and back again. + * Test if a simple lookup table containing only string values is the same when + * converted to JSON and back again. */ @Test public void testStringLookupJson() { diff --git a/common/plugins/eu.esdihumboldt.hale.common.propertyaccessor/src/eu/esdihumboldt/hale/common/propertyaccessor/InstancePropertyAccessorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.propertyaccessor/src/eu/esdihumboldt/hale/common/propertyaccessor/InstancePropertyAccessorFactory.java index f862b8a297..1193890f8d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.propertyaccessor/src/eu/esdihumboldt/hale/common/propertyaccessor/InstancePropertyAccessorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.propertyaccessor/src/eu/esdihumboldt/hale/common/propertyaccessor/InstancePropertyAccessorFactory.java @@ -15,17 +15,15 @@ */ package eu.esdihumboldt.hale.common.propertyaccessor; +import eu.esdihumboldt.hale.common.instance.helper.PropertyResolver; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import java.util.Collection; import java.util.stream.Collectors; - import org.geotools.filter.expression.PropertyAccessor; import org.geotools.filter.expression.PropertyAccessorFactory; import org.geotools.util.factory.Hints; -import eu.esdihumboldt.hale.common.instance.helper.PropertyResolver; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; - /** * Factory for property accessor using {@link PropertyResolver}. * @@ -67,12 +65,11 @@ public boolean canHandle(Object object, String xpath, protected Object unwrap(Object obj) { if (obj instanceof GeometryProperty) { /* - * Extract geometry from GeometryProperty, as a Geometry is - * usually expected in Geotools filters related to geometries. + * Extract geometry from GeometryProperty, as a Geometry is usually expected in + * Geotools filters related to geometries. * - * XXX A better alternative might be adding a Geotools converter - * factory that supports this conversions (also see Geotools - * Converters class). + * XXX A better alternative might be adding a Geotools converter factory that + * supports this conversions (also see Geotools Converters class). */ return ((GeometryProperty) obj).getGeometry(); } @@ -87,17 +84,15 @@ public Object get(Object object, String xpath, @SuppressWarnings("rawtypes") Cla Collection values = PropertyResolver.getValues((Instance) object, xpath); if (values.size() == 1) { /* - * Always yield single value if there is only a single - * value. This is required for instance for the IS NULL - * filter. It does not work on lists. + * Always yield single value if there is only a single value. This is required + * for instance for the IS NULL filter. It does not work on lists. */ return unwrap(values.iterator().next()); } else if (values.isEmpty()) { /* - * No values -> return null. This is required for instance - * for the IS NULL filter. It treats a list always as not - * null. + * No values -> return null. This is required for instance for the IS NULL + * filter. It treats a list always as not null. */ return null; } diff --git a/common/plugins/eu.esdihumboldt.hale.common.referencing/src/eu/esdihumboldt/hale/common/referencing/factory/adv/AdvCrsAuthorityFactory.java b/common/plugins/eu.esdihumboldt.hale.common.referencing/src/eu/esdihumboldt/hale/common/referencing/factory/adv/AdvCrsAuthorityFactory.java index 984e584067..359058fb40 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.referencing/src/eu/esdihumboldt/hale/common/referencing/factory/adv/AdvCrsAuthorityFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.referencing/src/eu/esdihumboldt/hale/common/referencing/factory/adv/AdvCrsAuthorityFactory.java @@ -20,7 +20,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; - import org.geotools.metadata.iso.IdentifierImpl; import org.geotools.metadata.iso.citation.CitationImpl; import org.geotools.metadata.iso.citation.Citations; @@ -103,8 +102,7 @@ public class AdvCrsAuthorityFactory extends AbstractAuthorityFactory private final Map cache = new HashMap(); /** - * The name used in {@link Hints#FORCE_AXIS_ORDER_HONORING} for this - * factory. + * The name used in {@link Hints#FORCE_AXIS_ORDER_HONORING} for this factory. */ public static final String HINTS_AUTHORITY = "urn"; @@ -143,8 +141,7 @@ public AdvCrsAuthorityFactory(final CRSFactory factory) { * Add an AdV CRS definition * * @param code the CRS code (e.g. DE_DHDN_3GK3) - * @param epsgCode the code of the corresponding EPSG CRS (must include - * prefix) + * @param epsgCode the code of the corresponding EPSG CRS (must include prefix) */ public void addCodeMapping(String code, String epsgCode) { Objects.requireNonNull("AdV code must not be null", code); @@ -164,8 +161,8 @@ public void addCodeMapping(String code, String epsgCode) { /** * Get the EPSG code for the given AdV code * - * @param code the CRS code (e.g. DE_DHDN_3GK3 or urn:adv:crs:DE_DHDN_3GK3) - * that the AdV CRS is associated with + * @param code the CRS code (e.g. DE_DHDN_3GK3 or urn:adv:crs:DE_DHDN_3GK3) that + * the AdV CRS is associated with * @return the EPSG code or null */ public String getEpsgCode(String code) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.referencing/src/eu/esdihumboldt/hale/common/referencing/factory/adv/AdvCrsUrnAuthorityFactory.java b/common/plugins/eu.esdihumboldt.hale.common.referencing/src/eu/esdihumboldt/hale/common/referencing/factory/adv/AdvCrsUrnAuthorityFactory.java index 1374cc4262..1f4f0fa5c6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.referencing/src/eu/esdihumboldt/hale/common/referencing/factory/adv/AdvCrsUrnAuthorityFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.referencing/src/eu/esdihumboldt/hale/common/referencing/factory/adv/AdvCrsUrnAuthorityFactory.java @@ -17,7 +17,6 @@ import java.net.URI; import java.util.Objects; - import org.geotools.metadata.iso.IdentifierImpl; import org.geotools.metadata.iso.citation.CitationImpl; import org.geotools.metadata.iso.citation.ContactImpl; @@ -106,8 +105,8 @@ public static AdvCrsUrn from(String urn) { } /** - * @return the concatenation of the authority and the {@linkplain #code} - * , separated by ':' + * @return the concatenation of the authority and the {@linkplain #code} , + * separated by ':' */ public String getAuthorityCode() { return "ADV:" + code; @@ -138,9 +137,9 @@ public Citation getAuthority() { } /** - * Returns an object factory for the specified code. This method invokes one - * of the getTypeAuthorityFactory - * methods where Type is inferred from the code. + * Returns an object factory for the specified code. This method invokes one of + * the getTypeAuthorityFactory methods + * where Type is inferred from the code. * * @param code The authority code given to this class. * @return A factory for the specified authority code (never {@code null}). diff --git a/common/plugins/eu.esdihumboldt.hale.common.referencing/test/eu/esdihumboldt/hale/common/referencing/factory/CrsAuthorityFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.referencing/test/eu/esdihumboldt/hale/common/referencing/factory/CrsAuthorityFactoryTest.groovy index 80f0247f82..50568e4bfa 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.referencing/test/eu/esdihumboldt/hale/common/referencing/factory/CrsAuthorityFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.referencing/test/eu/esdihumboldt/hale/common/referencing/factory/CrsAuthorityFactoryTest.groovy @@ -17,11 +17,10 @@ package eu.esdihumboldt.hale.common.referencing.factory import static org.junit.Assert.* +import groovy.transform.CompileStatic import org.geotools.referencing.CRS import org.junit.Test -import groovy.transform.CompileStatic - /** * Tests for {@link CRSAuthorityFactory} implementations * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/DefinitionAccessor.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/DefinitionAccessor.groovy index e51051e4a2..1dab26cd84 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/DefinitionAccessor.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/DefinitionAccessor.groovy @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.schema.groovy; import com.google.common.collect.ImmutableList - import eu.esdihumboldt.hale.common.schema.model.Definition import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/SchemaBuilder.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/SchemaBuilder.groovy index 442b7fe099..fe566b044b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/SchemaBuilder.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/SchemaBuilder.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.schema.groovy -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.schema.groovy.constraints.AugmentedValueFactory import eu.esdihumboldt.hale.common.schema.groovy.constraints.BindingFactory import eu.esdihumboldt.hale.common.schema.groovy.constraints.CardinalityFactory @@ -48,6 +46,7 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeIndex import eu.esdihumboldt.util.groovy.builder.BuilderBase import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import javax.xml.namespace.QName @@ -428,5 +427,4 @@ class SchemaBuilder extends BuilderBase { name } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/constraints/CardinalityFactory.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/constraints/CardinalityFactory.groovy index 96d4a1aa41..088cf8025d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/constraints/CardinalityFactory.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/src/eu/esdihumboldt/hale/common/schema/groovy/constraints/CardinalityFactory.groovy @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints -import java.util.regex.Matcher -import java.util.regex.Pattern - import eu.esdihumboldt.hale.common.schema.model.Definition import eu.esdihumboldt.hale.common.schema.model.constraint.property.Cardinality import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import java.util.regex.Matcher +import java.util.regex.Pattern /** @@ -94,5 +93,4 @@ class CardinalityFactory extends OptionalContextConstraintFactory { private Cardinality createFromRange(Range range) { return Cardinality.get(range.from, range.to) } - } diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/DefinitionAccessorTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/DefinitionAccessorTest.groovy index f742a7dd6c..eec5df1e9a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/DefinitionAccessorTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/DefinitionAccessorTest.groovy @@ -15,14 +15,14 @@ package eu.esdihumboldt.hale.common.schema.groovy +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.schema.model.Definition import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.util.test.AbstractPlatformTest import org.junit.Before import org.junit.Test -import static org.junit.Assert.* - /** * Tests for the {@link DefinitionAccessor}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/SchemaBuilderTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/SchemaBuilderTest.groovy index 7f44a77f81..065aec19d3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/SchemaBuilderTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/SchemaBuilderTest.groovy @@ -15,6 +15,8 @@ package eu.esdihumboldt.hale.common.schema.groovy +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition import eu.esdihumboldt.hale.common.schema.model.Schema @@ -28,8 +30,6 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag import org.junit.Test -import static org.junit.Assert.* - /** * Test cases for the {@link SchemaBuilder}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/AugmentedValueFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/AugmentedValueFactoryTest.groovy index caa343ac9c..4283bc6e60 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/AugmentedValueFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/AugmentedValueFactoryTest.groovy @@ -15,12 +15,12 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.schema.model.constraint.type.AugmentedValueFlag import groovy.transform.CompileStatic import org.junit.Test -import static org.junit.Assert.* - /** * Tests creation of {@link AugmentedValueFlag} constraints w/ {@link AugmentedValueFactory}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/BindingFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/BindingFactoryTest.groovy index edda438767..6ffb8ee1ce 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/BindingFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/BindingFactoryTest.groovy @@ -15,11 +15,11 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints +import static org.junit.Assert.* + import groovy.transform.CompileStatic import org.junit.Test -import static org.junit.Assert.* - /** * Tests creation of {@link Binding} constraints w/ {@link BindingFactory}. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/CardinalityFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/CardinalityFactoryTest.groovy index 5499cb5cac..12903302a1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/CardinalityFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/CardinalityFactoryTest.groovy @@ -15,12 +15,12 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.schema.model.constraint.property.Cardinality import groovy.transform.CompileStatic import org.junit.Test -import static org.junit.Assert.* - /** * Tests creation of {@link Cardinality} constraints w/ {@link CardinalityFactory}. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/ChoiceFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/ChoiceFactoryTest.groovy index dc85136453..f9058afc7b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/ChoiceFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/ChoiceFactoryTest.groovy @@ -15,12 +15,12 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.schema.model.constraint.property.ChoiceFlag import groovy.transform.CompileStatic import org.junit.Test -import static org.junit.Assert.* - /** * Tests creation of {@link ChoiceFlag} constraints w/ {@link ChoiceFactory}. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/DisplayNameFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/DisplayNameFactoryTest.groovy index 89dd2a3d6b..fe0c34a3bb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/DisplayNameFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/DisplayNameFactoryTest.groovy @@ -15,11 +15,11 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints +import static org.junit.Assert.* + import groovy.transform.CompileStatic import org.junit.Test -import static org.junit.Assert.* - /** * Tests creation of {@link DisplayName} constraints w/ {@link DisplayNameFactory}. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/EnumerationFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/EnumerationFactoryTest.groovy index 31d94f79e5..fc05301293 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/EnumerationFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/EnumerationFactoryTest.groovy @@ -15,12 +15,12 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.schema.model.constraint.type.Enumeration import groovy.transform.CompileStatic import org.junit.Test -import static org.junit.Assert.* - /** * Tests creation of {@link Enumeration} constraints w/ {@link EnumerationFactory}. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/GeometryFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/GeometryFactoryTest.groovy index cffffb8f0e..06b82a5088 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/GeometryFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/GeometryFactoryTest.groovy @@ -15,18 +15,15 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints -import org.junit.Test - -import javax.xml.namespace.QName - -import org.locationtech.jts.geom.Polygon +import static org.junit.Assert.* import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition import groovy.transform.CompileStatic - -import static org.junit.Assert.* +import javax.xml.namespace.QName +import org.junit.Test +import org.locationtech.jts.geom.Polygon /** * Tests creation of {@link GeometryType} constraints w/ {@link GeometryFactory}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/NillableFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/NillableFactoryTest.groovy index 95237e9f03..a6e6916345 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/NillableFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/NillableFactoryTest.groovy @@ -15,12 +15,12 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.schema.model.constraint.property.NillableFlag import groovy.transform.CompileStatic import org.junit.Test -import static org.junit.Assert.* - /** * Tests creation of {@link NillableFlag} constraints w/ {@link NillableFactory}. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/TypeAbstractFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/TypeAbstractFactoryTest.groovy index 4357e790ff..2083fd0af6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/TypeAbstractFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/test/eu/esdihumboldt/hale/common/schema/groovy/constraints/TypeAbstractFactoryTest.groovy @@ -15,12 +15,12 @@ package eu.esdihumboldt.hale.common.schema.groovy.constraints +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.schema.model.constraint.type.AbstractFlag import groovy.transform.CompileStatic import org.junit.Test -import static org.junit.Assert.* - /** * Tests creation of {@link AbstractFlag} constraints w/ {@link TypeAbstractFactory}. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/AbstractCachedSchemaReader.java b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/AbstractCachedSchemaReader.java index 13d90d548d..0d04c83ab8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/AbstractCachedSchemaReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/AbstractCachedSchemaReader.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist; -import org.w3c.dom.Element; - import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.impl.ElementValue; @@ -28,6 +26,7 @@ import eu.esdihumboldt.hale.common.schema.persist.hsd.SchemaToXml; import eu.esdihumboldt.hale.common.schema.persist.hsd.XmlToSchema; import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder; +import org.w3c.dom.Element; /** * Base class for schema readers caching their result as HALE Schema Definition. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/AbstractCachedSchemaReaderBase.java b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/AbstractCachedSchemaReaderBase.java index b596382bd8..1eafb30150 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/AbstractCachedSchemaReaderBase.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/AbstractCachedSchemaReaderBase.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; - import eu.esdihumboldt.hale.common.core.io.CachingImportProvider; import eu.esdihumboldt.hale.common.core.io.HaleIO; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -29,6 +25,9 @@ import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.schema.io.impl.AbstractSchemaReader; import eu.esdihumboldt.hale.common.schema.model.Schema; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; /** * Base class for schema readers that are able to cache a loaded schema through @@ -83,8 +82,7 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) } /** - * @return if the cache should be used as fall-back if loading the source - * fails + * @return if the cache should be used as fall-back if loading the source fails */ protected boolean useCacheAsFallback() { // by default use the cache as fall-back if loading the source fails @@ -106,8 +104,8 @@ public void setProvideCache() { protected abstract Value storeInCache(Schema schema) throws Exception; /** - * Load the schema from the given cache. On success the reporter must be - * updated accordingly.
    + * Load the schema from the given cache. On success the reporter must be updated + * accordingly.
    *
    * This method is called if both {@link #validCache(Value)} and * {@link #useCache(Value)} returned true.
    @@ -121,12 +119,12 @@ protected abstract Schema loadFromCache(Value cache, ProgressIndicator progress, IOReporter reporter); /** - * Determines if with the current configuration and source the cache should - * be used to load the schema or not. This method is only called after + * Determines if with the current configuration and source the cache should be + * used to load the schema or not. This method is only called after * {@link #validCache(Value)} returned true.
    *
    - * The default implementation checks if the source location/stream is - * readable and allows using the cache if it's not. + * The default implementation checks if the source location/stream is readable + * and allows using the cache if it's not. * * @param cache the cache value * @return if the cache should be used to load the schema @@ -151,12 +149,11 @@ protected boolean useCache(Value cache) { } /** - * Determines if the given value provides valid cache information that could - * be used in {@link #loadFromCache(Value, ProgressIndicator, IOReporter)}. - *
    + * Determines if the given value provides valid cache information that could be + * used in {@link #loadFromCache(Value, ProgressIndicator, IOReporter)}.
    *
    - * The default implementation classifies the cache value as valid if it is - * not null or the NULL value. + * The default implementation classifies the cache value as valid if it is not + * null or the NULL value. * * @param cache the cache value * @return if the cache value is valid @@ -166,8 +163,8 @@ protected boolean validCache(Value cache) { } /** - * Load the schema from the {@link #getSource()}. On success the reporter - * must be updated accordingly. + * Load the schema from the {@link #getSource()}. On success the reporter must + * be updated accordingly. * * @param progress the progress indicator * @param reporter the reporter diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaConstants.java b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaConstants.java index 617a149a59..02e7f2c955 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaConstants.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaConstants.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd; -import java.util.Map; - import com.google.common.collect.ImmutableMap; +import java.util.Map; /** * HALE Schema Definition constants. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaReader.java b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaReader.java index 88c80317d6..e4552743a4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaReader.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -28,6 +23,10 @@ import eu.esdihumboldt.hale.common.schema.io.impl.AbstractSchemaReader; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.OsgiClassResolver; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; /** * Reads the HALE schema model from XML (HALE Schema Definition). diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaUtil.java b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaUtil.java index d039b3ba49..2c74acf8b4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaUtil.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.schema.model.Schema; +import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchema; import java.io.InputStream; import java.text.MessageFormat; import java.util.List; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.schema.model.Schema; -import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchema; - /** * HALE Schema Definition related utilities. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaWriter.java b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaWriter.java index 63596f0592..0af13ae973 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/HaleSchemaWriter.java @@ -15,17 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd; -import java.io.IOException; -import java.io.OutputStream; - -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.w3c.dom.Element; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -34,6 +23,14 @@ import eu.esdihumboldt.hale.common.schema.io.impl.AbstractSchemaWriter; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder; +import java.io.IOException; +import java.io.OutputStream; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Element; /** * Writes the HALE schema model to XML. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/MergeSchemas.java b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/MergeSchemas.java index b2d5638020..b172225844 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/MergeSchemas.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/MergeSchemas.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd; +import com.google.common.collect.Streams; +import eu.esdihumboldt.hale.common.schema.model.Schema; +import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace; import java.net.URI; import java.util.Collections; import java.util.Map; import java.util.stream.Collectors; -import com.google.common.collect.Streams; - -import eu.esdihumboldt.hale.common.schema.model.Schema; -import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace; - /** * Helper class for merging multiple schemas for export. * @@ -56,8 +54,7 @@ public String getNamespace() { } /** - * Namespace to use for combined schemas if no common namespace is - * available. + * Namespace to use for combined schemas if no common namespace is available. */ public static final String DEFAULT_COMBINED_NAMESPACE = HaleSchemaConstants.NS + "/combine"; @@ -65,9 +62,9 @@ public String getNamespace() { * Merge the given schemas to a single schema. * * @param schemas the schemas to merge - * @param mergeAll true if all schemas should be merged - * independent of the namespace, false if only those - * with the same namespace should be merged + * @param mergeAll true if all schemas should be merged independent + * of the namespace, false if only those with the same + * namespace should be merged * @return the merged schemas */ public static Iterable merge(Iterable schemas, diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/SchemaToXml.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/SchemaToXml.groovy index 1ec705db9f..58453b63f7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/SchemaToXml.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/SchemaToXml.groovy @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd -import javax.xml.namespace.QName - -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.core.io.DOMValueUtil import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.schema.model.ChildDefinition @@ -34,6 +30,8 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantF import eu.esdihumboldt.util.Pair import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import groovy.transform.CompileStatic +import javax.xml.namespace.QName +import org.w3c.dom.Element /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/XmlToSchema.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/XmlToSchema.groovy index e411e4f4b4..04be88a44e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/XmlToSchema.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/XmlToSchema.groovy @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd; -import javax.xml.namespace.QName - -import org.w3c.dom.Element - import de.fhg.igd.slf4jplus.ALogger import de.fhg.igd.slf4jplus.ALoggerFactory import eu.esdihumboldt.hale.common.core.io.DOMValueUtil @@ -40,6 +36,8 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchema import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition import eu.esdihumboldt.util.groovy.xml.NSDOMCategory import groovy.xml.DOMBuilder +import javax.xml.namespace.QName +import org.w3c.dom.Element /** * Reads HALE Schema Definitions back to the HALE schema model. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/HaleSchemaReaderJson.java b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/HaleSchemaReaderJson.java index 89ad8afef6..c21c66e06f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/HaleSchemaReaderJson.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/HaleSchemaReaderJson.java @@ -15,14 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd.json; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.StreamSupport; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -32,6 +24,13 @@ import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.OsgiClassResolver; import eu.esdihumboldt.hale.common.schema.persist.hsd.HaleSchemaUtil; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; /** * Reads the HALE schema model from JSON (HALE Schema Definition). diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/HaleSchemaWriterJson.java b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/HaleSchemaWriterJson.java index d0176c75c7..b5c04fb793 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/HaleSchemaWriterJson.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/HaleSchemaWriterJson.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd.json; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.nio.charset.StandardCharsets; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -30,6 +24,11 @@ import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.persist.hsd.MergeSchemas; import eu.esdihumboldt.util.groovy.json.JsonStreamBuilder; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; /** * Writes the HALE schema model to XML. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/JsonToSchema.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/JsonToSchema.groovy index b4f96cdea1..ce3304238c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/JsonToSchema.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/JsonToSchema.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd.json; -import javax.xml.namespace.QName - import de.fhg.igd.slf4jplus.ALogger import de.fhg.igd.slf4jplus.ALoggerFactory import eu.esdihumboldt.hale.common.core.io.JsonValueUtil @@ -37,6 +35,7 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchema import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition import groovy.json.JsonSlurper +import javax.xml.namespace.QName /** * Reads HALE Schema Definitions back to the HALE schema model. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/SchemaToJson.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/SchemaToJson.groovy index 2f9dcb0f53..80482b89be 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/SchemaToJson.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/json/SchemaToJson.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd.json -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.core.io.JsonValueUtil import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.core.io.ValueList @@ -34,6 +32,7 @@ import eu.esdihumboldt.hale.common.schema.persist.hsd.SchemaEncoderBase import eu.esdihumboldt.util.Pair import eu.esdihumboldt.util.groovy.json.JsonStreamBuilder import groovy.transform.CompileStatic +import javax.xml.namespace.QName /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/test/eu/esdihumboldt/hale/common/schema/persist/hsd/test/HaleSchemaWriterTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/test/eu/esdihumboldt/hale/common/schema/persist/hsd/test/HaleSchemaWriterTest.groovy index b4645ebd2d..8b5b0db05a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/test/eu/esdihumboldt/hale/common/schema/persist/hsd/test/HaleSchemaWriterTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/test/eu/esdihumboldt/hale/common/schema/persist/hsd/test/HaleSchemaWriterTest.groovy @@ -15,15 +15,7 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd.test -import org.junit.Test - -import java.nio.file.Files -import java.nio.file.Path - -import javax.xml.XMLConstants -import javax.xml.namespace.QName -import javax.xml.transform.stream.StreamSource -import javax.xml.validation.SchemaFactory +import static org.junit.Assert.* import eu.esdihumboldt.hale.common.core.io.report.IOReport import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier @@ -50,8 +42,13 @@ import eu.esdihumboldt.hale.common.test.TestUtil import eu.esdihumboldt.util.validator.EnumerationValidator import eu.esdihumboldt.util.validator.Validator import groovy.transform.CompileStatic - -import static org.junit.Assert.* +import java.nio.file.Files +import java.nio.file.Path +import javax.xml.XMLConstants +import javax.xml.namespace.QName +import javax.xml.transform.stream.StreamSource +import javax.xml.validation.SchemaFactory +import org.junit.Test /** @@ -229,4 +226,3 @@ class HaleSchemaWriterTest { tempFile } } - diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/test/eu/esdihumboldt/hale/common/schema/persist/hsd/test/json/HaleSchemaWriterJsonTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/test/eu/esdihumboldt/hale/common/schema/persist/hsd/test/json/HaleSchemaWriterJsonTest.groovy index 1aa1037d4f..2d2f7b1264 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/test/eu/esdihumboldt/hale/common/schema/persist/hsd/test/json/HaleSchemaWriterJsonTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/test/eu/esdihumboldt/hale/common/schema/persist/hsd/test/json/HaleSchemaWriterJsonTest.groovy @@ -15,8 +15,7 @@ package eu.esdihumboldt.hale.common.schema.persist.hsd.test.json -import java.nio.file.Files -import java.nio.file.Path +import static org.junit.Assert.* import eu.esdihumboldt.hale.common.core.io.report.IOReport import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier @@ -28,8 +27,8 @@ import eu.esdihumboldt.hale.common.schema.persist.hsd.json.HaleSchemaReaderJson import eu.esdihumboldt.hale.common.schema.persist.hsd.json.HaleSchemaWriterJson import eu.esdihumboldt.hale.common.schema.persist.hsd.test.HaleSchemaWriterTest import groovy.transform.CompileStatic - -import static org.junit.Assert.* +import java.nio.file.Files +import java.nio.file.Path /** * Tests for {@link HaleSchemaWriterJson}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaCategoryExtension.java b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaCategoryExtension.java index 9307e78f68..13479d364d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaCategoryExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaCategoryExtension.java @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.common.schema.presets.extension; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; +import eu.esdihumboldt.hale.common.schema.presets.extension.internal.SchemaCategoryImpl; import java.util.ArrayList; import java.util.Collection; import java.util.List; - import org.eclipse.core.runtime.IConfigurationElement; -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; -import eu.esdihumboldt.hale.common.schema.presets.extension.internal.SchemaCategoryImpl; - /** * Extension point for schema categories. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaPreset.java b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaPreset.java index dcba9ea08c..7846859b02 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaPreset.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaPreset.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.schema.presets.extension; -import java.io.InputStream; -import java.net.URL; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import java.io.InputStream; +import java.net.URL; /** * Represents a predefined schema. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaPresetExtension.java b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaPresetExtension.java index 618da92264..43d91823f8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaPresetExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/SchemaPresetExtension.java @@ -15,20 +15,17 @@ package eu.esdihumboldt.hale.common.schema.presets.extension; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.SetMultimap; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; +import eu.esdihumboldt.hale.common.schema.presets.extension.internal.PredefinedSchemaImpl; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; - import org.eclipse.core.runtime.IConfigurationElement; -import com.google.common.collect.LinkedHashMultimap; -import com.google.common.collect.SetMultimap; - -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; -import eu.esdihumboldt.hale.common.schema.presets.extension.internal.PredefinedSchemaImpl; - /** * Extension point for predefined schemas. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/internal/PredefinedSchemaImpl.java b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/internal/PredefinedSchemaImpl.java index 8b6d58e1f1..7fc7fb93ac 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/internal/PredefinedSchemaImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/internal/PredefinedSchemaImpl.java @@ -15,20 +15,18 @@ package eu.esdihumboldt.hale.common.schema.presets.extension.internal; +import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import eu.esdihumboldt.hale.common.schema.presets.extension.SchemaCategory; +import eu.esdihumboldt.hale.common.schema.presets.extension.SchemaCategoryExtension; +import eu.esdihumboldt.hale.common.schema.presets.extension.SchemaPreset; import java.io.InputStream; import java.net.URI; import java.net.URL; - import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; -import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; -import eu.esdihumboldt.hale.common.schema.presets.extension.SchemaCategory; -import eu.esdihumboldt.hale.common.schema.presets.extension.SchemaCategoryExtension; -import eu.esdihumboldt.hale.common.schema.presets.extension.SchemaPreset; - /** * Predefined schema based on a configuration element. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/internal/SchemaCategoryImpl.java b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/internal/SchemaCategoryImpl.java index 842e0c97e7..7d6e88b679 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/internal/SchemaCategoryImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/src/eu/esdihumboldt/hale/common/schema/presets/extension/internal/SchemaCategoryImpl.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.schema.presets.extension.internal; -import org.eclipse.core.runtime.IConfigurationElement; - import eu.esdihumboldt.hale.common.schema.presets.extension.SchemaCategory; import eu.esdihumboldt.hale.common.schema.presets.extension.SchemaPreset; import eu.esdihumboldt.hale.common.schema.presets.extension.SchemaPresetExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Default {@link SchemaCategory} implementation. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/Classification.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/Classification.java index 6a5b4e12a7..a575cbeff0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/Classification.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/Classification.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.hale.common.schema; -import java.time.Instant; -import java.time.LocalDate; -import java.util.Date; - import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; @@ -29,6 +25,9 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import java.time.Instant; +import java.time.LocalDate; +import java.util.Date; /** * Basic classification for definitions @@ -37,6 +36,7 @@ * @since 2.2 */ public enum Classification { + /** Abstract feature type */ ABSTRACT_FT("abstractFeatureType"), /** Concrete feature type */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/geometry/CRSDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/geometry/CRSDefinition.java index 3facbd7ed2..43fe307d8b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/geometry/CRSDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/geometry/CRSDefinition.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.common.schema.geometry; import java.io.Serializable; - import org.opengis.referencing.crs.CoordinateReferenceSystem; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/geometry/GeometryProperty.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/geometry/GeometryProperty.java index a34fd74ae3..e4d408cb86 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/geometry/GeometryProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/geometry/GeometryProperty.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.common.schema.geometry; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import java.io.Serializable; - import org.locationtech.jts.geom.Geometry; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; - /** * {@link Binding} for geometry properties. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/SchemaIO.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/SchemaIO.java index beb4650cc8..58cce37c16 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/SchemaIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/SchemaIO.java @@ -16,13 +16,6 @@ package eu.esdihumboldt.hale.common.schema.io; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.runtime.content.IContentType; - import de.fhg.igd.osgi.util.configuration.IConfigurationService; import eu.esdihumboldt.hale.common.core.io.HaleIO; import eu.esdihumboldt.hale.common.core.io.project.ProjectIO; @@ -31,6 +24,11 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.eclipse.core.runtime.content.IContentType; /** * Schema I/O utilities @@ -54,14 +52,14 @@ public abstract class SchemaIO { public static final String ACTION_LOAD_TARGET_SCHEMA = "eu.esdihumboldt.hale.io.schema.read.target"; /** - * ID of the action to export the target schemas. Reflects the ID defined in - * the extension. + * ID of the action to export the target schemas. Reflects the ID defined in the + * extension. */ public static final String ACTION_EXPORT_TARGET_SCHEMAS = "eu.esdihumboldt.hale.io.schema.export.target"; /** - * ID of the action to export the source schemas. Reflects the ID defined in - * the extension. + * ID of the action to export the source schemas. Reflects the ID defined in the + * extension. */ public static final String ACTION_EXPORT_SOURCE_SCHEMAS = "eu.esdihumboldt.hale.io.schema.export.source"; @@ -70,10 +68,10 @@ public abstract class SchemaIO { * * @param contentType the content type the provider must match, may be * null if providerId is set - * @param providerId the id of the provider to use, may be null - * if contentType is set - * @return the I/O provider preconfigured with the content type if it was - * given or null if no matching I/O provider is found + * @param providerId the id of the provider to use, may be null if + * contentType is set + * @return the I/O provider preconfigured with the content type if it was given + * or null if no matching I/O provider is found */ public static SchemaReader createSchemaReader(IContentType contentType, String providerId) { return HaleIO.createIOProvider(SchemaReader.class, contentType, providerId); @@ -110,8 +108,7 @@ public static void loadMappingRelevantTypesConfig(TypeIndex types, SchemaSpaceID } /** - * Get the name of the project settings parameter specifying the mappable - * types. + * Get the name of the project settings parameter specifying the mappable types. * * @param spaceID the schemas space * @return the parameter name diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/util/SchemaReaderDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/util/SchemaReaderDecorator.java index ec55988f28..bc4ec063e0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/util/SchemaReaderDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/util/SchemaReaderDecorator.java @@ -27,8 +27,8 @@ * @param the provider type * @author Stefano Costa, GeoSolutions */ -public abstract class SchemaReaderDecorator extends - ImportProviderDecorator implements SchemaReader { +public abstract class SchemaReaderDecorator + extends ImportProviderDecorator implements SchemaReader { /** * @see ImportProviderDecorator#ImportProviderDecorator(eu.esdihumboldt.hale.common.core.io.ImportProvider) diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/ChildDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/ChildDefinition.java index 6b8e0f9115..6f07959621 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/ChildDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/ChildDefinition.java @@ -26,8 +26,8 @@ public interface ChildDefinition extends Definition { /** - * Get the parent type of the child. This can either be the declaring type - * or a sub-type. + * Get the parent type of the child. This can either be the declaring type or a + * sub-type. * * @return the parent type of the property */ @@ -41,8 +41,8 @@ public interface ChildDefinition extends Definition { public DefinitionGroup getDeclaringGroup(); /** - * Return as a property definition is possible. This is convenience for - * avoiding casts and instanceof expressions when handling children. + * Return as a property definition is possible. This is convenience for avoiding + * casts and instanceof expressions when handling children. * * @return a property definition if this child definition is one, otherwise * null @@ -50,8 +50,8 @@ public interface ChildDefinition extends Definition { public PropertyDefinition asProperty(); /** - * Return as a group definition is possible. This is convenience for - * avoiding casts and instanceof expressions when handling children. + * Return as a group definition is possible. This is convenience for avoiding + * casts and instanceof expressions when handling children. * * @return a group definition if this child definition is one, otherwise * null diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/Constraint.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/Constraint.java index 60bcc73845..b044298cb4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/Constraint.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/Constraint.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.schema.model; +import eu.esdihumboldt.hale.common.schema.model.constraint.ConstraintUtil; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import eu.esdihumboldt.hale.common.schema.model.constraint.ConstraintUtil; - /** * Marks constraint types.
    *
    @@ -44,13 +43,11 @@ /** * States if the default constraint is mutable. If possible the default - * constraint should not be mutable if it is based on the default - * constructor, as - * {@link ConstraintUtil#getDefaultConstraint(Class, Definition)} will only + * constraint should not be mutable if it is based on the default constructor, + * as {@link ConstraintUtil#getDefaultConstraint(Class, Definition)} will only * be able to cache it in this case. * - * @return if the default constraint is mutable, true by - * default + * @return if the default constraint is mutable, true by default */ boolean mutable() default true; diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/Definition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/Definition.java index 39feb3b6ec..4b948532e8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/Definition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/Definition.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.schema.model; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; +import javax.xml.namespace.QName; /** * Common interface for type and property definitions @@ -71,11 +70,10 @@ public interface Definition extends Locatable, Comparable> { public T getConstraint(Class constraintType); /** - * Get the constraints that are explicitly set on the definition (i.e. - * inherited and default constraints are not included). This method is - * intended for use when persisting the schema model. To obtain information - * on the constraints of a definition, use {@link #getConstraint(Class)} - * instead. + * Get the constraints that are explicitly set on the definition (i.e. inherited + * and default constraints are not included). This method is intended for use + * when persisting the schema model. To obtain information on the constraints of + * a definition, use {@link #getConstraint(Class)} instead. * * @return the collection of constraints explicitly set for this definition */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/DefinitionGroup.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/DefinitionGroup.java index 6d0b584c00..83b42c2cab 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/DefinitionGroup.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/DefinitionGroup.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model; +import eu.esdihumboldt.hale.common.schema.model.impl.AbstractChildDefinition; import java.util.Collection; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.schema.model.impl.AbstractChildDefinition; - /** * A group of children, which may be properties or property groups * @@ -41,14 +39,14 @@ public interface DefinitionGroup { * * @param name the child name * - * @return the child definition or null if no child with the - * given name is available + * @return the child definition or null if no child with the given + * name is available */ public ChildDefinition getChild(QName name); /** - * Add a declared child, this is called by the - * {@link AbstractChildDefinition} constructor. + * Add a declared child, this is called by the {@link AbstractChildDefinition} + * constructor. * * @param child the child definition */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/DefinitionUtil.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/DefinitionUtil.java index f1cb09f956..33062768d0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/DefinitionUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/DefinitionUtil.java @@ -16,16 +16,14 @@ package eu.esdihumboldt.hale.common.schema.model; -import java.util.ArrayList; -import java.util.Collection; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.constraint.property.Cardinality; import eu.esdihumboldt.hale.common.schema.model.impl.internal.RedeclareGroupProperty; import eu.esdihumboldt.hale.common.schema.model.impl.internal.RedeclareProperty; import eu.esdihumboldt.hale.common.schema.model.impl.internal.ReparentGroupProperty; import eu.esdihumboldt.hale.common.schema.model.impl.internal.ReparentProperty; +import java.util.ArrayList; +import java.util.Collection; +import javax.xml.namespace.QName; /** * Definition utility methods @@ -75,8 +73,8 @@ else if (child.asGroup() != null) { } /** - * Get all children of a definition group. For {@link TypeDefinition} also - * the inherited children will be returned. + * Get all children of a definition group. For {@link TypeDefinition} also the + * inherited children will be returned. * * @param group the definition group * @return the children @@ -91,9 +89,9 @@ public static Collection> getAllChildren(Definition } /** - * Get all properties of a definition group. For {@link TypeDefinition} also - * the inherited children will be returned. If there are children that are - * groups, their properties are also added. + * Get all properties of a definition group. For {@link TypeDefinition} also the + * inherited children will be returned. If there are children that are groups, + * their properties are also added. * * @param group the definition group * @return the children @@ -173,11 +171,11 @@ public static ChildDefinition getChild(ChildDefinition definition, QName n * * @param definition the definition * @param name the name of the child - * @param allowIgnoreNamespace specifies if when the child with the exact - * name is not present, a child with a similar local name should - * be returned - * @return the child with the given name if it exists, a child with a - * similar local name if it exists or null + * @param allowIgnoreNamespace specifies if when the child with the exact name + * is not present, a child with a similar local name should be + * returned + * @return the child with the given name if it exists, a child with a similar + * local name if it exists or null * @throws IllegalStateException if the given definition isn't group nor * property definition */ @@ -231,8 +229,8 @@ private static int namespaceEqualityRating(String ns1, String ns2) { * Get the represented definition group of a definition. * * @param def the definition - * @return for a property definition its property type, for a type - * definition or a group property definition the definition itself + * @return for a property definition its property type, for a type definition or + * a group property definition the definition itself */ public static DefinitionGroup getDefinitionGroup(Definition def) { if (def instanceof TypeDefinition) { @@ -259,8 +257,8 @@ public static boolean hasChildren(Definition def) { } /** - * Checks whether superType is a super type of - * subType or if they are the same. + * Checks whether superType is a super type of subType + * or if they are the same. * * @param subType the type in question * @param superType the super type @@ -282,10 +280,10 @@ public static boolean isSuperType(TypeDefinition subType, TypeDefinition superTy * The result is *
      *
    • {@code true} if {@code a} and {@code b} are both null. - *
    • {@code true} if {@code a} and {@code b} are both non-null, their - * names are equal and both are of the same: {@link TypeDefinition}, - * {@link PropertyDefinition}, {@link GroupPropertyDefinition} or exactly - * the same class. + *
    • {@code true} if {@code a} and {@code b} are both non-null, their names + * are equal and both are of the same: {@link TypeDefinition}, + * {@link PropertyDefinition}, {@link GroupPropertyDefinition} or exactly the + * same class. *
    • {@code false} in all other situations. *
    * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/GroupPropertyDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/GroupPropertyDefinition.java index 1aae2eeea0..04cc035fd0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/GroupPropertyDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/GroupPropertyDefinition.java @@ -21,16 +21,16 @@ * * @author Simon Templer */ -public interface GroupPropertyDefinition extends DefinitionGroup, - ChildDefinition { +public interface GroupPropertyDefinition + extends DefinitionGroup, ChildDefinition { // concrete typed interface /** - * States if the group may be flattened, i.e. that the group's children may - * be added to the group's parent instead of itself.
    - * This can be reasonable for groups that are only created because at - * creation time the children are not yet determined. + * States if the group may be flattened, i.e. that the group's children may be + * added to the group's parent instead of itself.
    + * This can be reasonable for groups that are only created because at creation + * time the children are not yet determined. * * @return if the group may be replaced by its children */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeConstraint.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeConstraint.java index a88990be4c..8af86bb0ab 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeConstraint.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeConstraint.java @@ -25,8 +25,8 @@ public interface TypeConstraint { /** * Determines if the constraint is inheritable, meaning it may be used for a - * sub-type. A constraint may only be inherited if it is not overriden in - * the sub-type. + * sub-type. A constraint may only be inherited if it is not overriden in the + * sub-type. * * @return if the constraint is inheritable */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeDefinition.java index 0d3d848059..db0610c806 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeDefinition.java @@ -40,8 +40,8 @@ public interface TypeDefinition extends Definition, DefinitionGr public Collection getSubTypes(); /** - * Get all children that an instance of the type may have. Usually these are - * the declared children and the super type children. + * Get all children that an instance of the type may have. Usually these are the + * declared children and the super type children. * * @return the child definitions */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeIndex.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeIndex.java index 4725cf3170..22e27a4574 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeIndex.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/TypeIndex.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; import java.util.Collection; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; - /** * A type index holds a set of type definitions and a corresponding name index. * @@ -40,8 +38,8 @@ public interface TypeIndex { * Get the type with the given name * * @param name the type name - * @return the type definition or null if no type with the - * given name exists in the index + * @return the type definition or null if no type with the given + * name exists in the index */ public TypeDefinition getType(QName name); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/ConstraintUtil.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/ConstraintUtil.java index 9bb3c7f25f..9a19f7968c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/ConstraintUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/ConstraintUtil.java @@ -16,17 +16,16 @@ package eu.esdihumboldt.hale.common.schema.model.constraint; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.schema.model.Constraint; +import eu.esdihumboldt.hale.common.schema.model.Definition; import java.lang.reflect.Constructor; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; import java.util.Queue; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.schema.model.Constraint; -import eu.esdihumboldt.hale.common.schema.model.Definition; - /** * Helper for creating default constraints and dealing with the * {@link Constraint} annotation. Caches immutable default constraints that have @@ -49,13 +48,12 @@ public abstract class ConstraintUtil { * @param the constraint type * * @param constraintType the concrete constraint type, i.e. a type annotated - * with {@link Constraint} and defining a default constructor - * and/or a constructor taking a {@link Definition} as an - * argument + * with {@link Constraint} and defining a default constructor and/or + * a constructor taking a {@link Definition} as an argument * @param definition the definition the constraint will be associated to * @return the default constraint of the given type - * @throws IllegalArgumentException if the given type is no constraint type - * or creating the default constraint fails + * @throws IllegalArgumentException if the given type is no constraint type or + * creating the default constraint fails * * @see Constraint * @see Definition#getConstraint(Class) @@ -64,8 +62,8 @@ public abstract class ConstraintUtil { public static T getDefaultConstraint(Class constraintType, Definition definition) throws IllegalArgumentException { if (!constraintType.isAnnotationPresent(Constraint.class)) { - throw new IllegalArgumentException("The type " + constraintType.getName() - + " is no constraint type."); + throw new IllegalArgumentException( + "The type " + constraintType.getName() + " is no constraint type."); } Object cached = cachedDefaults.get(constraintType); @@ -126,8 +124,8 @@ public static T getDefaultConstraint(Class constraintType, Definition } /** - * Determine the constraint type in the hierarchy of the given type, i.e. - * the type that is marked with {@link Constraint} + * Determine the constraint type in the hierarchy of the given type, i.e. the + * type that is marked with {@link Constraint} * * @param type the type to determine the constraint type for * @return the constraint type @@ -137,8 +135,8 @@ public static T getDefaultConstraint(Class constraintType, Definition public static Class getConstraintType(Class type) throws IllegalArgumentException { while (!type.isAnnotationPresent(Constraint.class)) { if (type.equals(Object.class)) { - throw new IllegalArgumentException("The type " + type.getName() - + " has no constraint type in its hierarchy."); + throw new IllegalArgumentException( + "The type " + type.getName() + " has no constraint type in its hierarchy."); } type = type.getSuperclass(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/DisplayName.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/DisplayName.java index 2ab6c1ce27..470e89f892 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/DisplayName.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/DisplayName.java @@ -16,11 +16,11 @@ package eu.esdihumboldt.hale.common.schema.model.constraint; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import net.jcip.annotations.Immutable; /** * Constraint that can provide a custom display name. By default has no custom @@ -54,8 +54,8 @@ public DisplayName(String customName) { /** * Get the custom display name. * - * @return the customName the custom display name or null if - * there is no custom name + * @return the customName the custom display name or null if there + * is no custom name */ public String getCustomName() { return customName; diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/DefaultClassResolver.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/DefaultClassResolver.java index ef60ea720c..0f8fea9395 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/DefaultClassResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/DefaultClassResolver.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; -import org.apache.commons.lang.ClassUtils; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; +import org.apache.commons.lang.ClassUtils; /** * Default class resolver. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeProvider.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeProvider.java index 99ab0b8491..6be9379bf7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeProvider.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; -import java.util.Map; -import java.util.Optional; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; +import java.util.Map; +import java.util.Optional; +import javax.xml.namespace.QName; /** * Type resolver backed by a map. @@ -36,8 +34,7 @@ public class MapTypeProvider implements TypeProvider { /** * Create a new type provider based on the given map. * - * @param map the map with references mapped to the respective type - * definitions + * @param map the map with references mapped to the respective type definitions */ public MapTypeProvider(Map map) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeReferenceBuilder.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeReferenceBuilder.java index 54e96ef161..8c4cd5d0b6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeReferenceBuilder.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeReferenceBuilder.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; -import java.util.Map; -import java.util.Optional; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Map; +import java.util.Optional; /** * Type reference builder backed by a map. @@ -33,8 +32,7 @@ public class MapTypeReferenceBuilder implements TypeReferenceBuilder { /** * Create a new type reference builder based on the given map. * - * @param map the map with references mapped to the respective type - * definitions + * @param map the map with references mapped to the respective type definitions */ public MapTypeReferenceBuilder(Map map) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeResolver.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeResolver.java index 254c7b990f..0c973c590b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/MapTypeResolver.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; -import java.util.Map; -import java.util.Optional; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Map; +import java.util.Optional; /** * Type resolver backed by a map. @@ -33,8 +32,7 @@ public class MapTypeResolver implements TypeResolver { /** * Create a new type resolver based on the given map. * - * @param map the map with references mapped to the respective type - * definitions + * @param map the map with references mapped to the respective type definitions */ public MapTypeResolver(Map map) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/OsgiClassResolver.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/OsgiClassResolver.java index af2ee15387..d62ff1c18f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/OsgiClassResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/OsgiClassResolver.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; +import de.fhg.igd.osgi.util.OsgiUtils; import java.util.HashMap; import java.util.Map; -import de.fhg.igd.osgi.util.OsgiUtils; - /** * Resolves class names to classes by inspecting OSGi bundle class loaders. * Caches classes loaded through {@link #loadClass(String)}, not thread safe. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeProvider.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeProvider.java index 5c098ce9b0..dccdeb7ce4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeProvider.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; +import javax.xml.namespace.QName; /** * Interface for type providers that allow resolving and populating types. @@ -28,8 +27,8 @@ public interface TypeProvider extends TypeResolver { /** - * Get an existing type definition or create a new one. This is meant for - * the purpose of populating a type with information read from the schema. + * Get an existing type definition or create a new one. This is meant for the + * purpose of populating a type with information read from the schema. * * @param typeName the type name * @param id the identifier of the type diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeReferenceBuilder.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeReferenceBuilder.java index 59e64a986e..7fe046ff50 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeReferenceBuilder.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeReferenceBuilder.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; -import java.util.Optional; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Optional; /** * Interface for creating type references. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeResolver.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeResolver.java index 27d1617544..8494035ce9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/TypeResolver.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; -import java.util.Optional; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Optional; /** * Interface for resolving types through a reference. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/ValueConstraintFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/ValueConstraintFactory.java index da2920169e..aea1f429dd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/ValueConstraintFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/ValueConstraintFactory.java @@ -43,8 +43,8 @@ public interface ValueConstraintFactory { * * @param value the {@link Value} to recreate the constraint from * @param definition the definition the constraint will be associated to - * @param typeResolver the type index that allows resolving references to - * type definitions + * @param typeResolver the type index that allows resolving references to type + * definitions * @param classResolver the resolver for reconstructing classes * @return the restored constraint * @throws Exception if the creation of the constraint fails diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/Alias.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/Alias.java index 357bb4e083..83bacc1f1e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/Alias.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/Alias.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; +import org.eclipse.core.runtime.IConfigurationElement; /** * {@link ValueConstraintFactory} alias. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/AliasExtension.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/AliasExtension.java index 1c7a22fe22..5416427359 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/AliasExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/AliasExtension.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension point for {@link ValueConstraintFactory} aliases. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/ValueConstraintExtension.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/ValueConstraintExtension.java index bb93d9b56b..95f6b1381d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/ValueConstraintExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/ValueConstraintExtension.java @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory.extension; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; +import java.util.HashMap; +import java.util.Map; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension point for {@link ValueConstraintFactory}ies. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/ValueConstraintFactoryDescriptor.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/ValueConstraintFactoryDescriptor.java index 3b92aedb3a..3df1c650e1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/ValueConstraintFactoryDescriptor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/factory/extension/ValueConstraintFactoryDescriptor.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; +import org.eclipse.core.runtime.IConfigurationElement; /** * Descriptor for a {@link ValueConstraintFactory}. @@ -42,7 +41,8 @@ public class ValueConstraintFactoryDescriptor implements Identifiable { * @throws Exception if an error occurs loading the classes or creating the * factory */ - public ValueConstraintFactoryDescriptor(String id, IConfigurationElement conf) throws Exception { + public ValueConstraintFactoryDescriptor(String id, IConfigurationElement conf) + throws Exception { this.id = id; constraintType = ExtensionUtil.loadClass(conf, "type"); String fcName = conf.getAttribute("factory"); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Cardinality.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Cardinality.java index 3ae44b3066..c827f7fc74 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Cardinality.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Cardinality.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.property; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; +import net.jcip.annotations.Immutable; /** * Specifies the cardinality for a property, default is for a property to occur @@ -42,8 +42,8 @@ public class Cardinality implements GroupPropertyConstraint, PropertyConstraint public static final Cardinality CC_EXACTLY_ONCE = new Cardinality(1, 1); /** - * Cardinality constraint for properties that occur once or not at all (zero - * to one) + * Cardinality constraint for properties that occur once or not at all (zero to + * one) */ public static final Cardinality CC_OPTIONAL = new Cardinality(0, 1); @@ -62,8 +62,8 @@ public class Cardinality implements GroupPropertyConstraint, PropertyConstraint /** * Get the cardinality constraint with the given occurrences * - * @param minOccurs the number of minimum occurrences of a property, may not - * be negative + * @param minOccurs the number of minimum occurrences of a property, may not be + * negative * @param maxOccurs the number of maximum occurrences of a property, * {@value #UNBOUNDED} for an infinite maximum occurrence * @return the cardinality constraint @@ -117,8 +117,8 @@ public Cardinality() { * NOTE: Instead of using the constructor to create new instances please use * {@link #get(long, long)} if possible. * - * @param minOccurs the number of minimum occurrences of a property, may not - * be negative + * @param minOccurs the number of minimum occurrences of a property, may not be + * negative * @param maxOccurs the number of maximum occurrences of a property, * {@value #UNBOUNDED} for an infinite maximum occurrence */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ChoiceFlag.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ChoiceFlag.java index 3973b9dc94..627183277b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ChoiceFlag.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ChoiceFlag.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.property; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if a property group is a choice, disabled by default diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/CodeListAssociation.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/CodeListAssociation.java index 616487526b..5042d5865d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/CodeListAssociation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/CodeListAssociation.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.property; +import eu.esdihumboldt.hale.common.schema.model.Constraint; +import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; -import eu.esdihumboldt.hale.common.schema.model.Constraint; -import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; - /** * Specifies code list associated to a property. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/NillableFlag.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/NillableFlag.java index e8daa735b2..d2e793217e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/NillableFlag.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/NillableFlag.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.property; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if a property is nillable, disabled by default @@ -51,8 +51,8 @@ public static NillableFlag get(boolean isNillable) { } /** - * Creates a default nillable flag, which is disabled. If possible, instead - * of creating an instance, use {@link #get(boolean)}, {@link #ENABLED} or + * Creates a default nillable flag, which is disabled. If possible, instead of + * creating an instance, use {@link #get(boolean)}, {@link #ENABLED} or * {@link #DISABLED}. * * @see Cardinality diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Reference.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Reference.java index 3e99c69484..488c11ff74 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Reference.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Reference.java @@ -16,15 +16,14 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.property; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.PrimaryKey; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; /** * Specifies that a property references another identifiers of other objects, @@ -120,8 +119,8 @@ public Object extractId(Object refValue) { } /** - * Converts the identifier of a referenced object to the reference value. - * The default implementation just returns the given identifier. + * Converts the identifier of a referenced object to the reference value. The + * default implementation just returns the given identifier. * * @param id the identifier * @return the reference value diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ReferenceLike.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ReferenceLike.java index 3883b6922e..40ede05bf9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ReferenceLike.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ReferenceLike.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.property; -import java.util.Collection; - import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collection; /** * Common interface for constraints representing references. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ReferenceProperty.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ReferenceProperty.java index f236b3a569..2c40f8071b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ReferenceProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/ReferenceProperty.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.property; +import eu.esdihumboldt.hale.common.schema.model.Constraint; +import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.schema.model.Constraint; -import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Specifies that a property represents a reference, where the actual reference * value is stored in a child. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Unique.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Unique.java index b4f9851478..7546643e88 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Unique.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/Unique.java @@ -48,8 +48,7 @@ public Unique(String identifier) { } /** - * Returns whether the unique constraint is enabled, the identifier is not - * null. + * Returns whether the unique constraint is enabled, the identifier is not null. * * @return whether the unique constraint is enabled */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/factory/CodeListAssocationFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/factory/CodeListAssocationFactory.java index a87572d2c5..a3bcbd6882 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/factory/CodeListAssocationFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/factory/CodeListAssocationFactory.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.property.factory; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.StreamSupport; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueList; import eu.esdihumboldt.hale.common.schema.model.Definition; @@ -28,6 +23,10 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.factory.TypeResolver; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; import eu.esdihumboldt.hale.common.schema.model.constraint.property.CodeListAssociation; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; /** * Converts a {@link CodeListAssociation} constraint to a {@link Value} and vice @@ -67,13 +66,13 @@ else if (refs.size() == 1) { @Override public CodeListAssociation restore(Value value, Definition definition, TypeResolver typeIndex, ClassResolver resolver) throws Exception { - + // is it a simple value? (single String code list reference) String single = value.as(String.class); if (single != null) { return new CodeListAssociation(Collections.singleton(single)); } - + // is it a value list? (multiple String code list references) ValueList list = value.as(ValueList.class); if (list != null) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/factory/ReferenceFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/factory/ReferenceFactory.java index 2d845ec23a..4ac53565a7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/factory/ReferenceFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/property/factory/ReferenceFactory.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.property.factory; -import java.text.MessageFormat; -import java.util.Optional; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueList; import eu.esdihumboldt.hale.common.core.io.ValueProperties; @@ -28,6 +25,8 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.factory.TypeResolver; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; +import java.text.MessageFormat; +import java.util.Optional; /** * Converts a {@link Reference} constraint to a {@link Value} and vice versa. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/AbstractFlag.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/AbstractFlag.java index 772e1dbaa1..fe31e7e178 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/AbstractFlag.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/AbstractFlag.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if a type is abstract, disabled by default @@ -51,8 +51,8 @@ public static AbstractFlag get(boolean isAbstract) { } /** - * Creates a default abstract flag, which is disabled. If possible, instead - * of creating an instance, use {@link #get(boolean)}, {@link #ENABLED} or + * Creates a default abstract flag, which is disabled. If possible, instead of + * creating an instance, use {@link #get(boolean)}, {@link #ENABLED} or * {@link #DISABLED}. * * @see Constraint diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/AugmentedValueFlag.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/AugmentedValueFlag.java index 0ae89d15cd..2943daf3b2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/AugmentedValueFlag.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/AugmentedValueFlag.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if an augmented value is present for a type, meaning a value that is @@ -60,8 +60,7 @@ public static AugmentedValueFlag get(boolean augmentedValue) { /** * Creates a default augmented value flag, which is disabled. If possible, - * instead of creating an instance, use {@link #ENABLED} or - * {@link #DISABLED}. + * instead of creating an instance, use {@link #ENABLED} or {@link #DISABLED}. * * @see Constraint */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/Binding.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/Binding.java index ba2edd373e..df1f1981bf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/Binding.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/Binding.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import java.util.HashMap; -import java.util.Map; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import java.util.HashMap; +import java.util.Map; import net.jcip.annotations.Immutable; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/ElementType.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/ElementType.java index 9c869d3dbc..2bc8d693de 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/ElementType.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/ElementType.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import java.util.HashMap; -import java.util.Map; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.HashMap; +import java.util.Map; +import net.jcip.annotations.Immutable; /** * Specifies a Java binding and optionally a {@link TypeDefinition} for a @@ -78,8 +77,8 @@ public static ElementType createFromType(TypeDefinition elementType) { private final Class binding; /** - * Creates a default element binding constraint with {@link Object} binding - * and no type definition. + * Creates a default element binding constraint with {@link Object} binding and + * no type definition. * * @see Constraint */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/Enumeration.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/Enumeration.java index 1dd27035b7..34c36232ab 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/Enumeration.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/Enumeration.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import java.util.Collection; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import java.util.Collection; +import net.jcip.annotations.Immutable; /** * Constraint that holds allowed values for a type @@ -38,8 +37,8 @@ public class Enumeration implements TypeConstraint { private final boolean allowOthers; /** - * Creates a default constraint where no restriction on the allowed values - * is present. + * Creates a default constraint where no restriction on the allowed values is + * present. */ public Enumeration() { super(); @@ -50,8 +49,8 @@ public Enumeration() { /** * Create a constraint that holds allowed values for a type * - * @param values the collection of allowed values, ownership of the - * collection is transferred to the constraint + * @param values the collection of allowed values, ownership of the collection + * is transferred to the constraint * @param allowOthers if other values are allowed */ public Enumeration(Collection values, boolean allowOthers) { @@ -61,8 +60,8 @@ public Enumeration(Collection values, boolean allowOthers) { } /** - * @return the collection of allowed values, null there is no - * such restriction + * @return the collection of allowed values, null there is no such + * restriction */ public Collection getValues() { return values; diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/GeometryMetadata.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/GeometryMetadata.java index a2b33f5882..35816ed093 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/GeometryMetadata.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/GeometryMetadata.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import javax.annotation.Nullable; /** * A constraint for the geometry metadata. @@ -34,8 +33,7 @@ public class GeometryMetadata implements TypeConstraint { public static final int UNKNOWN_DIMENSION = 0; /** - * The the WKT definition of the spatial reference system or - * null. + * The the WKT definition of the spatial reference system or null. */ private final String srsText; @@ -70,8 +68,7 @@ public GeometryMetadata() { * @param srs the spatial reference system code * @param dimension the dimension, or 0 if unknown * @param srsText the WKT definition of the spatial reference system - * @param auth_name the name of the authority defining the SRS code, e.g. - * EPSG + * @param auth_name the name of the authority defining the SRS code, e.g. EPSG */ public GeometryMetadata(@Nullable String srs, int dimension, @Nullable String srsText, @Nullable String auth_name) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/GeometryType.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/GeometryType.java index 0309d3453c..fde158941a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/GeometryType.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/GeometryType.java @@ -16,19 +16,16 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import eu.esdihumboldt.hale.common.schema.model.Constraint; +import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.util.Collection; import java.util.HashMap; import java.util.Map; - import net.jcip.annotations.Immutable; - import org.locationtech.jts.geom.Geometry; -import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; -import eu.esdihumboldt.hale.common.schema.model.Constraint; -import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Specifies the geometry type for properties with a {@link GeometryProperty} * binding. @@ -42,9 +39,9 @@ public class GeometryType implements TypeConstraint { /** * Geometry binding singletons, binding class mapped to the corresponding - * geometry type constraint. Defaults to the type binding as geometry - * binding if it is a {@link Geometry} binding or to {@link Geometry} if it - * is a {@link GeometryProperty} binding. + * geometry type constraint. Defaults to the type binding as geometry binding if + * it is a {@link Geometry} binding or to {@link Geometry} if it is a + * {@link GeometryProperty} binding. */ private static final Map, GeometryType> singletons = new HashMap, GeometryType>(); @@ -85,8 +82,8 @@ public GeometryType() { } /** - * Creates a geometry type constraint that determines the geometry binding - * from the given type definition. + * Creates a geometry type constraint that determines the geometry binding from + * the given type definition. * * @param type the type definition */ @@ -98,8 +95,8 @@ public GeometryType(TypeDefinition type) { * Creates a constraint with the given geometry binding * * @param binding the JTS geometry binding - * @param type the definition of the type the constraint is associated to, - * may be null + * @param type the definition of the type the constraint is associated to, may + * be null */ private GeometryType(Class binding, TypeDefinition type) { super(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/HasValueFlag.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/HasValueFlag.java index c0fcb4288d..9eb781e9d9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/HasValueFlag.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/HasValueFlag.java @@ -16,11 +16,11 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if a type has a direct value, apart from eventual properties, defined @@ -59,9 +59,8 @@ public static HasValueFlag get(boolean hasValue) { } /** - * Creates a default simple type flag, which is disabled. If possible, - * instead of creating an instance, use {@link #ENABLED} or - * {@link #DISABLED}. + * Creates a default simple type flag, which is disabled. If possible, instead + * of creating an instance, use {@link #ENABLED} or {@link #DISABLED}. * * @see Constraint */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/IgnoreOrderFlag.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/IgnoreOrderFlag.java index afa3da7869..04774eb979 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/IgnoreOrderFlag.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/IgnoreOrderFlag.java @@ -52,8 +52,8 @@ public static IgnoreOrderFlag get(boolean hasValue) { } /** - * Creates a default flag, which is disabled. If possible, instead of - * creating an instance, use {@link #ENABLED} or {@link #DISABLED}. + * Creates a default flag, which is disabled. If possible, instead of creating + * an instance, use {@link #ENABLED} or {@link #DISABLED}. * * @see Constraint */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/MappableFlag.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/MappableFlag.java index aa7634d385..f0e1dd4689 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/MappableFlag.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/MappableFlag.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if a type is mappable, i.e. that it is a valid source or target for a @@ -52,8 +52,8 @@ public static MappableFlag get(boolean isMappable) { } /** - * Creates a default mappable flag, which is disabled. If possible, instead - * of creating an instance, use {@link #get(boolean)}, {@link #ENABLED} or + * Creates a default mappable flag, which is disabled. If possible, instead of + * creating an instance, use {@link #get(boolean)}, {@link #ENABLED} or * {@link #DISABLED}. * * @see Constraint diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/MappingRelevantFlag.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/MappingRelevantFlag.java index 218c9fa8fa..6c9bd22e41 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/MappingRelevantFlag.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/MappingRelevantFlag.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if a type is mapping relevant, i.e. that it is a valid source or target @@ -53,8 +53,8 @@ public static MappingRelevantFlag get(boolean isMappable) { /** * Creates a default mapping relevant flag, which is disabled. If possible, - * instead of creating an instance, use {@link #get(boolean)}, - * {@link #ENABLED} or {@link #DISABLED}. + * instead of creating an instance, use {@link #get(boolean)}, {@link #ENABLED} + * or {@link #DISABLED}. * * @see Constraint */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/PrimaryKey.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/PrimaryKey.java index eb2f80e194..c54f37a83e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/PrimaryKey.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/PrimaryKey.java @@ -16,15 +16,13 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; +import eu.esdihumboldt.hale.common.schema.model.Constraint; +import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; import java.util.Collections; import java.util.List; - import javax.xml.namespace.QName; - import net.jcip.annotations.Immutable; -import eu.esdihumboldt.hale.common.schema.model.Constraint; -import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; -import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; /** * Specifies a type's primary key, which may be the target of {@link Reference} @@ -67,8 +65,8 @@ public boolean hasPrimaryKey() { } /** - * Returns the path to the primary key. This is null if and - * only if {@link #hasPrimaryKey()} returns false. + * Returns the path to the primary key. This is null if and only if + * {@link #hasPrimaryKey()} returns false. * * @return the path to the primary key, may be null */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/SkipValidation.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/SkipValidation.java index 4b78d49e31..a90be40640 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/SkipValidation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/SkipValidation.java @@ -15,10 +15,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Specifies if validation should be skipped for a property value. May be @@ -52,9 +52,9 @@ public static SkipValidation get(boolean skipValidation) { } /** - * Creates a default skip validation constraint, which is disabled. If - * possible, instead of creating an instance, use {@link #get(boolean)}, - * {@link #ENABLED} or {@link #DISABLED}. + * Creates a default skip validation constraint, which is disabled. If possible, + * instead of creating an instance, use {@link #get(boolean)}, {@link #ENABLED} + * or {@link #DISABLED}. */ public SkipValidation() { this(false); @@ -63,16 +63,16 @@ public SkipValidation() { /** * Creates a skip validation constraint * - * @param enabled if validation should be generally skipped for the - * associated property + * @param enabled if validation should be generally skipped for the associated + * property */ protected SkipValidation(boolean enabled) { super(enabled); } /** - * Determines if validation should be skipped for a property and its - * children for the given property value + * Determines if validation should be skipped for a property and its children + * for the given property value * * @param propertyValue the property value, may be an Instance * @return if validation should be skipped for the property and its children diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/ValidationConstraint.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/ValidationConstraint.java index ce87af4be6..a16e6733ee 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/ValidationConstraint.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/ValidationConstraint.java @@ -16,14 +16,13 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type; -import java.util.ArrayList; -import java.util.Collections; - import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.util.validator.AndValidator; import eu.esdihumboldt.util.validator.Validator; +import java.util.ArrayList; +import java.util.Collections; /** * Constraint holding information about validation rules specified by diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/ElementTypeFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/ElementTypeFactory.java index 1820193270..e72cadc47f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/ElementTypeFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/ElementTypeFactory.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type.factory; -import java.text.MessageFormat; -import java.util.Optional; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueProperties; import eu.esdihumboldt.hale.common.schema.model.Definition; @@ -27,6 +24,8 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.factory.TypeResolver; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; import eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType; +import java.text.MessageFormat; +import java.util.Optional; /** * Converts {@link ElementType} constraints to {@link Value}s and vice versa. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/EnumerationFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/EnumerationFactory.java index ea6736c635..def246cada 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/EnumerationFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/EnumerationFactory.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type.factory; -import java.util.ArrayList; -import java.util.Collection; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueList; import eu.esdihumboldt.hale.common.core.io.ValueProperties; @@ -27,6 +24,8 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.factory.TypeResolver; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; import eu.esdihumboldt.hale.common.schema.model.constraint.type.Enumeration; +import java.util.ArrayList; +import java.util.Collection; /** * Converts {@link Enumeration} constraints to {@link Value} objects and vice diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/GeometryTypeFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/GeometryTypeFactory.java index 0ddc6132e7..efc4799c7d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/GeometryTypeFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/GeometryTypeFactory.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type.factory; -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ClassResolver; @@ -24,6 +22,7 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.factory.TypeResolver; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType; +import org.locationtech.jts.geom.Geometry; /** * Converts a {@link GeometryType} constraint to a {@link Value} and vice versa. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/PrimaryKeyFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/PrimaryKeyFactory.java index 25940ba885..a02e1af920 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/PrimaryKeyFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/PrimaryKeyFactory.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.type.factory; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueList; import eu.esdihumboldt.hale.common.schema.model.Definition; @@ -28,6 +23,9 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.factory.TypeResolver; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; import eu.esdihumboldt.hale.common.schema.model.constraint.type.PrimaryKey; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; /** * Converts a {@link PrimaryKey} constraint to a {@link Value} or vice versa. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractChildDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractChildDefinition.java index 5eb646b446..37f5fc37f1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractChildDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractChildDefinition.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import javax.xml.namespace.QName; /** * Abstract child definition implementation @@ -30,8 +29,8 @@ * * @author Simon Templer */ -public abstract class AbstractChildDefinition extends AbstractDefinition implements - ChildDefinition { +public abstract class AbstractChildDefinition extends AbstractDefinition + implements ChildDefinition { /** * The parent group diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractDefinition.java index d0025482d1..2fd6fc5f32 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractDefinition.java @@ -16,19 +16,16 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - import com.google.common.collect.ImmutableList; - import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; import eu.esdihumboldt.hale.common.schema.model.constraint.ConstraintUtil; import eu.esdihumboldt.hale.common.schema.model.constraint.DisplayName; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import javax.xml.namespace.QName; /** * Basic definition implementation to be subclassed @@ -60,8 +57,8 @@ public abstract class AbstractDefinition implements Definition { private URI location; /** - * Creates a new definition with the given name. Description and location - * are not set. + * Creates a new definition with the given name. Description and location are + * not set. * * @param name the qualified definition name */ @@ -112,8 +109,8 @@ protected T getInheritedConstraint(Class constraintType) { } /** - * Determines if the constraint with the given type is set explicitly for - * the definition. + * Determines if the constraint with the given type is set explicitly for the + * definition. * * @param constraintType the constraint type * @return if the constraint is set explicitly @@ -139,15 +136,14 @@ public void setConstraint(C constraint) { } /** - * Set a constraint on the definition if none of the same type has been set - * yet. + * Set a constraint on the definition if none of the same type has been set yet. * * @param constraint the constraint to set */ @SuppressWarnings("unchecked") public void setConstraintIfNotSet(C constraint) { - if (!hasConstraint((Class) ConstraintUtil.getConstraintType(constraint - .getClass()))) { + if (!hasConstraint( + (Class) ConstraintUtil.getConstraintType(constraint.getClass()))) { setConstraint(constraint); } } @@ -237,8 +233,7 @@ public int hashCode() { } /** - * Two definitions are equal if their name is equal (namespace and local - * part) + * Two definitions are equal if their name is equal (namespace and local part) * * @see Object#equals(Object) */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractGroupPropertyDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractGroupPropertyDecorator.java index 8c5dc3e73e..89db572ecf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractGroupPropertyDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractGroupPropertyDecorator.java @@ -16,12 +16,6 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import java.net.URI; -import java.util.Collection; - -import javax.xml.namespace.QName; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.Definition; @@ -30,6 +24,10 @@ import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.net.URI; +import java.util.Collection; +import javax.xml.namespace.QName; +import net.jcip.annotations.Immutable; /** * Abstract decorator for {@link GroupPropertyDefinition}s diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractPropertyDecorator.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractPropertyDecorator.java index 34b6fcb084..4024ceb325 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractPropertyDecorator.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/AbstractPropertyDecorator.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import java.net.URI; - -import javax.xml.namespace.QName; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.Definition; @@ -30,6 +25,9 @@ import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.net.URI; +import javax.xml.namespace.QName; +import net.jcip.annotations.Immutable; /** * Abstract decorator for {@link PropertyDefinition}s diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultGroup.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultGroup.java index 4eb93fec62..5db0864939 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultGroup.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultGroup.java @@ -16,19 +16,17 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashMap; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; import eu.esdihumboldt.hale.common.schema.model.constraint.property.Cardinality; import eu.esdihumboldt.hale.common.schema.model.impl.internal.ConstraintOverrideGroupProperty; import eu.esdihumboldt.hale.common.schema.model.impl.internal.ConstraintOverrideProperty; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashMap; +import javax.xml.namespace.QName; /** * Default {@link DefinitionGroup} implementation used internally in @@ -105,8 +103,8 @@ private LinkedHashMap> flattenChildren() { if (flatten) { synchronized (this) { if (flattenedChildren == null) { - Collection> flat = flattenIfPossible(declaredChildren - .values()); + Collection> flat = flattenIfPossible( + declaredChildren.values()); flattenedChildren = new LinkedHashMap>(); for (ChildDefinition child : flat) { flattenedChildren.put(child.getName(), child); @@ -139,8 +137,8 @@ private Collection> flattenIfPossible( // replace group with children for (ChildDefinition groupChild : child.asGroup().getDeclaredChildren()) { - result.add(DefinitionUtil.redeclareChild(groupChild, child.asGroup() - .getDeclaringGroup())); + result.add(DefinitionUtil.redeclareChild(groupChild, + child.asGroup().getDeclaringGroup())); } } else if (child.asGroup().getDeclaredChildren().size() == 1) { // special @@ -151,8 +149,8 @@ else if (child.asGroup().getDeclaredChildren().size() == 1) { // special // one // child // check the cardinality of the group child - ChildDefinition groupChild = child.asGroup().getDeclaredChildren() - .iterator().next(); + ChildDefinition groupChild = child.asGroup().getDeclaredChildren().iterator() + .next(); Cardinality gcc = null; if (groupChild.asProperty() != null) { gcc = groupChild.asProperty().getConstraint(Cardinality.class); @@ -167,12 +165,12 @@ else if (groupChild.asGroup() != null) { // group // get group cardinality - Cardinality groupCardinality = child.asGroup().getConstraint( - Cardinality.class); + Cardinality groupCardinality = child.asGroup() + .getConstraint(Cardinality.class); // redeclare group child - ChildDefinition redeclaredChild = DefinitionUtil.redeclareChild( - groupChild, child.asGroup().getDeclaringGroup()); + ChildDefinition redeclaredChild = DefinitionUtil + .redeclareChild(groupChild, child.asGroup().getDeclaringGroup()); // set group cardinality on child if (redeclaredChild.asGroup() != null) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultGroupPropertyDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultGroupPropertyDefinition.java index ad06b1703e..fc08fcd24e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultGroupPropertyDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultGroupPropertyDefinition.java @@ -16,23 +16,21 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import java.util.Collection; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; +import java.util.Collection; +import javax.xml.namespace.QName; /** * Default {@link GroupPropertyDefinition} implementation * * @author Simon Templer */ -public class DefaultGroupPropertyDefinition extends - AbstractChildDefinition implements GroupPropertyDefinition { +public class DefaultGroupPropertyDefinition extends AbstractChildDefinition + implements GroupPropertyDefinition { private final DefinitionGroup children; diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultPropertyDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultPropertyDefinition.java index deff4276a6..2aa46a9106 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultPropertyDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultPropertyDefinition.java @@ -16,14 +16,13 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import javax.xml.namespace.QName; /** * Default {@link PropertyDefinition} implementation diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultSchema.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultSchema.java index eb360e76be..457c1fd437 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultSchema.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultSchema.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import java.net.URI; - import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; import eu.esdihumboldt.hale.common.schema.model.Schema; +import java.net.URI; /** * Default {@link Schema} implemenation diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultSchemaSpace.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultSchemaSpace.java index 8f86f1c21e..d502914528 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultSchemaSpace.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultSchemaSpace.java @@ -16,14 +16,6 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; @@ -31,6 +23,12 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import javax.xml.namespace.QName; /** * Default {@link SchemaSpace} implementation diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultTypeDefinition.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultTypeDefinition.java index d6ead6c0f1..0ea5ee5769 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultTypeDefinition.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultTypeDefinition.java @@ -16,6 +16,14 @@ package eu.esdihumboldt.hale.common.schema.model.impl; +import com.google.common.base.Function; +import com.google.common.collect.Collections2; +import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; +import eu.esdihumboldt.hale.common.schema.model.Definition; +import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; +import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; +import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -27,26 +35,15 @@ import java.util.Map.Entry; import java.util.SortedSet; import java.util.TreeSet; - import javax.xml.namespace.QName; -import com.google.common.base.Function; -import com.google.common.collect.Collections2; - -import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; -import eu.esdihumboldt.hale.common.schema.model.Definition; -import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; -import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; -import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Default {@link TypeDefinition} implementation. * * @author Simon Templer */ -public class DefaultTypeDefinition extends AbstractDefinition implements - TypeDefinition { +public class DefaultTypeDefinition extends AbstractDefinition + implements TypeDefinition { /** * The definition of the super type diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultTypeIndex.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultTypeIndex.java index dcdd5b67c7..19a2dd1a60 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultTypeIndex.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/DefaultTypeIndex.java @@ -16,22 +16,20 @@ package eu.esdihumboldt.hale.common.schema.model.impl; +import eu.esdihumboldt.hale.common.schema.model.Definition; +import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappableFlag; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.schema.model.Definition; -import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeIndex; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappableFlag; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; - /** * Default {@link TypeIndex} implementation * diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/PropertyTypeOverrideProperty.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/PropertyTypeOverrideProperty.java index bd72640151..7ec565562e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/PropertyTypeOverrideProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/PropertyTypeOverrideProperty.java @@ -33,7 +33,8 @@ public class PropertyTypeOverrideProperty extends AbstractPropertyDecorator { * @param property the original property * @param newPropertyType the replacement property type */ - public PropertyTypeOverrideProperty(PropertyDefinition property, TypeDefinition newPropertyType) { + public PropertyTypeOverrideProperty(PropertyDefinition property, + TypeDefinition newPropertyType) { super(property); this.newPropertyType = newPropertyType; } diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/ResourceSchemaSpace.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/ResourceSchemaSpace.java index 9123628cb4..a8dc4b7337 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/ResourceSchemaSpace.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/ResourceSchemaSpace.java @@ -15,15 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; @@ -31,6 +22,13 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import javax.xml.namespace.QName; /** * {@link SchemaSpace} implementation with resource Id. @@ -71,8 +69,8 @@ public ResourceSchemaSpace addSchema(String resourceId, Schema schema) { * * @param resourceId resource id of the schema. * - * @return returns the schema to which this map previously associated the - * key, or null if the map contained no mapping for the key. + * @return returns the schema to which this map previously associated the key, + * or null if the map contained no mapping for the key. */ public Schema removeSchema(String resourceId) { Schema removed = schemasMap.remove(resourceId); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ConstraintOverrideGroupProperty.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ConstraintOverrideGroupProperty.java index e92e18854c..3ead77506e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ConstraintOverrideGroupProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ConstraintOverrideGroupProperty.java @@ -16,16 +16,15 @@ package eu.esdihumboldt.hale.common.schema.model.impl.internal; -import java.util.HashMap; -import java.util.Map; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.ConstraintUtil; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractGroupPropertyDecorator; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractPropertyDecorator; +import java.util.HashMap; +import java.util.Map; +import net.jcip.annotations.Immutable; /** * Decorator for {@link GroupPropertyDefinition}s that overrides given @@ -39,8 +38,8 @@ public class ConstraintOverrideGroupProperty extends AbstractGroupPropertyDecora private final AbstractDefinition constraints; /** - * Create a decorator for the given group property where the given - * constraints override the constraints of the group. + * Create a decorator for the given group property where the given constraints + * override the constraints of the group. * * @param property the property to decorate * @param constraints the overriding constraints diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ConstraintOverrideProperty.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ConstraintOverrideProperty.java index 73adb253f4..17181309ae 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ConstraintOverrideProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ConstraintOverrideProperty.java @@ -16,15 +16,14 @@ package eu.esdihumboldt.hale.common.schema.model.impl.internal; -import java.util.HashMap; -import java.util.Map; - -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.ConstraintUtil; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractPropertyDecorator; +import java.util.HashMap; +import java.util.Map; +import net.jcip.annotations.Immutable; /** * Decorator for {@link PropertyDefinition}s that overrides given constraints. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/RedeclareGroupProperty.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/RedeclareGroupProperty.java index d07c378c98..d908d43205 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/RedeclareGroupProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/RedeclareGroupProperty.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.schema.model.impl.internal; -import net.jcip.annotations.Immutable; - import com.google.common.base.Preconditions; - import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractGroupPropertyDecorator; +import net.jcip.annotations.Immutable; /** * Decorator for {@link GroupPropertyDefinition}s that has a changed declaring @@ -36,12 +34,10 @@ public class RedeclareGroupProperty extends AbstractGroupPropertyDecorator { private final DefinitionGroup declaringGroup; /** - * Create a decorator for the given property that has a changed declaring - * group. + * Create a decorator for the given property that has a changed declaring group. * * @param propertyGroup the property group to decorate - * @param declaringGroup the new declaring group, may not be - * null + * @param declaringGroup the new declaring group, may not be null */ public RedeclareGroupProperty(GroupPropertyDefinition propertyGroup, DefinitionGroup declaringGroup) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/RedeclareProperty.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/RedeclareProperty.java index 09f4ebb69b..a6da0e1435 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/RedeclareProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/RedeclareProperty.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.schema.model.impl.internal; -import net.jcip.annotations.Immutable; - import com.google.common.base.Preconditions; - import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractPropertyDecorator; +import net.jcip.annotations.Immutable; /** * Decorator for {@link PropertyDefinition}s that has a changed parent type @@ -35,12 +33,10 @@ public class RedeclareProperty extends AbstractPropertyDecorator { private final DefinitionGroup declaringGroup; /** - * Create a decorator for the given property that has a changed declaring - * group. + * Create a decorator for the given property that has a changed declaring group. * * @param property the property to decorate - * @param declaringGroup the new declaring group, may not be - * null + * @param declaringGroup the new declaring group, may not be null */ public RedeclareProperty(PropertyDefinition property, DefinitionGroup declaringGroup) { super(property); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ReparentGroupProperty.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ReparentGroupProperty.java index c99ce3087e..4c88a8f916 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ReparentGroupProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ReparentGroupProperty.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.common.schema.model.impl.internal; -import net.jcip.annotations.Immutable; - import com.google.common.base.Preconditions; - import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractGroupPropertyDecorator; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractPropertyDecorator; +import net.jcip.annotations.Immutable; /** * Decorator for {@link GroupPropertyDefinition}s that has a changed parent type diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ReparentProperty.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ReparentProperty.java index 99247fe01a..738dc0c9ec 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ReparentProperty.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/internal/ReparentProperty.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.schema.model.impl.internal; -import net.jcip.annotations.Immutable; - import com.google.common.base.Preconditions; - import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractPropertyDecorator; +import net.jcip.annotations.Immutable; /** * Decorator for {@link PropertyDefinition}s that has a changed parent type diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/extension/ValidatorFactoryDescriptor.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/extension/ValidatorFactoryDescriptor.java index 970f06d112..39783d6abe 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/extension/ValidatorFactoryDescriptor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/extension/ValidatorFactoryDescriptor.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.schema.model.validate.factory.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.validate.factory.ValidatorFactory; +import org.eclipse.core.runtime.IConfigurationElement; /** * Descriptor for a {@link ValidatorFactory}. @@ -34,8 +33,8 @@ public class ValidatorFactoryDescriptor implements Identifiable { private final ValidatorFactory factory; /** - * Create a new {@link ValidatorFactory} descriptor based on the definition - * in the extension point. + * Create a new {@link ValidatorFactory} descriptor based on the definition in + * the extension point. * * @param id the descriptor identifier * @param conf the configuration element defining the descriptor diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/extension/ValidatorFactoryExtension.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/extension/ValidatorFactoryExtension.java index 5c40a63886..7c9db8c3ae 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/extension/ValidatorFactoryExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/extension/ValidatorFactoryExtension.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.validate.factory.extension; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; @@ -27,6 +22,9 @@ import eu.esdihumboldt.hale.common.schema.model.validate.factory.ValidatorFactory; import eu.esdihumboldt.util.Pair; import eu.esdihumboldt.util.validator.Validator; +import java.util.HashMap; +import java.util.Map; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension point for {@link ValidatorFactory}ies. @@ -72,8 +70,8 @@ public static Validator fromValue(Value value, String validatorId) throws Except * Create a {@link Value} representation of a {@link Validator}. * * @param validator the validator - * @return a pair of the validator ID and the validator's value - * representation, or null + * @return a pair of the validator ID and the validator's value representation, + * or null * @throws Exception if creating the value representation fails */ @SuppressWarnings("unchecked") @@ -145,8 +143,7 @@ public ValidatorFactoryDescriptor getForValidator(Validator validator) { } /** - * Get the validator descriptor directly associated to the given validator - * type. + * Get the validator descriptor directly associated to the given validator type. * * @param validatorType the constraint type * @return the descriptor or null if none is registered for the diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/AbstractCombinedValidatorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/AbstractCombinedValidatorFactory.java index c153964e20..97266699f4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/AbstractCombinedValidatorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/AbstractCombinedValidatorFactory.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.common.schema.model.validate.factory.impl; -import java.util.ArrayList; -import java.util.List; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueList; import eu.esdihumboldt.hale.common.schema.model.validate.factory.ValidatorFactory; import eu.esdihumboldt.hale.common.schema.model.validate.factory.ValidatorValue; import eu.esdihumboldt.util.validator.CombinedValidator; import eu.esdihumboldt.util.validator.Validator; +import java.util.ArrayList; +import java.util.List; /** * Base class for {@link Value} factories for {@link CombinedValidator}s. @@ -31,8 +30,8 @@ * @author Simon Templer * @param the concrete combined validator type */ -public abstract class AbstractCombinedValidatorFactory implements - ValidatorFactory { +public abstract class AbstractCombinedValidatorFactory + implements ValidatorFactory { @Override public Value store(T validator) throws Exception { diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/AndValidatorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/AndValidatorFactory.java index 384c7eb52e..a943d98e69 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/AndValidatorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/AndValidatorFactory.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.schema.model.validate.factory.impl; -import java.util.List; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.util.validator.AndValidator; import eu.esdihumboldt.util.validator.CombinedValidator; import eu.esdihumboldt.util.validator.Validator; +import java.util.List; /** * Converts {@link AndValidator}s to {@link Value}s and vice versa. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/EnumerationValidatorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/EnumerationValidatorFactory.java index 863fb3a7b5..6df31c3cc9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/EnumerationValidatorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/EnumerationValidatorFactory.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.common.schema.model.validate.factory.impl; -import java.util.ArrayList; -import java.util.List; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueList; import eu.esdihumboldt.hale.common.schema.model.validate.factory.ValidatorFactory; import eu.esdihumboldt.util.validator.EnumerationValidator; import eu.esdihumboldt.util.validator.Validator; +import java.util.ArrayList; +import java.util.List; /** * Converts {@link EnumerationValidator}s to {@link Value}s and vice versa. @@ -53,7 +52,8 @@ public Validator restore(Value value) throws Exception { values.add(str); } else { - throw new IllegalStateException("Enumeration value for validator could not be read"); + throw new IllegalStateException( + "Enumeration value for validator could not be read"); } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/NumberValidatorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/NumberValidatorFactory.java index aa021d6edb..ae8fc313f4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/NumberValidatorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/NumberValidatorFactory.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.common.schema.model.validate.factory.impl; -import java.math.BigDecimal; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueProperties; import eu.esdihumboldt.hale.common.schema.model.validate.factory.ValidatorFactory; import eu.esdihumboldt.util.validator.NumberValidator; import eu.esdihumboldt.util.validator.NumberValidator.Type; import eu.esdihumboldt.util.validator.Validator; +import java.math.BigDecimal; /** * Converts {@link NumberValidator}s to {@link Value}s and vice versa. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/OrValidatorFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/OrValidatorFactory.java index 450e9891a3..00b45aa159 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/OrValidatorFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/impl/OrValidatorFactory.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.schema.model.validate.factory.impl; -import java.util.List; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.util.validator.CombinedValidator; import eu.esdihumboldt.util.validator.OrValidator; import eu.esdihumboldt.util.validator.Validator; +import java.util.List; /** * Converts {@link OrValidator}s to {@link Value}s and vice versa. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/internal/ValidatorValueType.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/internal/ValidatorValueType.groovy index 36b652ae69..d075d563b0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/internal/ValidatorValueType.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/validate/factory/internal/ValidatorValueType.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.validate.factory.internal; -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.core.io.ComplexValueType import eu.esdihumboldt.hale.common.core.io.DOMValueUtil import eu.esdihumboldt.hale.common.core.io.HaleIO @@ -27,6 +25,7 @@ import eu.esdihumboldt.hale.common.schema.model.validate.factory.ValidatorValue import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import org.w3c.dom.Element /** * Complex value descriptor for {@link ValidatorValue}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/paths/DefinitionResolver.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/paths/DefinitionResolver.java index c7d32b4a7a..f5a9d6ed7f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/paths/DefinitionResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/paths/DefinitionResolver.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.common.schema.paths; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; @@ -30,6 +25,9 @@ import eu.esdihumboldt.hale.common.schema.paths.internal.CachedResolver; import eu.esdihumboldt.util.groovy.paths.Path; import eu.esdihumboldt.util.groovy.paths.PathImpl; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; /** * Resolves property names on {@link DefinitionGroup}s. @@ -39,21 +37,21 @@ public class DefinitionResolver { /** - * Find all possible property paths for the given property name, also - * descending into sub-groups. The results will be cached in a special - * definition constraint. + * Find all possible property paths for the given property name, also descending + * into sub-groups. The results will be cached in a special definition + * constraint. * * @param parent the type or group in which to look for the property * @param name the property local name - * @param namespace the property namespace or null if the - * namespace should be ignored + * @param namespace the property namespace or null if the namespace + * should be ignored * @return the list of found definition paths */ public static List>> findPropertyCached(DefinitionGroup parent, String name, String namespace) { if (parent instanceof TypeDefinition) { - return ((TypeDefinition) parent).getConstraint(CachedResolver.class).getResolvedPaths( - name, namespace); + return ((TypeDefinition) parent).getConstraint(CachedResolver.class) + .getResolvedPaths(name, namespace); } else if (parent instanceof GroupPropertyDefinition) { return ((GroupPropertyDefinition) parent).getConstraint(CachedResolver.class) @@ -65,16 +63,16 @@ else if (parent instanceof GroupPropertyDefinition) { } /** - * Find all possible property paths for the given property name, also - * descending into sub-groups. Does a complete calculation based on the - * definition structure. + * Find all possible property paths for the given property name, also descending + * into sub-groups. Does a complete calculation based on the definition + * structure. * * @see #findPropertyCached(DefinitionGroup, String, String) * * @param parent the type or group in which to look for the property * @param name the property local name - * @param namespace the property namespace or null if the - * namespace should be ignored + * @param namespace the property namespace or null if the namespace + * should be ignored * @return the list of found definition paths */ public static List>> findProperty(DefinitionGroup parent, String name, @@ -83,21 +81,20 @@ public static List>> findProperty(DefinitionGroup parent, Str } /** - * Find all possible property paths for the given property name, also - * descending into sub-groups. + * Find all possible property paths for the given property name, also descending + * into sub-groups. * * Used for the internal computation. In most cases * {@link #findProperty(DefinitionGroup, String, String)} or - * {@link #findPropertyCached(DefinitionGroup, String, String)} should be - * called instead. + * {@link #findPropertyCached(DefinitionGroup, String, String)} should be called + * instead. * * @param parent the type or group in which to look for the property * @param name the property local name - * @param namespace the property namespace or null if the - * namespace should be ignored + * @param namespace the property namespace or null if the namespace + * should be ignored * @param basePath the definition base path - * @param useCachedResolver if for sub-groups a cached resolver should be - * used + * @param useCachedResolver if for sub-groups a cached resolver should be used * @return the list of found definition paths */ public static List>> findProperty(DefinitionGroup parent, String name, @@ -116,8 +113,7 @@ else if (child.asGroup() != null) { Path> groupPath = basePath.subPath(group); /* - * If the name is a match, we take the reference to the group as - * result as well. + * If the name is a match, we take the reference to the group as result as well. */ if (accept(group.getName(), name, namespace)) { results.add(groupPath); @@ -147,8 +143,8 @@ else if (child.asGroup() != null) { * * @param name the qualified name * @param localName the local name - * @param namespace the namespace, may be null if any namespace - * is acceptable + * @param namespace the namespace, may be null if any namespace is + * acceptable * @return if the name is accepted */ private static boolean accept(QName name, String localName, String namespace) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/paths/internal/CachedResolver.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/paths/internal/CachedResolver.java index c6ec049f5f..317a49b6be 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/paths/internal/CachedResolver.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/paths/internal/CachedResolver.java @@ -15,13 +15,8 @@ package eu.esdihumboldt.hale.common.schema.paths.internal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; - import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; @@ -33,6 +28,9 @@ import eu.esdihumboldt.util.Pair; import eu.esdihumboldt.util.groovy.paths.Path; import eu.esdihumboldt.util.groovy.paths.PathImpl; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * Constraint that caches paths found by the {@link DefinitionResolver}. @@ -54,8 +52,8 @@ public class CachedResolver implements TypeConstraint, GroupPropertyConstraint { public CachedResolver(Definition def) { super(); - Preconditions.checkArgument(def instanceof TypeDefinition - || def instanceof GroupPropertyDefinition); + Preconditions.checkArgument( + def instanceof TypeDefinition || def instanceof GroupPropertyDefinition); this.def = def; } @@ -64,8 +62,8 @@ public CachedResolver(Definition def) { * Get the resolved paths for the given property name and namespace. * * @param name the property name - * @param namespace the property namespace or null if the - * namespace should be ignored + * @param namespace the property namespace or null if the namespace + * should be ignored * @return the resolved paths */ public List>> getResolvedPaths(String name, String namespace) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/helper/DefinitionResolverTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/helper/DefinitionResolverTest.groovy index 2126a4f349..f1b848abc3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/helper/DefinitionResolverTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/helper/DefinitionResolverTest.groovy @@ -15,6 +15,8 @@ package eu.esdihumboldt.hale.common.schema.helper +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Definition import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition @@ -26,8 +28,6 @@ import groovy.transform.TypeCheckingMode import org.junit.Before import org.junit.Test -import static org.junit.Assert.* - /** * Definition resolver tests. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/AbstractValueConstraintFactoryTest.java b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/AbstractValueConstraintFactoryTest.java index 30bcef1844..0ff7d92cb3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/AbstractValueConstraintFactoryTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/AbstractValueConstraintFactoryTest.java @@ -15,16 +15,8 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; - import eu.esdihumboldt.hale.common.core.io.DOMValueUtil; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.schema.model.Definition; @@ -40,6 +32,10 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; import eu.esdihumboldt.hale.common.test.TestUtil; import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder; +import java.util.HashMap; +import java.util.Map; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; /** * Base class for {@link ValueConstraintFactory} tests. @@ -54,12 +50,12 @@ public abstract class AbstractValueConstraintFactoryTest { private static final QName DEF_NAME = new QName("test"); /** - * Test storing a constraint, restoring it and compare both using an empty - * type index and a default constraint definition. + * Test storing a constraint, restoring it and compare both using an empty type + * index and a default constraint definition. * * @param constraint the constraint to store - * @throws Exception if an error occurs during storing, restoring or - * comparing the constraint + * @throws Exception if an error occurs during storing, restoring or comparing + * the constraint */ protected void storeRestoreTest(T constraint) throws Exception { storeRestoreTest(constraint, null, null); @@ -72,11 +68,11 @@ protected void storeRestoreTest(T constraint) throws Exception { * @param typeIndex the type index (as context for storing/restoring), * null for an empty index * @param constraintDef the definition the constraint is associated to (as - * context for storing/restoring), for null the - * method will try to generate a default definition based on the - * constraint type - * @throws Exception if an error occurs during storing, restoring or - * comparing the constraint + * context for storing/restoring), for null the method + * will try to generate a default definition based on the constraint + * type + * @throws Exception if an error occurs during storing, restoring or comparing + * the constraint */ @SuppressWarnings("unchecked") protected void storeRestoreTest(T constraint, Map typeIndex, @@ -123,9 +119,9 @@ protected void storeRestoreTest(T constraint, Map typeInd } /** - * Create a default definition where the given constraint type is - * applicable. This is decided on whether the constraint implements certain - * (marker) interfaces. + * Create a default definition where the given constraint type is applicable. + * This is decided on whether the constraint implements certain (marker) + * interfaces. * * @param constraintType the constraint type * @return the default definition diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/DisplayNameFactoryTest.java b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/DisplayNameFactoryTest.java index d0fa26ba57..b88d1dd4f0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/DisplayNameFactoryTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/DisplayNameFactoryTest.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory; +import eu.esdihumboldt.hale.common.schema.model.constraint.DisplayName; import java.util.Collections; import java.util.List; - -import eu.esdihumboldt.hale.common.schema.model.constraint.DisplayName; import org.junit.Test; /** @@ -26,8 +25,8 @@ * * @author Simon Templer */ -public class DisplayNameFactoryTest extends - AbstractPropertiesCompareConstraintFactoryTest { +public class DisplayNameFactoryTest + extends AbstractPropertiesCompareConstraintFactoryTest { /** * Test with a custom name. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/property/ReferenceFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/property/ReferenceFactoryTest.groovy index f287ab27fb..8e3f4877c1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/property/ReferenceFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/property/ReferenceFactoryTest.groovy @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory.property -import org.junit.Test - -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.common.schema.model.constraint.factory.AbstractPropertiesCompareConstraintFactoryTest import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition +import javax.xml.namespace.QName +import org.junit.Test /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/AugmentedValueFlagFactoryTest.java b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/AugmentedValueFlagFactoryTest.java index 9996e6d5b1..1709e2cb8d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/AugmentedValueFlagFactoryTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/AugmentedValueFlagFactoryTest.java @@ -24,8 +24,8 @@ * * @author Simon Templer */ -public class AugmentedValueFlagFactoryTest extends - AbstractFlagConstraintFactoryTest { +public class AugmentedValueFlagFactoryTest + extends AbstractFlagConstraintFactoryTest { /** * Default constructor. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/ElementTypeFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/ElementTypeFactoryTest.groovy index e4f763f457..e94d2dc890 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/ElementTypeFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/ElementTypeFactoryTest.groovy @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory.type -import org.junit.Test - -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.common.schema.model.constraint.factory.AbstractPropertiesCompareConstraintFactoryTest import eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition +import javax.xml.namespace.QName +import org.junit.Test /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/MappingRelevantFlagFactoryTest.java b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/MappingRelevantFlagFactoryTest.java index e0b2ea86b9..379ff97be3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/MappingRelevantFlagFactoryTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/MappingRelevantFlagFactoryTest.java @@ -23,8 +23,8 @@ * * @author Simon Templer */ -public class MappingRelevantFlagFactoryTest extends - AbstractFlagConstraintFactoryTest { +public class MappingRelevantFlagFactoryTest + extends AbstractFlagConstraintFactoryTest { /** * Default constructor. diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/PrimaryKeyFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/PrimaryKeyFactoryTest.groovy index 2576c2aa33..385dc9b7ab 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/PrimaryKeyFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/PrimaryKeyFactoryTest.groovy @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory.type -import org.junit.Test - -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.schema.model.constraint.factory.AbstractPropertiesCompareConstraintFactoryTest import eu.esdihumboldt.hale.common.schema.model.constraint.type.PrimaryKey +import javax.xml.namespace.QName +import org.junit.Test /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/ValidationConstraintFactoryTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/ValidationConstraintFactoryTest.groovy index 72e8a71a04..2089bbccd5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/ValidationConstraintFactoryTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/test/eu/esdihumboldt/hale/common/schema/model/constraint/factory/type/ValidationConstraintFactoryTest.groovy @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.schema.model.constraint.factory.type -import org.junit.Test - -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.common.schema.model.constraint.factory.AbstractValueConstraintFactoryTest import eu.esdihumboldt.hale.common.schema.model.constraint.type.ValidationConstraint @@ -32,6 +28,8 @@ import eu.esdihumboldt.util.validator.NumberValidator import eu.esdihumboldt.util.validator.OrValidator import eu.esdihumboldt.util.validator.PatternValidator import eu.esdihumboldt.util.validator.Validator +import javax.xml.namespace.QName +import org.junit.Test /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/Script.java b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/Script.java index ce93634374..e080ffe4da 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/Script.java +++ b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/Script.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.scripting; -import javax.script.ScriptException; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import javax.script.ScriptException; /** * Interface for the scripting extension. @@ -49,15 +48,14 @@ public Object evaluate(String script, Iterable variables, * @param script the script to validate * @param variables the variables to use * @param provider the service provider - * @return null if the script validates, an error message - * otherwise + * @return null if the script validates, an error message otherwise */ public String validate(String script, Iterable variables, ServiceProvider provider); /** - * Returns the string representation of the given entity definition this - * script is using. + * Returns the string representation of the given entity definition this script + * is using. * * @param entityDefinition the entity definition * @return the string representation of the entity definition @@ -72,13 +70,13 @@ public String validate(String script, Iterable variables, public String getId(); /** - * States if transformation variables should be replaced in the script - * string, before it is passed to evaluation. + * States if transformation variables should be replaced in the script string, + * before it is passed to evaluation. * - * @return true if the script expects transformation variables - * to be already replaced when evaluating it, false if - * transformation variables are handled by the script or not - * supported at all + * @return true if the script expects transformation variables to + * be already replaced when evaluating it, false if + * transformation variables are handled by the script or not supported + * at all */ default boolean requiresReplacedTransformationVariables() { return false; diff --git a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/ScriptExtension.java b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/ScriptExtension.java index d589b2bf83..fec0f2903d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/ScriptExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/ScriptExtension.java @@ -16,13 +16,11 @@ package eu.esdihumboldt.hale.common.scripting; +import de.fhg.igd.eclipse.util.extension.AbstractExtension; import java.util.ArrayList; import java.util.Collection; - import org.eclipse.core.runtime.IConfigurationElement; -import de.fhg.igd.eclipse.util.extension.AbstractExtension; - /** * Extension for {@link Script}s. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/ScriptFactory.java b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/ScriptFactory.java index 7f1eeb7635..02ab519324 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/ScriptFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/ScriptFactory.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.common.scripting; +import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; +import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import java.util.ArrayList; import java.util.Collection; - import org.eclipse.core.runtime.IConfigurationElement; -import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; -import de.fhg.igd.eclipse.util.extension.ExtensionUtil; - /** * Factory for {@link Script}s. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/scripts/groovy/GroovyScript.java b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/scripts/groovy/GroovyScript.java index dbff284e92..722862ad80 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/scripts/groovy/GroovyScript.java +++ b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/scripts/groovy/GroovyScript.java @@ -15,14 +15,9 @@ package eu.esdihumboldt.hale.common.scripting.scripts.groovy; -import javax.script.ScriptException; - -import org.springframework.core.convert.ConversionException; - import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.collect.Lists; - import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -34,6 +29,8 @@ import groovy.lang.Binding; import groovy.lang.GroovyShell; import groovy.lang.MissingPropertyException; +import javax.script.ScriptException; +import org.springframework.core.convert.ConversionException; /** * Groovy script implementation. @@ -84,13 +81,13 @@ public Object process(groovy.lang.Script script, Object returnValue) * * FIXME why is here an additional implementation of this as already used in * GroovyTransformation? Could the implementation in GroovyTransformation be - * used instead? FIXME It could (should?) only be the other way around - * (because of dependencies); or it should be at another "common"-place + * used instead? FIXME It could (should?) only be the other way around (because + * of dependencies); or it should be at another "common"-place * * @param variables the variables * @param useNullForMissingBindings if the binding should provide - * null values for variables that are not provided - * in the given variable list + * null values for variables that are not provided in + * the given variable list * @return the binding for use with {@link GroovyShell} */ private Binding createGroovyBinding(Iterable variables, @@ -153,18 +150,17 @@ public Object getVariable(String name) { */ @Override public String getVariableName(PropertyEntityDefinition entityDefinition) { - return Joiner.on('_').join( - Lists.transform(entityDefinition.getPropertyPath(), - new Function() { - - /** - * @see com.google.common.base.Function#apply(java.lang.Object) - */ - @Override - public String apply(ChildContext input) { - return input.getChild().getName().getLocalPart(); - } - })); + return Joiner.on('_').join(Lists.transform(entityDefinition.getPropertyPath(), + new Function() { + + /** + * @see com.google.common.base.Function#apply(java.lang.Object) + */ + @Override + public String apply(ChildContext input) { + return input.getChild().getName().getLocalPart(); + } + })); } /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/scripts/mathematical/MathScript.java b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/scripts/mathematical/MathScript.java index 6ea47caffd..ae3dcdc7bb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/scripts/mathematical/MathScript.java +++ b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/scripts/mathematical/MathScript.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.scripting.scripts.mathematical; -import javax.script.ScriptException; - -import org.springframework.core.convert.ConversionException; - import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.collect.Lists; @@ -26,12 +22,13 @@ import com.iabcinc.jmep.Expression; import com.iabcinc.jmep.XExpression; import com.iabcinc.jmep.hooks.Constant; - import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.common.scripting.Script; +import javax.script.ScriptException; +import org.springframework.core.convert.ConversionException; /** * Mathematical formula script implementation. diff --git a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/transformation/AbstractScriptedPropertyTransformation.java b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/transformation/AbstractScriptedPropertyTransformation.java index 167d074495..9bca614b9c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/transformation/AbstractScriptedPropertyTransformation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/transformation/AbstractScriptedPropertyTransformation.java @@ -15,15 +15,9 @@ package eu.esdihumboldt.hale.common.scripting.transformation; -import java.text.MessageFormat; -import java.util.Map; - -import javax.script.ScriptException; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -36,6 +30,9 @@ import eu.esdihumboldt.hale.common.scripting.Script; import eu.esdihumboldt.hale.common.scripting.ScriptExtension; import eu.esdihumboldt.hale.common.scripting.ScriptFactory; +import java.text.MessageFormat; +import java.util.Map; +import javax.script.ScriptException; /** * Base class for {@link PropertyTransformation} that supports evaluating @@ -54,7 +51,7 @@ protected final ListMultimap evaluate(String transformationIdent ListMultimap variables, ListMultimap resultNames, Map executionParameters, TransformationLog log) - throws TransformationException { + throws TransformationException { ListMultimap originalParameters = getParameters(); ListMultimap transformedParameters = ArrayListMultimap.create(); @@ -108,8 +105,8 @@ protected final ListMultimap evaluate(String transformationIdent } /** - * Execute the evaluation function as configured. The transformed parameters - * are available in here. + * Execute the evaluation function as configured. The transformed parameters are + * available in here. * * @param transformationIdentifier the transformation function identifier * @param engine the transformation engine that may be used for the function @@ -117,8 +114,8 @@ protected final ListMultimap evaluate(String transformationIdent * @param variables the input variables * @param resultNames the expected results (names associated with the * corresponding entity definitions) - * @param executionParameters additional parameters for the execution, may - * be null + * @param executionParameters additional parameters for the execution, may be + * null * @param log the transformation log to report any information about the * execution of the transformation to * @return the evaluation result @@ -129,7 +126,7 @@ protected abstract ListMultimap evaluateImpl(String transformati E engine, ListMultimap variables, ListMultimap resultNames, Map executionParameters, TransformationLog log) - throws TransformationException; + throws TransformationException; /** * Returns the transformed parameters. @@ -142,13 +139,12 @@ protected ListMultimap getTransformedParameters() { /** * Get the first evaluated parameter defined with the given parameter name. - * Throws a {@link TransformationException} if such a parameter doesn't - * exist. + * Throws a {@link TransformationException} if such a parameter doesn't exist. * * @param parameterName the parameter name * @return the parameter value - * @throws TransformationException if a parameter with the given name - * doesn't exist + * @throws TransformationException if a parameter with the given name doesn't + * exist */ protected Value getTransformedParameterChecked(String parameterName) throws TransformationException { @@ -162,8 +158,8 @@ protected Value getTransformedParameterChecked(String parameterName) } /** - * Get the first evaluated parameter defined with the given parameter name. - * If no such parameter exists, the given default value is returned. + * Get the first evaluated parameter defined with the given parameter name. If + * no such parameter exists, the given default value is returned. * * @param parameterName the parameter name * @param defaultValue the default value for the parameter diff --git a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/transformation/AbstractSingleTargetScriptedPropertyTransformation.java b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/transformation/AbstractSingleTargetScriptedPropertyTransformation.java index 52db3d0c12..02b05879de 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/transformation/AbstractSingleTargetScriptedPropertyTransformation.java +++ b/common/plugins/eu.esdihumboldt.hale.common.scripting/src/eu/esdihumboldt/hale/common/scripting/transformation/AbstractSingleTargetScriptedPropertyTransformation.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.common.scripting.transformation; -import java.util.Map; -import java.util.Map.Entry; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationException; import eu.esdihumboldt.hale.common.align.transformation.function.impl.NoResultException; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; +import java.util.Map; +import java.util.Map.Entry; /** * Abstract property transformation implementation for functions with a single @@ -43,7 +41,7 @@ protected ListMultimap evaluateImpl(String transformationIdentif ListMultimap variables, ListMultimap resultNames, Map executionParameters, TransformationLog log) - throws TransformationException { + throws TransformationException { assert resultNames.size() == 1; Entry entry = resultNames.entries().iterator().next(); ListMultimap resultMap = ArrayListMultimap.create(1, 1); @@ -68,8 +66,8 @@ protected ListMultimap evaluateImpl(String transformationIdentif * @param resultName the name of the result * @param resultProperty the property entity definition associated with the * result - * @param executionParameters additional parameters for the execution, may - * be null + * @param executionParameters additional parameters for the execution, may be + * null * @param log the transformation log to report any information about the * execution of the transformation to * @return the evaluation result diff --git a/common/plugins/eu.esdihumboldt.hale.common.service.helper/src/eu/esdihumboldt/hale/common/service/helper/population/EntityPopulationCount.java b/common/plugins/eu.esdihumboldt.hale.common.service.helper/src/eu/esdihumboldt/hale/common/service/helper/population/EntityPopulationCount.java index 6e05f3f117..d3955b814d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.service.helper/src/eu/esdihumboldt/hale/common/service/helper/population/EntityPopulationCount.java +++ b/common/plugins/eu.esdihumboldt.hale.common.service.helper/src/eu/esdihumboldt/hale/common/service/helper/population/EntityPopulationCount.java @@ -1,13 +1,12 @@ package eu.esdihumboldt.hale.common.service.helper.population; -import java.util.ArrayList; -import java.util.List; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.hale.common.instance.model.Instance; +import java.util.ArrayList; +import java.util.List; /** * Helper class for Population Service diff --git a/common/plugins/eu.esdihumboldt.hale.common.service.helper/src/eu/esdihumboldt/hale/common/service/helper/population/IPopulationUpdater.java b/common/plugins/eu.esdihumboldt.hale.common.service.helper/src/eu/esdihumboldt/hale/common/service/helper/population/IPopulationUpdater.java index 5e8eca1731..125d6dbe80 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.service.helper/src/eu/esdihumboldt/hale/common/service/helper/population/IPopulationUpdater.java +++ b/common/plugins/eu.esdihumboldt.hale.common.service.helper/src/eu/esdihumboldt/hale/common/service/helper/population/IPopulationUpdater.java @@ -1,12 +1,11 @@ package eu.esdihumboldt.hale.common.service.helper.population; - -import java.util.Collection; - import eu.esdihumboldt.hale.common.align.model.EntityDefinition; +import java.util.Collection; /** * Notifier for Population count helper class + * * @author Arun * */ @@ -14,6 +13,7 @@ public interface IPopulationUpdater { /** * Increase count for given entity + * * @param def A {@link EntityDefinition} * @param count counts for given EntityDefinition */ @@ -21,9 +21,10 @@ public interface IPopulationUpdater { /** * Get children of entity definition + * * @param entityDef A {@link EntityDefinition} * @return All the children including contexts. */ public Collection getChildren(EntityDefinition entityDef); - + } diff --git a/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/PopulationCountTest.groovy b/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/PopulationCountTest.groovy index c9fab8cd17..acfcc96fcf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/PopulationCountTest.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/PopulationCountTest.groovy @@ -1,5 +1,7 @@ package eu.esdihumboldt.hale.common.service.helper.test +import static org.junit.Assert.* + import eu.esdihumboldt.hale.common.align.model.EntityDefinition import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition @@ -17,8 +19,6 @@ import eu.esdihumboldt.hale.common.service.helper.test.dummy.PopulationContainer import eu.esdihumboldt.util.test.AbstractPlatformTest import org.junit.Test -import static org.junit.Assert.* - /** * Test for Entity Population Count * @author Arun @@ -315,4 +315,3 @@ class PopulationCountTest extends AbstractPlatformTest { assertEquals parentCount, pop.getParentsCount(); } } - diff --git a/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/Population.java b/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/Population.java index 5c99b0301a..f764420ad2 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/Population.java +++ b/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/Population.java @@ -35,12 +35,12 @@ public interface Population { public int getOverallCount(); /** - * Get how many of the parents of the property actually have at least one - * value for this property. For instances the overall count is returned as - * they have no parents. + * Get how many of the parents of the property actually have at least one value + * for this property. For instances the overall count is returned as they have + * no parents. * - * @return the count of parents that have such a property value, or the - * overall count if the population is associated to an instance + * @return the count of parents that have such a property value, or the overall + * count if the population is associated to an instance */ public int getParentsCount(); diff --git a/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/PopulationContainer.java b/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/PopulationContainer.java index ca419b5d14..769444f375 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/PopulationContainer.java +++ b/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/PopulationContainer.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.common.service.helper.test.dummy; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.EntityDefinition; @@ -33,6 +26,12 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.service.helper.population.EntityPopulationCount; import eu.esdihumboldt.hale.common.service.helper.population.IPopulationUpdater; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * Contains the populations of {@link EntityDefinition}s diff --git a/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/PopulationImpl.java b/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/PopulationImpl.java index 7714bbad85..330633d52e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/PopulationImpl.java +++ b/common/plugins/eu.esdihumboldt.hale.common.service.helper/test/eu/esdihumboldt/hale/common/service/helper/test/dummy/PopulationImpl.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.service.helper.test.dummy; - /** * Default implementation instance/property {@link Population} * diff --git a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/StyleReader.java b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/StyleReader.java index f45e438e0f..51ad47264f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/StyleReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/StyleReader.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.style.io; -import org.geotools.styling.Style; - import eu.esdihumboldt.hale.common.core.io.ImportProvider; +import org.geotools.styling.Style; /** * Provides support for reading styles. diff --git a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/StyleWriter.java b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/StyleWriter.java index 4836384c50..c8dfc50cf5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/StyleWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/StyleWriter.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.common.style.io; -import org.geotools.styling.Style; - import eu.esdihumboldt.hale.common.core.io.ExportProvider; +import org.geotools.styling.Style; /** * Provides support for writing styles. diff --git a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/AbstractStyleWriter.java b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/AbstractStyleWriter.java index 063a301702..4dfccfbd8c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/AbstractStyleWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/AbstractStyleWriter.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.style.io.impl; -import org.geotools.styling.Style; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.impl.AbstractExportProvider; import eu.esdihumboldt.hale.common.style.io.StyleWriter; +import org.geotools.styling.Style; /** * Base class for {@link StyleWriter} implementations. diff --git a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/SLDStyleReader.java b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/SLDStyleReader.java index b06c4f88bf..59b83a1452 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/SLDStyleReader.java +++ b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/SLDStyleReader.java @@ -16,14 +16,6 @@ package eu.esdihumboldt.hale.common.style.io.impl; -import java.io.IOException; -import java.io.InputStream; - -import org.geotools.factory.CommonFactoryFinder; -import org.geotools.styling.Style; -import org.geotools.styling.StyleFactory; -import org.geotools.xml.styling.SLDParser; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -33,6 +25,12 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.style.io.StyleReader; +import java.io.IOException; +import java.io.InputStream; +import org.geotools.factory.CommonFactoryFinder; +import org.geotools.styling.Style; +import org.geotools.styling.StyleFactory; +import org.geotools.xml.styling.SLDParser; /** * Read styles from SLD. diff --git a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/SLDStyleWriter.java b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/SLDStyleWriter.java index a7e2119627..405b094936 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/SLDStyleWriter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.style/src/eu/esdihumboldt/hale/common/style/io/impl/SLDStyleWriter.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.hale.common.style.io.impl; -import java.io.IOException; -import java.io.OutputStream; - -import org.geotools.xml.styling.SLDTransformer; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -28,6 +23,9 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import java.io.IOException; +import java.io.OutputStream; +import org.geotools.xml.styling.SLDTransformer; /** * Writes styles to SLD. diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/AbstractTaskProvider.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/AbstractTaskProvider.java index e2aaf608eb..1ff1de7968 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/AbstractTaskProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/AbstractTaskProvider.java @@ -38,8 +38,7 @@ public abstract class AbstractTaskProvider implements TaskProvider { /** * Add a task factory. It must be added before - * {@link #registerTaskTypes(TaskRegistry)} is called (e.g in the - * constructor) + * {@link #registerTaskTypes(TaskRegistry)} is called (e.g in the constructor) * * @param factory the factory to add */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/CellMessageTask.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/CellMessageTask.java index cb4a361a18..0361cee8e3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/CellMessageTask.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/CellMessageTask.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.common.tasks; -import java.util.List; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.MutableCell; import eu.esdihumboldt.hale.common.align.model.annotations.messages.Message; import eu.esdihumboldt.hale.common.tasks.TaskUserData.TaskStatus; +import java.util.List; /** * Task for {@link Message} annotations of a {@link Cell}. diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/CellTaskFactory.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/CellTaskFactory.java index 71077de17e..b870ef441d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/CellTaskFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/CellTaskFactory.java @@ -15,16 +15,15 @@ package eu.esdihumboldt.hale.common.tasks; +import eu.esdihumboldt.hale.common.align.model.Cell; +import eu.esdihumboldt.hale.common.align.model.annotations.messages.Message; +import eu.esdihumboldt.hale.common.align.model.annotations.messages.MessageDescriptor; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.annotations.messages.Message; -import eu.esdihumboldt.hale.common.align.model.annotations.messages.MessageDescriptor; - /** * Task factory for {@link Cell}s * diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/ResolvedTask.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/ResolvedTask.java index 8ee5671cbc..50b539c2e8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/ResolvedTask.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/ResolvedTask.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.common.tasks; -import java.util.List; -import java.util.Objects; - import eu.esdihumboldt.hale.common.tasks.TaskType.TaskSeverity; import eu.esdihumboldt.hale.common.tasks.TaskUserData.TaskStatus; +import java.util.List; +import java.util.Objects; /** * Task decorator that provides convenience methods for accessing the task type @@ -60,8 +59,8 @@ public ResolvedTask(Task task, TaskUserData userData) { * @param task the task to be resolved * @param userData the task user data, may be null * - * @return the resolved task or null if the task type could not - * be resolved + * @return the resolved task or null if the task type could not be + * resolved */ public static ResolvedTask resolveTask(TaskRegistry registry, Task task, TaskUserData userData) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/Task.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/Task.java index 2d97a4514d..a4e79c1fc4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/Task.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/Task.java @@ -49,8 +49,8 @@ public interface Task extends Comparable> { List getContext(); /** - * Clean up the task. This method is called when a task is removed from the - * task service + * Clean up the task. This method is called when a task is removed from the task + * service */ void dispose(); @@ -58,8 +58,7 @@ public interface Task extends Comparable> { * Compare this task's main context object to the given one * * @param context the context object to compare - * @return true if the context objects are equal or are both - * null + * @return true if the context objects are equal or are both null */ boolean hasMainContext(Object context); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskFactory.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskFactory.java index af40638c04..05fd6b57bf 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskFactory.java @@ -36,8 +36,8 @@ public interface TaskFactory { TaskType getTaskType(); /** - * Create a task for the given definitions. The task factory must check if - * input is valid before creating a task + * Create a task for the given definitions. The task factory must check if input + * is valid before creating a task * * @param context Context object * diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskProvider.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskProvider.java index 6212f44fb7..c0d11a3cc8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskProvider.java @@ -25,8 +25,8 @@ public interface TaskProvider { /** - * Register the task types provided by this task provider. This method must - * be called before calling {@link #activate(TaskService)} + * Register the task types provided by this task provider. This method must be + * called before calling {@link #activate(TaskService)} * * @param taskRegistry the task type registry to register the types at */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskRegistry.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskRegistry.java index b6685d793b..aba7324d0f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskRegistry.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskRegistry.java @@ -40,8 +40,8 @@ public interface TaskRegistry { * * @param typeName the task type name * - * @return the task type or null if no type with the given name - * is registered + * @return the task type or null if no type with the given name is + * registered */ TaskType getType(String typeName); } diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskType.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskType.java index c0c7829986..fcc0670be9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskType.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskType.java @@ -31,14 +31,15 @@ public interface TaskType { * Task severity level */ public enum TaskSeverity { + /** * A logical error in the alignment that makes it impossible to apply. */ ERROR, /** - * A warning indicates a possible error in the alignment, as indicated - * by instance analysis + * A warning indicates a possible error in the alignment, as indicated by + * instance analysis */ WARNING, @@ -89,14 +90,14 @@ else if (one.equals(WARNING) || theOther.equals(WARNING)) { public TaskFactory getTaskFactory(); /** - * Get the severity level of the given task. The {@link TaskSeverity} - * identifies whether the task is required to clear up a logical error in - * the mapping or schema, whether it is a logical warning that indicates a - * possible mismatch or erroneous modeling, and a normal task indicates a - * simple open point that will improve the quality of the schema or mapping. - * As an example for a warning, take the case that two classes are declared - * equal via an equality relation, but an algorithm finds they share no - * substructures like attribute names and types. + * Get the severity level of the given task. The {@link TaskSeverity} identifies + * whether the task is required to clear up a logical error in the mapping or + * schema, whether it is a logical warning that indicates a possible mismatch or + * erroneous modeling, and a normal task indicates a simple open point that will + * improve the quality of the schema or mapping. As an example for a warning, + * take the case that two classes are declared equal via an equality relation, + * but an algorithm finds they share no substructures like attribute names and + * types. * * @param task the task which severity level shall be identified. The task's * type name must match that of the task type @@ -108,8 +109,8 @@ else if (one.equals(WARNING) || theOther.equals(WARNING)) { /** * Get the creation reason for the given task * - * @param task the task which reason shall be determined. The task's type - * name must match that of the task type + * @param task the task which reason shall be determined. The task's type name + * must match that of the task type * * @return the task's creation reason */ @@ -118,8 +119,8 @@ else if (one.equals(WARNING) || theOther.equals(WARNING)) { /** * Get the title of the given task * - * @param task the task which title shall be determined. The task's type - * name must match that of the task type + * @param task the task which title shall be determined. The task's type name + * must match that of the task type * * @return the task title */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskUserData.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskUserData.java index 73d08fbfca..30347547c8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskUserData.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/TaskUserData.java @@ -28,6 +28,7 @@ public interface TaskUserData { * Task status */ public enum TaskStatus { + /** a new task */ NEW, /** an active task */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/extension/TaskProviderExtension.java b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/extension/TaskProviderExtension.java index 15cb1938fa..21c884d6a3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/extension/TaskProviderExtension.java +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/src/eu/esdihumboldt/hale/common/tasks/extension/TaskProviderExtension.java @@ -15,16 +15,14 @@ */ package eu.esdihumboldt.hale.common.tasks.extension; +import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; +import de.fhg.igd.eclipse.util.extension.AbstractExtension; +import eu.esdihumboldt.hale.common.tasks.TaskProvider; import java.util.ArrayList; import java.util.List; - import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; -import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; -import de.fhg.igd.eclipse.util.extension.AbstractExtension; -import eu.esdihumboldt.hale.common.tasks.TaskProvider; - /** * Task provider extension utilities * diff --git a/common/plugins/eu.esdihumboldt.hale.common.test.allure/src/eu/esdihumboldt/hale/common/test/allure/AllureTestListener.java b/common/plugins/eu.esdihumboldt.hale.common.test.allure/src/eu/esdihumboldt/hale/common/test/allure/AllureTestListener.java index 947ee682df..0fdf7a84ec 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test.allure/src/eu/esdihumboldt/hale/common/test/allure/AllureTestListener.java +++ b/common/plugins/eu.esdihumboldt.hale.common.test.allure/src/eu/esdihumboldt/hale/common/test/allure/AllureTestListener.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.common.test.allure; import java.io.File; - import ru.yandex.qatools.allure.junit.AllureRunListener; /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/AbstractDockerTest.java b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/AbstractDockerTest.java index 37fe67eb5b..225ead137b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/AbstractDockerTest.java +++ b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/AbstractDockerTest.java @@ -34,11 +34,10 @@ public AbstractDockerTest(ClassLoader cl) { /** * It gets the class loader of the unit test class which will be useful for - * fetching the configuration from the classpath. It delegates the call with - * the given class loader. + * fetching the configuration from the classpath. It delegates the call with the + * given class loader. * - * @see DockerConfigHelper#withContainer(String, RunWithContainer, - * ClassLoader) + * @see DockerConfigHelper#withContainer(String, RunWithContainer, ClassLoader) * @param configName a configuration name key * @param runInstance an anonymous class object * @throws Exception if it fails delegate the method call diff --git a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/ContainerParameters.java b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/ContainerParameters.java index 0a64277a14..f873986407 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/ContainerParameters.java +++ b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/ContainerParameters.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.common.test.docker.config; -import java.util.List; - import com.typesafe.config.Config; +import java.util.List; /** * Parameters related to docker @@ -52,8 +51,8 @@ public interface ContainerParameters { String DOCKER_HOST = "dockerHost"; /** - * A configuration key which has a boolean value whether to start a - * container with privileged mode or not. + * A configuration key which has a boolean value whether to start a container + * with privileged mode or not. */ String IS_PRIVILEGED = "isPrivileged"; @@ -123,8 +122,8 @@ public interface ContainerParameters { public boolean getBooleanValue(String key, boolean defaultValue); /** - * gets a int value from a config map which maps the config key with the - * config value. + * gets a int value from a config map which maps the config key with the config + * value. * * @param key a config key * @param defaultValue a default value when no configuration is configured @@ -133,8 +132,7 @@ public interface ContainerParameters { public int getIntValue(String key, int defaultValue); /** - * returns a config which maps configuration key path to a configuration - * value. + * returns a config which maps configuration key path to a configuration value. * * @return a config */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/DockerConfig.java b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/DockerConfig.java index 5d5e906b41..ab9e0ad917 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/DockerConfig.java +++ b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/DockerConfig.java @@ -1,31 +1,32 @@ package eu.esdihumboldt.hale.common.test.docker.config; +import com.typesafe.config.Config; +import com.typesafe.config.ConfigFactory; import java.io.File; import java.io.InputStream; import java.io.InputStreamReader; -import com.typesafe.config.Config; -import com.typesafe.config.ConfigFactory; - /** * A docker config class which is responsible for getting the docker * configuration information. It searches for the configuration in System * properties, working directory, home directory and classpath. *

    - * Example
    Mandatory configurations are: + * Example
    + * Mandatory configurations are: *

      *
    • dockerHost
    • *
    • dockerImage *
    - *
    Optional configuration are: + *
    + * Optional configuration are: *
      *
    • exposedPorts (default: exposed ports in the image, if mentioned then it * will be added to the image's exposed port list )
    • *
    • exposeAllPorts (default: true, while starting a container, if all ports * to be exposed for providing services outside the container.) This should be - * true to start the communication with the container from HALE. - *
    • command (default: commands used in the image will be used) - *
    • isPrivileged (default: false) + * true to start the communication with the container from HALE.
    • command + * (default: commands used in the image will be used)
    • isPrivileged + * (default: false) *
    * * The docker configuration example is as below: @@ -43,9 +44,8 @@ * * *

    - *

    Preference order

    - * Hale looks for the docker configuration in the following files in the - * following order: + *

    Preference order

    Hale looks for the docker configuration in the + * following files in the following order: *
      *
    • System.getProperty("docker.conf.file")
    • *
    • HOMEDIR/.hale/hale-docker.conf
    • @@ -59,9 +59,17 @@ *

      * Global configuration Hale gives more precedence to the * global docker host configuration than the embedded one. Example - *

      global{
      dockerHost="http://192.168.59.103:2375" - *
      }

      takes more precedence over

      postgis{
      - * dockerHost="http://127.0.0.1:2375"
      } + *
      + *
      + * global{
      + * dockerHost="http://192.168.59.103:2375"
      + * }
      + *
      + * takes more precedence over
      + *
      + * postgis{
      + * dockerHost="http://127.0.0.1:2375"
      + * } * * * @@ -99,8 +107,7 @@ private static String getHomeDirConf() { /** * Looks for the configuration file in the working directory * - * @return the absolute path of the configuration file in the working - * directory + * @return the absolute path of the configuration file in the working directory */ private static String getWorkDirConf() { @@ -108,8 +115,8 @@ private static String getWorkDirConf() { } /** - * Checks for the configuration file in the system properties, home - * directory, working directory and then class path. + * Checks for the configuration file in the system properties, home directory, + * working directory and then class path. * * @param cl a class loader to fetch the configuration from class path * diff --git a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/DockerConfigInstance.java b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/DockerConfigInstance.java index 48fea41736..3ecad05a4a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/DockerConfigInstance.java +++ b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/DockerConfigInstance.java @@ -1,10 +1,9 @@ package eu.esdihumboldt.hale.common.test.docker.config; +import com.typesafe.config.Config; import java.util.ArrayList; import java.util.List; -import com.typesafe.config.Config; - /** * A general docker config instance * @@ -51,9 +50,9 @@ public boolean isExposeAllPorts() { } /** - * It checks if the global configuration for the docker host is available. - * It overrides the local configuration for the docker host and takes the - * global configuration. + * It checks if the global configuration for the docker host is available. It + * overrides the local configuration for the docker host and takes the global + * configuration. * * @see eu.esdihumboldt.hale.common.test.docker.config.ContainerParameters#getDockerHost() */ diff --git a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/HaleDockerClient.java b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/HaleDockerClient.java index baa7433a9f..84c81ce1bb 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/HaleDockerClient.java +++ b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/config/HaleDockerClient.java @@ -1,10 +1,9 @@ package eu.esdihumboldt.hale.common.test.docker.config; -import java.text.MessageFormat; -import java.time.Duration; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; +import java.text.MessageFormat; +import java.time.Duration; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.images.PullPolicy; @@ -13,8 +12,8 @@ /** * Docker client abstraction for use in hale tests. * - * Original implementation used Spotify Docker client. - * Now replaced by using testcontainers, but it is encouraged to instead use testcontainers directly. + * Original implementation used Spotify Docker client. Now replaced by using + * testcontainers, but it is encouraged to instead use testcontainers directly. * * @author Sameer Sheikh * @@ -44,12 +43,15 @@ public HaleDockerClient(ContainerParameters dbc) { public void createContainer() { String configuredDocker = dbc.getDockerHost(); if (configuredDocker != null) { - LOGGER.warn("Setting for docker host ({}) is ignored when using testcontainers, instead configure testcontainers", configuredDocker); + LOGGER.warn( + "Setting for docker host ({}) is ignored when using testcontainers, instead configure testcontainers", + configuredDocker); // see also https://java.testcontainers.org/features/configuration/ } container = new GenericContainer(DockerImageName.parse(dbc.getImageName())) - .withExposedPorts(dbc.getExposedPortList().stream().map(Integer::parseInt).toArray(Integer[]::new)) + .withExposedPorts(dbc.getExposedPortList().stream().map(Integer::parseInt) + .toArray(Integer[]::new)) .withCommand(dbc.getCommands().toArray(String[]::new)) .withLogConsumer(new Slf4jLogConsumer(LOGGER)) .withPrivilegedMode(dbc.isPrivileged()) @@ -81,8 +83,8 @@ public String getContainerIp() { * @throws InterruptedException interrupted exception */ public void startContainer() throws InterruptedException { - LOGGER.info(MessageFormat.format("Preparing container for image {0}...", - container.getImage())); + LOGGER.info( + MessageFormat.format("Preparing container for image {0}...", container.getImage())); container.start(); LOGGER.info(MessageFormat.format("Created container with ID {0}, now starting...", container.getContainerId())); @@ -114,8 +116,7 @@ public void killAndRemoveContainer() throws Exception { } /** - * @return the container ID or null if no container was created - * yet + * @return the container ID or null if no container was created yet */ public String getContainerId() { if (container != null) { diff --git a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/helper/DockerConfigHelper.java b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/helper/DockerConfigHelper.java index 5cdc36663b..8ea2e3fca1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/helper/DockerConfigHelper.java +++ b/common/plugins/eu.esdihumboldt.hale.common.test.docker/src/eu/esdihumboldt/hale/common/test/docker/helper/DockerConfigHelper.java @@ -15,9 +15,9 @@ public class DockerConfigHelper { /** - * fetches the configuration parameters for the key configName - * which is usefull in creating a docker container. It starts a container, - * executes the logic and kills the container. + * fetches the configuration parameters for the key configName which is + * usefull in creating a docker container. It starts a container, executes the + * logic and kills the container. * * @param configName a name for the configuration group * @param runInstance an anonymous class object diff --git a/common/plugins/eu.esdihumboldt.hale.common.test/src/eu/esdihumboldt/hale/common/test/TestUtil.java b/common/plugins/eu.esdihumboldt.hale.common.test/src/eu/esdihumboldt/hale/common/test/TestUtil.java index f39a88e589..7a50e240dc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test/src/eu/esdihumboldt/hale/common/test/TestUtil.java +++ b/common/plugins/eu.esdihumboldt.hale.common.test/src/eu/esdihumboldt/hale/common/test/TestUtil.java @@ -20,17 +20,6 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import eu.esdihumboldt.hale.common.core.HalePlatform; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.BundleException; - import de.fhg.igd.osgi.util.OsgiUtils; import de.fhg.igd.osgi.util.OsgiUtils.Condition; import de.fhg.igd.osgi.util.OsgiUtilsActivator; @@ -38,6 +27,7 @@ import eu.esdihumboldt.hale.common.align.io.impl.CastorAlignmentIO; import eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentIO; import eu.esdihumboldt.hale.common.align.model.Alignment; +import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.core.io.HaleIO; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.PathUpdate; @@ -53,6 +43,14 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeIndex; import eu.esdihumboldt.hale.io.gml.reader.internal.XmlInstanceReader; import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleException; /** * Some static helper methods for tests. @@ -67,8 +65,8 @@ public class TestUtil { * * @param location the URI specifying the location of the schema * @return the loaded schema - * @throws IOProviderConfigurationException if the schema reader - * configuration failed + * @throws IOProviderConfigurationException if the schema reader configuration + * failed * @throws IOException if the schema could not be loaded */ public static Schema loadSchema(URI location) @@ -93,8 +91,8 @@ public static Schema loadSchema(URI location) } /** - * Loads the specified alignment. Assumes that its base alignments don't - * need a location update. + * Loads the specified alignment. Assumes that its base alignments don't need a + * location update. * * @param location the URI specifying the location of the alignment * @param sourceTypes the source type index @@ -128,15 +126,15 @@ public URI getLocation() { } /** - * Loads an instance collection from the specified file with the given - * source types. + * Loads an instance collection from the specified file with the given source + * types. * * @param location the URI specifying the location of the instance file * @param types the type index * @return the loaded instance collection * @throws IOException if loading the instance failed - * @throws IOProviderConfigurationException if configuring the instance - * reader failed + * @throws IOProviderConfigurationException if configuring the instance reader + * failed */ public static InstanceCollection loadInstances(URI location, Schema types) throws IOProviderConfigurationException, IOException { @@ -200,8 +198,7 @@ public static void uninstallBundle(String name) { } /** - * Start the given bundles and then check that the given service is - * available. + * Start the given bundles and then check that the given service is available. * * XXX HACKHACK * diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/AssignFromCollector.java b/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/AssignFromCollector.java index 903e8b80cf..1a74b90820 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/AssignFromCollector.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/AssignFromCollector.java @@ -15,14 +15,7 @@ package eu.esdihumboldt.cst.functions.collector; -import java.text.MessageFormat; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.function.Function; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.cst.MultiValue; import eu.esdihumboldt.cst.functions.collector.helpers.CollectorGroovyHelper; import eu.esdihumboldt.cst.functions.groovy.helpers.ContextHelpers; @@ -41,6 +34,11 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import java.text.MessageFormat; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; /** * Function to assign values collected by a {@link Collector} to a multi-valued @@ -93,11 +91,9 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine "Error retrieving collector \"{0}\"", collectorName.getValue().toString())); } else if (collector.values().isEmpty()) { - log.warn(new TransformationMessageImpl(getCell(), - MessageFormat.format( - "Collector \"{0}\" contains no values. If this is unexpected, check the spelling of the collector name and the priority of the transformation function.", - collectorName.getStringRepresentation()), - null)); + log.warn(new TransformationMessageImpl(getCell(), MessageFormat.format( + "Collector \"{0}\" contains no values. If this is unexpected, check the spelling of the collector name and the priority of the transformation function.", + collectorName.getStringRepresentation()), null)); } // Determine where to assign the collected values @@ -141,8 +137,7 @@ else if (collector.values().isEmpty()) { /** * Find first child property of the given {@link TypeDefinition} where - * child.getConstraint(Reference.class).isReference() returns - * true. + * child.getConstraint(Reference.class).isReference() returns true. * * @param propertyType The TypeDefinition to search * diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/AssignFromCollectorFunction.java b/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/AssignFromCollectorFunction.java index 615110dc81..5d3ab0a2ea 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/AssignFromCollectorFunction.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/AssignFromCollectorFunction.java @@ -28,8 +28,8 @@ public interface AssignFromCollectorFunction { public static final String ID = "eu.esdihumboldt.cst.functions.collector.assign"; /** - * Name of the parameter specifying the name of the collector to assign - * values from. + * Name of the parameter specifying the name of the collector to assign values + * from. */ public static final String PARAMETER_COLLECTOR = "collector"; diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/explanations/AssignFromCollectorExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/explanations/AssignFromCollectorExplanation.java index f86700bb8b..b4a78b5c9d 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/explanations/AssignFromCollectorExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.collector/src/eu/esdihumboldt/cst/functions/collector/explanations/AssignFromCollectorExplanation.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.cst.functions.collector.explanations; -import java.util.Locale; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; @@ -27,6 +24,8 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import java.util.Locale; +import java.util.Map; /** * Explanation for the Assign collected values function. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Assign.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Assign.java index 08c58a90c1..321631220d 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Assign.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Assign.java @@ -16,11 +16,7 @@ package eu.esdihumboldt.cst.functions.core; -import java.util.List; -import java.util.Map; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.functions.AssignFunction; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; @@ -30,6 +26,8 @@ import eu.esdihumboldt.hale.common.align.transformation.function.impl.NoResultException; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; import eu.esdihumboldt.hale.common.scripting.transformation.AbstractSingleTargetScriptedPropertyTransformation; +import java.util.List; +import java.util.Map; import net.jcip.annotations.Immutable; /** @@ -49,9 +47,9 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine // check anchor /* - * Source node that are not defined will not result in a variable being - * set (if the variable is optional), thus the only way we can check if - * there should be an anchor, is checking the cell. + * Source node that are not defined will not result in a variable being set (if + * the variable is optional), thus the only way we can check if there should be + * an anchor, is checking the cell. */ boolean hasAnchor = false; ListMultimap source = getCell().getSource(); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/ClassificationMapping.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/ClassificationMapping.java index ccd72a45ae..8147b22081 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/ClassificationMapping.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/ClassificationMapping.java @@ -16,10 +16,7 @@ package eu.esdihumboldt.cst.functions.core; -import java.util.Map; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.functions.ClassificationMappingFunction; import eu.esdihumboldt.hale.common.align.model.functions.ClassificationMappingUtil; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; @@ -31,6 +28,7 @@ import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.lookup.LookupTable; +import java.util.Map; /** * Classification mapping function to map values of an attribute to a different diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Create.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Create.java index 8994303ce6..e03e6b9845 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Create.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Create.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.cst.functions.core; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.functions.CreateFunction; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -26,6 +24,7 @@ import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.instance.model.MutableInstance; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Map; import net.jcip.annotations.Immutable; /** @@ -42,7 +41,7 @@ public class Create extends AbstractTypeTransformation @Override public void execute(String transformationIdentifier, TransformationEngine engine, Map executionParameters, TransformationLog log, Cell cell) - throws TransformationException { + throws TransformationException { // get number of executions int num; String numberExpr = getOptionalParameter(PARAM_NUMBER, Value.of(1)).as(String.class); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/FormattedString.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/FormattedString.java index a411b5bf32..9aa796991a 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/FormattedString.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/FormattedString.java @@ -16,17 +16,7 @@ package eu.esdihumboldt.cst.functions.core; -import java.text.MessageFormat; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.regex.Pattern; - -import org.springframework.core.convert.ConversionException; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.functions.FormattedStringFunction; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -35,6 +25,13 @@ import eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractSingleTargetPropertyTransformation; import eu.esdihumboldt.hale.common.align.transformation.function.impl.NoResultException; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; +import java.text.MessageFormat; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.regex.Pattern; +import org.springframework.core.convert.ConversionException; /** * Function that creates a formatted string from a pattern and input variables. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/GenerateUID.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/GenerateUID.java index ff272c882d..cbbac284d8 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/GenerateUID.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/GenerateUID.java @@ -16,13 +16,7 @@ package eu.esdihumboldt.cst.functions.core; -import java.util.Map; -import java.util.UUID; - -import net.jcip.annotations.Immutable; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.functions.GenerateUIDFunction; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -31,6 +25,9 @@ import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.scripting.transformation.AbstractSingleTargetScriptedPropertyTransformation; +import java.util.Map; +import java.util.UUID; +import net.jcip.annotations.Immutable; /** * Generate unique id function. @@ -38,9 +35,9 @@ * @author Andrea Antonello */ @Immutable -public class GenerateUID extends - AbstractSingleTargetScriptedPropertyTransformation implements - GenerateUIDFunction { +public class GenerateUID + extends AbstractSingleTargetScriptedPropertyTransformation + implements GenerateUIDFunction { @Override protected Object evaluate(String transformationIdentifier, TransformationEngine engine, diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Join.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Join.java index a84e48eb12..7412576439 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Join.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Join.java @@ -16,11 +16,6 @@ package eu.esdihumboldt.cst.functions.core; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - import eu.esdihumboldt.cst.functions.core.join.IndexJoinHandler; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.functions.JoinFunction; @@ -30,6 +25,10 @@ import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.InstanceHandler; import eu.esdihumboldt.hale.common.instance.index.InstanceIndexContribution; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; /** * Type transformation that joins multiple instances of different source types diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Merge.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Merge.java index 6b13c54cd4..53900eb9f9 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Merge.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Merge.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.cst.functions.core; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - import eu.esdihumboldt.cst.functions.core.merge.IndexMergeHandler; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.functions.MergeFunction; @@ -28,6 +24,9 @@ import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.InstanceHandler; import eu.esdihumboldt.hale.common.instance.index.InstanceIndexContribution; +import java.util.Collection; +import java.util.Collections; +import java.util.List; /** * Type transformation that merges multiple instances of the same source type diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Rename.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Rename.java index ae174bf6f6..c2bd48b084 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Rename.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Rename.java @@ -16,18 +16,7 @@ package eu.esdihumboldt.cst.functions.core; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; -import org.springframework.core.convert.ConversionException; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.functions.RenameFunction; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -51,7 +40,14 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.xml.namespace.QName; import net.jcip.annotations.Immutable; +import org.locationtech.jts.geom.Geometry; +import org.springframework.core.convert.ConversionException; /** * Property rename function. @@ -107,13 +103,13 @@ else if (!structuralRenameEnabled) { } /** - * Performs a structural rename on the given source object to the given - * target definition. + * Performs a structural rename on the given source object to the given target + * definition. * * @param source the source value (or group/instance) * @param targetDefinition the target definition - * @param allowIgnoreNamespaces if for the structure comparison, namespaces - * may be ignored + * @param allowIgnoreNamespaces if for the structure comparison, namespaces may + * be ignored * @param instanceFactory the instance factory * @param copyGeometries specifies if geometry objects should be copied * @return the transformed value (or group/instance) or NO_MATCH @@ -126,13 +122,13 @@ public static Object structuralRename(Object source, ChildDefinition targetDe } /** - * Performs a structural rename on the given source object to the given - * target definition. + * Performs a structural rename on the given source object to the given target + * definition. * * @param source the source value (or group/instance) * @param targetDefinition the target definition - * @param allowIgnoreNamespaces if for the structure comparison, namespaces - * may be ignored + * @param allowIgnoreNamespaces if for the structure comparison, namespaces may + * be ignored * @param instanceFactory the instance factory * @param copyGeometries specifies if geometry objects should be copied * @param skipChildren a set of direct children to skip or null @@ -237,8 +233,8 @@ else if (targetDefinition.asGroup() != null) { * Determines if the given value is a geometry object. * * @param value the value - * @return true if the value is a geometry object or - * collection, false otherwise + * @return true if the value is a geometry object or collection, + * false otherwise */ private static boolean isGeometry(Object value) { if (value instanceof GeometryProperty) { @@ -275,8 +271,8 @@ private static boolean isGeometry(Object value) { * @param source the source group * @param target the target group * @param targetDefinition the target definition - * @param allowIgnoreNamespaces if for the structure comparison, namespaces - * may be ignored + * @param allowIgnoreNamespaces if for the structure comparison, namespaces may + * be ignored * @param instanceFactory the instance factory * @param copyGeometries specifies if geometry objects should be copied * @param skipChildren a set of direct children to skip or null diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Retype.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Retype.java index 2f2dde6009..c2e7d42e0f 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Retype.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/Retype.java @@ -16,14 +16,7 @@ package eu.esdihumboldt.cst.functions.core; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.functions.RenameFunction; @@ -38,6 +31,10 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import javax.xml.namespace.QName; import net.jcip.annotations.Immutable; /** @@ -62,8 +59,8 @@ public void execute(String transformationIdentifier, TransformationEngine engine Value.of(false)).as(Boolean.class, false); if (structuralRename) { boolean ignoreNamespaces = getOptionalParameter( - RenameFunction.PARAMETER_IGNORE_NAMESPACES, Value.of(false)).as(Boolean.class, - false); + RenameFunction.PARAMETER_IGNORE_NAMESPACES, Value.of(false)) + .as(Boolean.class, false); boolean copyGeometries = getOptionalParameter(RenameFunction.PARAMETER_COPY_GEOMETRIES, Value.of(true)).as(Boolean.class); target = doStructuralRename(getSource(), targetType, ignoreNamespaces, copyGeometries, diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/inline/InlineTransformation.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/inline/InlineTransformation.java index baf7be8174..3fde767bc1 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/inline/InlineTransformation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/inline/InlineTransformation.java @@ -15,14 +15,8 @@ package eu.esdihumboldt.cst.functions.core.inline; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.MutableAlignment; @@ -51,14 +45,18 @@ import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstanceCollection; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; /** * Transformation that runs a type transformation on a property. * * @author Simon Templer */ -public class InlineTransformation extends - AbstractSingleTargetPropertyTransformation { +public class InlineTransformation + extends AbstractSingleTargetPropertyTransformation { @Override protected Object evaluate(String transformationIdentifier, TransformationEngine engine, @@ -76,7 +74,8 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine throw new NoResultException("Source value is null"); } if (!(sourceValue instanceof Instance)) { - throw new TransformationException("Sources for inline transformation must be instances"); + throw new TransformationException( + "Sources for inline transformation must be instances"); } Instance sourceInstance = (Instance) sourceValue; TypeDefinition sourceType = sourceInstance.getDefinition(); @@ -88,12 +87,12 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine // identify relevant type cell(s) MutableCell queryCell = new DefaultCell(); ListMultimap sourceEntities = ArrayListMultimap.create(); - sourceEntities.put(null, new DefaultType(new TypeEntityDefinition(sourceType, - SchemaSpaceID.SOURCE, null))); + sourceEntities.put(null, + new DefaultType(new TypeEntityDefinition(sourceType, SchemaSpaceID.SOURCE, null))); queryCell.setSource(sourceEntities); ListMultimap targetEntities = ArrayListMultimap.create(); - targetEntities.put(null, new DefaultType(new TypeEntityDefinition(resultProperty - .getDefinition().getPropertyType(), SchemaSpaceID.TARGET, null))); + targetEntities.put(null, new DefaultType(new TypeEntityDefinition( + resultProperty.getDefinition().getPropertyType(), SchemaSpaceID.TARGET, null))); queryCell.setTarget(targetEntities); Collection candidates = alignment.getTypeCells(queryCell); if (candidates.isEmpty()) { diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/DefaultValueProcessor.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/DefaultValueProcessor.java index 2527a9b36e..b8486af372 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/DefaultValueProcessor.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/DefaultValueProcessor.java @@ -30,8 +30,8 @@ public class DefaultValueProcessor implements ValueProcessor { * * @param value the value * @param property the entity definition the value is associated to - * @return the processed value, possibly wrapped or replaced through a - * different representation + * @return the processed value, possibly wrapped or replaced through a different + * representation */ @Override public Object processValue(Object value, PropertyEntityDefinition property) { diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/IndexJoinHandler.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/IndexJoinHandler.java index 46cfe33652..bbc64ab5ce 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/IndexJoinHandler.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/IndexJoinHandler.java @@ -15,15 +15,7 @@ package eu.esdihumboldt.cst.functions.core.join; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.cst.functions.core.join.JoinUtil.JoinDefinition; import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.functions.JoinFunction; @@ -44,6 +36,12 @@ import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.instance.model.impl.InstanceDecorator; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; /** * Join based on equal properties using an {@link InstanceIndex} diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/IndexJoinIterator.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/IndexJoinIterator.java index d16e1e5853..20d952a6ab 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/IndexJoinIterator.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/IndexJoinIterator.java @@ -15,19 +15,7 @@ package eu.esdihumboldt.cst.functions.core.join; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - import com.google.common.collect.Multimap; - import eu.esdihumboldt.cst.functions.core.join.JoinUtil.JoinDefinition; import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter.JoinCondition; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; @@ -37,6 +25,15 @@ import eu.esdihumboldt.hale.common.instance.model.FamilyInstance; import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; import eu.esdihumboldt.hale.common.instance.model.impl.FilterResourceIteratorAdapter; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; /** * Iterator used by {@link IndexJoinHandler} diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinHandler.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinHandler.java index 82fda96ad0..8155d6c3ca 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinHandler.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinHandler.java @@ -16,16 +16,9 @@ package eu.esdihumboldt.cst.functions.core.join; -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimap; - import eu.esdihumboldt.cst.functions.core.join.JoinUtil.JoinDefinition; import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.ParameterValue; @@ -42,6 +35,11 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import java.util.Collection; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; /** * Join based on equal properties. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinIterator.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinIterator.java index be15cb9a80..5ff81223e8 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinIterator.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinIterator.java @@ -15,15 +15,7 @@ package eu.esdihumboldt.cst.functions.core.join; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - import com.google.common.collect.Multimap; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter.JoinCondition; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; @@ -33,6 +25,12 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceReference; import eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference; import eu.esdihumboldt.hale.common.instance.model.impl.FilterResourceIteratorAdapter; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; /** * Iterator used by {@link JoinHandler} diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinUtil.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinUtil.java index cf7509c92b..46985902df 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinUtil.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/JoinUtil.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.cst.functions.core.join; -import java.util.HashMap; -import java.util.Map; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; - import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter; import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter.JoinCondition; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.HashMap; +import java.util.Map; /** * Utility methods for Join operations diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/ValueProcessor.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/ValueProcessor.java index 820193e728..2581889f77 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/ValueProcessor.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/join/ValueProcessor.java @@ -26,13 +26,13 @@ public interface ValueProcessor { /** - * Process a value of a property in a join condition before using it with - * the index. + * Process a value of a property in a join condition before using it with the + * index. * * @param value the value * @param property the entity definition the value is associated to - * @return the processed value, possibly wrapped or replaced through a - * different representation + * @return the processed value, possibly wrapped or replaced through a different + * representation */ Object processValue(Object value, PropertyEntityDefinition property); } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/AbstractMergeHandler.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/AbstractMergeHandler.java index 0d4e048f6f..b0f2308469 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/AbstractMergeHandler.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/AbstractMergeHandler.java @@ -16,13 +16,9 @@ package eu.esdihumboldt.cst.functions.core.merge; -import java.util.Collection; -import java.util.Map; - import com.google.common.collect.HashMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimap; - import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.InstanceHandler; @@ -39,6 +35,8 @@ import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.instance.model.impl.GenericResourceIteratorAdapter; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collection; +import java.util.Map; /** * Abstract merge handler implementation based on a merge index of instance @@ -116,7 +114,7 @@ public ResourceIterator partitionInstances(InstanceCollection in String transformationIdentifier, TransformationEngine engine, ListMultimap transformationParameters, Map executionParameters, TransformationLog log) - throws TransformationException { + throws TransformationException { T mergeConfig = createMergeConfiguration(transformationIdentifier, transformationParameters, executionParameters, log); @@ -157,13 +155,12 @@ protected InstanceFactory getInstanceFactory() { * @param executionParameters the execution parameters * @param log the transformation log * @return the merge configuration - * @throws TransformationException if the merge configuration cannot be - * created + * @throws TransformationException if the merge configuration cannot be created */ protected abstract T createMergeConfiguration(String transformationIdentifier, ListMultimap transformationParameters, Map executionParameters, TransformationLog log) - throws TransformationException; + throws TransformationException; /** * Get the merge key for a given instance. Instances with an equal merge key diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/IndexMergeHandler.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/IndexMergeHandler.java index 331e464f2f..72ffffd8c8 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/IndexMergeHandler.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/IndexMergeHandler.java @@ -15,20 +15,7 @@ package eu.esdihumboldt.cst.functions.core.merge; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.functions.MergeFunction; import eu.esdihumboldt.hale.common.align.model.functions.merge.MergeUtil; @@ -54,6 +41,16 @@ import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstanceCollection; import eu.esdihumboldt.hale.common.instance.model.impl.InstanceDecorator; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; /** * Merge using an instance index @@ -215,11 +212,11 @@ private Instance merge(InstanceCollection instances, IndexMergeConfig mergeConfi MutableInstance result = getInstanceFactory().createInstance(type); /* - * FIXME This a first VERY basic implementation, where only the first - * item in each property path is regarded, and that whole tree is added - * only once (from the first instance). XXX This especially will be a - * problem, if a path contains a choice. XXX For more advanced stuff we - * need more advanced test cases. + * FIXME This a first VERY basic implementation, where only the first item in + * each property path is regarded, and that whole tree is added only once (from + * the first instance). XXX This especially will be a problem, if a path + * contains a choice. XXX For more advanced stuff we need more advanced test + * cases. */ Set rootNames = new HashSet(); Set nonKeyRootNames = new HashSet(); @@ -242,8 +239,8 @@ private Instance merge(InstanceCollection instances, IndexMergeConfig mergeConfi for (QName name : instance.getPropertyNames()) { if (rootNames.contains(name)) { /* - * Property is merge key -> only use first occurrence - * (as all entries need to be the same) + * Property is merge key -> only use first occurrence (as all entries need + * to be the same) * * TODO adapt if multiple keys are possible per instance */ @@ -265,10 +262,9 @@ else if (mergeConfig.autoDetect) { * * Only keep unique values. * - * XXX This differs from the traditional behavior in - * that there only the first value would be used, but - * only if all values were equal. That cannot be easily - * checked in an iterative approach. + * XXX This differs from the traditional behavior in that there only the + * first value would be used, but only if all values were equal. That cannot + * be easily checked in an iterative approach. */ addUnique(result, instance, name); } @@ -306,9 +302,8 @@ public void setServiceProvider(ServiceProvider services) { } /** - * Apply instance property values to the merged result instance. Use the - * "first occurrence" strategy that only keeps the values from the first - * instance. + * Apply instance property values to the merged result instance. Use the "first + * occurrence" strategy that only keeps the values from the first instance. * * @param result the result instance * @param instance the instance to merge with the result @@ -356,8 +351,8 @@ private void addUnique(MutableInstance result, Instance instance, QName property } /** - * Apply instance property values to the merged result instance. Use the - * "add values" strategy that keeps all values. + * Apply instance property values to the merged result instance. Use the "add + * values" strategy that keeps all values. * * @param result the result instance * @param instance the instance to merge with the result diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/PropertiesMergeHandler.java b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/PropertiesMergeHandler.java index 54c4e8d9c5..5cfad3cf30 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/PropertiesMergeHandler.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/src/eu/esdihumboldt/cst/functions/core/merge/PropertiesMergeHandler.java @@ -16,18 +16,7 @@ package eu.esdihumboldt.cst.functions.core.merge; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.functions.MergeFunction; import eu.esdihumboldt.hale.common.align.model.functions.merge.MergeUtil; @@ -41,6 +30,14 @@ import eu.esdihumboldt.hale.common.instance.model.MutableInstance; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.xml.namespace.QName; /** * Merge based on equal properties. @@ -70,7 +67,7 @@ private PropertiesMergeConfig(List> keyProperties, protected PropertiesMergeConfig createMergeConfiguration(String transformationIdentifier, ListMultimap transformationParameters, Map executionParameters, TransformationLog log) - throws TransformationException { + throws TransformationException { if (transformationParameters == null) { throw new TransformationException("Transformation parameters invalid"); } @@ -130,11 +127,11 @@ protected Instance merge(InstanceCollection instances, TypeDefinition type, MutableInstance result = getInstanceFactory().createInstance(type); /* - * FIXME This a first VERY basic implementation, where only the first - * item in each property path is regarded, and that whole tree is added - * only once (from the first instance). XXX This especially will be a - * problem, if a path contains a choice. XXX For more advanced stuff we - * need more advanced test cases. + * FIXME This a first VERY basic implementation, where only the first item in + * each property path is regarded, and that whole tree is added only once (from + * the first instance). XXX This especially will be a problem, if a path + * contains a choice. XXX For more advanced stuff we need more advanced test + * cases. */ Set rootNames = new HashSet(); Set nonKeyRootNames = new HashSet(); @@ -157,8 +154,8 @@ protected Instance merge(InstanceCollection instances, TypeDefinition type, for (QName name : instance.getPropertyNames()) { if (rootNames.contains(name)) { /* - * Property is merge key -> only use first occurrence - * (as all entries need to be the same) + * Property is merge key -> only use first occurrence (as all entries need + * to be the same) * * TODO adapt if multiple keys are possible per instance */ @@ -180,10 +177,9 @@ else if (mergeConfig.autoDetect) { * * Only keep unique values. * - * XXX This differs from the traditional behavior in - * that there only the first value would be used, but - * only if all values were equal. That cannot be easily - * checked in an iterative approach. + * XXX This differs from the traditional behavior in that there only the + * first value would be used, but only if all values were equal. That cannot + * be easily checked in an iterative approach. */ addUnique(result, instance, name); } @@ -213,9 +209,8 @@ else if (mergeConfig.autoDetect) { } /** - * Apply instance property values to the merged result instance. Use the - * "first occurrence" strategy that only keeps the values from the first - * instance. + * Apply instance property values to the merged result instance. Use the "first + * occurrence" strategy that only keeps the values from the first instance. * * @param result the result instance * @param instance the instance to merge with the result @@ -263,8 +258,8 @@ private void addUnique(MutableInstance result, Instance instance, QName property } /** - * Apply instance property values to the merged result instance. Use the - * "add values" strategy that keeps all values. + * Apply instance property values to the merged result instance. Use the "add + * values" strategy that keeps all values. * * @param result the result instance * @param instance the instance to merge with the result diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomFunctionExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomFunctionExplanation.java index 44a17e12c7..fe173a2d1d 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomFunctionExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomFunctionExplanation.java @@ -15,17 +15,6 @@ package eu.esdihumboldt.hale.common.align.custom; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Optional; -import java.util.ResourceBundle; -import java.util.function.Supplier; - -import javax.annotation.Nullable; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; @@ -36,6 +25,15 @@ import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import groovy.text.Template; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.ResourceBundle; +import java.util.function.Supplier; +import javax.annotation.Nullable; /** * Explanation for custom functions based on Markdown templates. @@ -57,8 +55,8 @@ public class DefaultCustomFunctionExplanation extends MarkdownCellExplanation * * @param templates map of localized templates * @param functionResolver the custom resolver for the associated function - * definition, to be used instead of the usual mechanism to - * resolve functions + * definition, to be used instead of the usual mechanism to resolve + * functions */ public DefaultCustomFunctionExplanation(Map templates, @Nullable Supplier> functionResolver) { @@ -99,9 +97,9 @@ public DefaultCustomFunctionExplanation(DefaultCustomFunctionExplanation other) } /** - * @param functionResolver the the custom resolver for the associated - * function definition, to be used instead of the usual mechanism - * to resolve functions + * @param functionResolver the the custom resolver for the associated function + * definition, to be used instead of the usual mechanism to resolve + * functions */ public void setFunctionResolver(@Nullable Supplier> functionResolver) { this.functionResolver = functionResolver; diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunction.java b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunction.java index 772cfdf072..66b232515c 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunction.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunction.java @@ -15,16 +15,6 @@ package eu.esdihumboldt.hale.common.align.custom; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - import eu.esdihumboldt.hale.common.align.custom.groovy.CustomGroovyTransformation; import eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition; import eu.esdihumboldt.hale.common.align.extension.function.PropertyFunctionDefinition; @@ -34,6 +24,15 @@ import eu.esdihumboldt.hale.common.align.model.CellExplanation; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyTransformation; import eu.esdihumboldt.hale.common.core.io.Value; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; /** * Custom property function. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionEntity.java b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionEntity.java index f9da0ed6a4..227183f773 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionEntity.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionEntity.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.common.align.custom; -import java.util.Collections; -import java.util.List; - import eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunctionEntity; import eu.esdihumboldt.hale.common.align.model.Type; import eu.esdihumboldt.hale.common.align.model.condition.PropertyCondition; @@ -25,6 +22,8 @@ import eu.esdihumboldt.hale.common.align.model.condition.TypeCondition; import eu.esdihumboldt.hale.common.align.model.condition.impl.BindingCondition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collections; +import java.util.List; /** * Default implementation of a property entity for a custom function. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionParameter.java b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionParameter.java index 77d0f4cc9f..becb1654c2 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionParameter.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionParameter.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.common.align.custom; +import eu.esdihumboldt.hale.common.core.io.Value; import java.util.HashSet; import java.util.Set; -import eu.esdihumboldt.hale.common.core.io.Value; - /** * Default implementation of a custom function parameter. * diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionParameterDefinition.java b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionParameterDefinition.java index b346b52a8b..0f08d5e570 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionParameterDefinition.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/DefaultCustomPropertyFunctionParameterDefinition.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.common.align.custom; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueDefinition; import eu.esdihumboldt.hale.common.core.parameter.ParameterValueDescriptor; import eu.esdihumboldt.hale.common.core.parameter.Validator; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; /** * Wrapper for default implementation of a custom function parameter that diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/groovy/CustomGroovyTransformation.java b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/groovy/CustomGroovyTransformation.java index 09f725962c..40db071022 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/groovy/CustomGroovyTransformation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/groovy/CustomGroovyTransformation.java @@ -15,12 +15,8 @@ package eu.esdihumboldt.hale.common.align.custom.groovy; -import java.util.List; -import java.util.Map; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.cst.functions.groovy.GroovyTransformation; import eu.esdihumboldt.cst.functions.groovy.internal.GroovyUtil; import eu.esdihumboldt.cst.functions.groovy.internal.InstanceAccessorArrayList; @@ -46,6 +42,8 @@ import eu.esdihumboldt.util.groovy.sandbox.GroovyService; import groovy.lang.Binding; import groovy.lang.Script; +import java.util.List; +import java.util.Map; /** * Implementation of a custom transformation as Groovy transformation. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/internal/DefaultCustomPropertyFunctionType.groovy b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/internal/DefaultCustomPropertyFunctionType.groovy index 7db5a7eca7..277069b190 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/internal/DefaultCustomPropertyFunctionType.groovy +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom/src/eu/esdihumboldt/hale/common/align/custom/internal/DefaultCustomPropertyFunctionType.groovy @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.common.align.custom.internal; -import javax.xml.namespace.QName - -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.align.custom.DefaultCustomFunctionExplanation import eu.esdihumboldt.hale.common.align.custom.DefaultCustomPropertyFunction import eu.esdihumboldt.hale.common.align.custom.DefaultCustomPropertyFunctionEntity @@ -31,6 +27,8 @@ import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.schema.model.TypeIndex import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import eu.esdihumboldt.util.groovy.xml.NSDOMCategory +import javax.xml.namespace.QName +import org.w3c.dom.Element /** * Complex value definition for custom property functions. @@ -318,5 +316,4 @@ ComplexValueType { public Class getContextType() { return LoadAlignmentContext.class; } - } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom/test/eu/esdihumboldt/cst/functions/custom/test/internal/DefaultCustomPropertyFunctionTypeTest.java b/cst/plugins/eu.esdihumboldt.cst.functions.custom/test/eu/esdihumboldt/cst/functions/custom/test/internal/DefaultCustomPropertyFunctionTypeTest.java index 2df2ba58ac..30a14e2b74 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom/test/eu/esdihumboldt/cst/functions/custom/test/internal/DefaultCustomPropertyFunctionTypeTest.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom/test/eu/esdihumboldt/cst/functions/custom/test/internal/DefaultCustomPropertyFunctionTypeTest.java @@ -18,6 +18,15 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import eu.esdihumboldt.hale.common.align.custom.DefaultCustomFunctionExplanation; +import eu.esdihumboldt.hale.common.align.custom.DefaultCustomPropertyFunction; +import eu.esdihumboldt.hale.common.align.custom.DefaultCustomPropertyFunctionEntity; +import eu.esdihumboldt.hale.common.align.custom.DefaultCustomPropertyFunctionParameter; +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.common.core.io.Text; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import groovy.xml.XmlUtil; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,20 +34,9 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; import org.junit.Test; import org.w3c.dom.Element; -import eu.esdihumboldt.hale.common.align.custom.DefaultCustomFunctionExplanation; -import eu.esdihumboldt.hale.common.align.custom.DefaultCustomPropertyFunction; -import eu.esdihumboldt.hale.common.align.custom.DefaultCustomPropertyFunctionEntity; -import eu.esdihumboldt.hale.common.align.custom.DefaultCustomPropertyFunctionParameter; -import eu.esdihumboldt.hale.common.core.io.HaleIO; -import eu.esdihumboldt.hale.common.core.io.Text; -import eu.esdihumboldt.hale.common.core.io.Value; -import groovy.xml.XmlUtil; - /** * Custom function serialization tests. * @@ -47,8 +45,8 @@ public class DefaultCustomPropertyFunctionTypeTest extends AbstractPlatformTest { /** - * Test if a simple lookup table containing only string values is the same - * when converted to DOM and back again. + * Test if a simple lookup table containing only string values is the same when + * converted to DOM and back again. */ @Test public void testWriteRead() { diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CRSHelperFunctions.groovy b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CRSHelperFunctions.groovy index 142aa914fd..51b808360a 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CRSHelperFunctions.groovy +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CRSHelperFunctions.groovy @@ -74,12 +74,13 @@ class CRSHelperFunctions { */ public static final eu.esdihumboldt.cst.functions.groovy.helper.spec.Specification _fromWKT_spec = SpecBuilder.newSpec( // description: 'Build a CRS definition from a well-known text (WKT) representation.', // - result: 'the CRS definition') { // - wkt('Well-known text definition of a coordinate reference system') } // + result: 'the CRS definition') { + // + wkt('Well-known text definition of a coordinate reference system') + } // @CompileStatic static CRSDefinition _fromWKT(def wkt) { new WKTDefinition(wkt as String, null) } - } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CalculateArea.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CalculateArea.java index 924c1335ce..1fdd802937 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CalculateArea.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CalculateArea.java @@ -16,13 +16,7 @@ package eu.esdihumboldt.cst.functions.geometric; -import java.util.List; -import java.util.Map; - -import org.locationtech.jts.geom.Geometry; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -34,6 +28,9 @@ import eu.esdihumboldt.hale.common.instance.helper.DepthFirstInstanceTraverser; import eu.esdihumboldt.hale.common.instance.helper.InstanceTraverser; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import java.util.List; +import java.util.Map; +import org.locationtech.jts.geom.Geometry; /** * Calculate area function diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CalculateLength.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CalculateLength.java index 977833e89a..3aae24bacf 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CalculateLength.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/CalculateLength.java @@ -16,13 +16,7 @@ package eu.esdihumboldt.cst.functions.geometric; -import java.util.List; -import java.util.Map; - -import org.locationtech.jts.geom.Geometry; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -34,6 +28,9 @@ import eu.esdihumboldt.hale.common.instance.helper.DepthFirstInstanceTraverser; import eu.esdihumboldt.hale.common.instance.helper.InstanceTraverser; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import java.util.List; +import java.util.Map; +import org.locationtech.jts.geom.Geometry; /** * Calculate length function diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/Centroid.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/Centroid.java index ffa4d10f7a..461735d8ce 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/Centroid.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/Centroid.java @@ -16,14 +16,7 @@ package eu.esdihumboldt.cst.functions.geometric; -import java.util.List; -import java.util.Map; - import com.google.common.collect.ListMultimap; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.geom.Point; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -40,6 +33,11 @@ import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; +import java.util.List; +import java.util.Map; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Point; /** * Centroid function. @@ -64,7 +62,8 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine TypeDefinition targetType = resultProperty.getDefinition().getPropertyType(); // TODO check element type? Class binding = targetType.getConstraint(Binding.class).getBinding(); - if (Geometry.class.isAssignableFrom(binding) && binding.isAssignableFrom(result.getClass())) { + if (Geometry.class.isAssignableFrom(binding) + && binding.isAssignableFrom(result.getClass())) { return result.getGeometry(); } return result; @@ -76,8 +75,8 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine * @param geometryHolder {@link Geometry}, {@link GeometryProperty} or * {@link Instance} holding a geometry * @return the centroid of the geometry - * @throws TransformationException if the no geometry could be extracted - * from the input + * @throws TransformationException if the no geometry could be extracted from + * the input */ public static GeometryProperty calculateCentroid(Object geometryHolder) throws TransformationException { diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/GeometryHelperFunctions.groovy b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/GeometryHelperFunctions.groovy index 7aef0f80ce..05129b39dd 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/GeometryHelperFunctions.groovy +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/GeometryHelperFunctions.groovy @@ -15,21 +15,6 @@ package eu.esdihumboldt.cst.functions.geometric; -import java.text.MessageFormat - -import javax.annotation.Nullable -import javax.xml.namespace.QName - -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.GeometryFactory -import org.locationtech.jts.geom.LineString -import org.locationtech.jts.geom.MultiLineString -import org.locationtech.jts.geom.MultiPoint -import org.locationtech.jts.geom.MultiPolygon -import org.locationtech.jts.geom.Point -import org.locationtech.jts.geom.Polygon -import org.locationtech.jts.io.WKTReader - import de.fhg.igd.geom.BoundingBox import de.fhg.igd.slf4jplus.ALogger import de.fhg.igd.slf4jplus.ALoggerFactory @@ -55,6 +40,18 @@ import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty import eu.esdihumboldt.hale.common.schema.model.SchemaSpace import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import groovy.transform.CompileStatic +import java.text.MessageFormat +import javax.annotation.Nullable +import javax.xml.namespace.QName +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.GeometryFactory +import org.locationtech.jts.geom.LineString +import org.locationtech.jts.geom.MultiLineString +import org.locationtech.jts.geom.MultiPoint +import org.locationtech.jts.geom.MultiPolygon +import org.locationtech.jts.geom.Point +import org.locationtech.jts.geom.Polygon +import org.locationtech.jts.io.WKTReader /** * Geometry helper functions for Groovy scripts. @@ -74,8 +71,10 @@ class GeometryHelperFunctions { */ public static final Specification _centroid_spec = SpecBuilder.newSpec( // description: 'Calculate the centroid of a geometry.', - result: 'The Point geometry that is the centroid of the given geometry (wrapped in a GeometryProperty) or null.') { // - geometry(GEOM_HOLDER_DESC) } + result: 'The Point geometry that is the centroid of the given geometry (wrapped in a GeometryProperty) or null.') { + // + geometry(GEOM_HOLDER_DESC) + } /** * Calculate the centroid of a given geometry. @@ -99,7 +98,8 @@ class GeometryHelperFunctions { return null; } - if (!result.geometry || ((Geometry)result.geometry).isEmpty()) { // Explicit cast to circumvent type inferring problems of Groovy 2.3.11 + if (!result.geometry || ((Geometry)result.geometry).isEmpty()) { + // Explicit cast to circumvent type inferring problems of Groovy 2.3.11 return null; } @@ -111,8 +111,10 @@ class GeometryHelperFunctions { */ public static final Specification _interiorPoint_spec = SpecBuilder.newSpec( // description: 'Computes an interior point of a geometry (up to 2D). An interior point is guaranteed to lie in the interior of the geometry, if it is possible to calculate such a point exactly. Otherwise, the point may lie on the boundary of the geometry (e.g. if the geometry is a line).', - result: 'A point geometry that lies within (or, if this is not possible, on the boundary) of the given geometry (wrapped in a GeometryProperty) or null.') { // - geometry(GEOM_HOLDER_DESC) } + result: 'A point geometry that lies within (or, if this is not possible, on the boundary) of the given geometry (wrapped in a GeometryProperty) or null.') { + // + geometry(GEOM_HOLDER_DESC) + } /** * Calculate an interior point of a given geometry. @@ -126,7 +128,8 @@ class GeometryHelperFunctions { static GeometryProperty _interiorPoint(def geometryHolder) { GeometryProperty result = InteriorPoint.calculateInteriorPoint(geometryHolder); - if (!result.geometry || ((Geometry)result.geometry).isEmpty()) { // Explicit cast to circumvent type inferring problems of Groovy 2.3.11 + if (!result.geometry || ((Geometry)result.geometry).isEmpty()) { + // Explicit cast to circumvent type inferring problems of Groovy 2.3.11 return null; } @@ -317,7 +320,6 @@ class GeometryHelperFunctions { // all are already type definitions types = argTypes as List } - } if (box != null) { @@ -353,8 +355,10 @@ class GeometryHelperFunctions { */ public static final Specification _find_spec = SpecBuilder.newSpec( // description: 'Find a geometry in the given objects.', - result: 'the first geometry found (wrapped in a GeometryProperty) or null.') { // - objects('An object or a list of objects to search for geometries') } + result: 'the first geometry found (wrapped in a GeometryProperty) or null.') { + // + objects('An object or a list of objects to search for geometries') + } @CompileStatic static GeometryProperty _find(def geometryHolder) { @@ -390,8 +394,10 @@ class GeometryHelperFunctions { */ public static final Specification _findAll_spec = SpecBuilder.newSpec( // description: 'Find geometries in the given objects.', - result: 'the list of found geometries (each wrapped in a GeometryProperty)') { // - objects('An object or a list of objects to search for geometries') } + result: 'the list of found geometries (each wrapped in a GeometryProperty)') { + // + objects('An object or a list of objects to search for geometries') + } @CompileStatic static List> _findAll(def geometryHolder) { @@ -421,8 +427,10 @@ class GeometryHelperFunctions { */ public static final Specification _aggregate_spec = SpecBuilder.newSpec( // description: 'Aggregate geometries in the given objects.', - result: 'the aggregated geometry (wrapped in a GeometryProperty) or null') { // - geometries('A single or multiple (as a list/iterable) geometries, geometry properties or instances holding a geometry') } + result: 'the aggregated geometry (wrapped in a GeometryProperty) or null') { + // + geometries('A single or multiple (as a list/iterable) geometries, geometry properties or instances holding a geometry') + } @CompileStatic static GeometryProperty _aggregate(def geometryHolders) { @@ -448,8 +456,10 @@ class GeometryHelperFunctions { */ public static final Specification _findPolygons_spec = SpecBuilder.newSpec( // description: 'Find polygon or multi-polygon geometries in the given objects.', - result: 'the list of found geometries (each wrapped in a GeometryProperty)') { // - objects('An object or a list of objects to search for geometries') } + result: 'the list of found geometries (each wrapped in a GeometryProperty)') { + // + objects('An object or a list of objects to search for geometries') + } @CompileStatic static Collection> _findPolygons(def geometryHolders) { @@ -466,8 +476,10 @@ class GeometryHelperFunctions { */ public static final Specification _findLines_spec = SpecBuilder.newSpec( // description: 'Find line or multi-line geometries in the given objects.', - result: 'the list of found geometries (each wrapped in a GeometryProperty)') { // - objects('An object or a list of objects to search for geometries') } + result: 'the list of found geometries (each wrapped in a GeometryProperty)') { + // + objects('An object or a list of objects to search for geometries') + } @CompileStatic static Collection> _findLines(def geometryHolders) { @@ -484,8 +496,10 @@ class GeometryHelperFunctions { */ public static final Specification _findPoints_spec = SpecBuilder.newSpec( // description: 'Find point or multi-point geometries in the given objects.', - result: 'the list of found geometries (each wrapped in a GeometryProperty)') { // - objects('An object or a list of objects to search for geometries') } + result: 'the list of found geometries (each wrapped in a GeometryProperty)') { + // + objects('An object or a list of objects to search for geometries') + } @CompileStatic static Collection> _findPoints(def geometryHolders) { @@ -502,8 +516,10 @@ class GeometryHelperFunctions { */ public static final Specification _splitMulti_spec = SpecBuilder.newSpec( // description: 'Split multi-geometries into separate geometries.', - result: 'the list of single geometries (each wrapped in a GeometryProperty)') { // - geometries('A single or multiple (as a list/iterable) geometries, geometry properties or instances holding a geometry') } + result: 'the list of single geometries (each wrapped in a GeometryProperty)') { + // + geometries('A single or multiple (as a list/iterable) geometries, geometry properties or instances holding a geometry') + } @CompileStatic static Collection> _splitMulti(def geometryHolders) { @@ -548,7 +564,8 @@ class GeometryHelperFunctions { result: 'the geometry wrapped in a GeometryProperty and with the given CRS associated') { // geometry('A geometry object, a WKT geometry definition, a geometry property or an instance holding a geometry') // - crs('the coordinate reference system definition object or code') } + crs('the coordinate reference system definition object or code') + } @CompileStatic static GeometryProperty _with(Map args) { @@ -591,5 +608,4 @@ class GeometryHelperFunctions { null } } - } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/NetworkExpansion.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/NetworkExpansion.java index fc9f664cc5..029b3e49fb 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/NetworkExpansion.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/NetworkExpansion.java @@ -16,19 +16,7 @@ package eu.esdihumboldt.cst.functions.geometric; -import java.util.List; -import java.util.Map; - -import javax.annotation.Nullable; -import javax.script.ScriptException; - -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.operation.buffer.BufferOp; -import org.locationtech.jts.operation.buffer.BufferParameters; -import org.springframework.core.convert.ConversionException; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -46,22 +34,30 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.scripting.scripts.mathematical.MathScript; import eu.esdihumboldt.hale.common.scripting.transformation.AbstractSingleTargetScriptedPropertyTransformation; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; +import javax.script.ScriptException; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.operation.buffer.BufferOp; +import org.locationtech.jts.operation.buffer.BufferParameters; +import org.springframework.core.convert.ConversionException; /** * Network expansion function. * * @author Simon Templer */ -public class NetworkExpansion extends - AbstractSingleTargetScriptedPropertyTransformation implements - NetworkExpansionFunction { +public class NetworkExpansion + extends AbstractSingleTargetScriptedPropertyTransformation + implements NetworkExpansionFunction { private static int CAP_STYLE = BufferParameters.CAP_ROUND; /** * @see AbstractSingleTargetScriptedPropertyTransformation#evaluate(String, - * TransformationEngine, ListMultimap, String, - * PropertyEntityDefinition, Map, TransformationLog) + * TransformationEngine, ListMultimap, String, PropertyEntityDefinition, + * Map, TransformationLog) */ @Override protected Object evaluate(String transformationIdentifier, TransformationEngine engine, @@ -69,8 +65,8 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine PropertyEntityDefinition resultProperty, Map executionParameters, TransformationLog log) throws TransformationException, NoResultException { // get the buffer width parameter - String bufferWidthString = getTransformedParameterChecked(PARAMETER_BUFFER_WIDTH).as( - String.class); + String bufferWidthString = getTransformedParameterChecked(PARAMETER_BUFFER_WIDTH) + .as(String.class); double bufferWidth; try { @@ -83,7 +79,8 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine variables.get(ENTITY_VARIABLE), getExecutionContext()); bufferWidth = ConversionUtil.getAs(result, Double.class); } catch (ScriptException e1) { - throw new TransformationException("Failed to evaluate buffer width expression.", e1); + throw new TransformationException("Failed to evaluate buffer width expression.", + e1); } catch (ConversionException e2) { throw new TransformationException( "Failed to convert buffer width expression result to double.", e2); @@ -140,10 +137,9 @@ public static GeometryProperty calculateBuffer(Object geometryHolder, if (geometries.size() > 1) { if (log != null) { - log.warn(log - .createMessage( - "Multiple geometries found, but network expansion is only done on the first.", - null)); + log.warn(log.createMessage( + "Multiple geometries found, but network expansion is only done on the first.", + null)); } } } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/NetworkExpansionExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/NetworkExpansionExplanation.java index 0d2f518491..e2f49cf127 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/NetworkExpansionExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/NetworkExpansionExplanation.java @@ -16,17 +16,16 @@ package eu.esdihumboldt.cst.functions.geometric; -import java.text.MessageFormat; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.stream.Collectors; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.impl.AbstractCellExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; /** * Explanation for {@link NetworkExpansion} cells. @@ -58,7 +57,7 @@ protected String getExplanation(Cell cell, boolean html, ServiceProvider service Map varToProperty = variables.stream() .collect(Collectors.toMap(entity -> { return getEntityNameWithoutCondition(entity); - } , entity -> { + }, entity -> { return formatEntity(entity, true, false, locale); })); explanation += buildReplacementTable(varToProperty, locale); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/OrdinatesToPoint.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/OrdinatesToPoint.java index 19335faa6e..cb2f0a9721 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/OrdinatesToPoint.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/OrdinatesToPoint.java @@ -16,15 +16,7 @@ package eu.esdihumboldt.cst.functions.geometric; -import java.util.Map; - -import net.jcip.annotations.Immutable; - import com.google.common.collect.ListMultimap; -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.geom.Point; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -35,6 +27,11 @@ import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import java.util.Map; +import net.jcip.annotations.Immutable; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Point; /** * Ordinates to point function. @@ -42,9 +39,9 @@ * @author Kai Schwierczek */ @Immutable -public class OrdinatesToPoint extends - AbstractSingleTargetPropertyTransformation implements - OrdinatesToPointFunction { +public class OrdinatesToPoint + extends AbstractSingleTargetPropertyTransformation + implements OrdinatesToPointFunction { /** * @see eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractPropertyTransformation#evaluate(java.lang.String, @@ -79,8 +76,8 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine if (z == null) resultPoint = geomFactory.createPoint(new Coordinate(xValue, yValue)); else - resultPoint = geomFactory.createPoint(new Coordinate(xValue, yValue, z - .getValueAs(Double.class))); + resultPoint = geomFactory + .createPoint(new Coordinate(xValue, yValue, z.getValueAs(Double.class))); // pack result into geometry property and return it GeometryProperty result = new DefaultGeometryProperty(crsDef, resultPoint); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/ReprojectGeometry.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/ReprojectGeometry.java index b966ee6161..e05b186bda 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/ReprojectGeometry.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/ReprojectGeometry.java @@ -1,19 +1,6 @@ package eu.esdihumboldt.cst.functions.geometric; -import java.util.List; -import java.util.Map; - -import org.geotools.geometry.jts.JTS; -import org.geotools.referencing.CRS; -import org.opengis.geometry.MismatchedDimensionException; -import org.opengis.referencing.FactoryException; -import org.opengis.referencing.crs.CoordinateReferenceSystem; -import org.opengis.referencing.operation.MathTransform; -import org.opengis.referencing.operation.TransformException; - import com.google.common.collect.ListMultimap; -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -29,7 +16,17 @@ import eu.esdihumboldt.hale.common.instance.helper.InstanceTraverser; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import java.util.List; +import java.util.Map; import net.jcip.annotations.Immutable; +import org.geotools.geometry.jts.JTS; +import org.geotools.referencing.CRS; +import org.locationtech.jts.geom.Geometry; +import org.opengis.geometry.MismatchedDimensionException; +import org.opengis.referencing.FactoryException; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.operation.MathTransform; +import org.opengis.referencing.operation.TransformException; /** * Reproject geometry function. @@ -98,8 +95,8 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine } /** - * Construct a {@link CoordinateReferenceSystem} instance by parsing the - * input string via a {@link CRSDefinitionManager} instance. + * Construct a {@link CoordinateReferenceSystem} instance by parsing the input + * string via a {@link CRSDefinitionManager} instance. * * @param crs string representation of the CRS * @return the {@link CoordinateReferenceSystem} instance @@ -121,13 +118,13 @@ private CoordinateReferenceSystem parseReferenceSystemParamter(String crs) { } /** - * Attempt to find a math transform between the specified Coordinate - * Reference Systems. + * Attempt to find a math transform between the specified Coordinate Reference + * Systems. *

      - * The method first tries to look up a relevant MathTransform instance from - * the provided {@code context} object; then, if none was found, it creates - * a new one and stores it in the context, to allow its reuse by following - * reproject transformations. + * The method first tries to look up a relevant MathTransform instance from the + * provided {@code context} object; then, if none was found, it creates a new + * one and stores it in the context, to allow its reuse by following reproject + * transformations. *

      * * @param sourceCRS The source CRS. @@ -155,8 +152,8 @@ private MathTransform getOrCreateMathTransform(CoordinateReferenceSystem sourceC } /** - * Attempt to find a math transform between the specified Coordinate - * Reference Systems. + * Attempt to find a math transform between the specified Coordinate Reference + * Systems. * * @param sourceCRS The source CRS. * @param targetCRS The target CRS. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/SRSValidator.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/SRSValidator.java index 66e0c672dd..66c187f5e3 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/SRSValidator.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/SRSValidator.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.cst.functions.geometric; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.core.parameter.Validator; import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/SimpleFeatureGeometryHelpers.groovy b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/SimpleFeatureGeometryHelpers.groovy index c3cdca3ae3..4e8ec81c08 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/SimpleFeatureGeometryHelpers.groovy +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/SimpleFeatureGeometryHelpers.groovy @@ -15,17 +15,16 @@ package eu.esdihumboldt.cst.functions.geometric -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.GeometryCollection -import org.locationtech.jts.geom.GeometryFactory -import org.locationtech.jts.geom.LineString -import org.locationtech.jts.geom.MultiLineString - import eu.esdihumboldt.cst.functions.groovy.helper.spec.SpecBuilder import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty import eu.esdihumboldt.util.geometry.CurveHelper import groovy.transform.CompileStatic +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.GeometryCollection +import org.locationtech.jts.geom.GeometryFactory +import org.locationtech.jts.geom.LineString +import org.locationtech.jts.geom.MultiLineString /** * Helpers related to simple feature geometries. @@ -93,5 +92,4 @@ class SimpleFeatureGeometryHelpers { return [geometry] } } - } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/aggregate/AggregateTransformation.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/aggregate/AggregateTransformation.java index f90d973f6c..daf014ea41 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/aggregate/AggregateTransformation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/aggregate/AggregateTransformation.java @@ -15,26 +15,9 @@ package eu.esdihumboldt.cst.functions.geometric.aggregate; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import javax.annotation.Nullable; - import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.collect.ListMultimap; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryCollection; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.MultiLineString; -import org.locationtech.jts.geom.MultiPoint; -import org.locationtech.jts.geom.MultiPolygon; -import org.locationtech.jts.geom.Point; -import org.locationtech.jts.geom.Polygon; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -51,15 +34,29 @@ import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import eu.esdihumboldt.util.geometry.CurveHelper; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryCollection; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.MultiLineString; +import org.locationtech.jts.geom.MultiPoint; +import org.locationtech.jts.geom.MultiPolygon; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; /** * Aggregates input geometries if possible. * * @author Simon Templer */ -public class AggregateTransformation extends - AbstractSingleTargetPropertyTransformation implements - AggregateFunction { +public class AggregateTransformation + extends AbstractSingleTargetPropertyTransformation + implements AggregateFunction { @Override protected Object evaluate(String transformationIdentifier, TransformationEngine engine, @@ -85,13 +82,12 @@ public Object apply(PropertyValue input) { * @param cell the currently process cell or null * @param log the transformation log or null * @return the aggregated geometry - * @throws TransformationException if source geometries don't have a common - * CRS + * @throws TransformationException if source geometries don't have a common CRS * @throws NoResultException if the result extent would be null */ public static GeometryProperty aggregateGeometries(Iterable geometries, - @Nullable TransformationLog log, @Nullable Cell cell) throws NoResultException, - TransformationException { + @Nullable TransformationLog log, @Nullable Cell cell) + throws NoResultException, TransformationException { InstanceTraverser traverser = new DepthFirstInstanceTraverser(true); GeometryFinder geoFind = new GeometryFinder(null); @@ -178,8 +174,8 @@ else if (Polygon.class.isAssignableFrom(commonGeometryType)) { .toArray(new Polygon[collectedGeometries.size()])); } else { - return fact.createGeometryCollection(collectedGeometries - .toArray(new Geometry[collectedGeometries.size()])); + return fact.createGeometryCollection( + collectedGeometries.toArray(new Geometry[collectedGeometries.size()])); } } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentHelperFunctions.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentHelperFunctions.java index 28dc8d874a..03c1ff4074 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentHelperFunctions.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentHelperFunctions.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.cst.functions.geometric.extent; -import java.text.MessageFormat; -import java.util.Collections; - -import javax.annotation.Nullable; - import eu.esdihumboldt.cst.functions.groovy.helper.spec.Argument; import eu.esdihumboldt.cst.functions.groovy.helper.spec.impl.HelperFunctionArgument; import eu.esdihumboldt.cst.functions.groovy.helper.spec.impl.HelperFunctionSpecification; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationException; import eu.esdihumboldt.hale.common.align.transformation.function.impl.NoResultException; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import java.text.MessageFormat; +import java.util.Collections; +import javax.annotation.Nullable; /** * Helper functions for use in Groovy scripts related to extent calculation. @@ -35,8 +33,7 @@ @SuppressWarnings("javadoc") public class ExtentHelperFunctions { - private static final Argument GEOMETRIES_ARG_SPEC = new HelperFunctionArgument( - "geometries", + private static final Argument GEOMETRIES_ARG_SPEC = new HelperFunctionArgument("geometries", "A single or multiple (as a list/iterable) geometries, geometry properties or instances holding a geometry"); @Nullable @@ -63,8 +60,10 @@ public GeometryProperty _bbox(Object geometryHolders) throws TransformationEx } public HelperFunctionSpecification _bbox_spec(String name) { - return new HelperFunctionSpecification(MessageFormat.format( - "The {0} function calculates the bounding box of the given geometries", name), + return new HelperFunctionSpecification( + MessageFormat.format( + "The {0} function calculates the bounding box of the given geometries", + name), "the calculated bounding box (wrapped in a GeometryProperty)", // GEOMETRIES_ARG_SPEC); } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentTransformation.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentTransformation.java index 38dd39c6ff..265ac0ccf9 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentTransformation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentTransformation.java @@ -15,16 +15,9 @@ package eu.esdihumboldt.cst.functions.geometric.extent; -import java.util.Arrays; -import java.util.Map; - import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.collect.ListMultimap; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryCollection; -import org.locationtech.jts.geom.GeometryFactory; - import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -39,6 +32,11 @@ import eu.esdihumboldt.hale.common.instance.helper.InstanceTraverser; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import java.util.Arrays; +import java.util.Map; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryCollection; +import org.locationtech.jts.geom.GeometryFactory; /** * Computes the extent of all input geometries. @@ -50,10 +48,9 @@ public class ExtentTransformation extends /** * Number of Geometries to be processed at once by either extent option. - * Especially the "union" process run time depends on this value. A too - * large value causes a @code{java.lang.OutOfMemoryError}. The chosen value - * results in fairly good processing time of 30-60 seconds per 10,000 - * geometries. + * Especially the "union" process run time depends on this value. A too large + * value causes a @code{java.lang.OutOfMemoryError}. The chosen value results in + * fairly good processing time of 30-60 seconds per 10,000 geometries. */ private static final short SIMULTAN_PROCESS_GEOMS = 768; @@ -81,8 +78,7 @@ public Object apply(PropertyValue input) { * @param geometries the geometries or instances containing geometries * @param type the type of extent to calculate * @return the calculated extent - * @throws TransformationException if source geometries don't have a common - * CRS + * @throws TransformationException if source geometries don't have a common CRS * @throws NoResultException if the result extent would be null */ public static GeometryProperty calculateExtent(Iterable geometries, ExtentType type) @@ -143,8 +139,9 @@ public static GeometryProperty calculateExtent(Iterable geometries, Extent } Geometry extent = resolveParam( - new GeometryCollection(Arrays.copyOfRange(geomsCollectingArray, 0, - geomsCollectedIdx), fact), type); + new GeometryCollection( + Arrays.copyOfRange(geomsCollectingArray, 0, geomsCollectedIdx), fact), + type); if (extent != null) { return new DefaultGeometryProperty(commonCrs, extent); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentType.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentType.java index 8006b22dac..bbd79991d6 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentType.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/extent/ExtentType.java @@ -21,6 +21,7 @@ * @author Simon Templer */ public enum ExtentType { + /** Bounding box */ BBOX(ExtentFunction.PARAM_BOUNDING_BOX), // /** Convex hull */ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/interiorpoint/InteriorPoint.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/interiorpoint/InteriorPoint.java index a90040a6cc..a41b240835 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/interiorpoint/InteriorPoint.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/interiorpoint/InteriorPoint.java @@ -15,13 +15,7 @@ package eu.esdihumboldt.cst.functions.geometric.interiorpoint; -import java.util.List; -import java.util.Map; - import com.google.common.collect.ListMultimap; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.TopologyException; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -38,6 +32,10 @@ import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; +import java.util.List; +import java.util.Map; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.TopologyException; /** * Interior Point function. @@ -62,7 +60,8 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine TypeDefinition targetType = resultProperty.getDefinition().getPropertyType(); // TODO check element type? Class binding = targetType.getConstraint(Binding.class).getBinding(); - if (Geometry.class.isAssignableFrom(binding) && binding.isAssignableFrom(result.getClass())) { + if (Geometry.class.isAssignableFrom(binding) + && binding.isAssignableFrom(result.getClass())) { return result.getGeometry(); } return result; @@ -75,8 +74,7 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine * @param geometryHolder {@link Geometry}, {@link GeometryProperty} or * {@link Instance} holding a geometry * @return an interior point of the geometry - * @throws TransformationException if the interior point could not be - * calculated + * @throws TransformationException if the interior point could not be calculated */ public static GeometryProperty calculateInteriorPoint(Object geometryHolder) throws TransformationException { diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinHandler.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinHandler.java index c8192311b0..0a6583ec00 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinHandler.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinHandler.java @@ -15,26 +15,9 @@ package eu.esdihumboldt.cst.functions.geometric.join; -import java.text.MessageFormat; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimap; - import de.fhg.igd.geom.BoundingBox; import de.fhg.igd.geom.Localizable; import eu.esdihumboldt.cst.functions.geometric.join.SpatialJoinParameter.SpatialJoinCondition; @@ -60,6 +43,19 @@ import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.instance.model.impl.FilterResourceIteratorAdapter; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Geometry; /** * Join based on the spatial relation of geometry properties. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinParameter.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinParameter.java index 4f44b7828a..a8e77402e2 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinParameter.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinParameter.java @@ -15,6 +15,10 @@ package eu.esdihumboldt.cst.functions.geometric.join; +import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; +import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; +import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -22,11 +26,6 @@ import java.util.List; import java.util.Set; -import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; -import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Parameter for a spatial join transformation. * @@ -59,11 +58,10 @@ public SpatialJoinParameter(List types, /** * Checks whether this join parameter is valid.
      *
      - * Valid means, that there has to be at least two types, with each type - * after the first having at least one join condition on previous types. + * Valid means, that there has to be at least two types, with each type after + * the first having at least one join condition on previous types. * - * @return a error description or null if the parameter is - * valid. + * @return a error description or null if the parameter is valid. */ public String validate() { // enough types? @@ -160,9 +158,8 @@ public static class SpatialJoinCondition { public final String relation; /** - * Constructs a join condition to join the type of - * joinProperty if the condition - * joinProperty = baseProperty matches. + * Constructs a join condition to join the type of joinProperty if + * the condition joinProperty = baseProperty matches. * * @param baseProperty the property of a base type * @param joinProperty the property of the type to join diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinParameterType.groovy b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinParameterType.groovy index 7132d8bc79..1675038516 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinParameterType.groovy +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialJoinParameterType.groovy @@ -15,11 +15,6 @@ package eu.esdihumboldt.cst.functions.geometric.join; -import javax.xml.parsers.DocumentBuilderFactory - -import org.w3c.dom.Document -import org.w3c.dom.Element - import eu.esdihumboldt.cst.functions.geometric.join.SpatialJoinParameter.SpatialJoinCondition import eu.esdihumboldt.hale.common.align.helper.EntityDefinitionComparator import eu.esdihumboldt.hale.common.align.io.LoadAlignmentContext @@ -31,6 +26,9 @@ import eu.esdihumboldt.hale.common.schema.model.TypeIndex import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import eu.esdihumboldt.util.xml.XmlUtil import groovy.xml.dom.DOMCategory +import javax.xml.parsers.DocumentBuilderFactory +import org.w3c.dom.Document +import org.w3c.dom.Element /** * Descriptor for conversion between DOM and SpatialJoinParameter. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialRelationEvaluator.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialRelationEvaluator.java index 6c7191c8c2..64e25bef44 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialRelationEvaluator.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/src/eu/esdihumboldt/cst/functions/geometric/join/SpatialRelationEvaluator.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.cst.functions.geometric.join; import java.util.function.BiFunction; - import org.locationtech.jts.geom.Geometry; /** @@ -113,8 +112,8 @@ public SpatialRelationEvaluator relation() { * Returns the {@link StandardRelation} that has the given title. * * @param relation Title of the relation to return - * @return the {@link StandardRelation} with the given title or null if - * none exists + * @return the {@link StandardRelation} with the given title or null if none + * exists */ public static StandardRelation valueOfOrNull(String relation) { try { @@ -140,8 +139,7 @@ public static StandardRelation valueOfOrNull(String relation) { String getDescription(); /** - * Builds a {@link SpatialRelationEvaluator} for a specific evaluation - * function. + * Builds a {@link SpatialRelationEvaluator} for a specific evaluation function. * * @param description Description of the spatial relation evaluation, e.g. * "covers" diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/CRSHelperFunctionsTest.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/CRSHelperFunctionsTest.java index 5ab8e980e0..17520614ba 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/CRSHelperFunctionsTest.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/CRSHelperFunctionsTest.java @@ -19,15 +19,13 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.util.HashMap; -import java.util.Map; - -import org.junit.Test; - import eu.esdihumboldt.cst.functions.geometric.CRSHelperFunctions; import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; import eu.esdihumboldt.hale.common.instance.geometry.impl.WKTDefinition; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; /** * Tests for geometry helper functions diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/GeometryHelperFunctionsTest.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/GeometryHelperFunctionsTest.java index dc47568328..6abe64328a 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/GeometryHelperFunctionsTest.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/GeometryHelperFunctionsTest.java @@ -18,15 +18,15 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import eu.esdihumboldt.cst.functions.geometric.GeometryHelperFunctions; +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; - import org.junit.Test; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; @@ -37,9 +37,6 @@ import org.locationtech.jts.geom.Point; import org.locationtech.jts.geom.Polygon; -import eu.esdihumboldt.cst.functions.geometric.GeometryHelperFunctions; -import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; - /** * Tests for geometry helper functions * diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/InteriorPointTest.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/InteriorPointTest.java index 303d8519d6..2f5c3db19b 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/InteriorPointTest.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/InteriorPointTest.java @@ -18,12 +18,14 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import eu.esdihumboldt.cst.functions.geometric.interiorpoint.InteriorPoint; +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import eu.esdihumboldt.util.svg.test.PaintSettings; +import eu.esdihumboldt.util.svg.test.SVGPainter; import java.awt.Color; import java.io.File; import java.nio.file.Path; - import org.junit.Test; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LinearRing; @@ -31,11 +33,6 @@ import org.locationtech.jts.geom.Point; import org.locationtech.jts.geom.Polygon; -import eu.esdihumboldt.cst.functions.geometric.interiorpoint.InteriorPoint; -import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; -import eu.esdihumboldt.util.svg.test.PaintSettings; -import eu.esdihumboldt.util.svg.test.SVGPainter; - /** * Tests checking if a calculated point is inside the original area. * @@ -83,8 +80,8 @@ protected void testPointWithin(MultiPolygon geometry) throws Exception { if (GEN_IMAGES) { /* - * Stuff related to SVG commented out because of issues with - * dependencies in test product. + * Stuff related to SVG commented out because of issues with dependencies in + * test product. */ PaintSettings settings = new PaintSettings(geometry.getEnvelopeInternal(), MAX_SIZE, @@ -161,19 +158,14 @@ public void testTriangleHole() throws Exception { */ @Test public void testCurve() throws Exception { - LinearRing outer = factory - .createLinearRing( - new Coordinate[] { new Coordinate(49.87377, 8.65508), - new Coordinate(49.87369, 8.65529), new Coordinate(49.87356, - 8.65544), - new Coordinate(49.87349, 8.65549), - new Coordinate(49.87327, 8.65566), new Coordinate(49.87325, 8.6556), - new Coordinate(49.8734, 8.65548), new Coordinate(49.87351, 8.6554), - new Coordinate(49.87357, 8.65532), - new Coordinate(49.87365, 8.65518), - new Coordinate(49.87371, 8.65497), - new Coordinate(49.87376, 8.65444), new Coordinate(49.87385, 8.6545), - new Coordinate(49.87377, 8.65508) }); + LinearRing outer = factory.createLinearRing(new Coordinate[] { + new Coordinate(49.87377, 8.65508), new Coordinate(49.87369, 8.65529), + new Coordinate(49.87356, 8.65544), new Coordinate(49.87349, 8.65549), + new Coordinate(49.87327, 8.65566), new Coordinate(49.87325, 8.6556), + new Coordinate(49.8734, 8.65548), new Coordinate(49.87351, 8.6554), + new Coordinate(49.87357, 8.65532), new Coordinate(49.87365, 8.65518), + new Coordinate(49.87371, 8.65497), new Coordinate(49.87376, 8.65444), + new Coordinate(49.87385, 8.6545), new Coordinate(49.87377, 8.65508) }); Polygon geom = factory.createPolygon(outer); testPointWithin(geom); } @@ -217,36 +209,23 @@ public void testCurve2() throws Exception { */ @Test public void testFootprint() throws Exception { - LinearRing outer = factory - .createLinearRing( - new Coordinate[] { new Coordinate(49.87367, 8.65714), - new Coordinate(49.87362, 8.65741), new Coordinate(49.87365, - 8.65758), - new Coordinate(49.87396, 8.65748), - new Coordinate(49.87399, 8.65766), - new Coordinate(49.87362, 8.65778), - new Coordinate(49.87365, 8.65796), new Coordinate(49.874, 8.65785), - new Coordinate(49.87409, 8.65856), - new Coordinate(49.87403, 8.65858), new Coordinate(49.87402, 8.6585), - new Coordinate(49.87365, 8.65863), - new Coordinate(49.87362, 8.65874), - new Coordinate(49.87369, 8.65873), new Coordinate(49.87372, - 8.65907), - new Coordinate(49.87343, 8.65915), - new Coordinate(49.87339, 8.65884), - new Coordinate(49.87356, 8.65874), - new Coordinate(49.87353, 8.65864), - new Coordinate(49.87348, 8.65867), - new Coordinate(49.87339, 8.65805), new Coordinate(49.8736, 8.65797), - new Coordinate(49.87358, 8.6578), - new Coordinate(49.87336, 8.65788), new Coordinate(49.87332, - 8.65768), - new Coordinate(49.87356, 8.65758), - new Coordinate(49.87354, 8.65745), - new Coordinate(49.87347, 8.65744), - new Coordinate(49.87338, 8.65723), new Coordinate(49.8734, 8.65701), - new Coordinate(49.8736, 8.65698), - new Coordinate(49.87367, 8.65714) }); + LinearRing outer = factory.createLinearRing(new Coordinate[] { + new Coordinate(49.87367, 8.65714), new Coordinate(49.87362, 8.65741), + new Coordinate(49.87365, 8.65758), new Coordinate(49.87396, 8.65748), + new Coordinate(49.87399, 8.65766), new Coordinate(49.87362, 8.65778), + new Coordinate(49.87365, 8.65796), new Coordinate(49.874, 8.65785), + new Coordinate(49.87409, 8.65856), new Coordinate(49.87403, 8.65858), + new Coordinate(49.87402, 8.6585), new Coordinate(49.87365, 8.65863), + new Coordinate(49.87362, 8.65874), new Coordinate(49.87369, 8.65873), + new Coordinate(49.87372, 8.65907), new Coordinate(49.87343, 8.65915), + new Coordinate(49.87339, 8.65884), new Coordinate(49.87356, 8.65874), + new Coordinate(49.87353, 8.65864), new Coordinate(49.87348, 8.65867), + new Coordinate(49.87339, 8.65805), new Coordinate(49.8736, 8.65797), + new Coordinate(49.87358, 8.6578), new Coordinate(49.87336, 8.65788), + new Coordinate(49.87332, 8.65768), new Coordinate(49.87356, 8.65758), + new Coordinate(49.87354, 8.65745), new Coordinate(49.87347, 8.65744), + new Coordinate(49.87338, 8.65723), new Coordinate(49.8734, 8.65701), + new Coordinate(49.8736, 8.65698), new Coordinate(49.87367, 8.65714) }); Polygon geom = factory.createPolygon(outer); testPointWithin(geom); } @@ -365,19 +344,14 @@ public void testStreetHole() throws Exception { new Coordinate(49.8724, 8.65521), new Coordinate(49.87244, 8.65509), new Coordinate(49.87252, 8.65494), new Coordinate(49.87258, 8.65483), new Coordinate(49.87267, 8.65475), new Coordinate(49.87274, 8.6547) }); - LinearRing inner = factory - .createLinearRing( - new Coordinate[] { new Coordinate(49.87246, 8.65545), - new Coordinate(49.87245, 8.65551), new Coordinate(49.87244, - 8.65555), - new Coordinate(49.87241, 8.65557), new Coordinate(49.87236, 8.6556), - new Coordinate(49.87232, 8.6556), new Coordinate(49.87225, 8.65556), - new Coordinate(49.8722, 8.65552), new Coordinate(49.87233, 8.65539), - new Coordinate(49.87235, 8.65539), - new Coordinate(49.87238, 8.65539), - new Coordinate(49.87243, 8.65539), - new Coordinate(49.87245, 8.65541), - new Coordinate(49.87246, 8.65545) }); + LinearRing inner = factory.createLinearRing(new Coordinate[] { + new Coordinate(49.87246, 8.65545), new Coordinate(49.87245, 8.65551), + new Coordinate(49.87244, 8.65555), new Coordinate(49.87241, 8.65557), + new Coordinate(49.87236, 8.6556), new Coordinate(49.87232, 8.6556), + new Coordinate(49.87225, 8.65556), new Coordinate(49.8722, 8.65552), + new Coordinate(49.87233, 8.65539), new Coordinate(49.87235, 8.65539), + new Coordinate(49.87238, 8.65539), new Coordinate(49.87243, 8.65539), + new Coordinate(49.87245, 8.65541), new Coordinate(49.87246, 8.65545) }); Polygon geom = factory.createPolygon(outer, new LinearRing[] { inner }); testPointWithin(geom); } @@ -449,18 +423,13 @@ public void testMulti1() throws Exception { */ @Test public void testProblemCase() throws Exception { - LinearRing outer1 = factory - .createLinearRing(new Coordinate[] { new Coordinate(466713.482, 5974979.283), - new Coordinate(466737.125, 5974995.621), - new Coordinate(466737.125, 5974995.621), - new Coordinate(467230.558, 5975071.481), - new Coordinate(467230.558, 5975071.481), new Coordinate(467309.28, - 5975083.867), - new Coordinate(467309.28, 5975083.867), - new Coordinate(466776.829, 5975009.807), - new Coordinate(466776.829, 5975009.807), - new Coordinate(466742.764, 5974999.507), - new Coordinate(466713.482, 5974979.283) }); + LinearRing outer1 = factory.createLinearRing(new Coordinate[] { + new Coordinate(466713.482, 5974979.283), new Coordinate(466737.125, 5974995.621), + new Coordinate(466737.125, 5974995.621), new Coordinate(467230.558, 5975071.481), + new Coordinate(467230.558, 5975071.481), new Coordinate(467309.28, 5975083.867), + new Coordinate(467309.28, 5975083.867), new Coordinate(466776.829, 5975009.807), + new Coordinate(466776.829, 5975009.807), new Coordinate(466742.764, 5974999.507), + new Coordinate(466713.482, 5974979.283) }); Polygon poly1 = factory.createPolygon(outer1); testPointWithin(factory.createMultiPolygon(new Polygon[] { poly1 })); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/join/SpatialJoinParameterTest.groovy b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/join/SpatialJoinParameterTest.groovy index 360dd121c9..7b66c3a570 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/join/SpatialJoinParameterTest.groovy +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/join/SpatialJoinParameterTest.groovy @@ -15,18 +15,9 @@ package eu.esdihumboldt.cst.functions.geometric.test.join -import eu.esdihumboldt.util.test.AbstractPlatformTest -import org.junit.Test - -import javax.xml.namespace.QName - -import org.w3c.dom.Element - -import org.locationtech.jts.geom.Geometry - import eu.esdihumboldt.cst.functions.geometric.join.SpatialJoinParameter -import eu.esdihumboldt.cst.functions.geometric.join.SpatialJoinParameterType import eu.esdihumboldt.cst.functions.geometric.join.SpatialJoinParameter.SpatialJoinCondition +import eu.esdihumboldt.cst.functions.geometric.join.SpatialJoinParameterType import eu.esdihumboldt.cst.functions.geometric.join.SpatialRelationEvaluator.StandardRelation import eu.esdihumboldt.hale.common.align.io.LoadAlignmentContext import eu.esdihumboldt.hale.common.align.io.impl.internal.LoadAlignmentContextImpl @@ -37,6 +28,11 @@ import eu.esdihumboldt.hale.common.schema.SchemaSpaceID import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.schema.model.TypeDefinition +import eu.esdihumboldt.util.test.AbstractPlatformTest +import javax.xml.namespace.QName +import org.junit.Test +import org.locationtech.jts.geom.Geometry +import org.w3c.dom.Element /** * Tests for {@link SpatialJoinParameter} diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/AbstractHandlerTest.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/AbstractHandlerTest.java index 1619d9b4ef..6a7d6ffa16 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/AbstractHandlerTest.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/AbstractHandlerTest.java @@ -18,14 +18,6 @@ import static org.junit.Assert.assertTrue; -import java.io.IOException; -import java.net.URI; - -import org.junit.Before; -import org.junit.BeforeClass; - -import org.locationtech.jts.geom.GeometryFactory; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; @@ -37,6 +29,11 @@ import eu.esdihumboldt.hale.common.test.TestUtil; import eu.esdihumboldt.hale.io.gml.reader.internal.GmlInstanceReader; import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader; +import java.io.IOException; +import java.net.URI; +import org.junit.Before; +import org.junit.BeforeClass; +import org.locationtech.jts.geom.GeometryFactory; /** * Base class for handler tests. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/ReprojectGeometryTest.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/ReprojectGeometryTest.java index 690279b6f3..69f71486b7 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/ReprojectGeometryTest.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/ReprojectGeometryTest.java @@ -4,20 +4,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.geotools.geometry.jts.JTS; -import org.geotools.referencing.CRS; -import org.junit.Test; -import org.opengis.referencing.operation.MathTransform; - -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.cst.ConceptualSchemaTransformer; import eu.esdihumboldt.cst.test.AbstractTransformationTest; import eu.esdihumboldt.cst.test.TransformationExample; @@ -34,6 +20,16 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.impl.DefaultGroup; import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstance; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import javax.xml.namespace.QName; +import org.geotools.geometry.jts.JTS; +import org.geotools.referencing.CRS; +import org.junit.Test; +import org.locationtech.jts.geom.Geometry; +import org.opengis.referencing.operation.MathTransform; /** * Tests for the ReprojectGeometry transformation function. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/TestData.java b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/TestData.java index e5c65a88c0..203c98056f 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/TestData.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/test/eu/esdihumboldt/cst/functions/geometric/test/reprojectgeometry/TestData.java @@ -1,17 +1,17 @@ package eu.esdihumboldt.cst.functions.geometric.test.reprojectgeometry; +import eu.esdihumboldt.cst.test.TransformationExampleImpl; import java.net.URI; import java.net.URISyntaxException; -import eu.esdihumboldt.cst.test.TransformationExampleImpl; - @SuppressWarnings("javadoc") public class TestData extends TransformationExampleImpl { public TestData(TestDataConfiguration configuration) throws URISyntaxException { - super(toLocalURI(configuration.getSourceSchema()), toLocalURI(configuration - .getTargetSchema()), toLocalURI(configuration.getAlignment()), - toLocalURI(configuration.getSourceData()), null, null, null); + super(toLocalURI(configuration.getSourceSchema()), + toLocalURI(configuration.getTargetSchema()), + toLocalURI(configuration.getAlignment()), toLocalURI(configuration.getSourceData()), + null, null, null); } private static URI toLocalURI(String location) throws URISyntaxException { diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/ContextHelpers.groovy b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/ContextHelpers.groovy index d63fd894be..5260298320 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/ContextHelpers.groovy +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/ContextHelpers.groovy @@ -15,11 +15,10 @@ package eu.esdihumboldt.cst.functions.groovy.helpers -import javax.annotation.Nullable - import eu.esdihumboldt.cst.functions.groovy.helper.HelperContext import eu.esdihumboldt.cst.functions.groovy.helper.spec.SpecBuilder import eu.esdihumboldt.cst.functions.groovy.helpers.util.Collector +import javax.annotation.Nullable /** * Helper functions for interacting with a context map. @@ -35,8 +34,10 @@ class ContextHelpers { */ public static final eu.esdihumboldt.cst.functions.groovy.helper.spec.Specification _collector_spec = SpecBuilder.newSpec( // description: 'Get the Collector associated to a context map.', // - result: 'The Collector instance. Use it to collect values within a transformation') { // - context('The context map, if omitted uses the overall transformation context.') } + result: 'The Collector instance. Use it to collect values within a transformation') { + // + context('The context map, if omitted uses the overall transformation context.') + } @Nullable static Collector _collector(def context, HelperContext hc) { @@ -58,5 +59,4 @@ class ContextHelpers { throw new IllegalArgumentException('You need to provide a context map as argument') } - } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/ConversionHelper.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/ConversionHelper.java index 36a8c32598..6611b4ee15 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/ConversionHelper.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/ConversionHelper.java @@ -15,17 +15,14 @@ package eu.esdihumboldt.cst.functions.groovy.helpers; -import java.util.Map; - -import org.springframework.core.convert.ConversionService; - import com.google.common.base.Preconditions; - import eu.esdihumboldt.cst.functions.groovy.helper.HelperFunction; import eu.esdihumboldt.cst.functions.groovy.helper.spec.Specification; import eu.esdihumboldt.cst.functions.groovy.helper.spec.impl.HelperFunctionArgument; import eu.esdihumboldt.cst.functions.groovy.helper.spec.impl.HelperFunctionSpecification; import eu.esdihumboldt.hale.common.core.HalePlatform; +import java.util.Map; +import org.springframework.core.convert.ConversionService; /** * Helper using the {@link ConversionService} for value conversions. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/CryptoHelpers.groovy b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/CryptoHelpers.groovy index a52226ae1f..1e2ffde68c 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/CryptoHelpers.groovy +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/src/eu/esdihumboldt/cst/functions/groovy/helpers/CryptoHelpers.groovy @@ -15,14 +15,12 @@ package eu.esdihumboldt.cst.functions.groovy.helpers +import eu.esdihumboldt.cst.functions.groovy.helper.spec.SpecBuilder +import groovy.transform.CompileStatic import java.nio.charset.StandardCharsets import java.security.MessageDigest - import javax.annotation.Nullable -import eu.esdihumboldt.cst.functions.groovy.helper.spec.SpecBuilder -import groovy.transform.CompileStatic - /** * Cryptographic helper functions. * @@ -35,8 +33,10 @@ class CryptoHelpers { */ public static final eu.esdihumboldt.cst.functions.groovy.helper.spec.Specification _sha256_spec = SpecBuilder.newSpec( // description: 'Calculate a SHA-256 hash as a hex-encoded string.', // - result: 'Hex-encoded string representation of the hash. For a null input, null will be returned.') { // - input('Input to hash, usually a byte array or String. For Strings the UTF-8 encoded bytes will be hashed.') } + result: 'Hex-encoded string representation of the hash. For a null input, null will be returned.') { + // + input('Input to hash, usually a byte array or String. For Strings the UTF-8 encoded bytes will be hashed.') + } @CompileStatic @Nullable @@ -62,5 +62,4 @@ class CryptoHelpers { digest.update(data) digest.digest().encodeHex() } - } diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyCreate.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyCreate.java index e2d9b44633..a80b0f78e5 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyCreate.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyCreate.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.util.Collections; -import java.util.Map; - import eu.esdihumboldt.cst.functions.groovy.internal.GroovyUtil; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.functions.CreateFunction; @@ -33,6 +30,8 @@ import eu.esdihumboldt.util.groovy.sandbox.GroovyService; import groovy.lang.Binding; import groovy.lang.Script; +import java.util.Collections; +import java.util.Map; /** * Creates instances based on a Groovy script. @@ -50,7 +49,7 @@ public class GroovyCreate extends AbstractTypeTransformation executionParameters, TransformationLog log, Cell cell) - throws TransformationException { + throws TransformationException { // get number of executions int num; String numberExpr = getOptionalParameter(PARAM_NUMBER, Value.of(1)).as(String.class); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyCreateExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyCreateExplanation.java index 8728e77043..de5b07a536 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyCreateExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyCreateExplanation.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.text.MessageFormat; -import java.util.Locale; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.impl.AbstractCellExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.Locale; /** * Explanation for {@link GroovyCreate} diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyExplanation.java index 6f32c643f1..9cd34d309c 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyExplanation.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.text.MessageFormat; -import java.util.Locale; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; @@ -26,6 +23,8 @@ import eu.esdihumboldt.hale.common.core.io.Text; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.Locale; /** * Explanation for groovy cells. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyGreedyTransformation.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyGreedyTransformation.java index afd6f12a7c..c26653b826 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyGreedyTransformation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyGreedyTransformation.java @@ -16,16 +16,7 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.cst.functions.groovy.internal.GroovyUtil; import eu.esdihumboldt.cst.functions.groovy.internal.InstanceAccessorArrayList; import eu.esdihumboldt.hale.common.align.model.Cell; @@ -46,6 +37,13 @@ import groovy.lang.Binding; import groovy.lang.GroovyShell; import groovy.lang.Script; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; /** * Property transformation based on a Groovy script. With greedy variables in @@ -53,8 +51,9 @@ * * @author Kai Schwierczek */ -public class GroovyGreedyTransformation extends - AbstractSingleTargetPropertyTransformationimplements GroovyConstants { +public class GroovyGreedyTransformation + extends AbstractSingleTargetPropertyTransformation + implements GroovyConstants { /** * The function/transformation ID. @@ -62,8 +61,8 @@ public class GroovyGreedyTransformation extends public static final String ID = "eu.esdihumboldt.cst.functions.groovy.greedy"; /** - * Name of the parameter specifying if instances should be used as variables - * in the binding. + * Name of the parameter specifying if instances should be used as variables in + * the binding. */ public static final String PARAM_INSTANCE_VARIABLES = "variablesAsInstances"; @@ -109,15 +108,15 @@ useInstanceVariables, log, getExecutionContext(), * Create a Groovy binding from the list of variables. * * @param vars the variable values - * @param varDefs definition of the assigned variables, in case some - * variable values are not set, may be null + * @param varDefs definition of the assigned variables, in case some variable + * values are not set, may be null * @param cell the cell the binding is created for * @param typeCell the type cell the binding is created for, may be * null * @param builder the instance builder for creating target instances, or * null if not applicable - * @param useInstanceVariables if instances should be used as variables for - * the binding instead of extracting the instance values + * @param useInstanceVariables if instances should be used as variables for the + * binding instead of extracting the instance values * @param log the transformation log * @param context the execution context * @param targetInstanceType the type of the target instance diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyJoin.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyJoin.java index fac74e7d4b..4d743968e4 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyJoin.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyJoin.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.util.Collection; -import java.util.List; - import eu.esdihumboldt.cst.functions.core.Join; import eu.esdihumboldt.cst.functions.core.join.IndexJoinHandler; import eu.esdihumboldt.hale.common.align.model.Cell; @@ -26,6 +23,8 @@ import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.InstanceHandler; import eu.esdihumboldt.hale.common.instance.index.InstanceIndexContribution; +import java.util.Collection; +import java.util.List; /** * Type transformation that joins multiple instances of different source types diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyJoinExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyJoinExplanation.java index 924e17bbdc..d9bd2522af 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyJoinExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyJoinExplanation.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.util.Locale; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.functions.explanations.JoinExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.Locale; /** * Explanation for {@link GroovyJoin} diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyMerge.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyMerge.java index 892b66fff6..17051ed7df 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyMerge.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyMerge.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.util.Collection; -import java.util.List; - import eu.esdihumboldt.cst.functions.core.Merge; import eu.esdihumboldt.cst.functions.core.merge.IndexMergeHandler; import eu.esdihumboldt.hale.common.align.model.Cell; @@ -27,6 +24,8 @@ import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.InstanceHandler; import eu.esdihumboldt.hale.common.instance.index.InstanceIndexContribution; +import java.util.Collection; +import java.util.List; /** * Type transformation that merges multiple instances of the same source type diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyMergeExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyMergeExplanation.java index f5f8815399..53b11e6163 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyMergeExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyMergeExplanation.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.util.Locale; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.functions.explanations.MergeExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.Locale; /** * Explanation for {@link GroovyMerge} diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyRetype.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyRetype.java index 57c68d1442..c47c724b0c 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyRetype.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyRetype.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.util.Map; - import eu.esdihumboldt.cst.functions.groovy.internal.GroovyUtil; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -32,6 +30,7 @@ import eu.esdihumboldt.util.groovy.sandbox.GroovyService; import groovy.lang.Binding; import groovy.lang.Script; +import java.util.Map; /** * 1:1 retype based on a Groovy script. @@ -49,7 +48,7 @@ public class GroovyRetype extends AbstractTypeTransformation executionParameters, TransformationLog log, Cell cell) - throws TransformationException { + throws TransformationException { // for each source instance create a target instance TypeDefinition targetType = getTarget().values().iterator().next().getDefinition() .getDefinition(); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyRetypeExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyRetypeExplanation.java index d0bc594f2e..60c7e032c7 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyRetypeExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyRetypeExplanation.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.util.Locale; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.functions.explanations.RetypeExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.Locale; /** * Explanation for {@link GroovyRetype} diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyTransformation.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyTransformation.java index f9741b2a75..5a0c433ce0 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyTransformation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/GroovyTransformation.java @@ -16,15 +16,8 @@ package eu.esdihumboldt.cst.functions.groovy; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - import com.google.common.base.Joiner; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.cst.functions.groovy.internal.GroovyUtil; import eu.esdihumboldt.cst.functions.groovy.internal.TargetCollector; import eu.esdihumboldt.hale.common.align.model.Cell; @@ -52,18 +45,24 @@ import groovy.lang.Closure; import groovy.lang.GroovyShell; import groovy.lang.Script; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * Property transformation based on a Groovy script. * * @author Simon Templer */ -public class GroovyTransformation extends - AbstractSingleTargetPropertyTransformationimplements GroovyConstants { +public class GroovyTransformation + extends AbstractSingleTargetPropertyTransformation + implements GroovyConstants { /** - * Name of the parameter specifying if instances should be used as variables - * in the binding. + * Name of the parameter specifying if instances should be used as variables in + * the binding. */ public static final String PARAM_INSTANCE_VARIABLES = "variablesAsInstances"; @@ -122,7 +121,7 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine */ public static Object evaluate(Script groovyScript, final InstanceBuilder builder, final TypeDefinition targetType, GroovyService service, SimpleLog log) - throws TransformationException, NoResultException { + throws TransformationException, NoResultException { try { return service.evaluate(groovyScript, new ResultProcessor() { @@ -209,15 +208,15 @@ public static InstanceBuilder createBuilder(PropertyEntityDefinition resultPrope * Create a Groovy binding from the list of variables. * * @param vars the variable values - * @param varDefs definition of the assigned variables, in case some - * variable values are not set, may be null + * @param varDefs definition of the assigned variables, in case some variable + * values are not set, may be null * @param cell the cell the binding is created for * @param typeCell the type cell the binding is created for, may be * null * @param builder the instance builder for creating target instances, or * null if not applicable - * @param useInstanceVariables if instances should be used as variables for - * the binding instead of extracting the instance values + * @param useInstanceVariables if instances should be used as variables for the + * binding instead of extracting the instance values * @param log the transformation log * @param context the execution context * @param targetInstanceType the type of the target instance @@ -304,8 +303,8 @@ public static void addToBinding(Binding binding, PropertyEntityDefinition prop, * Extracts the value to be used in the binding from the present value. * * @param value the original unmodified value - * @param useInstanceVariables if instances should be used as variables for - * the binding instead of extracting the instance values + * @param useInstanceVariables if instances should be used as variables for the + * binding instead of extracting the instance values * @return the value to be used by the script */ public static Object getUseValue(Object value, boolean useInstanceVariables) { diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/filter/GroovyFilter.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/filter/GroovyFilter.java index 485cb40e6f..54aeb71aa4 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/filter/GroovyFilter.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/filter/GroovyFilter.java @@ -15,8 +15,6 @@ package eu.esdihumboldt.cst.functions.groovy.filter; -import java.util.Map; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.cst.functions.groovy.GroovyConstants; @@ -30,6 +28,7 @@ import eu.esdihumboldt.util.groovy.sandbox.GroovyService.ResultProcessor; import groovy.lang.Binding; import groovy.lang.Script; +import java.util.Map; /** * Filter based on a Groovy script. @@ -70,8 +69,8 @@ public boolean match(Instance instance) { */ protected Script getScript(GroovyService service, Binding binding) { /* - * The compiled script is stored in a ThreadLocal variable so it needs - * only to be created once per filter thread. + * The compiled script is stored in a ThreadLocal variable so it needs only to + * be created once per filter thread. */ Script groovyScript = localScript.get(); if (groovyScript == null) { diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/Category.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/Category.java index 04c64a607b..e52d99baf7 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/Category.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/Category.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.cst.functions.groovy.helper; +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; import java.util.Arrays; import java.util.Collections; import java.util.List; - import javax.annotation.Nullable; -import com.google.common.base.Joiner; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterables; - /** * Category for Groovy script helper functions. A category is defined by its * path. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/DefaultHelperContext.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/DefaultHelperContext.java index a8d4d2231d..2c4d2a3c1d 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/DefaultHelperContext.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/DefaultHelperContext.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.cst.functions.groovy.helper; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.transformation.function.ExecutionContext; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import javax.annotation.Nullable; /** * Default implementation of HelperContext interface. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperContext.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperContext.java index 3269696a97..cfef20e1c9 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperContext.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperContext.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.cst.functions.groovy.helper; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.transformation.function.ExecutionContext; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import javax.annotation.Nullable; /** * Context for helper functions. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperFunctionOrCategory.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperFunctionOrCategory.java index fc25e530af..049140a4d2 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperFunctionOrCategory.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperFunctionOrCategory.java @@ -30,15 +30,15 @@ public interface HelperFunctionOrCategory { String getName(); /** - * @return the category if this object represents a category, - * null otherwise + * @return the category if this object represents a category, null + * otherwise */ @Nullable Category asCategory(); /** - * @return the function if this object represents a function, - * null otherwise + * @return the function if this object represents a function, null + * otherwise */ @Nullable HelperFunction asFunction(); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperFunctions.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperFunctions.java index 8715b94530..f397ac566b 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperFunctions.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/HelperFunctions.java @@ -15,15 +15,12 @@ package eu.esdihumboldt.cst.functions.groovy.helper; +import eu.esdihumboldt.hale.common.core.HalePlatform; +import groovy.lang.GroovyObjectSupport; import java.text.MessageFormat; - import javax.annotation.Nullable; - import org.codehaus.groovy.runtime.InvokerHelper; -import eu.esdihumboldt.hale.common.core.HalePlatform; -import groovy.lang.GroovyObjectSupport; - /** * Accessor for Groovy script helper functions and categories. * diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/extension/HelperFunctionsExtension.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/extension/HelperFunctionsExtension.java index fda585bb00..ba0fb13900 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/extension/HelperFunctionsExtension.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/extension/HelperFunctionsExtension.java @@ -15,24 +15,7 @@ package eu.esdihumboldt.cst.functions.groovy.helper.extension; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.annotation.Nullable; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.Platform; - import com.google.common.base.Splitter; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; @@ -46,6 +29,19 @@ import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.transformation.function.ExecutionContext; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; +import javax.annotation.Nullable; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Platform; /** * Groovy script helper functions extension point. @@ -99,8 +95,8 @@ public HelperFunctionsExtension(@Nullable ServiceProvider serviceProvider) { } /** - * Initialize the extension point from the registered extensions (if not - * already done). + * Initialize the extension point from the registered extensions (if not already + * done). */ protected void init() { if (initialized.compareAndSet(false, true)) { @@ -175,8 +171,8 @@ private void addToCategory(String category, Iterable func * * @param helperClass the helper class, either a {@link HelperFunction} or a * class that defines helper functions by convention - * @param customName the custom name for a helper function, only applicable - * for {@link HelperFunction} classes + * @param customName the custom name for a helper function, only applicable for + * {@link HelperFunction} classes * @return the functions that were loaded from the class * @throws Exception if loading the functions failed */ @@ -199,9 +195,13 @@ private Iterable loadFunctions(final Class helperClass List functions = new ArrayList<>(); for (Method method : helperClass.getMethods()) { int modifiers = method.getModifiers(); - if (method.getName().startsWith("_") - && !method.getName().startsWith( - "__") /* exclude __$swapInit and the like */ + if (method.getName().startsWith("_") && !method.getName().startsWith("__") /* + * exclude + * __$swapInit + * and + * the + * like + */ && !Modifier.isAbstract(modifiers) && !method.getName().endsWith(SPEC_END)) { HelperFunctionWrapper function = loadFunction(method, helperClass); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/spec/impl/HelperFunctionSpecification.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/spec/impl/HelperFunctionSpecification.java index 85eb23259f..9bcbf0ed5b 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/spec/impl/HelperFunctionSpecification.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/helper/spec/impl/HelperFunctionSpecification.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.cst.functions.groovy.helper.spec.impl; +import eu.esdihumboldt.cst.functions.groovy.helper.spec.Argument; +import eu.esdihumboldt.cst.functions.groovy.helper.spec.Specification; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import eu.esdihumboldt.cst.functions.groovy.helper.spec.Argument; -import eu.esdihumboldt.cst.functions.groovy.helper.spec.Specification; - /** * It denotes the specification details for helper functions. * diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/AsMultiValueMetaClass.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/AsMultiValueMetaClass.java index 5ef794d603..4fc59fc5c3 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/AsMultiValueMetaClass.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/AsMultiValueMetaClass.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.cst.functions.groovy.internal; -import java.lang.reflect.Array; -import java.util.Arrays; -import java.util.Collection; - import eu.esdihumboldt.cst.MultiValue; import groovy.lang.DelegatingMetaClass; import groovy.lang.MetaClass; +import java.lang.reflect.Array; +import java.util.Arrays; +import java.util.Collection; /** * Adds implicit groovy conversions to {@link MultiValue} via the asType() diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/GroovyProjectVariables.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/GroovyProjectVariables.java index b676170cbd..d18f9b6718 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/GroovyProjectVariables.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/GroovyProjectVariables.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.cst.functions.groovy.internal; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.align.transformation.function.ExecutionContext; import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoService; import eu.esdihumboldt.hale.common.core.io.project.ProjectVariables; import groovy.lang.GroovyObjectSupport; +import javax.annotation.Nullable; /** * Accessor for project variables in Groovy scripts. @@ -83,8 +82,7 @@ public String get(String name, String def) { } /** - * Get a variable value. Fail with an exception if the variable does not - * exist. + * Get a variable value. Fail with an exception if the variable does not exist. * * @param name the variable name * @return the variable value diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/GroovyUtil.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/GroovyUtil.java index a32c27ccf5..219e5159ea 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/GroovyUtil.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/GroovyUtil.java @@ -15,15 +15,6 @@ package eu.esdihumboldt.cst.functions.groovy.internal; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - import eu.esdihumboldt.cst.MultiValue; import eu.esdihumboldt.cst.functions.groovy.GroovyConstants; import eu.esdihumboldt.cst.functions.groovy.helper.DefaultHelperContext; @@ -57,6 +48,14 @@ import groovy.lang.Script; import groovy.transform.CompileStatic; import jakarta.xml.bind.DatatypeConverter; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; /** * Groovy function utilities. @@ -79,8 +78,8 @@ public class GroovyUtil implements GroovyConstants { } /* - * Simple thread-local cache that associates the hash of the script String - * with the compiled script. + * Simple thread-local cache that associates the hash of the script String with + * the compiled script. */ private static final ThreadLocal> PARSED_SCRIPTS = new ThreadLocal<>(); @@ -129,8 +128,8 @@ public static Script getScript(AbstractTransformationFunction function, Bindi * @param function the transformation function the script is associated to * @param binding the binding to set on the script * @param service the Groovy service - * @param functionCached if the script should be cached per function instead - * of per cell + * @param functionCached if the script should be cached per function instead of + * per cell * @return the script * @throws TransformationException if getting the script parameter from the * function fails @@ -139,8 +138,8 @@ public static Script getScript(AbstractTransformationFunction function, Bindi public static Script getScript(AbstractTransformationFunction function, Binding binding, GroovyService service, boolean functionCached) throws TransformationException { /* - * The compiled script is stored in a ThreadLocal cache, so it needs to - * be compiled only once per transformation thread. + * The compiled script is stored in a ThreadLocal cache, so it needs to be + * compiled only once per transformation thread. */ String script = getScriptString(function); @@ -170,8 +169,8 @@ public static Script getScript(AbstractTransformationFunction function, Bindi * @param log the log * @return the created instance * @throws TransformationException if the target binding does not contain - * exactly one result after script evaluation or an internal - * error occurs + * exactly one result after script evaluation or an internal error + * occurs * @throws NoResultException if the script implies that no result should be * created */ @@ -252,8 +251,7 @@ public Iterable process(Script script, Object returnValue) * * @param builder the instance builder, may be null * @param cell the cell of the function - * @param typeCell the type cell the function works on, may be - * null + * @param typeCell the type cell the function works on, may be null * @param log the transformation log * @param executionContext the execution context * @param targetInstanceType the type of the target instance to create diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/InstanceAccessorArrayList.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/InstanceAccessorArrayList.java index b9545c1030..ef18334533 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/InstanceAccessorArrayList.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/InstanceAccessorArrayList.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.cst.functions.groovy.internal; -import java.util.ArrayList; - import eu.esdihumboldt.hale.common.instance.groovy.InstanceAccessor; +import java.util.ArrayList; /** * {@link ArrayList} with the addition of methods {@link #getP()} and diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/ProjectAccessor.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/ProjectAccessor.java index d1cc6293dd..9766225944 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/ProjectAccessor.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/ProjectAccessor.java @@ -15,16 +15,13 @@ package eu.esdihumboldt.cst.functions.groovy.internal; -import java.util.Date; - -import javax.annotation.Nullable; - -import org.osgi.framework.Version; - import eu.esdihumboldt.hale.common.align.transformation.function.ExecutionContext; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.project.ProjectInfo; import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoService; +import java.util.Date; +import javax.annotation.Nullable; +import org.osgi.framework.Version; /** * Accessor for project information in Groovy scripts. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/TargetCollector.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/TargetCollector.java index 39033d11a2..7687e2faeb 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/TargetCollector.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/TargetCollector.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.cst.functions.groovy.internal; -import java.util.ArrayList; - -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.cst.MultiValue; import eu.esdihumboldt.cst.functions.groovy.GroovyTransformation; import eu.esdihumboldt.hale.common.align.transformation.function.TransformationException; @@ -31,6 +27,8 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.AugmentedValueFlag; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; import groovy.lang.Closure; +import java.util.ArrayList; +import org.locationtech.jts.geom.Geometry; /** * Target binding class for {@link GroovyTransformation}. @@ -120,15 +118,15 @@ public void call(Object value, Closure targetClosure) { } /** - * Transforms the closures added to this collector to a {@link MultiValue} - * using the supplied builder. + * Transforms the closures added to this collector to a {@link MultiValue} using + * the supplied builder. * * @param builder the instance builder for creating target instances * @param type the type of the instance to create * @param log the log * @return a result value for all closures added to this collector - * @throws TransformationException if some of the collected targets do not - * match the specified type + * @throws TransformationException if some of the collected targets do not match + * the specified type */ public MultiValue toMultiValue(InstanceBuilder builder, TypeDefinition type, SimpleLog log) throws TransformationException { diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/TransformationLogWrapper.java b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/TransformationLogWrapper.java index 371303ea59..8f543aa37d 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/TransformationLogWrapper.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/src/eu/esdihumboldt/cst/functions/groovy/internal/TransformationLogWrapper.java @@ -36,8 +36,8 @@ public TransformationLogWrapper(TransformationLog log) { } /** - * Adds an info to the report. If configured accordingly a log message will - * also be created. + * Adds an info to the report. If configured accordingly a log message will also + * be created. * * @param message the message string */ @@ -46,8 +46,8 @@ public void info(String message) { } /** - * Adds an info to the report. If configured accordingly a log message will - * also be created. + * Adds an info to the report. If configured accordingly a log message will also + * be created. * * @param message the message string * @param throwable a throwable associated to the message, may be null @@ -57,8 +57,8 @@ public void info(String message, Throwable throwable) { } /** - * Adds a warning to the report. If configured accordingly a log message - * will also be created. + * Adds a warning to the report. If configured accordingly a log message will + * also be created. * * @param message the message string */ @@ -67,8 +67,8 @@ public void warn(String message) { } /** - * Adds a warning to the report. If configured accordingly a log message - * will also be created. + * Adds a warning to the report. If configured accordingly a log message will + * also be created. * * @param message the message string * @param throwable a throwable associated to the message, may be null diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/GeographicalName.java b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/GeographicalName.java index 83adae6578..b78c0833a1 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/GeographicalName.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/GeographicalName.java @@ -16,11 +16,7 @@ package eu.esdihumboldt.cst.functions.inspire; -import java.util.List; -import java.util.Map; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -32,20 +28,22 @@ import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstance; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.List; +import java.util.Map; /** * Class for the geographical name function * * @author Kevin Mais */ -public class GeographicalName extends - AbstractSingleTargetPropertyTransformation implements - GeographicalNameFunction { +public class GeographicalName + extends AbstractSingleTargetPropertyTransformation + implements GeographicalNameFunction { /** * @see AbstractSingleTargetPropertyTransformation#evaluate(String, - * TransformationEngine, ListMultimap, String, - * PropertyEntityDefinition, Map, TransformationLog) + * TransformationEngine, ListMultimap, String, PropertyEntityDefinition, + * Map, TransformationLog) */ @Override protected Object evaluate(String transformationIdentifier, TransformationEngine engine, @@ -222,10 +220,11 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine PropertyDefinition spellOfNameChildText = Util.getChild("text", spellOfNameType); // name/GeographicalName/spelling/SpellingOfName/transliterationScheme - PropertyDefinition spellOfNameChildTransliteration = Util.getChild( - "transliterationScheme", spellOfNameType); + PropertyDefinition spellOfNameChildTransliteration = Util + .getChild("transliterationScheme", spellOfNameType); TypeDefinition transliterationType = spellOfNameChildTransliteration.getPropertyType(); - DefaultInstance transliterationInstance = new DefaultInstance(transliterationType, null); + DefaultInstance transliterationInstance = new DefaultInstance(transliterationType, + null); // build the spelling instance scriptInstance.setValue(scripts.get(i).as(String.class)); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/GeographicalNameExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/GeographicalNameExplanation.java index 91410af785..decdcebb2a 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/GeographicalNameExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/GeographicalNameExplanation.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.cst.functions.inspire; -import java.text.MessageFormat; -import java.util.List; -import java.util.Locale; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition; import eu.esdihumboldt.hale.common.align.extension.function.FunctionUtil; import eu.esdihumboldt.hale.common.align.extension.function.PropertyFunctionDefinition; @@ -29,6 +25,9 @@ import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.impl.AbstractCellExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.List; +import java.util.Locale; /** * Explanation class for the geographical name function diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/Identifier.java b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/Identifier.java index c2834a3122..33b6d03016 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/Identifier.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/Identifier.java @@ -16,10 +16,7 @@ package eu.esdihumboldt.cst.functions.inspire; -import java.util.Map; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -30,6 +27,7 @@ import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstance; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Map; /** * Class for the identifier function diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/IdentifierExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/IdentifierExplanation.java index a82b566b89..5aa57bb091 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/IdentifierExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/IdentifierExplanation.java @@ -16,14 +16,13 @@ package eu.esdihumboldt.cst.functions.inspire; -import java.text.MessageFormat; -import java.util.Locale; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.impl.AbstractCellExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.Locale; /** * Explanation class for the identifier function diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/Util.java b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/Util.java index 30185804ef..77c580bc3e 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/Util.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/src/eu/esdihumboldt/cst/functions/inspire/Util.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.cst.functions.inspire; -import java.util.Collection; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collection; /** * Util class for geographical name and identifier function diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/MathematicalExpression.java b/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/MathematicalExpression.java index 6f16d71aea..88bedc8691 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/MathematicalExpression.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/MathematicalExpression.java @@ -16,17 +16,12 @@ package eu.esdihumboldt.cst.functions.numeric; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - import com.google.common.base.Joiner; import com.google.common.collect.ListMultimap; import com.iabcinc.jmep.Environment; import com.iabcinc.jmep.Expression; import com.iabcinc.jmep.XExpression; import com.iabcinc.jmep.hooks.Constant; - import eu.esdihumboldt.hale.common.align.model.ChildContext; import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; @@ -34,6 +29,9 @@ import eu.esdihumboldt.hale.common.align.transformation.function.TransformationException; import eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractSingleTargetPropertyTransformation; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import net.jcip.annotations.Immutable; /** @@ -48,8 +46,8 @@ public class MathematicalExpression /** * @see AbstractSingleTargetPropertyTransformation#evaluate(String, - * TransformationEngine, ListMultimap, String, - * PropertyEntityDefinition, Map, TransformationLog) + * TransformationEngine, ListMultimap, String, PropertyEntityDefinition, + * Map, TransformationLog) */ @Override protected Object evaluate(String transformationIdentifier, TransformationEngine engine, @@ -74,8 +72,8 @@ protected Object evaluate(String transformationIdentifier, TransformationEngine /** * Evaluate a mathematical expression. * - * @param expression the mathematical expression. It may contain references - * to variables + * @param expression the mathematical expression. It may contain references to + * variables * @param vars the list of available property values that may be bound to * variables * @return the evaluated expression, which can be Double, Integer or String diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/MathematicalExpressionExplanation.java b/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/MathematicalExpressionExplanation.java index e3202ebbdc..a47545d375 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/MathematicalExpressionExplanation.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/MathematicalExpressionExplanation.java @@ -16,17 +16,16 @@ package eu.esdihumboldt.cst.functions.numeric; -import java.text.MessageFormat; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.stream.Collectors; - import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.CellUtil; import eu.esdihumboldt.hale.common.align.model.Entity; import eu.esdihumboldt.hale.common.align.model.impl.AbstractCellExplanation; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.text.MessageFormat; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; /** * Explanation for mathematical expression cells. @@ -56,7 +55,7 @@ protected String getExplanation(Cell cell, boolean html, ServiceProvider service Map varToProperty = sources.stream() .collect(Collectors.toMap(entity -> { return getEntityNameWithoutCondition(entity); - } , entity -> { + }, entity -> { return formatEntity(entity, true, false, locale); })); explanation += buildReplacementTable(varToProperty, locale); diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/sequentialid/SequentialID.java b/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/sequentialid/SequentialID.java index 73f3107fac..bf9c86f085 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/sequentialid/SequentialID.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.numeric/src/eu/esdihumboldt/cst/functions/numeric/sequentialid/SequentialID.java @@ -16,10 +16,7 @@ package eu.esdihumboldt.cst.functions.numeric.sequentialid; -import java.util.Map; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -28,6 +25,7 @@ import eu.esdihumboldt.hale.common.align.transformation.function.impl.NoResultException; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; import eu.esdihumboldt.hale.common.core.io.Value; +import java.util.Map; /** * Function that generates a sequential identifier. @@ -39,8 +37,8 @@ public class SequentialID extends AbstractSingleTargetPropertyTransformation + * Name of the parameter specifying the date format of the source entity.
      * See the function definition on * eu.esdihumboldt.hale.common.align. */ public static final String PARAMETER_DATE_FORMAT = "dateFormat"; /** - * Name of the parameter specifying whether the interpretation of the date - * and time of SimpleDateFormat object is to be lenient or not. With lenient - * interpretation, a date such as "February 942, 1996" will be treated as - * being equivalent to the 941st day after February 1, 1996. With strict - * (non-lenient) interpretation, such dates will cause an exception to be - * thrown. The default is lenient. + * Name of the parameter specifying whether the interpretation of the date and + * time of SimpleDateFormat object is to be lenient or not. With lenient + * interpretation, a date such as "February 942, 1996" will be treated as being + * equivalent to the 941st day after February 1, 1996. With strict (non-lenient) + * interpretation, such dates will cause an exception to be thrown. The default + * is lenient. */ public static final String PARAMETER_LENIENCY = "leniency"; diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.string/src/eu/esdihumboldt/cst/functions/string/RegexAnalysis.java b/cst/plugins/eu.esdihumboldt.cst.functions.string/src/eu/esdihumboldt/cst/functions/string/RegexAnalysis.java index 23e78ea9b2..bd352d95bd 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.string/src/eu/esdihumboldt/cst/functions/string/RegexAnalysis.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.string/src/eu/esdihumboldt/cst/functions/string/RegexAnalysis.java @@ -16,13 +16,7 @@ package eu.esdihumboldt.cst.functions.string; -import java.text.MessageFormat; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; import eu.esdihumboldt.hale.common.align.transformation.engine.TransformationEngine; import eu.esdihumboldt.hale.common.align.transformation.function.PropertyValue; @@ -30,6 +24,10 @@ import eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractSingleTargetPropertyTransformation; import eu.esdihumboldt.hale.common.align.transformation.function.impl.NoResultException; import eu.esdihumboldt.hale.common.align.transformation.report.TransformationLog; +import java.text.MessageFormat; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Regex string analysis function. diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.string/src/eu/esdihumboldt/cst/functions/string/RegexFormatValidator.java b/cst/plugins/eu.esdihumboldt.cst.functions.string/src/eu/esdihumboldt/cst/functions/string/RegexFormatValidator.java index 4bcef4f44e..1fce8d2807 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.string/src/eu/esdihumboldt/cst/functions/string/RegexFormatValidator.java +++ b/cst/plugins/eu.esdihumboldt.cst.functions.string/src/eu/esdihumboldt/cst/functions/string/RegexFormatValidator.java @@ -16,11 +16,9 @@ package eu.esdihumboldt.cst.functions.string; -import java.util.regex.Pattern; - import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.core.parameter.Validator; +import java.util.regex.Pattern; /** * Validator for regex patterns. diff --git a/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/AbstractTransformationTest.java b/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/AbstractTransformationTest.java index dfd3aef03e..7ccfc2975a 100644 --- a/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/AbstractTransformationTest.java +++ b/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/AbstractTransformationTest.java @@ -16,19 +16,18 @@ package eu.esdihumboldt.cst.test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.InstanceUtil; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.test.TestUtil; import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.BeforeClass; - import java.util.LinkedList; import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.junit.BeforeClass; /** * Base class for transformation tests. @@ -48,8 +47,8 @@ public static void waitForService() { /** * Execute the transformation on a transformation example and test if the - * transformation result conforms to the expected target instances provided - * by the example. + * transformation result conforms to the expected target instances provided by + * the example. * * @param example the transformation example * @@ -62,8 +61,8 @@ protected void testTransform(TransformationExample example) throws Exception { } /** - * Compares the two given collections for equality. Order of occurrence - * doesn't matter for this implementation. + * Compares the two given collections for equality. Order of occurrence doesn't + * matter for this implementation. * * @param targetData the expected data * @param transformedData the transformed data to test diff --git a/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/TransformationExample.java b/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/TransformationExample.java index ed539bf609..4bfa645807 100644 --- a/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/TransformationExample.java +++ b/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/TransformationExample.java @@ -19,7 +19,6 @@ import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.schema.model.Schema; - import java.io.InputStream; /** @@ -56,8 +55,8 @@ public interface TransformationExample { /** * Get the target container namespace (XML specific). * - * @return the name of the target file root element namespace, - * null represents the target schema default namespace + * @return the name of the target file root element namespace, null + * represents the target schema default namespace */ public String getTargetContainerNamespace(); diff --git a/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/TransformationExampleImpl.java b/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/TransformationExampleImpl.java index 8999a876aa..f2977246a9 100644 --- a/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/TransformationExampleImpl.java +++ b/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/TransformationExampleImpl.java @@ -22,11 +22,10 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.test.TestUtil; - -import javax.annotation.Nullable; import java.io.IOException; import java.io.InputStream; import java.net.URI; +import javax.annotation.Nullable; /** * Transformation example default implementation. @@ -107,8 +106,8 @@ public Alignment getAlignment() throws Exception { } @Override - public InstanceCollection getSourceInstances() throws IOProviderConfigurationException, - IOException { + public InstanceCollection getSourceInstances() + throws IOProviderConfigurationException, IOException { if (sourceInstances == null) { sourceInstances = TestUtil.loadInstances(sourceDataLocation, getSourceSchema()); } @@ -116,8 +115,8 @@ public InstanceCollection getSourceInstances() throws IOProviderConfigurationExc } @Override - public InstanceCollection getTargetInstances() throws IOProviderConfigurationException, - IOException { + public InstanceCollection getTargetInstances() + throws IOProviderConfigurationException, IOException { if (targetDataLocation == null) { throw new IllegalStateException("Example has no target data"); } diff --git a/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/internal/InternalExample.java b/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/internal/InternalExample.java index b031d3fc5f..08039b6b10 100644 --- a/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/internal/InternalExample.java +++ b/cst/plugins/eu.esdihumboldt.cst.test/src/eu/esdihumboldt/cst/test/internal/InternalExample.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.cst.test.internal; import eu.esdihumboldt.cst.test.TransformationExampleImpl; - import java.net.URI; import java.net.URISyntaxException; import java.net.URL; @@ -29,9 +28,9 @@ public class InternalExample extends TransformationExampleImpl { /** - * Create a transformation example. All provided locations are specific to - * this bundle. Relative locations refer to the {@link InternalExample} - * class, absolute locations start with a /. + * Create a transformation example. All provided locations are specific to this + * bundle. Relative locations refer to the {@link InternalExample} class, + * absolute locations start with a /. * * @param sourceSchemaLocation the source schema location * @param targetSchemaLocation the target schema location @@ -56,8 +55,8 @@ public InternalExample(String sourceSchemaLocation, String targetSchemaLocation, * getClass().getResource(location).toURI() * * @param location the location - * @param mustExist if the location must exist (i.e. if the result may not - * be null) + * @param mustExist if the location must exist (i.e. if the result may not be + * null) * @return an URI for the location * @throws URISyntaxException if toURI throws an exception */ diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/ConceptualSchemaTransformer.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/ConceptualSchemaTransformer.java index bd4c8dc30c..72b4556782 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/ConceptualSchemaTransformer.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/ConceptualSchemaTransformer.java @@ -16,20 +16,9 @@ package eu.esdihumboldt.cst; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import eu.esdihumboldt.cst.internal.EngineManager; import eu.esdihumboldt.cst.internal.TransformationContext; import eu.esdihumboldt.cst.internal.TreePropertyTransformer; @@ -67,6 +56,15 @@ import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.instance.model.impl.GenericResourceIteratorAdapter; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import net.jcip.annotations.Immutable; /** @@ -141,11 +139,9 @@ protected void countChanged(int count) { .getTypeTransformations(typeCell.getTransformationIdentifier()); if (transformations == null || transformations.isEmpty()) { - reporter.error(new TransformationMessageImpl(typeCell, - MessageFormat.format( - "No transformation for function {0} found. Skipped type transformation.", - typeCell.getTransformationIdentifier()), - null)); + reporter.error(new TransformationMessageImpl(typeCell, MessageFormat.format( + "No transformation for function {0} found. Skipped type transformation.", + typeCell.getTransformationIdentifier()), null)); } else { // TODO select based on e.g. preferred transformation @@ -357,8 +353,7 @@ private static class TypeCellFilter implements Filter { private final HashMap lookup = new HashMap(); /** - * Constructs a filter that matches all instances relevant to the given - * cell. + * Constructs a filter that matches all instances relevant to the given cell. * * @param typeCell the type cell */ diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/MultiValue.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/MultiValue.java index af2e416a5b..0395d7e5c0 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/MultiValue.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/MultiValue.java @@ -36,8 +36,8 @@ public MultiValue() { } /** - * Constructs a list containing the elements of the specified collection, in - * the order they are returned by the collection's iterator. + * Constructs a list containing the elements of the specified collection, in the + * order they are returned by the collection's iterator. * * @param c the collection whose elements are to be placed into this list */ diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/HooksUtil.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/HooksUtil.java index 5d6ef76327..5c6d9d743d 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/HooksUtil.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/HooksUtil.java @@ -50,9 +50,8 @@ public static void executeTreeHooks(TransformationTreeHooks hooks, TreeState sta try { hook.processTransformationTree(tree, state, target); } catch (Exception e) { - log.error( - "Error processing transformation tree hook " - + def.getDisplayName(), e); + log.error("Error processing transformation tree hook " + + def.getDisplayName(), e); } } } diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHook.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHook.java index be94de1c5c..e651455e78 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHook.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHook.java @@ -47,9 +47,8 @@ public enum TreeState { } /** - * Process the given transformation tree, called before property - * transformation of an instance. Hooks should either be stateless or thread - * safe. + * Process the given transformation tree, called before property transformation + * of an instance. Hooks should either be stateless or thread safe. * * @param tree the transformation tree * @param state the tree state diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHookExtension.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHookExtension.java index d88709ee9c..942378c8df 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHookExtension.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHookExtension.java @@ -16,19 +16,18 @@ package eu.esdihumboldt.cst.extension.hooks; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractExtension; import eu.esdihumboldt.cst.extension.hooks.TransformationTreeHook.TreeState; import eu.esdihumboldt.cst.extension.hooks.internal.DefaultTreeHookFactory; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link TransformationTreeHook}s * * @author Simon Templer */ -public class TransformationTreeHookExtension extends - AbstractExtension { +public class TransformationTreeHookExtension + extends AbstractExtension { /** * The extension ID diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHookFactory.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHookFactory.java index 22e01992e9..a5b98593fb 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHookFactory.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHookFactory.java @@ -24,8 +24,8 @@ * * @author Simon Templer */ -public interface TransformationTreeHookFactory extends - ExtensionObjectFactory { +public interface TransformationTreeHookFactory + extends ExtensionObjectFactory { /** * Get the tree state associated to the hook. diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHooks.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHooks.java index 84ca2edb13..f75fa302f4 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHooks.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/TransformationTreeHooks.java @@ -23,8 +23,8 @@ * * @author Simon Templer */ -public interface TransformationTreeHooks extends - SelectiveExtension { +public interface TransformationTreeHooks + extends SelectiveExtension { // marker interface diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/internal/DefaultTreeHookFactory.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/internal/DefaultTreeHookFactory.java index b85043372f..205562bfde 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/internal/DefaultTreeHookFactory.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/extension/hooks/internal/DefaultTreeHookFactory.java @@ -16,14 +16,13 @@ package eu.esdihumboldt.cst.extension.hooks.internal; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.ExtensionObjectDefinition; import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; import eu.esdihumboldt.cst.extension.hooks.TransformationTreeHook; import eu.esdihumboldt.cst.extension.hooks.TransformationTreeHook.TreeState; import eu.esdihumboldt.cst.extension.hooks.TransformationTreeHookFactory; +import org.eclipse.core.runtime.IConfigurationElement; /** * Default {@link TransformationTreeHook} factory based on a configuration @@ -37,8 +36,8 @@ public class DefaultTreeHookFactory extends AbstractConfigurationFactorynull if none with the - * given ID was found or the creation failed + * @return the transformation engine or null if none with the given + * ID was found or the creation failed */ public synchronized TransformationEngine get(String engineId, TransformationLog log) { TransformationEngine engine = engines.get(engineId); @@ -68,8 +67,8 @@ public synchronized TransformationEngine get(String engineId, TransformationLog EngineFactory engineFactory = ee.getFactory(engineId); if (engineFactory == null) { - log.error(log.createMessage(MessageFormat.format( - "Transformation engine with ID {0} not found.", engineId), null)); + log.error(log.createMessage(MessageFormat + .format("Transformation engine with ID {0} not found.", engineId), null)); } else { try { diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/ExecutionContextImpl.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/ExecutionContextImpl.java index 60076741a6..d454a2ee54 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/ExecutionContextImpl.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/ExecutionContextImpl.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.cst.internal; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.transformation.function.ExecutionContext; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; /** * Implementation of {@link ExecutionContext} used by @@ -50,7 +49,8 @@ public class ExecutionContextImpl implements ExecutionContext { * @param cell the cell this context is for */ public ExecutionContextImpl(ServiceProvider serviceProvider, Alignment alignment, - FunctionContexts functionContexts, Map transformationContext, Cell cell) { + FunctionContexts functionContexts, Map transformationContext, + Cell cell) { this.serviceProvider = serviceProvider; this.alignment = alignment; this.functionContexts = functionContexts; diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/FunctionContexts.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/FunctionContexts.java index c7286411f8..758e4377b5 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/FunctionContexts.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/FunctionContexts.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.cst.internal; +import eu.esdihumboldt.hale.common.align.model.Cell; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import eu.esdihumboldt.hale.common.align.model.Cell; - /** * Function contexts used by {@link TransformationContext} and * {@link ExecutionContextImpl}. diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/FunctionExecutor.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/FunctionExecutor.java index 8abfa1c67e..a32b3054c1 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/FunctionExecutor.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/FunctionExecutor.java @@ -16,17 +16,8 @@ package eu.esdihumboldt.cst.internal; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map.Entry; - -import org.springframework.core.convert.ConversionException; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.cst.MultiValue; import eu.esdihumboldt.hale.common.align.extension.transformation.PropertyTransformationFactory; import eu.esdihumboldt.hale.common.align.model.Cell; @@ -58,6 +49,12 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType; import eu.esdihumboldt.util.Pair; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map.Entry; +import org.springframework.core.convert.ConversionException; /** * Function executor on a transformation tree. @@ -87,8 +84,8 @@ public FunctionExecutor(TransformationReporter reporter, EngineManager engines, this.context = context; this.functionPriority = functionPriority; - this.transformations = context.getServiceProvider().getService( - TransformationFunctionService.class); + this.transformations = context.getServiceProvider() + .getService(TransformationFunctionService.class); } /** @@ -102,10 +99,10 @@ protected void processValid(Cell cell, ListMultimap expectedResult = ArrayListMultimap.create( - targets.keySet().size(), 1); + ListMultimap expectedResult = ArrayListMultimap + .create(targets.keySet().size(), 1); for (Entry> targetEntry : targets.entries()) { EntityDefinition def = targetEntry.getValue().getSecond().getDefinition(); expectedResult.put(targetEntry.getKey(), toPropertyEntityDefinition(def)); @@ -244,10 +241,9 @@ protected void executeTransformation(PropertyTransformationFactory transformatio null)); } if (values.size() > nodes.size()) { - cellLog.warn(cellLog.createMessage( - MessageFormat - .format("More transformation results than target nodes for result with name {0}", - name), null)); + cellLog.warn(cellLog.createMessage(MessageFormat.format( + "More transformation results than target nodes for result with name {0}", + name), null)); } int count = Math.min(values.size(), nodes.size()); @@ -275,9 +271,8 @@ protected void executeTransformation(PropertyTransformationFactory transformatio /* * TODO * - * set node value only if no result has already been set. If - * a value is already there and we are in a lower priority - * executor, we do not overwrite. + * set node value only if no result has already been set. If a value is already + * there and we are in a lower priority executor, we do not overwrite. */ if (!node.isDefined()) { node.setResult(value); @@ -305,10 +300,9 @@ private Object processValue(TransformationLog cellLog, PropertyTransformation value = convert(value, toPropertyEntityDefinition(node.getEntityDefinition())); } catch (Throwable e) { // ignore, but create error - cellLog.error(cellLog - .createMessage( - "Conversion according to target property failed, using value as is.", - e)); + cellLog.error(cellLog.createMessage( + "Conversion according to target property failed, using value as is.", + e)); } } else { @@ -323,8 +317,8 @@ private Object processValue(TransformationLog cellLog, PropertyTransformation } /* - * If the value is no group, but it should be one, create an instance - * wrapping the value + * If the value is no group, but it should be one, create an instance wrapping + * the value */ TypeDefinition propertyType = toPropertyEntityDefinition(node.getEntityDefinition()) .getDefinition().getPropertyType(); @@ -397,8 +391,9 @@ private PropertyEntityDefinition toPropertyEntityDefinition(EntityDefinition def return (PropertyEntityDefinition) def; } - return new PropertyEntityDefinition(def.getType(), new ArrayList( - def.getPropertyPath()), def.getSchemaSpace(), def.getFilter()); + return new PropertyEntityDefinition(def.getType(), + new ArrayList(def.getPropertyPath()), def.getSchemaSpace(), + def.getFilter()); } /** diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/InstanceBuilder.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/InstanceBuilder.java index e7d966022f..e59668620f 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/InstanceBuilder.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/InstanceBuilder.java @@ -50,7 +50,8 @@ private static enum NoObject { * @param tree the transformation tree * @param typeLog the type transformation log */ - public void populate(MutableInstance target, TransformationTree tree, TransformationLog typeLog) { + public void populate(MutableInstance target, TransformationTree tree, + TransformationLog typeLog) { populateGroup(target, tree, typeLog); } @@ -97,8 +98,8 @@ private Object getValue(TargetNode node, TransformationLog typeLog) { value = ((Instance) value).getValue(); } - MutableInstance instance = new DefaultInstance(node.getDefinition() - .asProperty().getPropertyType(), null); + MutableInstance instance = new DefaultInstance( + node.getDefinition().asProperty().getPropertyType(), null); instance.setValue(value); // XXX since this is the same for all instances maybe do @@ -156,7 +157,8 @@ private boolean populateGroup(MutableGroup group, GroupNode node, Transformation // check cardinality Cardinality card = DefinitionUtil.getCardinality(child.getDefinition()); - if (card.getMaxOccurs() != Cardinality.UNBOUNDED && card.getMaxOccurs() < toAdd) { + if (card.getMaxOccurs() != Cardinality.UNBOUNDED + && card.getMaxOccurs() < toAdd) { toAdd = (int) card.getMaxOccurs(); typeLog.warn(typeLog.createMessage("Too many values present for " + child.getDefinition().getDisplayName() diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TransformationContext.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TransformationContext.java index c36561919d..55ed57509b 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TransformationContext.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TransformationContext.java @@ -16,15 +16,14 @@ package eu.esdihumboldt.cst.internal; -import java.util.Collections; -import java.util.HashMap; -import java.util.IdentityHashMap; -import java.util.Map; - import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.transformation.function.ExecutionContext; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import java.util.Collections; +import java.util.HashMap; +import java.util.IdentityHashMap; +import java.util.Map; /** * Execution context for the transformation. diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TransformationTreePool.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TransformationTreePool.java index 1166c07987..be4218fd89 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TransformationTreePool.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TransformationTreePool.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.cst.internal; -import java.util.List; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.model.Cell; import eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationTree; import eu.esdihumboldt.hale.common.align.model.transformation.tree.context.ContextMatcher; import eu.esdihumboldt.hale.common.align.model.transformation.tree.impl.TransformationTreeImpl; import eu.esdihumboldt.hale.common.align.model.transformation.tree.visitor.ResetVisitor; +import java.util.List; /** * Pool for transformation trees. diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TreePropertyTransformer.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TreePropertyTransformer.java index 56ca3015e0..9b7f3933ce 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TreePropertyTransformer.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/TreePropertyTransformer.java @@ -16,17 +16,6 @@ package eu.esdihumboldt.cst.internal; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - import eu.esdihumboldt.cst.extension.hooks.HooksUtil; import eu.esdihumboldt.cst.extension.hooks.TransformationTreeHook.TreeState; import eu.esdihumboldt.cst.extension.hooks.TransformationTreeHooks; @@ -53,6 +42,16 @@ import eu.esdihumboldt.hale.common.instance.model.MutableInstance; import gnu.trove.TObjectIntHashMap; import gnu.trove.TObjectIntProcedure; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; /** * Property transformer based on a {@link TransformationTree}. @@ -97,8 +96,8 @@ protected MetadataWorker initialValue() { * Create a simple property transformer * * @param alignment the alignment - * @param reporter the transformation log to report any transformation - * messages to + * @param reporter the transformation log to report any transformation messages + * to * @param sink the target instance sink * @param engines the transformation engine manager * @param context the transformation execution context @@ -148,8 +147,8 @@ public boolean offer(Runnable e) { return true; /* - * Alternative could be calling offer in a loop with - * a wait until it returns true. + * Alternative could be calling offer in a loop with a wait until it + * returns true. */ } @@ -248,8 +247,8 @@ public void run() { }); } catch (Throwable e) { /* - * Catch any error, as exceptions in the executor service - * will only result in a message on the console. + * Catch any error, as exceptions in the executor service will only result in a + * message on the console. */ typeLog.error( typeLog.createMessage("Error performing property transformations", e)); diff --git a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/util/CountingInstanceSink.java b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/util/CountingInstanceSink.java index 0d9cd72387..4588ef191b 100644 --- a/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/util/CountingInstanceSink.java +++ b/cst/plugins/eu.esdihumboldt.cst/src/eu/esdihumboldt/cst/internal/util/CountingInstanceSink.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.cst.internal.util; -import java.util.concurrent.atomic.AtomicInteger; - import eu.esdihumboldt.hale.common.align.transformation.service.InstanceSink; import eu.esdihumboldt.hale.common.instance.model.Instance; +import java.util.concurrent.atomic.AtomicInteger; /** * Instance sink decorator that counts the added instances. diff --git a/cst/plugins/eu.esdihumboldt.cst/test/eu/esdihumboldt/cst/internal/ConceptualSchemaTransformerTest.java b/cst/plugins/eu.esdihumboldt.cst/test/eu/esdihumboldt/cst/internal/ConceptualSchemaTransformerTest.java index 211860cf90..2754c13078 100644 --- a/cst/plugins/eu.esdihumboldt.cst/test/eu/esdihumboldt/cst/internal/ConceptualSchemaTransformerTest.java +++ b/cst/plugins/eu.esdihumboldt.cst/test/eu/esdihumboldt/cst/internal/ConceptualSchemaTransformerTest.java @@ -16,13 +16,6 @@ package eu.esdihumboldt.cst.internal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.junit.Ignore; -import org.junit.Test; - import eu.esdihumboldt.cst.ConceptualSchemaTransformer; import eu.esdihumboldt.cst.test.DefaultTransformationTest; import eu.esdihumboldt.cst.test.TransformationExample; @@ -41,6 +34,11 @@ import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Ignore; +import org.junit.Test; /** * Tests for the CST's alignment processor implementation @@ -80,8 +78,8 @@ public void testGroovy3() throws Exception { } /** - * Test for using the Groovy transformation function to return multiple - * results that should result in multiple properties. + * Test for using the Groovy transformation function to return multiple results + * that should result in multiple properties. * * @throws Exception if an error occurs executing the test */ @@ -91,8 +89,8 @@ public void testMultiResult1() throws Exception { } /** - * Test for using the Groovy transformation function to return multiple - * results that should result in multiple complex properties. + * Test for using the Groovy transformation function to return multiple results + * that should result in multiple complex properties. * * @throws Exception if an error occurs executing the test */ @@ -217,9 +215,9 @@ public void testPropertiesMix2() throws Exception { /** * Test where multiple properties from a simple source type are mapped to a - * complex property structure including a repeatable group in the target - * type. In this case there are no facts that the decision which way to - * group the source properties to an address can be based on. + * complex property structure including a repeatable group in the target type. + * In this case there are no facts that the decision which way to group the + * source properties to an address can be based on. * * @throws Exception if an error occurs executing the test */ @@ -240,8 +238,8 @@ public void testGroup() throws Exception { } /** - * Test where properties from a simple source type are mapped to to a - * complex property with simple content and attributes. + * Test where properties from a simple source type are mapped to to a complex + * property with simple content and attributes. * * @throws Exception if an error occurs executing the test */ @@ -312,8 +310,8 @@ public void testMergeAdditionalProp() throws Exception { } /** - * Test based on {@link #testMergeAdditionalProp()} but without the - * additional merge property + * Test based on {@link #testMergeAdditionalProp()} but without the additional + * merge property * * @throws Exception if an error occurs executing the test */ @@ -323,8 +321,8 @@ public void testMergeWithoutAdditionalProp() throws Exception { } /** - * Test based on a join and some renames with join on properties of - * non-matching types + * Test based on a join and some renames with join on properties of non-matching + * types * * @throws Exception if an error occurs executing the test */ @@ -366,8 +364,8 @@ public void testInnerJoin() throws Exception { } /** - * Test a Join that has the innerJoin flag enabled. Multiple types are - * joined to the join focus, not joins at second level. + * Test a Join that has the innerJoin flag enabled. Multiple types are joined to + * the join focus, not joins at second level. * * @throws Exception if an error occurs executing the test */ @@ -378,8 +376,8 @@ public void testInnerJoinFirstLevel() throws Exception { } /** - * Test a Join that has the innerJoin flag enabled. Conditions are bound to - * some of the joined types. + * Test a Join that has the innerJoin flag enabled. Conditions are bound to some + * of the joined types. * * @throws Exception if an error occurs executing the test */ diff --git a/cst/plugins/eu.esdihumboldt.cst/test/eu/esdihumboldt/cst/test/DefaultTransformationTest.java b/cst/plugins/eu.esdihumboldt.cst/test/eu/esdihumboldt/cst/test/DefaultTransformationTest.java index c103052dc4..28fd19ba95 100644 --- a/cst/plugins/eu.esdihumboldt.cst/test/eu/esdihumboldt/cst/test/DefaultTransformationTest.java +++ b/cst/plugins/eu.esdihumboldt.cst/test/eu/esdihumboldt/cst/test/DefaultTransformationTest.java @@ -19,16 +19,13 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import eu.esdihumboldt.hale.common.instance.model.Instance; import java.util.List; import java.util.TreeSet; - import javax.xml.namespace.QName; - import org.junit.Ignore; import org.junit.Test; -import eu.esdihumboldt.hale.common.instance.model.Instance; - /** * Tests for the CST's alignment processor implementation * @@ -58,8 +55,7 @@ public void testSimpleAttribute() throws Exception { } /** - * Test based on a very simple mapping with a retype, renames and an - * assignment. + * Test based on a very simple mapping with a retype, renames and an assignment. * * @throws Exception if an error occurs executing the test */ @@ -80,8 +76,8 @@ public void testCardinalityRename() throws Exception { } /** - * Test based on a simple mapping with a retype, rename and assign, - * duplicated targets should also get the assigned values. + * Test based on a simple mapping with a retype, rename and assign, duplicated + * targets should also get the assigned values. * * @throws Exception if an error occurs executing the test */ @@ -111,9 +107,9 @@ public void testJoinMultiCond_1() throws Exception { } /** - * Test based on a retype and a formatted string with several inputs where - * one input exists several times, whereas the others only exist once. So - * those should be used all the times. + * Test based on a retype and a formatted string with several inputs where one + * input exists several times, whereas the others only exist once. So those + * should be used all the times. * * @throws Exception if an error occurs executing the test */ @@ -123,12 +119,12 @@ public void testSimpleMerge() throws Exception { } /** - * Test based on a retype and a formatted string with several inputs where - * each input exists several times, so they should be combined accordingly. + * Test based on a retype and a formatted string with several inputs where each + * input exists several times, so they should be combined accordingly. * - * If some inputs exist more often than others there is no way to decide - * which of the others to use, so none should be used, so formatted string - * will not produce a value. + * If some inputs exist more often than others there is no way to decide which + * of the others to use, so none should be used, so formatted string will not + * produce a value. * * @throws Exception if an error occurs executing the test */ @@ -139,12 +135,12 @@ public void testCardinalityMerge_1() throws Exception { } /** - * Test based on a retype and a formatted string with several inputs where - * each input exists several times, so they should be combined accordingly. + * Test based on a retype and a formatted string with several inputs where each + * input exists several times, so they should be combined accordingly. * - * If some inputs exist more often than others there is no way to decide - * which of the others to use, so none should be used, so formatted string - * will not produce a value. + * If some inputs exist more often than others there is no way to decide which + * of the others to use, so none should be used, so formatted string will not + * produce a value. * * @throws Exception if an error occurs executing the test */ @@ -185,10 +181,9 @@ public void testSimpleComplex() throws Exception { } /** - * Test where elements with a high cardinality are mapped to an element - * which may only occur once within an element that allows a high - * cardinality. The elements should be grouped together to fill the target - * element. + * Test where elements with a high cardinality are mapped to an element which + * may only occur once within an element that allows a high cardinality. The + * elements should be grouped together to fill the target element. * * @throws Exception if an error occurs executing the test */ @@ -282,8 +277,8 @@ public void testNullValue() throws Exception { } /** - * Test for the generateduid. Since the uid is always different, just test - * for them being unique. + * Test for the generateduid. Since the uid is always different, just test for + * them being unique. * * @throws Exception if an error occurs executing the test */ @@ -330,8 +325,7 @@ public void testClassification2() throws Exception { } /** - * Test for the classification with non matching values and use a fixed - * value. + * Test for the classification with non matching values and use a fixed value. * * @throws Exception if an error occurs executing the test */ diff --git a/ext/adv/eu.esdihumboldt.hale.adv.merge/src/eu/esdihumboldt/hale/adv/merge/AdVMeasurementMigrator.java b/ext/adv/eu.esdihumboldt.hale.adv.merge/src/eu/esdihumboldt/hale/adv/merge/AdVMeasurementMigrator.java index c635c93345..33ad8ec9f0 100644 --- a/ext/adv/eu.esdihumboldt.hale.adv.merge/src/eu/esdihumboldt/hale/adv/merge/AdVMeasurementMigrator.java +++ b/ext/adv/eu.esdihumboldt.hale.adv.merge/src/eu/esdihumboldt/hale/adv/merge/AdVMeasurementMigrator.java @@ -15,11 +15,8 @@ package eu.esdihumboldt.hale.adv.merge; -import java.text.MessageFormat; - import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; - import eu.esdihumboldt.hale.common.align.merge.MergeIndex; import eu.esdihumboldt.hale.common.align.merge.impl.DefaultMergeCellMigrator; import eu.esdihumboldt.hale.common.align.migrate.AlignmentMigration; @@ -30,6 +27,7 @@ import eu.esdihumboldt.hale.common.align.model.ParameterValue; import eu.esdihumboldt.hale.common.align.model.functions.AssignFunction; import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import java.text.MessageFormat; /** * Migrator for custom function that converts AdV units of measurement to UCUM. diff --git a/ext/adv/eu.esdihumboldt.hale.adv.merge/test/eu/esdihumboldt/hale/adv/merge/test/AdVMeasurementMergeTest.groovy b/ext/adv/eu.esdihumboldt.hale.adv.merge/test/eu/esdihumboldt/hale/adv/merge/test/AdVMeasurementMergeTest.groovy index ce32d3aa8f..7a188be235 100644 --- a/ext/adv/eu.esdihumboldt.hale.adv.merge/test/eu/esdihumboldt/hale/adv/merge/test/AdVMeasurementMergeTest.groovy +++ b/ext/adv/eu.esdihumboldt.hale.adv.merge/test/eu/esdihumboldt/hale/adv/merge/test/AdVMeasurementMergeTest.groovy @@ -17,14 +17,13 @@ package eu.esdihumboldt.hale.adv.merge.test import static org.junit.Assert.* -import org.junit.Test - -import eu.esdihumboldt.hale.adv.merge.AdVMeasurementMigrator; +import eu.esdihumboldt.hale.adv.merge.AdVMeasurementMigrator import eu.esdihumboldt.hale.common.align.io.impl.JaxbAlignmentIO import eu.esdihumboldt.hale.common.align.merge.test.AbstractMergeCellMigratorTest import eu.esdihumboldt.hale.common.align.model.CellUtil import eu.esdihumboldt.hale.common.align.model.MutableCell import eu.esdihumboldt.hale.common.align.model.functions.AssignFunction +import org.junit.Test /** * Test the AdVMeasurementMigrator. diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/BoundingBox.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/BoundingBox.java index 36a860429f..0a8c96573d 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/BoundingBox.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/BoundingBox.java @@ -15,19 +15,17 @@ package de.fhg.igd.geom; +import de.fhg.igd.geom.util.BlochHashCode; +import de.fhg.igd.geom.util.MathHelper; import java.io.Serializable; import java.util.Arrays; import java.util.Collection; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.Point; import org.locationtech.jts.geom.Polygon; -import de.fhg.igd.geom.util.BlochHashCode; -import de.fhg.igd.geom.util.MathHelper; - /** * This class represents a Bounding Box in 3D, as defined by the lower left * minimum height and the upper right maximum height corners. @@ -234,8 +232,7 @@ public Point3D getCenter() { /** * @param bb the BoundingBox that may have any relation to this one - * @return true if the given BoundingBox has any spatial relation to this - * one. + * @return true if the given BoundingBox has any spatial relation to this one. */ public boolean any(BoundingBox bb) { return (this.intersects(bb) || this.covers(bb) || bb.covers(this) || bb.equals(this) @@ -256,8 +253,8 @@ public boolean covers(BoundingBox bbox) { } /** - * This checks if this Bounding Box completely contains the parameter - * Bounding Box. + * This checks if this Bounding Box completely contains the parameter Bounding + * Box. * * @param bbox the other BoundingBox * @return true if this Box contains bbox, false otherwise @@ -341,8 +338,8 @@ private boolean touches(BoundingBox bb) { } /** - * Test emptiness, i.e. whether at least one axis has zero width and the box - * is regular. + * Test emptiness, i.e. whether at least one axis has zero width and the box is + * regular. * * @return whether the bounding box is empty. */ @@ -380,8 +377,7 @@ else if (this.getMinZ() >= bb.getMaxZ() || this.getMaxZ() <= bb.getMinZ()) { } /** - * Checks if this BoundingBox intersects with or covers the given - * BoundingBox bb + * Checks if this BoundingBox intersects with or covers the given BoundingBox bb * * @param bb the BoundingBox to check against * @return true if this BoundingBox intersects with or covers bb, false @@ -424,9 +420,8 @@ private static void computeInternal(double x, double y, double[] result) { * @param x the x ordinate of the point to add * @param y the y ordinate * @param z the z ordinate - * @param result an array containing the current bounding box. This array - * will be updated by this method. The structure is as follows: - *
      + * @param result an array containing the current bounding box. This array will + * be updated by this method. The structure is as follows:
      * result[0] - maximum x
      * result[1] - minimum x
      * result[2] - maximum y
      @@ -619,8 +614,8 @@ public static BoundingBox compute2D(Coordinate[] points) { } /** - * checks if min* and max* are actually in the expected relation. If a pair - * is real and in the wrong order, it is swapped. + * checks if min* and max* are actually in the expected relation. If a pair is + * real and in the wrong order, it is swapped. */ public void normalize() { if (MathHelper.isReal(minX) && MathHelper.isReal(maxX) && maxX < minX) { @@ -641,8 +636,8 @@ public void normalize() { } /** - * This method will return a 2D Extent that uses only the X and Y - * coordinates of this BoundingBox. + * This method will return a 2D Extent that uses only the X and Y coordinates of + * this BoundingBox. * * @return Extent */ @@ -702,8 +697,8 @@ public boolean equals(Object o) { } /** - * Provides a hashCode so that x.hashCode() == y.hashCode() when x.equals(y) - * == true + * Provides a hashCode so that x.hashCode() == y.hashCode() when x.equals(y) == + * true * * @see java.lang.Object#hashCode() */ @@ -737,9 +732,8 @@ public String toString() { } /** - * @return true if all limits of this bb have been initialized in a - * meaningful way (i.e. not NaN, Infinity or NegativeInfinty) and is - * regular. + * @return true if all limits of this bb have been initialized in a meaningful + * way (i.e. not NaN, Infinity or NegativeInfinty) and is regular. * @see #isRegular() */ public boolean checkIntegrity() { @@ -747,8 +741,8 @@ public boolean checkIntegrity() { } /** - * @return true if all limits of this bb have been initialized in a - * meaningful way (i.e. not NaN, Infinity or NegativeInfinty) + * @return true if all limits of this bb have been initialized in a meaningful + * way (i.e. not NaN, Infinity or NegativeInfinty) */ private boolean isRealValued() { double[] values = new double[] { minX, minY, minZ, maxX, maxY, maxZ }; diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Extent.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Extent.java index c2020e0638..2aaa1a082e 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Extent.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Extent.java @@ -15,10 +15,9 @@ package de.fhg.igd.geom; -import java.io.Serializable; - import de.fhg.igd.geom.util.BlochHashCode; import de.fhg.igd.geom.util.MathHelper; +import java.io.Serializable; /** * This class represents an Extent in 2D, as defined by the lower left and upper @@ -169,8 +168,7 @@ private boolean touches(Extent ex) { /** * @param ext the Extent that may have any relation to this Extent - * @return true if the specified Extent has ANY spacial relation to this - * Extent. + * @return true if the specified Extent has ANY spacial relation to this Extent. */ public boolean any(Extent ext) { return (this.intersects(ext) || this.covers(ext) || ext.covers(this) || ext.equals(this) @@ -178,11 +176,11 @@ public boolean any(Extent ext) { } /** - * This method will return true if 1..2 corners of the given extent lie - * within this Extent. If you want to check for all spatial relationships, - * use intersectsOrCovers(Extent). It will also return true if the extents - * have a cross-shaped intersections, that is, if no points lie in the other - * extent but when the lines of the extent actually cut each other. + * This method will return true if 1..2 corners of the given extent lie within + * this Extent. If you want to check for all spatial relationships, use + * intersectsOrCovers(Extent). It will also return true if the extents have a + * cross-shaped intersections, that is, if no points lie in the other extent but + * when the lines of the extent actually cut each other. * * @param ex the extent that may be intersected by this extent * @return true if this Extent intersects the given one @@ -236,8 +234,8 @@ public double getHeight() { // canonical java methods .................................................. /** - * Two extents are defined as being equal when their LL and UR coordinates - * are equal. + * Two extents are defined as being equal when their LL and UR coordinates are + * equal. * * @param o the extent to compare to * @return true if both extents are equal @@ -256,8 +254,8 @@ public boolean equals(Object o) { } /** - * checks if min* and max* are actually in the expected relation. If a pair - * is real and in the wrong order, it is swapped. + * checks if min* and max* are actually in the expected relation. If a pair is + * real and in the wrong order, it is swapped. */ private void normalize() { if (MathHelper.isReal(minX) && MathHelper.isReal(maxX) && maxX < minX) { @@ -273,8 +271,8 @@ private void normalize() { } /** - * Provides a hashCode so that x.hashCode() == y.hashCode() when x.equals(y) - * == true + * Provides a hashCode so that x.hashCode() == y.hashCode() when x.equals(y) == + * true * * @see java.lang.Object#hashCode() */ @@ -399,8 +397,8 @@ public Point2D getMax() { * Compares the area of this extent to another one * * @param e the other extent to compare to - * @return -1, 0, 1 if the area of this extent is greater than, equal to or - * less than the other one. + * @return -1, 0, 1 if the area of this extent is greater than, equal to or less + * than the other one. */ @Override public int compareTo(Extent e) { diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Point2D.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Point2D.java index 2ea645fa66..5d3101d2b3 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Point2D.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Point2D.java @@ -15,9 +15,8 @@ package de.fhg.igd.geom; -import java.io.Serializable; - import de.fhg.igd.geom.util.BlochHashCode; +import java.io.Serializable; /** * This is a base class for the description of a Point in 2D space (using double @@ -63,8 +62,8 @@ public Point2D(double x, double y) { /** * Copy constructor * - * @param p3d the Point3D to use as a template. x and y values will be - * copied. z will be discarded. + * @param p3d the Point3D to use as a template. x and y values will be copied. z + * will be discarded. */ public Point2D(Point3D p3d) { this.x = p3d.getX(); @@ -74,8 +73,7 @@ public Point2D(Point3D p3d) { // functional methods ...................................................... /** - * returns this Point's BoundingBox. Min values and max values are - * identical. + * returns this Point's BoundingBox. Min values and max values are identical. * * @see Localizable#getBoundingBox() */ @@ -87,9 +85,8 @@ public BoundingBox getBoundingBox() { // canonical java methods .................................................. /** - * This equals method is consistent with the compareTo() method implemented - * in this class, that means, it determines equality by comparing x and y - * values. + * This equals method is consistent with the compareTo() method implemented in + * this class, that means, it determines equality by comparing x and y values. * * @see Object#equals(Object) */ @@ -110,8 +107,8 @@ public boolean equals(Object o) { } /** - * Provides a hashCode so that x.hashCode() == y.hashCode() when x.equals(y) - * == true + * Provides a hashCode so that x.hashCode() == y.hashCode() when x.equals(y) == + * true * * @see java.lang.Object#hashCode() */ diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Point3D.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Point3D.java index 9f63e9b21a..5fda0aa920 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Point3D.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Point3D.java @@ -15,11 +15,10 @@ package de.fhg.igd.geom; +import de.fhg.igd.geom.util.BlochHashCode; import java.io.Serializable; import java.util.List; -import de.fhg.igd.geom.util.BlochHashCode; - /** * This is a base class for the description of a Point in 3D space (using double * coordinates). @@ -79,8 +78,7 @@ public Point3D(Point2D p2d, double z) { } /** - * Constructs a new Point with the x, y and z coordinates of another 3D - * point + * Constructs a new Point with the x, y and z coordinates of another 3D point * * @param p3d the other 3D point */ @@ -136,8 +134,8 @@ public boolean equals(Object o) { } /** - * Provides a hashCode so that x.hashCode() == y.hashCode() when x.equals(y) - * == true + * Provides a hashCode so that x.hashCode() == y.hashCode() when x.equals(y) == + * true * * @see java.lang.Object#hashCode() */ diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Verifier.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Verifier.java index 540c6c7add..a6bbf8d779 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Verifier.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/Verifier.java @@ -31,8 +31,8 @@ public interface Verifier { * * @param first the first localizable * @param second the other localizable - * @return true if the first localizable has a spatial relation to the - * second one + * @return true if the first localizable has a spatial relation to the second + * one */ public boolean verify(T first, L second); } diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/FaceTriangulation.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/FaceTriangulation.java index 914d7f7af4..def634e025 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/FaceTriangulation.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/FaceTriangulation.java @@ -15,12 +15,11 @@ package de.fhg.igd.geom.algorithm; +import de.fhg.igd.geom.Point3D; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import de.fhg.igd.geom.Point3D; - /** * Triangulates FaceSets using a 3D version of the ear cutting algorithm. This * class is also able to triangulate faces which are not flat. @@ -46,8 +45,8 @@ public FaceTriangulation() { } /** - * Checks if the vertex p2 is convex by calculating the determinant of - * p1,p2,p3 which is negative if p2 convex and positive if it is not. + * Checks if the vertex p2 is convex by calculating the determinant of p1,p2,p3 + * which is negative if p2 convex and positive if it is not. * * @param p1 the point prior to p2 * @param p2 the point to check @@ -199,11 +198,11 @@ private int[] earCutting(List points, int[] indices) { } /** - * This method calculates the signed 2D area of a Polygon. If the result is - * < 0.0 the Polygon is oriented clockwise, otherwise it's counterclockwise. + * This method calculates the signed 2D area of a Polygon. If the result is < + * 0.0 the Polygon is oriented clockwise, otherwise it's counterclockwise. * - * @param points the Polygon, whereas the first point MUST NOT equal the - * last one + * @param points the Polygon, whereas the first point MUST NOT equal the last + * one * @return true if the Polygon is clockwise, false otherwise */ private static boolean isClockwise(List points) { @@ -221,8 +220,8 @@ private static boolean isClockwise(List points) { * Reverses a list of points * * @param a the list - * @param indices the index array that connects the points with the vertices - * in the corresponding face + * @param indices the index array that connects the points with the vertices in + * the corresponding face */ private static void reversePoints(List a, int[] indices) { for (int i = 0; i < a.size() / 2; ++i) { @@ -271,8 +270,8 @@ private static int[] projectAndCompactFace(List f, List points } /** - * Projects a Face onto a 2D plane using a given normal. Also compacts the - * face (removes consecutive duplicate points). + * Projects a Face onto a 2D plane using a given normal. Also compacts the face + * (removes consecutive duplicate points). * * @param f the Face * @param k the normal diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/Point2DEventQueue.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/Point2DEventQueue.java index e12654348d..d8b19b0231 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/Point2DEventQueue.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/Point2DEventQueue.java @@ -15,11 +15,10 @@ package de.fhg.igd.geom.algorithm.sweepline; -import java.util.Collections; -import java.util.Comparator; - import de.fhg.igd.geom.shape.Line2D; import de.fhg.igd.geom.shape.Polygon; +import java.util.Collections; +import java.util.Comparator; /** * Represents a queue of events during a sweep-line search diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SortedCollection.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SortedCollection.java index 269db23f5d..b45ac3e187 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SortedCollection.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SortedCollection.java @@ -244,8 +244,7 @@ public T[] toArray(T[] a) { } /** - * Resorts this list (for example, if the comparator changed its internal - * state) + * Resorts this list (for example, if the comparator changed its internal state) */ public void resort() { Collections.sort(_list, _comp); diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepLineComparator.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepLineComparator.java index 13b9548417..ed06495477 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepLineComparator.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepLineComparator.java @@ -57,8 +57,8 @@ public void setPosition(double x) { * * @param s1 the first segment * @param s2 the second segment - * @return -1 if the first segment is "above" the second one, 1 if it is - * below and 0 if both segments are equal. + * @return -1 if the first segment is "above" the second one, 1 if it is below + * and 0 if both segments are equal. */ @Override public int compare(SweepLineSegment s1, SweepLineSegment s2) { diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepPoint2DEventComparator.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepPoint2DEventComparator.java index eb94b4d8d3..4f6abcff95 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepPoint2DEventComparator.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepPoint2DEventComparator.java @@ -35,9 +35,9 @@ public class SweepPoint2DEventComparator implements Comparator { * * @param p1 the first point * @param p2 the second point - * @return -1 if the x ordinate of p1 is lower than the one of p2, +1 if - * it's greater. If both ordinates are equal the method will compare - * the y ordinates. + * @return -1 if the x ordinate of p1 is lower than the one of p2, +1 if it's + * greater. If both ordinates are equal the method will compare the y + * ordinates. */ @Override public int compare(Point2DEvent p1, Point2DEvent p2) { diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepPoint2DXYComparator.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepPoint2DXYComparator.java index edba44ec47..244345f69a 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepPoint2DXYComparator.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/algorithm/sweepline/SweepPoint2DXYComparator.java @@ -15,9 +15,8 @@ package de.fhg.igd.geom.algorithm.sweepline; -import java.util.Comparator; - import de.fhg.igd.geom.Point2D; +import java.util.Comparator; /** * Compares Point2D objects to sort them by their increasing x ordinate and @@ -32,9 +31,9 @@ public class SweepPoint2DXYComparator implements Comparator { * * @param p1 the first point * @param p2 the second point - * @return -1 if the x ordinate of p1 is lower than the one of p2, +1 if - * it's greater. If both ordinates are equal the method will compare - * the y ordinates. + * @return -1 if the x ordinate of p1 is lower than the one of p2, +1 if it's + * greater. If both ordinates are equal the method will compare the y + * ordinates. */ @Override public int compare(Point2D p1, Point2D p2) { diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/NNComparator.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/NNComparator.java index 0929d9e7de..0ab22e0019 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/NNComparator.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/NNComparator.java @@ -15,9 +15,8 @@ package de.fhg.igd.geom.indices; -import java.util.Comparator; - import de.fhg.igd.geom.Localizable; +import java.util.Comparator; /** * This is a comparator for determining the distance that lies between two diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/Node.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/Node.java index 48071531eb..ea7efb8ee4 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/Node.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/Node.java @@ -15,11 +15,10 @@ package de.fhg.igd.geom.indices; -import java.util.ArrayList; -import java.util.List; - import de.fhg.igd.geom.BoundingBox; import de.fhg.igd.geom.Localizable; +import java.util.ArrayList; +import java.util.List; /** * Represents a node (or leaf) in a R-Tree. The splitting techniques used in @@ -42,8 +41,7 @@ public class Node implements Localizable { private List _children; /** - * True, if this node is a leaf. All nodes are leafs until child nodes are - * added + * True, if this node is a leaf. All nodes are leafs until child nodes are added */ private boolean _isLeaf = true; @@ -66,9 +64,9 @@ public class Node implements Localizable { /** * Default constructor * - * @param pageSize the page size (number of children/locs that can be - * attached to this node before it gets splitted). Must be even - * and greater than or equal to 4. + * @param pageSize the page size (number of children/locs that can be attached + * to this node before it gets splitted). Must be even and greater + * than or equal to 4. * @param parent the node's parent or null if the node is the root * @param tree the parent R-Tree */ @@ -97,9 +95,9 @@ private int calculateMinSize() { } /** - * In the RTree we can't use @link{BoundingBox#getVolume} as we want to - * index n-dimensional stuff. We make sure irregular stuff won't get in - * anyway, so be relaxed about BBs. + * In the RTree we can't use @link{BoundingBox#getVolume} as we want to index + * n-dimensional stuff. We make sure irregular stuff won't get in anyway, so be + * relaxed about BBs. * * @param bb the boundingBox * @return the ersatz volume @@ -116,9 +114,9 @@ protected double calcPseudoVolume(BoundingBox bb) { } /** - * In the RTree we can't use @link{BoundingBox#getVolume} as we want to - * index n-dimensional stuff. We make sure irregular stuff won't get in - * anyway, so be relaxed about BBs. + * In the RTree we can't use @link{BoundingBox#getVolume} as we want to index + * n-dimensional stuff. We make sure irregular stuff won't get in anyway, so be + * relaxed about BBs. * * @param bb the boundingBox * @return the ersatz volume @@ -132,8 +130,8 @@ protected double calcPseudoVolume(Localizable bb) { * * @param b1 the first bounding box * @param b2 the second bounding box - * @param useExtent true if the extents of the bounding boxes should be - * compared and not the bounding boxes themselves + * @param useExtent true if the extents of the bounding boxes should be compared + * and not the bounding boxes themselves * @return true if the first bounding box has any relation to the other one, * false otherwise */ @@ -145,8 +143,8 @@ private static boolean relate(BoundingBox b1, BoundingBox b2, boolean useExtent) } /** - * Searches this Node and all children and returns the leaf that contains - * the given Localizable + * Searches this Node and all children and returns the leaf that contains the + * given Localizable * * @param loc the Localizable to find * @return the leaf that contains loc or null if loc is not contained by any @@ -294,8 +292,8 @@ private void plainAdd(Localizable loc) { } /** - * Splits this node into two nodes and adds them to the parent node. - * (Quadratic Split) + * Splits this node into two nodes and adds them to the parent node. (Quadratic + * Split) * * @return the new second Node */ @@ -460,8 +458,8 @@ private void internalInsert(final Localizable loc) { } /** - * Finds the Leaf L in which to insert the given Localizable loc and inserts - * loc to L. Splits L if there are too many children. + * Finds the Leaf L in which to insert the given Localizable loc and inserts loc + * to L. Splits L if there are too many children. * * @param loc the Localizable to insert */ @@ -493,9 +491,9 @@ private void adjustTree(Node nn) { } /** - * Traverses the given Node "no" and all its children. If a leaf is found - * its children (the actual Localizables) will be inserted into the given - * RTree as usual. + * Traverses the given Node "no" and all its children. If a leaf is found its + * children (the actual Localizables) will be inserted into the given RTree as + * usual. * * @param the type of the objects stored in the RTree * @param no the Node to traverse @@ -520,8 +518,8 @@ private static void insertChildrenOfAllLeafs(Node no, } /** - * Eliminate l if it has too few entries. Propagate elimination upwards. - * Adjust BoundingBoxes. + * Eliminate l if it has too few entries. Propagate elimination upwards. Adjust + * BoundingBoxes. * * @param l the Leaf from which an entry has been deleted */ @@ -608,8 +606,8 @@ public boolean delete(Localizable loc) { * Localizable loc. * * @param loc the Localizable to match - * @param ignoreZ true if the z coordinate should be ignored during - * candidate search + * @param ignoreZ true if the z coordinate should be ignored during candidate + * search * @return a list of Localizables (containing only leafs of this tree and no * nodes) */ @@ -664,10 +662,10 @@ public List find2D(final Localizable loc) { * * @param k the number of neighbor candidates to retrieve * @param loc the given Localizable - * @param stepsize the size of each step in which the neighborhood is - * enlarged. If the original Localizable had no volume (because - * it's a point type), this value is first used as an absolute - * value and then as a successive relative increase + * @param stepsize the size of each step in which the neighborhood is enlarged. + * If the original Localizable had no volume (because it's a point + * type), this value is first used as an absolute value and then as a + * successive relative increase * @return a list with all neighbors */ public ArrayList findNeighborhood(int k, Localizable loc, double stepsize) { diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/RTree.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/RTree.java index b8339e94bc..f8994bf597 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/RTree.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/RTree.java @@ -15,18 +15,16 @@ package de.fhg.igd.geom.indices; +import com.google.common.base.Preconditions; +import de.fhg.igd.geom.BoundingBox; +import de.fhg.igd.geom.Localizable; +import de.fhg.igd.geom.Verifier; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.TreeSet; -import com.google.common.base.Preconditions; - -import de.fhg.igd.geom.BoundingBox; -import de.fhg.igd.geom.Localizable; -import de.fhg.igd.geom.Verifier; - /** * Implements an R-Tree * @@ -56,8 +54,8 @@ public class RTree implements SpatialIndex { private int _size; /** - * the size assumed for non-present dimensions - only important for - * optimization of mixed dimensionality, should be > 0 + * the size assumed for non-present dimensions - only important for optimization + * of mixed dimensionality, should be > 0 */ private final double _nonDimensionSize; @@ -65,8 +63,8 @@ public class RTree implements SpatialIndex { * Default constructor * * @param pageSize the page size (number of children that can be attached to - * this node before it gets splitted). Must be even and greater - * than or equal to 4. + * this node before it gets splitted). Must be even and greater than + * or equal to 4. */ public RTree(int pageSize) { this(pageSize, DEFAULT_NON_DIMEMSION_SIZE); @@ -76,11 +74,10 @@ public RTree(int pageSize) { * Default constructor * * @param pageSize the page size (number of children that can be attached to - * this node before it gets splitted). Must be even and greater - * than or equal to 4. - * @param nonDimemsionSize the size assumed for non-present dimensions - - * only important for optimization of mixed dimensionality, - * should be > 0 + * this node before it gets splitted). Must be even and greater than + * or equal to 4. + * @param nonDimemsionSize the size assumed for non-present dimensions - only + * important for optimization of mixed dimensionality, should be > 0 */ public RTree(int pageSize, double nonDimemsionSize) { Preconditions.checkArgument(pageSize >= 4 && pageSize % 2 == 0 && nonDimemsionSize > 0); @@ -97,8 +94,7 @@ public Node getRoot() { } /** - * Sets the new root node. Package visible, because only Node shall access - * it. + * Sets the new root node. Package visible, because only Node shall access it. * * @param root the new root node */ @@ -176,8 +172,8 @@ public Set query2D(L loc, Verifier veri } /** - * Traverses through the given list of candidates and finds those that match - * the given verifier + * Traverses through the given list of candidates and finds those that match the + * given verifier * * @param the type of localizables to search * @param loc the localizable to match against diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/SpatialIndex.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/SpatialIndex.java index dc66ce5c9c..7029e94179 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/SpatialIndex.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/indices/SpatialIndex.java @@ -15,12 +15,10 @@ package de.fhg.igd.geom.indices; -import java.util.Set; - import de.fhg.igd.geom.BoundingBox; import de.fhg.igd.geom.Localizable; import de.fhg.igd.geom.Verifier; -import de.fhg.igd.geom.indices.NNComparator; +import java.util.Set; /** * This interface describes the access methods that a spatial index has to diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Line2D.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Line2D.java index 555c7d5d1f..952d4265fb 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Line2D.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Line2D.java @@ -15,15 +15,14 @@ package de.fhg.igd.geom.shape; +import de.fhg.igd.geom.BoundingBox; +import de.fhg.igd.geom.Point2D; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.CoordinateSequence; import org.locationtech.jts.geom.CoordinateSequenceFactory; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.impl.CoordinateArraySequenceFactory; -import de.fhg.igd.geom.BoundingBox; -import de.fhg.igd.geom.Point2D; - /** * This class describes open 2D polylines. * @@ -60,22 +59,21 @@ public Line2D() { * @param geometryFactory the factory for JTS geometries * @return the converted LineString */ - private org.locationtech.jts.geom.LineString toJTSLineString( - GeometryFactory geometryFactory) { + private org.locationtech.jts.geom.LineString toJTSLineString(GeometryFactory geometryFactory) { Coordinate[] coords = new Coordinate[this.getPoints().length]; for (int i = 0; i < this.getPoints().length; i++) { coords[i] = new Coordinate(this.getPoints()[i].getX(), this.getPoints()[i].getY()); } CoordinateSequenceFactory csf = CoordinateArraySequenceFactory.instance(); CoordinateSequence cs = csf.create(coords); - org.locationtech.jts.geom.LineString jts_ls = new org.locationtech.jts.geom.LineString( - cs, geometryFactory); + org.locationtech.jts.geom.LineString jts_ls = new org.locationtech.jts.geom.LineString(cs, + geometryFactory); return jts_ls; } /** - * @param buffer - a value that defines how far around the line the buffer - * shall extend. + * @param buffer - a value that defines how far around the line the buffer shall + * extend. * @return a Polygon that is the buffer area. */ public Surface computeBuffer(double buffer) { diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Polygon.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Polygon.java index 5e9eda6468..9960ed3806 100644 --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Polygon.java +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Polygon.java @@ -15,9 +15,6 @@ package de.fhg.igd.geom.shape; -import java.util.ArrayList; -import java.util.List; - import de.fhg.igd.geom.BoundingBox; import de.fhg.igd.geom.Extent; import de.fhg.igd.geom.Point2D; @@ -25,6 +22,8 @@ import de.fhg.igd.geom.algorithm.sweepline.Point2DEventQueue; import de.fhg.igd.geom.algorithm.sweepline.SweepLine; import de.fhg.igd.geom.algorithm.sweepline.SweepLineSegment; +import java.util.ArrayList; +import java.util.List; /** * This class describes closed 2D polylines with straight segments. The @@ -76,8 +75,8 @@ private boolean contains(Point2D p2d) { /** * @return true if the given point is inside this Polygon. Uses the standard * contains algorithm that checks how often a ray projected form the - * point parallel to the y axis cuts a segment of the polygon. If - * the number is even, it's outide, if it is odd, it's inside. + * point parallel to the y axis cuts a segment of the polygon. If the + * number is even, it's outide, if it is odd, it's inside. * @param x the x ordinate of the point that may be inside of this Polygon * @param y the y ordinate of the point that may be inside of this Polygon */ @@ -166,8 +165,8 @@ public boolean contains(Extent e) { * * @param p the Polygon to add * @param q the queue to add to - * @return a list of line2d objects which are vertical and which could not - * be added. + * @return a list of line2d objects which are vertical and which could not be + * added. */ private static List addToPoint2DEventQueue(Polygon p, Point2DEventQueue q) { List verticalLines = new ArrayList(); @@ -290,10 +289,10 @@ private boolean intersects(Polygon p) { } /** - * Tests if this Polygon completely contains another one. First it checks - * for intersection (because the two Polygons must not intersect). Then it - * checks if this Polygon contains at least one point (actually the first - * one) of the other Polygon. + * Tests if this Polygon completely contains another one. First it checks for + * intersection (because the two Polygons must not intersect). Then it checks if + * this Polygon contains at least one point (actually the first one) of the + * other Polygon. * * @param p the other Polygon * @return true if this Polygon completely contains p, false otherwise @@ -307,23 +306,22 @@ public boolean contains(Polygon p) { /** *

      - * This method will test if there is an intersection point between the - * vectors defined by (a1,a2) and (b1,b2). If there is none, it will return - * null, otherwise it will return the parameter (usually called "lambda") - * where the intersection point can be found on the first line. + * This method will test if there is an intersection point between the vectors + * defined by (a1,a2) and (b1,b2). If there is none, it will return null, + * otherwise it will return the parameter (usually called "lambda") where the + * intersection point can be found on the first line. *

      *

      - * Attention: This method may also return lambda values lower than - * 0.0 or greater than 1.0. In this case the intersection point lies outside - * the first line! + * Attention: This method may also return lambda values lower than 0.0 or + * greater than 1.0. In this case the intersection point lies outside the first + * line! *

      *

      - * Attention: If the result value is - * 0.0 <= lambda <= 1.0 this does not mean that the - * intersection point lies on both lines in all cases. This method - * intersects vectors and so the intersection point may lie on the first - * line but not on the second one. If you want to make sure the intersection - * point lies on both lines, always call this method as follows: + * Attention: If the result value is 0.0 <= lambda <= 1.0 + * this does not mean that the intersection point lies on both lines in all + * cases. This method intersects vectors and so the intersection point may lie + * on the first line but not on the second one. If you want to make sure the + * intersection point lies on both lines, always call this method as follows: *

      * *
      diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Shape.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Shape.java
      index f7517ed7f1..be85401c5e 100644
      --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Shape.java
      +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Shape.java
      @@ -15,12 +15,11 @@
       
       package de.fhg.igd.geom.shape;
       
      -import java.io.Serializable;
      -import java.util.Arrays;
      -
       import de.fhg.igd.geom.Localizable;
       import de.fhg.igd.geom.Point2D;
       import de.fhg.igd.geom.util.BlochHashCode;
      +import java.io.Serializable;
      +import java.util.Arrays;
       
       /**
        * More or less what geom.feature.Geometry_2d was in the older
      diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Surface.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Surface.java
      index a98680c56c..f0d70f1d84 100644
      --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Surface.java
      +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/shape/Surface.java
      @@ -15,11 +15,10 @@
       
       package de.fhg.igd.geom.shape;
       
      -import java.util.Arrays;
      -
       import de.fhg.igd.geom.BoundingBox;
       import de.fhg.igd.geom.Point2D;
       import de.fhg.igd.geom.util.BlochHashCode;
      +import java.util.Arrays;
       
       /**
        * This class is equal to the OGC simple feature spec's Surface class, that is,
      @@ -41,8 +40,8 @@ public class Surface extends Shape {
       	private Polygon exterior_boundary;
       
       	/**
      -	 * An Array of Polygons which defines the holes in this Surface. Hole
      -	 * Polygons may neither intersect the outer boundary nor touch it.
      +	 * An Array of Polygons which defines the holes in this Surface. Hole Polygons
      +	 * may neither intersect the outer boundary nor touch it.
       	 */
       	private Polygon[] interior_boundaries;
       
      diff --git a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/util/MathHelper.java b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/util/MathHelper.java
      index cb17f17170..cbc1f399a0 100644
      --- a/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/util/MathHelper.java
      +++ b/ext/geom/de.fhg.igd.geom/src/de/fhg/igd/geom/util/MathHelper.java
      @@ -148,8 +148,7 @@ public static boolean isReal(double x) {
       	}
       
       	/**
      -	 * The so-called 'euclidean' modulo, a modulo which won't yield negative
      -	 * results
      +	 * The so-called 'euclidean' modulo, a modulo which won't yield negative results
       	 * 
       	 * @param x the number to divide
       	 * @param mod the divisor
      @@ -178,8 +177,8 @@ public static double dot2D(double p1x, double p1y, double p2x, double p2y) {
       	}
       
       	/**
      -	 * given two angels in radians, returns a difference in radians closest to
      -	 * zero such that a + angleDiff(a, b) represents b.
      +	 * given two angels in radians, returns a difference in radians closest to zero
      +	 * such that a + angleDiff(a, b) represents b.
       	 * 
       	 * @param a angle a
       	 * @param b angle b
      @@ -190,8 +189,8 @@ public static double angleDiff(double a, double b) {
       	}
       
       	/**
      -	 * given two angels in radians, returns a difference in radians closest to
      -	 * zero such that a + angleDiff(a, b) represents b.
      +	 * given two angels in radians, returns a difference in radians closest to zero
      +	 * such that a + angleDiff(a, b) represents b.
       	 * 
       	 * @param a angle a
       	 * @param b angle b
      @@ -209,8 +208,8 @@ public static double angleDiff(double a, double b, double ring) {
       	}
       
       	/**
      -	 * given two angels in radians, returns a difference in radians closest to
      -	 * zero and >= zero.
      +	 * given two angels in radians, returns a difference in radians closest to zero
      +	 * and >= zero.
       	 * 
       	 * @param a angle a
       	 * @param b angle b
      @@ -221,11 +220,10 @@ public static double angleDiffAbs(double a, double b) {
       	}
       
       	/**
      -	 * given two angels in radians, returns a difference in radians closest to
      -	 * zero and >= zero, depending on the scale. For example, while two angles
      -	 * pi/2 and -pi/2 may differ on a full circle (scale 1), they are considered
      -	 * equal at scale 2. At scale 3, also orthogonal angles would match, and so
      -	 * on.
      +	 * given two angels in radians, returns a difference in radians closest to zero
      +	 * and >= zero, depending on the scale. For example, while two angles pi/2 and
      +	 * -pi/2 may differ on a full circle (scale 1), they are considered equal at
      +	 * scale 2. At scale 3, also orthogonal angles would match, and so on.
       	 * 
       	 * @param a angle a
       	 * @param b angle b
      @@ -277,9 +275,9 @@ public static int previousPowerOfTwo(int i) {
       	}
       
       	/**
      -	 * Calls {@link #nextPowerOfTwo(int)} and {@link #previousPowerOfTwo(int)}
      -	 * and finds the nearest value to the given number. Prefers the higher
      -	 * number if the distance is equal.
      +	 * Calls {@link #nextPowerOfTwo(int)} and {@link #previousPowerOfTwo(int)} and
      +	 * finds the nearest value to the given number. Prefers the higher number if the
      +	 * distance is equal.
       	 * 
       	 * @param i the number (must be positive)
       	 * @return the nearest power of two
      diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/NonOsgiPlatform.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/NonOsgiPlatform.java
      index d58427107a..e5231081b3 100644
      --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/NonOsgiPlatform.java
      +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/NonOsgiPlatform.java
      @@ -1,11 +1,10 @@
       package eu.esdihumboldt.hale.util.nonosgi;
       
      -import org.eclipse.core.runtime.content.IContentTypeManager;
      -
       import eu.esdihumboldt.hale.util.nonosgi.contenttype.ContentTypeManager;
      +import org.eclipse.core.runtime.content.IContentTypeManager;
       
       public class NonOsgiPlatform {
      -	
      +
       	public static IContentTypeManager getContentTypeManager() {
       		return ContentTypeManager.getInstance();
       	}
      diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/BasicDescription.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/BasicDescription.java
      index 836162da49..a87860d94d 100644
      --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/BasicDescription.java
      +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/BasicDescription.java
      @@ -26,7 +26,7 @@ public BasicDescription(IContentTypeInfo contentTypeInfo) {
       	 */
       	public IContentType getContentType() {
       		ContentType contentType = contentTypeInfo.getContentType();
      -		//TODO performance: potential creation of garbage		
      +		// TODO performance: potential creation of garbage
       		return new ContentTypeHandler(contentType, contentType.getCatalog().getGeneration());
       	}
       
      diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentDescription.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentDescription.java
      index fffc812734..711f328e44 100644
      --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentDescription.java
      +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentDescription.java
      @@ -32,7 +32,8 @@ public ContentDescription(QualifiedName[] requested, IContentTypeInfo contentTyp
       		if (requested.length > 1) {
       			keys = requested;
       			values = new Object[requested.length];
      -		} else if (requested.length == 1)
      +		}
      +		else if (requested.length == 1)
       			keys = requested[0];
       		// if requested.length == 0 then keys == null (no options to describe!)
       	}
      @@ -141,8 +142,8 @@ public void setProperty(QualifiedName newKey, Object newValue) {
       		}
       		if (keys instanceof QualifiedName) {
       			if ((flags & FLAG_ALL_OPTIONS) != 0) {
      -				keys = new QualifiedName[] {(QualifiedName) keys, newKey};
      -				values = new Object[] {values, newValue};
      +				keys = new QualifiedName[] { (QualifiedName) keys, newKey };
      +				values = new Object[] { values, newValue };
       			}
       			return;
       		}
      @@ -154,7 +155,7 @@ public void setProperty(QualifiedName newKey, Object newValue) {
       			}
       		if ((flags & FLAG_ALL_OPTIONS) == 0)
       			return;
      -		// need to resize arrays 		
      +		// need to resize arrays
       		int currentSize = tmpKeys.length;
       		tmpKeys = new QualifiedName[currentSize + 1];
       		System.arraycopy(keys, 0, tmpKeys, 0, currentSize);
      @@ -172,7 +173,8 @@ public String toString() {
       			if (keys instanceof QualifiedName) {
       				if (values != null)
       					result.append(keys + "=" + values); //$NON-NLS-1$
      -			} else {
      +			}
      +			else {
       				QualifiedName[] tmpKeys = (QualifiedName[]) keys;
       				Object[] tmpValues = (Object[]) values;
       				boolean any = false;
      diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentType.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentType.java
      index 4ca4d05f7c..d321f068ac 100644
      --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentType.java
      +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentType.java
      @@ -12,7 +12,6 @@
       
       import java.io.*;
       import java.util.*;
      -
       import org.eclipse.core.internal.content.ContentMessages;
       import org.eclipse.core.internal.content.ILazySource;
       import org.eclipse.core.internal.content.Util;
      @@ -28,13 +27,14 @@
       /**
        * @see IContentType
        */
      -@SuppressWarnings({"restriction"})
      +@SuppressWarnings({ "restriction" })
       public final class ContentType implements IContentType, IContentTypeInfo {
      -	
      +
       	private static final Logger log = LoggerFactory.getLogger(ContentType.class);
       
       	/* A placeholder for missing/invalid binary/text describers. */
       	private class InvalidDescriber implements IContentDescriber, ITextContentDescriber {
      +
       		@Override
       		public int describe(InputStream contents, IContentDescription description) {
       			return INVALID;
      @@ -102,25 +102,31 @@ public QualifiedName[] getSupportedOptions() {
       	// -1 means unknown
       	private byte depth = -1;
       
      -	public static ContentType createContentType(ContentTypeCatalog catalog, String uniqueId, String name, byte priority,
      -			String[] fileExtensions, String[] fileNames, String[] filePatterns, String baseTypeId, String aliasTargetId,
      -			Map defaultProperties, IConfigurationElement contentTypeElement) {
      +	public static ContentType createContentType(ContentTypeCatalog catalog, String uniqueId,
      +			String name, byte priority, String[] fileExtensions, String[] fileNames,
      +			String[] filePatterns, String baseTypeId, String aliasTargetId,
      +			Map defaultProperties,
      +			IConfigurationElement contentTypeElement) {
       		ContentType contentType = new ContentType(catalog.getManager());
       		contentType.catalog = catalog;
       		contentType.defaultDescription = new DefaultDescription(contentType);
       		contentType.id = uniqueId;
       		contentType.name = name;
       		contentType.priority = priority;
      -		if ((fileExtensions != null && fileExtensions.length > 0) || (fileNames != null && fileNames.length > 0)
      +		if ((fileExtensions != null && fileExtensions.length > 0)
      +				|| (fileNames != null && fileNames.length > 0)
       				|| (filePatterns != null && filePatterns.length > 0)) {
       			contentType.builtInAssociations = true;
      -			contentType.fileSpecs = new ArrayList<>(fileExtensions.length + fileNames.length + filePatterns.length);
      +			contentType.fileSpecs = new ArrayList<>(
      +					fileExtensions.length + fileNames.length + filePatterns.length);
       			for (String fileName : fileNames)
       				contentType.internalAddFileSpec(fileName, FILE_NAME_SPEC | SPEC_PRE_DEFINED);
       			for (String fileExtension : fileExtensions)
      -				contentType.internalAddFileSpec(fileExtension, FILE_EXTENSION_SPEC | SPEC_PRE_DEFINED);
      +				contentType.internalAddFileSpec(fileExtension,
      +						FILE_EXTENSION_SPEC | SPEC_PRE_DEFINED);
       			for (String fileExtension : filePatterns) {
      -				contentType.internalAddFileSpec(fileExtension, FILE_PATTERN_SPEC | SPEC_PRE_DEFINED);
      +				contentType.internalAddFileSpec(fileExtension,
      +						FILE_PATTERN_SPEC | SPEC_PRE_DEFINED);
       			}
       		}
       		contentType.defaultProperties = defaultProperties;
      @@ -144,7 +150,8 @@ static String getPreferenceKey(int flags) {
       
       	@SuppressWarnings("unused")
       	private static String getValidationString(byte validation) {
      -		return validation == STATUS_VALID ? "VALID" : (validation == STATUS_INVALID ? "INVALID" : "UNKNOWN"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      +		return validation == STATUS_VALID ? "VALID" //$NON-NLS-1$
      +				: (validation == STATUS_INVALID ? "INVALID" : "UNKNOWN"); //$NON-NLS-1$ //$NON-NLS-2$
       	}
       
       	public ContentType(ContentTypeManager manager) {
      @@ -153,7 +160,8 @@ public ContentType(ContentTypeManager manager) {
       
       	@Override
       	public void addFileSpec(String fileSpec, int type) throws CoreException {
      -		Assert.isLegal(type == FILE_EXTENSION_SPEC || type == FILE_NAME_SPEC || type == FILE_PATTERN_SPEC,
      +		Assert.isLegal(
      +				type == FILE_EXTENSION_SPEC || type == FILE_NAME_SPEC || type == FILE_PATTERN_SPEC,
       				"Unknown type: " + type); //$NON-NLS-1$
       		String[] userSet;
       		synchronized (this) {
      @@ -178,21 +186,26 @@ public void addFileSpec(String fileSpec, int type) throws CoreException {
       		manager.fireContentTypeChangeEvent(this);
       	}
       
      -	int describe(IContentDescriber selectedDescriber, ILazySource contents, ContentDescription description) throws IOException {
      +	int describe(IContentDescriber selectedDescriber, ILazySource contents,
      +			ContentDescription description) throws IOException {
       		try {
      -			return contents.isText() ? ((ITextContentDescriber) selectedDescriber).describe((Reader) contents, description) : selectedDescriber.describe((InputStream) contents, description);
      +			return contents.isText()
      +					? ((ITextContentDescriber) selectedDescriber).describe((Reader) contents,
      +							description)
      +					: selectedDescriber.describe((InputStream) contents, description);
       		} catch (RuntimeException re) {
       			// describer seems to be buggy. just disable it (logging the reason)
       			invalidateDescriber(re);
       		} catch (Error e) {
      -			// describer got some serious problem. disable it (logging the reason) and throw the error again
      +			// describer got some serious problem. disable it (logging the reason) and throw
      +			// the error again
       			invalidateDescriber(e);
       			throw e;
       		} catch (LowLevelIOException llioe) {
       			// throw the actual exception
       			throw llioe.getActualException();
       		} catch (IOException ioe) {
      -			// bugs 67841/ 62443  - non-low level IOException should be "ignored"
      +			// bugs 67841/ 62443 - non-low level IOException should be "ignored"
       			if (ContentTypeManager.DEBUGGING) {
       				String message = NLS.bind(ContentMessages.content_errorReadingContents, id);
       				log.error(message, ioe);
      @@ -247,7 +260,8 @@ public IContentDescription getDefaultDescription() {
       	}
       
       	/**
      -	 * Returns the default value for the given property in this content type, or null.
      +	 * Returns the default value for the given property in this content type, or
      +	 * null.
       	 */
       	@Override
       	public String getDefaultProperty(QualifiedName key) {
      @@ -291,7 +305,8 @@ public IContentDescriber getDescriber() {
       						describer = NO_DESCRIBER;
       						return null;
       					}
      -					describer = tmpDescriber = contentTypeElement.createExecutableExtension(DESCRIBER_ELEMENT);
      +					describer = tmpDescriber = contentTypeElement
      +							.createExecutableExtension(DESCRIBER_ELEMENT);
       					return (IContentDescriber) tmpDescriber;
       				} catch (CoreException ce) {
       					// the content type definition was invalid. Ensure we don't
      @@ -301,12 +316,13 @@ public IContentDescriber getDescriber() {
       				}
       		} catch (InvalidRegistryObjectException e) {
       			/*
      -			 * This should only happen if  an API call is made after the registry has changed and before
      -			 * the corresponding registry change event has been broadcast.
      +			 * This should only happen if an API call is made after the registry has changed
      +			 * and before the corresponding registry change event has been broadcast.
       			 */
       			// the configuration element is stale - need to rebuild the catalog
       			manager.invalidate();
      -			// bad timing - next time the client asks for a describer, s/he will have better luck
      +			// bad timing - next time the client asks for a describer, s/he will have better
      +			// luck
       			return null;
       		}
       		if (baseType == null) {
      @@ -319,12 +335,14 @@ public IContentDescriber getDescriber() {
       	}
       
       	@Override
      -	public IContentDescription getDescriptionFor(InputStream contents, QualifiedName[] options) throws IOException {
      +	public IContentDescription getDescriptionFor(InputStream contents, QualifiedName[] options)
      +			throws IOException {
       		return internalGetDescriptionFor(ContentTypeManager.readBuffer(contents), options);
       	}
       
       	@Override
      -	public IContentDescription getDescriptionFor(Reader contents, QualifiedName[] options) throws IOException {
      +	public IContentDescription getDescriptionFor(Reader contents, QualifiedName[] options)
      +			throws IOException {
       		return internalGetDescriptionFor(ContentTypeManager.readBuffer(contents), options);
       	}
       
      @@ -392,10 +410,8 @@ boolean hasFileSpec(IScopeContext context, String text, int typeMask) {
       	/**
       	 * Returns whether this content type has the given file spec.
       	 *
      -	 * @param text
      -	 *            the file spec string
      -	 * @param typeMask
      -	 *            FILE_NAME_SPEC or FILE_EXTENSION_SPEC or FILE_REGEXP_SPEC
      +	 * @param text the file spec string
      +	 * @param typeMask FILE_NAME_SPEC or FILE_EXTENSION_SPEC or FILE_REGEXP_SPEC
       	 * @param strict
       	 * @return true if this file spec has already been added, false otherwise
       	 */
      @@ -429,7 +445,8 @@ boolean internalAddFileSpec(String fileSpec, int typeMask) {
       			fileSpecs.add(newFileSpec);
       			return true;
       		}
      -		// update file specs atomically so threads traversing the list of file specs don't have to synchronize
      +		// update file specs atomically so threads traversing the list of file specs
      +		// don't have to synchronize
       		ArrayList tmpFileSpecs = (ArrayList) fileSpecs.clone();
       		tmpFileSpecs.add(newFileSpec);
       		catalog.associate(this, newFileSpec.getText(), newFileSpec.getType());
      @@ -459,7 +476,8 @@ String basicGetDefaultProperty(QualifiedName key) {
       		return defaultProperties == null ? null : defaultProperties.get(key);
       	}
       
      -	BasicDescription internalGetDescriptionFor(ILazySource buffer, QualifiedName[] options) throws IOException {
      +	BasicDescription internalGetDescriptionFor(ILazySource buffer, QualifiedName[] options)
      +			throws IOException {
       		if (buffer == null)
       			return defaultDescription;
       		// use temporary local var to avoid sync'ing
      @@ -497,7 +515,8 @@ byte internalIsAssociatedWith(String fileName, IScopeContext context) {
       	boolean internalRemoveFileSpec(String fileSpec, int typeMask) {
       		if (fileSpecs.isEmpty())
       			return false;
      -		// we modify the list of file specs atomically so we don't interfere with threads doing traversals
      +		// we modify the list of file specs atomically so we don't interfere with
      +		// threads doing traversals
       		@SuppressWarnings("unchecked")
       		ArrayList tmpFileSpecs = (ArrayList) fileSpecs.clone();
       		for (Iterator i = tmpFileSpecs.iterator(); i.hasNext();) {
      @@ -569,7 +588,8 @@ void processPreferences(Preferences contentTypeNode) {
       
       	@Override
       	public void removeFileSpec(String fileSpec, int type) throws CoreException {
      -		Assert.isLegal(type == FILE_EXTENSION_SPEC || type == FILE_NAME_SPEC || type == FILE_PATTERN_SPEC,
      +		Assert.isLegal(
      +				type == FILE_EXTENSION_SPEC || type == FILE_NAME_SPEC || type == FILE_PATTERN_SPEC,
       				"Unknown type: " + type); //$NON-NLS-1$
       		synchronized (this) {
       			if (!internalRemoveFileSpec(fileSpec, type | SPEC_USER_DEFINED))
      @@ -603,7 +623,8 @@ public void setDefaultCharset(String newCharset) throws CoreException {
       			if (userCharset == null) {
       				if (newCharset == null)
       					return;
      -			} else if (userCharset.equals(newCharset))
      +			}
      +			else if (userCharset.equals(newCharset))
       				return;
       			// apply change in memory
       			userCharset = newCharset;
      diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeBuilder.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeBuilder.java
      index dfcd4a14b6..ea038df2d5 100644
      --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeBuilder.java
      +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeBuilder.java
      @@ -12,7 +12,6 @@
       package eu.esdihumboldt.hale.util.nonosgi.contenttype;
       
       import java.util.*;
      -
       import org.eclipse.core.internal.content.ContentMessages;
       import org.eclipse.core.internal.content.IContentConstants;
       import org.eclipse.core.internal.content.Util;
      @@ -31,14 +30,14 @@
       /**
        * This class is a sidekick for ContentTypeManager that provides mechanisms for
        * creating content types from the extension registry (which ContentTypeManager
      - *  is oblivious to).
      + * is oblivious to).
        */
      -@SuppressWarnings({"restriction"})
      +@SuppressWarnings({ "restriction" })
       public class ContentTypeBuilder {
      -	
      +
       	private static final Logger log = LoggerFactory.getLogger(ContentTypeBuilder.class);
      -	
      -	public static final String PT_CONTENTTYPES = "contentTypes"; //$NON-NLS-1$	
      +
      +	public static final String PT_CONTENTTYPES = "contentTypes"; //$NON-NLS-1$
       	private ContentTypeCatalog catalog;
       
       	private static String getUniqueId(String namespace, String baseTypeId) {
      @@ -75,7 +74,7 @@ private static byte parsePriority(String priority) {
       			return ContentType.PRIORITY_LOW;
       		if (!priority.equals("normal")) //$NON-NLS-1$
       			return ContentType.PRIORITY_NORMAL;
      -		//TODO: should log - INVALID PRIORITY
      +		// TODO: should log - INVALID PRIORITY
       		return ContentType.PRIORITY_NORMAL;
       	}
       
      @@ -83,16 +82,22 @@ protected ContentTypeBuilder(ContentTypeCatalog catalog) {
       		this.catalog = catalog;
       	}
       
      -	private void addFileAssociation(IConfigurationElement fileAssociationElement, ContentType target) {
      +	private void addFileAssociation(IConfigurationElement fileAssociationElement,
      +			ContentType target) {
       		String[] fileNames = Util.parseItems(fileAssociationElement.getAttribute("file-names")); //$NON-NLS-1$
       		for (String fileName : fileNames)
      -			target.internalAddFileSpec(fileName, IContentType.FILE_NAME_SPEC | ContentType.SPEC_PRE_DEFINED);
      -		String[] fileExtensions = Util.parseItems(fileAssociationElement.getAttribute("file-extensions")); //$NON-NLS-1$
      +			target.internalAddFileSpec(fileName,
      +					IContentType.FILE_NAME_SPEC | ContentType.SPEC_PRE_DEFINED);
      +		String[] fileExtensions = Util
      +				.parseItems(fileAssociationElement.getAttribute("file-extensions")); //$NON-NLS-1$
       		for (String fileExtension : fileExtensions)
      -			target.internalAddFileSpec(fileExtension, IContentType.FILE_EXTENSION_SPEC | ContentType.SPEC_PRE_DEFINED);
      -		String[] filePatterns = Util.parseItems(fileAssociationElement.getAttribute("file-patterns")); //$NON-NLS-1$
      +			target.internalAddFileSpec(fileExtension,
      +					IContentType.FILE_EXTENSION_SPEC | ContentType.SPEC_PRE_DEFINED);
      +		String[] filePatterns = Util
      +				.parseItems(fileAssociationElement.getAttribute("file-patterns")); //$NON-NLS-1$
       		for (String filePattern : filePatterns)
      -			target.internalAddFileSpec(filePattern, IContentType.FILE_PATTERN_SPEC | ContentType.SPEC_PRE_DEFINED);
      +			target.internalAddFileSpec(filePattern,
      +					IContentType.FILE_PATTERN_SPEC | ContentType.SPEC_PRE_DEFINED);
       	}
       
       	/**
      @@ -108,8 +113,8 @@ public void buildCatalog(IScopeContext context) {
       			catalog.addContentType(ContentType.createContentType(catalog, id,
       					node.get(ContentType.PREF_USER_DEFINED__NAME, ContentType.EMPTY_STRING),
       					(byte) 0, new String[0], new String[0], new String[0],
      -					node.get(ContentType.PREF_USER_DEFINED__BASE_TYPE_ID, null), null, Collections.emptyMap(),
      -					null));
      +					node.get(ContentType.PREF_USER_DEFINED__BASE_TYPE_ID, null), null,
      +					Collections.emptyMap(), null));
       		}
       		for (IConfigurationElement allContentTypeCE : allContentTypeCEs)
       			if (allContentTypeCE.getName().equals("file-association")) //$NON-NLS-1$
      @@ -125,6 +130,7 @@ private void applyPreferences() {
       			final ContentTypeCatalog localCatalog = catalog;
       			final IEclipsePreferences root = localCatalog.getManager().getPreferences();
       			root.accept(new IPreferenceNodeVisitor() {
      +
       				@Override
       				public boolean visit(IEclipsePreferences node) {
       					if (node == root)
      @@ -144,7 +150,8 @@ public boolean visit(IEclipsePreferences node) {
       	/**
       	 * @throws CoreException if mandatory attributes are missing in the markup
       	 */
      -	private ContentType createContentType(IConfigurationElement contentTypeCE) throws CoreException {
      +	private ContentType createContentType(IConfigurationElement contentTypeCE)
      +			throws CoreException {
       		String namespace = contentTypeCE.getContributor().getName();
       		String simpleId = contentTypeCE.getAttribute("id"); //$NON-NLS-1$
       		String name = contentTypeCE.getAttribute("name"); //$NON-NLS-1$
      @@ -178,7 +185,8 @@ private ContentType createContentType(IConfigurationElement contentTypeCE) throw
       				QualifiedName qualifiedKey = parseQualifiedName(namespace, propertyKey);
       				if (qualifiedKey == null) {
       					if (ContentTypeManager.DEBUGGING) {
      -						String message = NLS.bind(ContentMessages.content_invalidProperty, propertyKey, getUniqueId(namespace, simpleId));
      +						String message = NLS.bind(ContentMessages.content_invalidProperty,
      +								propertyKey, getUniqueId(namespace, simpleId));
       						log.error(message);
       					}
       					continue;
      @@ -189,11 +197,13 @@ private ContentType createContentType(IConfigurationElement contentTypeCE) throw
       		String defaultCharset = contentTypeCE.getAttribute("default-charset"); //$NON-NLS-1$
       		if (defaultCharset != null)
       			if (defaultProperties == null)
      -				defaultProperties = Collections.singletonMap(IContentDescription.CHARSET, defaultCharset);
      +				defaultProperties = Collections.singletonMap(IContentDescription.CHARSET,
      +						defaultCharset);
       			else if (!defaultProperties.containsKey(IContentDescription.CHARSET))
       				defaultProperties.put(IContentDescription.CHARSET, defaultCharset);
      -		return ContentType.createContentType(catalog, uniqueId, name, priority, fileExtensions, fileNames, filePatterns,
      -				baseTypeId, aliasTargetTypeId, defaultProperties, contentTypeCE);
      +		return ContentType.createContentType(catalog, uniqueId, name, priority, fileExtensions,
      +				fileNames, filePatterns, baseTypeId, aliasTargetTypeId, defaultProperties,
      +				contentTypeCE);
       	}
       
       	// Store this around for performance
      @@ -201,9 +211,8 @@ else if (!defaultProperties.containsKey(IContentDescription.CHARSET))
       
       	/**
       	 * Gets configuration elements for both "backward compatible" extension point
      -	 * 		org.eclipse.core.runtime.contentTypes
      -	 * and "new" extension point controlled by this plugin:
      -	 * 		org.eclipse.core.contenttype.contentTypes
      +	 * org.eclipse.core.runtime.contentTypes and "new" extension point controlled by
      +	 * this plugin: org.eclipse.core.contenttype.contentTypes
       	 */
       	protected IConfigurationElement[] getConfigurationElements() {
       		IExtensionRegistry registry = RegistryFactory.getRegistry();
      @@ -212,24 +221,30 @@ protected IConfigurationElement[] getConfigurationElements() {
       		IConfigurationElement[] oldConfigElements = emptyConfArray;
       		IConfigurationElement[] newConfigElements = emptyConfArray;
       		// "old" extension point
      -		IExtensionPoint oldPoint = registry.getExtensionPoint(IContentConstants.RUNTIME_NAME, PT_CONTENTTYPES);
      +		IExtensionPoint oldPoint = registry.getExtensionPoint(IContentConstants.RUNTIME_NAME,
      +				PT_CONTENTTYPES);
       		if (oldPoint != null)
       			oldConfigElements = oldPoint.getConfigurationElements();
       		// "new" extension point
      -		IExtensionPoint newPoint = registry.getExtensionPoint(IContentConstants.CONTENT_NAME, PT_CONTENTTYPES);
      +		IExtensionPoint newPoint = registry.getExtensionPoint(IContentConstants.CONTENT_NAME,
      +				PT_CONTENTTYPES);
       		if (newPoint != null)
       			newConfigElements = newPoint.getConfigurationElements();
       
      -		IConfigurationElement[] allContentTypeCEs = new IConfigurationElement[oldConfigElements.length + newConfigElements.length];
      +		IConfigurationElement[] allContentTypeCEs = new IConfigurationElement[oldConfigElements.length
      +				+ newConfigElements.length];
       		System.arraycopy(oldConfigElements, 0, allContentTypeCEs, 0, oldConfigElements.length);
      -		System.arraycopy(newConfigElements, 0, allContentTypeCEs, oldConfigElements.length, newConfigElements.length);
      +		System.arraycopy(newConfigElements, 0, allContentTypeCEs, oldConfigElements.length,
      +				newConfigElements.length);
       
       		return allContentTypeCEs;
       	}
       
      -	private void missingMandatoryAttribute(String messageKey, String argument) throws CoreException {
      +	private void missingMandatoryAttribute(String messageKey, String argument)
      +			throws CoreException {
       		String message = NLS.bind(messageKey, argument);
      -		throw new CoreException(new Status(IStatus.ERROR, ContentMessages.OWNER_NAME, 0, message, null));
      +		throw new CoreException(
      +				new Status(IStatus.ERROR, ContentMessages.OWNER_NAME, 0, message, null));
       	}
       
       	private void registerContentType(IConfigurationElement contentTypeCE) {
      @@ -242,12 +257,14 @@ private void registerContentType(IConfigurationElement contentTypeCE) {
       		}
       	}
       
      -	/* Adds extra file associations to existing content types. If the content
      -	 * type has not been added, the file association is ignored.
      +	/*
      +	 * Adds extra file associations to existing content types. If the content type
      +	 * has not been added, the file association is ignored.
       	 */
       	private void registerFileAssociation(IConfigurationElement fileAssociationElement) {
      -		//TODO: need to ensure the config. element is valid
      -		String contentTypeId = getUniqueId(fileAssociationElement.getContributor().getName(), fileAssociationElement.getAttribute("content-type")); //$NON-NLS-1$
      +		// TODO: need to ensure the config. element is valid
      +		String contentTypeId = getUniqueId(fileAssociationElement.getContributor().getName(),
      +				fileAssociationElement.getAttribute("content-type")); //$NON-NLS-1$
       		ContentType target = catalog.internalGetContentType(contentTypeId);
       		if (target == null)
       			return;
      diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeCatalog.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeCatalog.java
      index ae0719f684..69dade0eb5 100644
      --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeCatalog.java
      +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeCatalog.java
      @@ -15,7 +15,6 @@
       import java.util.*;
       import java.util.Map.Entry;
       import java.util.regex.Pattern;
      -
       import org.eclipse.core.internal.content.ContentMessages;
       import org.eclipse.core.internal.content.ILazySource;
       import org.eclipse.core.runtime.*;
      @@ -26,8 +25,9 @@
       import org.slf4j.Logger;
       import org.slf4j.LoggerFactory;
       
      -@SuppressWarnings({"restriction", "unchecked", "deprecation"})
      +@SuppressWarnings({ "restriction", "unchecked", "deprecation" })
       public final class ContentTypeCatalog {
      +
       	private static final Logger log = LoggerFactory.getLogger(ContentTypeCatalog.class);
       
       	private static final IContentType[] NO_CONTENT_TYPES = new IContentType[0];
      @@ -46,10 +46,11 @@ public final class ContentTypeCatalog {
       	private ContentTypeManager manager;
       
       	/**
      -	 * A sorting policy where the more generic content type wins. Lexicographical comparison is done
      -	 * as a last resort when all other criteria fail.
      +	 * A sorting policy where the more generic content type wins. Lexicographical
      +	 * comparison is done as a last resort when all other criteria fail.
       	 */
       	private final Comparator policyConstantGeneralIsBetter = new Comparator() {
      +
       		@Override
       		public int compare(IContentType o1, IContentType o2) {
       			ContentType type1 = (ContentType) o1;
      @@ -62,16 +63,18 @@ public int compare(IContentType o1, IContentType o2) {
       			int priorityCriteria = type1.getPriority() - type2.getPriority();
       			if (priorityCriteria != 0)
       				return -priorityCriteria;
      -			// they have same depth and priority - choose one arbitrarily (stability is important)
      +			// they have same depth and priority - choose one arbitrarily (stability is
      +			// important)
       			return type1.getId().compareTo(type2.getId());
       		}
       	};
       
       	/**
      -	 * A sorting policy where the more specific content type wins. Lexicographical comparison is done
      -	 * as a last resort when all other criteria fail.
      +	 * A sorting policy where the more specific content type wins. Lexicographical
      +	 * comparison is done as a last resort when all other criteria fail.
       	 */
       	private Comparator policyConstantSpecificIsBetter = new Comparator() {
      +
       		@Override
       		public int compare(IContentType o1, IContentType o2) {
       			ContentType type1 = (ContentType) o1;
      @@ -84,7 +87,8 @@ public int compare(IContentType o1, IContentType o2) {
       			int priorityCriteria = type1.getPriority() - type2.getPriority();
       			if (priorityCriteria != 0)
       				return -priorityCriteria;
      -			// they have same depth and priority - choose one arbitrarily (stability is important)
      +			// they have same depth and priority - choose one arbitrarily (stability is
      +			// important)
       			return type1.getId().compareTo(type2.getId());
       		}
       	};
      @@ -93,6 +97,7 @@ public int compare(IContentType o1, IContentType o2) {
       	 * A sorting policy where the more general content type wins.
       	 */
       	private Comparator policyGeneralIsBetter = new Comparator() {
      +
       		@Override
       		public int compare(IContentType o1, IContentType o2) {
       			ContentType type1 = (ContentType) o1;
      @@ -113,6 +118,7 @@ public int compare(IContentType o1, IContentType o2) {
       	 * A sorting policy where content types are sorted by id.
       	 */
       	private Comparator policyLexicographical = new Comparator() {
      +
       		@Override
       		public int compare(IContentType o1, IContentType o2) {
       			ContentType type1 = (ContentType) o1;
      @@ -124,6 +130,7 @@ public int compare(IContentType o1, IContentType o2) {
       	 * A sorting policy where the more specific content type wins.
       	 */
       	private Comparator policySpecificIsBetter = new Comparator() {
      +
       		@Override
       		public int compare(IContentType o1, IContentType o2) {
       			ContentType type1 = (ContentType) o1;
      @@ -173,9 +180,11 @@ synchronized void addContentType(IContentType contentType) {
       	/**
       	 * Applies a client-provided selection policy.
       	 */
      -	private IContentType[] applyPolicy(final IContentTypeManager.ISelectionPolicy policy, final IContentType[] candidates, final boolean fileName, final boolean contents) {
      -		final IContentType[][] result = new IContentType[][] {candidates};
      +	private IContentType[] applyPolicy(final IContentTypeManager.ISelectionPolicy policy,
      +			final IContentType[] candidates, final boolean fileName, final boolean contents) {
      +		final IContentType[][] result = new IContentType[][] { candidates };
       		SafeRunner.run(new ISafeRunnable() {
      +
       			@Override
       			public void handleException(Throwable exception) {
       				// already logged in SafeRunner#run()
      @@ -192,10 +201,12 @@ public void run() throws Exception {
       	}
       
       	private void associate(ContentType contentType) {
      -		String[] builtInFileNames = contentType.getFileSpecs(IContentType.IGNORE_USER_DEFINED | IContentType.FILE_NAME_SPEC);
      +		String[] builtInFileNames = contentType
      +				.getFileSpecs(IContentType.IGNORE_USER_DEFINED | IContentType.FILE_NAME_SPEC);
       		for (String builtInFileName : builtInFileNames)
       			associate(contentType, builtInFileName, IContentType.FILE_NAME_SPEC);
      -		String[] builtInFileExtensions = contentType.getFileSpecs(IContentType.IGNORE_USER_DEFINED | IContentType.FILE_EXTENSION_SPEC);
      +		String[] builtInFileExtensions = contentType
      +				.getFileSpecs(IContentType.IGNORE_USER_DEFINED | IContentType.FILE_EXTENSION_SPEC);
       		for (String builtInFileExtension : builtInFileExtensions)
       			associate(contentType, builtInFileExtension, IContentType.FILE_EXTENSION_SPEC);
       		String[] builtInFilePatterns = contentType
      @@ -213,7 +224,8 @@ synchronized void associate(ContentType contentType, String text, int type) {
       		Map> fileSpecMap = null;
       		if ((type & IContentType.FILE_NAME_SPEC) != 0) {
       			fileSpecMap = fileNames;
      -		} else if ((type & IContentType.FILE_EXTENSION_SPEC) != 0) {
      +		}
      +		else if ((type & IContentType.FILE_EXTENSION_SPEC) != 0) {
       			fileSpecMap = fileExtensions;
       		}
       		if (fileSpecMap != null) {
      @@ -222,7 +234,8 @@ synchronized void associate(ContentType contentType, String text, int type) {
       			if (existing == null)
       				fileSpecMap.put(mappingKey, existing = new HashSet<>());
       			existing.add(contentType);
      -		} else if ((type & IContentType.FILE_PATTERN_SPEC) != 0) {
      +		}
      +		else if ((type & IContentType.FILE_PATTERN_SPEC) != 0) {
       			Pattern compiledPattern = compiledRegexps.get(text);
       			if (compiledPattern == null) {
       				compiledPattern = Pattern.compile(toRegexp(text));
      @@ -234,14 +247,17 @@ synchronized void associate(ContentType contentType, String text, int type) {
       		}
       	}
       
      -	private int collectMatchingByContents(int valid, IContentType[] subset, List destination, ILazySource contents, Map properties) throws IOException {
      +	private int collectMatchingByContents(int valid, IContentType[] subset,
      +			List destination, ILazySource contents, Map properties)
      +			throws IOException {
       		for (IContentType element : subset) {
       			ContentType current = (ContentType) element;
       			IContentDescriber describer = current.getDescriber();
       			int status = IContentDescriber.INDETERMINATE;
       			if (describer != null) {
       				if (contents.isText() && !(describer instanceof ITextContentDescriber))
      -					// for text streams we skip content types that do not provide text-based content describers
      +					// for text streams we skip content types that do not provide text-based content
      +					// describers
       					continue;
       				status = describe(current, contents, null, properties);
       				if (status == IContentDescriber.INVALID)
      @@ -255,21 +271,29 @@ private int collectMatchingByContents(int valid, IContentType[] subset, List properties) throws IOException {
      +	int describe(ContentType type, ILazySource contents, ContentDescription description,
      +			Map properties) throws IOException {
       		IContentDescriber describer = type.getDescriber();
       		try {
       			if (contents.isText()) {
       				if (describer instanceof XMLRootElementContentDescriber2) {
      -					return ((XMLRootElementContentDescriber2) describer).describe((Reader) contents, description, properties);
      -				} else if (describer instanceof XMLRootElementContentDescriber) {
      -					return ((XMLRootElementContentDescriber) describer).describe((Reader) contents, description, properties);
      +					return ((XMLRootElementContentDescriber2) describer).describe((Reader) contents,
      +							description, properties);
      +				}
      +				else if (describer instanceof XMLRootElementContentDescriber) {
      +					return ((XMLRootElementContentDescriber) describer).describe((Reader) contents,
      +							description, properties);
       				}
       				return ((ITextContentDescriber) describer).describe((Reader) contents, description);
      -			} else {
      +			}
      +			else {
       				if (describer instanceof XMLRootElementContentDescriber2) {
      -					return ((XMLRootElementContentDescriber2) describer).describe((InputStream) contents, description, properties);
      -				} else if (describer instanceof XMLRootElementContentDescriber) {
      -					return ((XMLRootElementContentDescriber) describer).describe((InputStream) contents, description, properties);
      +					return ((XMLRootElementContentDescriber2) describer)
      +							.describe((InputStream) contents, description, properties);
      +				}
      +				else if (describer instanceof XMLRootElementContentDescriber) {
      +					return ((XMLRootElementContentDescriber) describer)
      +							.describe((InputStream) contents, description, properties);
       				}
       				return (describer).describe((InputStream) contents, description);
       			}
      @@ -277,16 +301,18 @@ int describe(ContentType type, ILazySource contents, ContentDescription descript
       			// describer seems to be buggy. just disable it (logging the reason)
       			type.invalidateDescriber(re);
       		} catch (Error e) {
      -			// describer got some serious problem. disable it (logging the reason) and throw the error again
      +			// describer got some serious problem. disable it (logging the reason) and throw
      +			// the error again
       			type.invalidateDescriber(e);
       			throw e;
       		} catch (LowLevelIOException llioe) {
       			// throw the actual exception
       			throw llioe.getActualException();
       		} catch (IOException ioe) {
      -			// bugs 67841/ 62443  - non-low level IOException should be "ignored"
      +			// bugs 67841/ 62443 - non-low level IOException should be "ignored"
       			if (ContentTypeManager.DEBUGGING) {
      -				String message = NLS.bind(ContentMessages.content_errorReadingContents, type.getId());
      +				String message = NLS.bind(ContentMessages.content_errorReadingContents,
      +						type.getId());
       				log.error(message, ioe);
       			}
       			// we don't know what the describer would say if the exception didn't occur
      @@ -298,7 +324,9 @@ int describe(ContentType type, ILazySource contents, ContentDescription descript
       	}
       
       	synchronized void dissociate(ContentType contentType, String text, int type) {
      -		Map> fileSpecMap = ((type & IContentType.FILE_NAME_SPEC) != 0) ? fileNames : fileExtensions;
      +		Map> fileSpecMap = ((type & IContentType.FILE_NAME_SPEC) != 0)
      +				? fileNames
      +				: fileExtensions;
       		String mappingKey = FileSpec.getMappingKeyFor(text);
       		Set existing = fileSpecMap.get(mappingKey);
       		if (existing == null)
      @@ -312,7 +340,10 @@ synchronized void dissociate(ContentType contentType, String text, int type) {
       	 * 
    • it does not designate a base type, or
    • *
    • it designates a base type that exists and is valid
    • * - *

      And

      : + *

      + * And + *

      + * : *
        *
      1. it does not designate an alias type, or
      2. *
      3. it designates an alias type that does not exist, or
      4. @@ -349,7 +380,8 @@ private boolean ensureValid(ContentType type) { return true; } - IContentType[] findContentTypesFor(ContentTypeMatcher matcher, InputStream contents, String fileName) throws IOException { + IContentType[] findContentTypesFor(ContentTypeMatcher matcher, InputStream contents, + String fileName) throws IOException { final ILazySource buffer = ContentTypeManager.readBuffer(contents); IContentType[] selected = internalFindContentTypesFor(matcher, buffer, fileName, true); // give the policy a chance to change the results @@ -360,7 +392,8 @@ IContentType[] findContentTypesFor(ContentTypeMatcher matcher, InputStream conte } IContentType[] findContentTypesFor(ContentTypeMatcher matcher, final String fileName) { - IContentType[] selected = concat(internalFindContentTypesFor(matcher, fileName, policyConstantGeneralIsBetter)); + IContentType[] selected = concat( + internalFindContentTypesFor(matcher, fileName, policyConstantGeneralIsBetter)); // give the policy a chance to change the results ISelectionPolicy policy = matcher.getPolicy(); if (policy != null) @@ -398,7 +431,8 @@ public ContentType getContentType(String contentTypeIdentifier) { return (type != null && type.isValid() && !type.isAlias()) ? type : null; } - private IContentDescription getDescriptionFor(ContentTypeMatcher matcher, ILazySource contents, String fileName, QualifiedName[] options) throws IOException { + private IContentDescription getDescriptionFor(ContentTypeMatcher matcher, ILazySource contents, + String fileName, QualifiedName[] options) throws IOException { IContentType[] selected = internalFindContentTypesFor(matcher, contents, fileName, false); if (selected.length == 0) return null; @@ -409,15 +443,20 @@ private IContentDescription getDescriptionFor(ContentTypeMatcher matcher, ILazyS if (selected.length == 0) return null; } - return matcher.getSpecificDescription(((ContentType) selected[0]).internalGetDescriptionFor(contents, options)); + return matcher.getSpecificDescription( + ((ContentType) selected[0]).internalGetDescriptionFor(contents, options)); } - public IContentDescription getDescriptionFor(ContentTypeMatcher matcher, InputStream contents, String fileName, QualifiedName[] options) throws IOException { - return getDescriptionFor(matcher, ContentTypeManager.readBuffer(contents), fileName, options); + public IContentDescription getDescriptionFor(ContentTypeMatcher matcher, InputStream contents, + String fileName, QualifiedName[] options) throws IOException { + return getDescriptionFor(matcher, ContentTypeManager.readBuffer(contents), fileName, + options); } - public IContentDescription getDescriptionFor(ContentTypeMatcher matcher, Reader contents, String fileName, QualifiedName[] options) throws IOException { - return getDescriptionFor(matcher, ContentTypeManager.readBuffer(contents), fileName, options); + public IContentDescription getDescriptionFor(ContentTypeMatcher matcher, Reader contents, + String fileName, QualifiedName[] options) throws IOException { + return getDescriptionFor(matcher, ContentTypeManager.readBuffer(contents), fileName, + options); } public int getGeneration() { @@ -433,12 +472,12 @@ private boolean internalAccept(ContentTypeVisitor visitor, ContentType root) { return true; int result = visitor.visit(root); switch (result) { - // stop traversing the tree - case ContentTypeVisitor.STOP : - return false; - // stop traversing this subtree - case ContentTypeVisitor.RETURN : - return true; + // stop traversing the tree + case ContentTypeVisitor.STOP: + return false; + // stop traversing this subtree + case ContentTypeVisitor.RETURN: + return true; } ContentType[] children = getChildren(root); if (children == null) @@ -451,47 +490,57 @@ private boolean internalAccept(ContentTypeVisitor visitor, ContentType root) { return true; } - private IContentType[] internalFindContentTypesFor(ILazySource buffer, IContentType[][] subset, Comparator validPolicy, Comparator indeterminatePolicy) throws IOException { + private IContentType[] internalFindContentTypesFor(ILazySource buffer, IContentType[][] subset, + Comparator validPolicy, Comparator indeterminatePolicy) + throws IOException { Map properties = new HashMap<>(); final List appropriate = new ArrayList<>(5); - final int validFullName = collectMatchingByContents(0, subset[0], appropriate, buffer, properties); + final int validFullName = collectMatchingByContents(0, subset[0], appropriate, buffer, + properties); final int appropriateFullName = appropriate.size(); - final int validExtension = collectMatchingByContents(validFullName, subset[1], appropriate, buffer, properties) - validFullName; + final int validExtension = collectMatchingByContents(validFullName, subset[1], appropriate, + buffer, properties) - validFullName; final int appropriateExtension = appropriate.size() - appropriateFullName; - final int validPattern = collectMatchingByContents(validExtension, subset[2], appropriate, buffer, properties) - - validExtension; - final int appropriatePattern = appropriate.size() - appropriateFullName - appropriateExtension; + final int validPattern = collectMatchingByContents(validExtension, subset[2], appropriate, + buffer, properties) - validExtension; + final int appropriatePattern = appropriate.size() - appropriateFullName + - appropriateExtension; IContentType[] result = appropriate.toArray(new IContentType[appropriate.size()]); if (validFullName > 1) Arrays.sort(result, 0, validFullName, validPolicy); if (validExtension > 1) Arrays.sort(result, validFullName, validFullName + validExtension, validPolicy); if (validPattern > 1) { - Arrays.sort(result, validFullName + validExtension, validFullName + validExtension + validPattern, - validPolicy); + Arrays.sort(result, validFullName + validExtension, + validFullName + validExtension + validPattern, validPolicy); } if (appropriateFullName - validFullName > 1) - Arrays.sort(result, validFullName + validExtension, appropriateFullName + validExtension, indeterminatePolicy); + Arrays.sort(result, validFullName + validExtension, + appropriateFullName + validExtension, indeterminatePolicy); if (appropriateExtension - validExtension > 1) - Arrays.sort(result, appropriateFullName + validExtension, appropriate.size() - validPattern, - indeterminatePolicy); + Arrays.sort(result, appropriateFullName + validExtension, + appropriate.size() - validPattern, indeterminatePolicy); if (appropriatePattern - validPattern > 1) { - Arrays.sort(result, appropriate.size() - validPattern, appropriate.size(), indeterminatePolicy); + Arrays.sort(result, appropriate.size() - validPattern, appropriate.size(), + indeterminatePolicy); } return result; } - private IContentType[] internalFindContentTypesFor(ContentTypeMatcher matcher, ILazySource buffer, String fileName, boolean forceValidation) throws IOException { + private IContentType[] internalFindContentTypesFor(ContentTypeMatcher matcher, + ILazySource buffer, String fileName, boolean forceValidation) throws IOException { final IContentType[][] subset; final Comparator validPolicy; Comparator indeterminatePolicy; if (fileName == null) { // we only have a single array, by need to provide a two-dimensional, 3-element // array - subset = new IContentType[][] { getAllContentTypes(), NO_CONTENT_TYPES, NO_CONTENT_TYPES }; + subset = new IContentType[][] { getAllContentTypes(), NO_CONTENT_TYPES, + NO_CONTENT_TYPES }; indeterminatePolicy = policyConstantGeneralIsBetter; validPolicy = policyConstantSpecificIsBetter; - } else { + } + else { subset = internalFindContentTypesFor(matcher, fileName, policyLexicographical); indeterminatePolicy = policyGeneralIsBetter; validPolicy = policySpecificIsBetter; @@ -501,8 +550,10 @@ private IContentType[] internalFindContentTypesFor(ContentTypeMatcher matcher, I // don't do further work if subset is empty return NO_CONTENT_TYPES; if (!forceValidation && total == 1) { - // do not do validation if not forced and only one was found (caller will validate later) - IContentType[] found = subset[0].length == 1 ? subset[0] : (subset[1].length == 1 ? subset[1] : subset[2]); + // do not do validation if not forced and only one was found (caller will + // validate later) + IContentType[] found = subset[0].length == 1 ? subset[0] + : (subset[1].length == 1 ? subset[1] : subset[2]); // bug 100032 - ignore binary content type if contents are text if (!buffer.isText()) // binary buffer, caller can call the describer with no risk @@ -524,7 +575,8 @@ private IContentType[] internalFindContentTypesFor(ContentTypeMatcher matcher, I * @return all matching content types in the preferred order * @see IContentTypeManager#findContentTypesFor(String) */ - synchronized private IContentType[][] internalFindContentTypesFor(ContentTypeMatcher matcher, final String fileName, Comparator sortingPolicy) { + synchronized private IContentType[][] internalFindContentTypesFor(ContentTypeMatcher matcher, + final String fileName, Comparator sortingPolicy) { IScopeContext context = matcher.getContext(); IContentType[][] result = { NO_CONTENT_TYPES, NO_CONTENT_TYPES, NO_CONTENT_TYPES }; @@ -534,11 +586,13 @@ synchronized private IContentType[][] internalFindContentTypesFor(ContentTypeMat if (context.equals(manager.getContext())) allByFileName = getDirectlyAssociated(fileName, IContentTypeSettings.FILE_NAME_SPEC); else { - allByFileName = new HashSet<>(getDirectlyAssociated(fileName, IContentTypeSettings.FILE_NAME_SPEC | IContentType.IGNORE_USER_DEFINED)); - allByFileName.addAll(matcher.getDirectlyAssociated(this, fileName, IContentTypeSettings.FILE_NAME_SPEC)); + allByFileName = new HashSet<>(getDirectlyAssociated(fileName, + IContentTypeSettings.FILE_NAME_SPEC | IContentType.IGNORE_USER_DEFINED)); + allByFileName.addAll(matcher.getDirectlyAssociated(this, fileName, + IContentTypeSettings.FILE_NAME_SPEC)); } - Set selectedByName = selectMatchingByName(context, allByFileName, Collections.emptySet(), fileName, - IContentType.FILE_NAME_SPEC); + Set selectedByName = selectMatchingByName(context, allByFileName, + Collections.emptySet(), fileName, IContentType.FILE_NAME_SPEC); existing.addAll(selectedByName); result[0] = selectedByName.toArray(new IContentType[selectedByName.size()]); if (result[0].length > 1) @@ -548,28 +602,34 @@ synchronized private IContentType[][] internalFindContentTypesFor(ContentTypeMat if (fileExtension != null) { final Set allByFileExtension; if (context.equals(manager.getContext())) - allByFileExtension = getDirectlyAssociated(fileExtension, IContentTypeSettings.FILE_EXTENSION_SPEC); + allByFileExtension = getDirectlyAssociated(fileExtension, + IContentTypeSettings.FILE_EXTENSION_SPEC); else { - allByFileExtension = new HashSet<>(getDirectlyAssociated(fileExtension, IContentTypeSettings.FILE_EXTENSION_SPEC | IContentType.IGNORE_USER_DEFINED)); - allByFileExtension.addAll(matcher.getDirectlyAssociated(this, fileExtension, IContentTypeSettings.FILE_EXTENSION_SPEC)); + allByFileExtension = new HashSet<>(getDirectlyAssociated(fileExtension, + IContentTypeSettings.FILE_EXTENSION_SPEC + | IContentType.IGNORE_USER_DEFINED)); + allByFileExtension.addAll(matcher.getDirectlyAssociated(this, fileExtension, + IContentTypeSettings.FILE_EXTENSION_SPEC)); } - Set selectedByExtension = selectMatchingByName(context, allByFileExtension, selectedByName, fileExtension, IContentType.FILE_EXTENSION_SPEC); + Set selectedByExtension = selectMatchingByName(context, allByFileExtension, + selectedByName, fileExtension, IContentType.FILE_EXTENSION_SPEC); existing.addAll(selectedByExtension); if (!selectedByExtension.isEmpty()) - result[1] = selectedByExtension.toArray(new IContentType[selectedByExtension.size()]); + result[1] = selectedByExtension + .toArray(new IContentType[selectedByExtension.size()]); } if (result[1].length > 1) Arrays.sort(result[1], sortingPolicy); final Set allByFilePattern; if (context.equals(manager.getContext())) - allByFilePattern = getMatchingRegexpAssociated(fileName, IContentTypeSettings.FILE_PATTERN_SPEC); + allByFilePattern = getMatchingRegexpAssociated(fileName, + IContentTypeSettings.FILE_PATTERN_SPEC); else { allByFilePattern = new HashSet<>(getMatchingRegexpAssociated(fileName, IContentTypeSettings.FILE_PATTERN_SPEC | IContentType.IGNORE_USER_DEFINED)); - allByFilePattern - .addAll(matcher.getMatchingRegexpAssociated(this, fileName, - IContentTypeSettings.FILE_PATTERN_SPEC)); + allByFilePattern.addAll(matcher.getMatchingRegexpAssociated(this, fileName, + IContentTypeSettings.FILE_PATTERN_SPEC)); } existing.addAll(allByFilePattern); if (!allByFilePattern.isEmpty()) @@ -585,8 +645,8 @@ private Set getMatchingRegexpAssociated(String fileName, int typeMa Set res = new HashSet<>(); for (Entry> spec : this.fileRegexps.entrySet()) { if (spec.getKey().matcher(fileName).matches()) { - res.addAll(filterOnDefinitionSource(initialPatternForRegexp.get(spec.getKey()), typeMask, - spec.getValue())); + res.addAll(filterOnDefinitionSource(initialPatternForRegexp.get(spec.getKey()), + typeMask, spec.getValue())); } } return res; @@ -597,21 +657,23 @@ private Set getMatchingRegexpAssociated(String fileName, int typeMa * * @param text a file name or extension * @param typeMask a bit-wise or of the following flags: - *
          - *
        • IContentType.FILE_NAME,
        • - *
        • IContentType.FILE_EXTENSION,
        • - *
        • IContentType.IGNORE_PRE_DEFINED,
        • - *
        • IContentType.IGNORE_USER_DEFINED
        • - *
        + *
          + *
        • IContentType.FILE_NAME,
        • + *
        • IContentType.FILE_EXTENSION,
        • + *
        • IContentType.IGNORE_PRE_DEFINED,
        • + *
        • IContentType.IGNORE_USER_DEFINED
        • + *
        * @return a set of content types */ private Set getDirectlyAssociated(String text, int typeMask) { if ((typeMask & IContentType.FILE_PATTERN_SPEC) != 0) { throw new IllegalArgumentException("This method don't allow FILE_REGEXP_SPEC."); //$NON-NLS-1$ } - Map> associations = (typeMask & IContentTypeSettings.FILE_NAME_SPEC) != 0 ? fileNames : fileExtensions; + Map> associations = (typeMask + & IContentTypeSettings.FILE_NAME_SPEC) != 0 ? fileNames : fileExtensions; Set result = associations.get(FileSpec.getMappingKeyFor(text)); - if ((typeMask & (IContentType.IGNORE_PRE_DEFINED | IContentType.IGNORE_USER_DEFINED)) != 0) { + if ((typeMask + & (IContentType.IGNORE_PRE_DEFINED | IContentType.IGNORE_USER_DEFINED)) != 0) { result = filterOnDefinitionSource(text, typeMask, result); } return result == null ? Collections.EMPTY_SET : result; @@ -621,19 +683,18 @@ private Set getDirectlyAssociated(String text, int typeMask) { * Filters a set of content-types on whether they have a mapping that matches * provided criteria. * - * @param text - * file name, file extension or file regexp (depending on value of + * @param text file name, file extension or file regexp (depending on value of * {@code typeMask}. - * @param typeMask - * the type mask. Spec type, and definition source (pre-defined or - * user-defined) will be used - * @param contentTypes - * content types to filter from (not modified during method + * @param typeMask the type mask. Spec type, and definition source (pre-defined + * or user-defined) will be used + * @param contentTypes content types to filter from (not modified during method * execution) * @return set of filtered content-type */ - private Set filterOnDefinitionSource(String text, int typeMask, Set contentTypes) { - if ((typeMask & (IContentType.IGNORE_PRE_DEFINED | IContentType.IGNORE_USER_DEFINED)) == 0) { + private Set filterOnDefinitionSource(String text, int typeMask, + Set contentTypes) { + if ((typeMask + & (IContentType.IGNORE_PRE_DEFINED | IContentType.IGNORE_USER_DEFINED)) == 0) { return contentTypes; } if (contentTypes != null && !contentTypes.isEmpty()) { @@ -688,10 +749,12 @@ synchronized protected void organize() { } /** - * Processes all content types in source, adding those matching the given file spec to the - * destination collection. + * Processes all content types in source, adding those matching the given file + * spec to the destination collection. */ - private Set selectMatchingByName(final IScopeContext context, Collection source, final Collection existing, final String fileSpecText, final int fileSpecType) { + private Set selectMatchingByName(final IScopeContext context, + Collection source, final Collection existing, + final String fileSpecText, final int fileSpecType) { if (source == null || source.isEmpty()) return Collections.EMPTY_SET; final Set destination = new HashSet<>(5); @@ -700,13 +763,15 @@ private Set selectMatchingByName(final IScopeContext context, Colle // From a given content type, check if it matches, and // include any children that match as well. internalAccept(new ContentTypeVisitor() { + @Override public int visit(ContentType type) { if (type != root && type.hasBuiltInAssociations()) // this content type has built-in associations - visit it later as root return RETURN; if (type == root && !type.hasFileSpec(context, fileSpecText, fileSpecType)) - // it is the root and does not match the file name - do not add it nor look into its children + // it is the root and does not match the file name - do not add it nor look + // into its children return RETURN; // either the content type is the root and matches the file name or // is a sub content type and does not have built-in files specs diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeHandler.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeHandler.java index 6bb01409b7..0788eb6afe 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeHandler.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeHandler.java @@ -18,17 +18,18 @@ import org.eclipse.core.runtime.preferences.IScopeContext; /** - * The only content types exposed to clients. Allows the content type registry to change - * underneath preserving handlers kept by clients. + * The only content types exposed to clients. Allows the content type registry + * to change underneath preserving handlers kept by clients. */ -@SuppressWarnings({"rawtypes", "unchecked"}) +@SuppressWarnings({ "rawtypes", "unchecked" }) public class ContentTypeHandler implements IContentType { /** - * A dummy description object to be returned by getDescription when this - * handler's target cannot be determined. + * A dummy description object to be returned by getDescription when this + * handler's target cannot be determined. */ private class DummyContentDescription implements IContentDescription { + public String getCharset() { return null; } @@ -79,7 +80,9 @@ public IContentType getBaseType() { if (target == null) return null; final ContentType baseType = (ContentType) target.getBaseType(); - return (baseType != null) ? new ContentTypeHandler(baseType, baseType.getCatalog().getGeneration()) : null; + return (baseType != null) + ? new ContentTypeHandler(baseType, baseType.getCatalog().getGeneration()) + : null; } public String getDefaultCharset() { @@ -92,12 +95,14 @@ public IContentDescription getDefaultDescription() { return (target != null) ? target.getDefaultDescription() : new DummyContentDescription(); } - public IContentDescription getDescriptionFor(InputStream contents, QualifiedName[] options) throws IOException { + public IContentDescription getDescriptionFor(InputStream contents, QualifiedName[] options) + throws IOException { final IContentType target = getTarget(); return (target != null) ? target.getDescriptionFor(contents, options) : null; } - public IContentDescription getDescriptionFor(Reader contents, QualifiedName[] options) throws IOException { + public IContentDescription getDescriptionFor(Reader contents, QualifiedName[] options) + throws IOException { final IContentType target = getTarget(); return (target != null) ? target.getDescriptionFor(contents, options) : null; } @@ -120,15 +125,16 @@ public IContentTypeSettings getSettings(IScopeContext context) throws CoreExcept final ContentType target = getTarget(); if (target == null) return null; - // the content type may returned itself as the settings object (instance scope context) + // the content type may returned itself as the settings object (instance scope + // context) final IContentTypeSettings settings = target.getSettings(context); - // in that case, return this same handler; otherwise, just return the settings + // in that case, return this same handler; otherwise, just return the settings return settings == target ? this : settings; } /** - * Returns the content type this handler represents. - * Note that this handles the case of aliasing. + * Returns the content type this handler represents. Note that this handles the + * case of aliasing. * * Public for testing purposes only. */ diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeManager.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeManager.java index d47aae07fe..784159177c 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeManager.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeManager.java @@ -17,7 +17,6 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; - import org.eclipse.core.internal.content.ContentMessages; import org.eclipse.core.internal.content.IContentConstants; import org.eclipse.core.internal.content.ILazySource; @@ -31,11 +30,14 @@ @SuppressWarnings("restriction") public class ContentTypeManager extends ContentTypeMatcher implements IContentTypeManager { + private static class ContentTypeRegistryChangeListener implements IRegistryChangeListener { + @Override public void registryChanged(IRegistryChangeEvent event) { // no changes related to the content type registry - if (event.getExtensionDeltas(IContentConstants.RUNTIME_NAME, ContentTypeBuilder.PT_CONTENTTYPES).length == 0 + if (event.getExtensionDeltas(IContentConstants.RUNTIME_NAME, + ContentTypeBuilder.PT_CONTENTTYPES).length == 0 && event.getExtensionDeltas(IContentConstants.CONTENT_NAME, ContentTypeBuilder.PT_CONTENTTYPES).length == 0) return; @@ -49,30 +51,32 @@ public void registryChanged(IRegistryChangeEvent event) { private static ContentTypeManager instance; public static final int BLOCK_SIZE = 0x400; - public static final String CONTENT_TYPE_PREF_NODE = IContentConstants.RUNTIME_NAME + IPath.SEPARATOR + "content-types"; //$NON-NLS-1$ + public static final String CONTENT_TYPE_PREF_NODE = IContentConstants.RUNTIME_NAME + + IPath.SEPARATOR + "content-types"; //$NON-NLS-1$ /* - * org.eclipse.core.internal.content.Activator can't be used b/c it is not being initialized. - * TODO Do we need to support a config option here or is simply setting it to false fine? + * org.eclipse.core.internal.content.Activator can't be used b/c it is not being + * initialized. TODO Do we need to support a config option here or is simply + * setting it to false fine? */ // private static final String OPTION_DEBUG_CONTENT_TYPES = "org.eclipse.core.contenttype/debug"; //$NON-NLS-1$; // static final boolean DEBUGGING = Activator.getDefault().getBooleanDebugOption(OPTION_DEBUG_CONTENT_TYPES, false); - static final boolean DEBUGGING = Boolean.FALSE; + static final boolean DEBUGGING = Boolean.FALSE; private ContentTypeCatalog catalog; private int catalogGeneration; /** * List of registered listeners (element type: - * IContentTypeChangeListener). - * These listeners are to be informed when - * something in a content type changes. + * IContentTypeChangeListener). These listeners are to be informed + * when something in a content type changes. */ protected final ListenerList contentTypeListeners = new ListenerList<>(); /** - * Creates and initializes the platform's content type manager. A reference to the - * content type manager can later be obtained by calling getInstance(). + * Creates and initializes the platform's content type manager. A reference to + * the content type manager can later be obtained by calling + * getInstance(). */ // TODO we can remove this sometime, it is no longer needed public static void startup() { @@ -83,14 +87,17 @@ public static void addRegistryChangeListener(IExtensionRegistry registry) { if (registry == null) return; // Different instances of listener required. See documentation of - // IExtensionRegistry.addRegistryChangeListener(IRegistryChangeListener, String). - registry.addRegistryChangeListener(runtimeExtensionListener, IContentConstants.RUNTIME_NAME); - registry.addRegistryChangeListener(contentExtensionListener, IContentConstants.CONTENT_NAME); + // IExtensionRegistry.addRegistryChangeListener(IRegistryChangeListener, + // String). + registry.addRegistryChangeListener(runtimeExtensionListener, + IContentConstants.RUNTIME_NAME); + registry.addRegistryChangeListener(contentExtensionListener, + IContentConstants.CONTENT_NAME); } /** - * Shuts down the platform's content type manager. After this call returns, - * the content type manager will be closed for business. + * Shuts down the platform's content type manager. After this call returns, the + * content type manager will be closed for business. */ public static void shutdown() { // there really is nothing left to do except null the instance. @@ -121,7 +128,8 @@ public static ContentTypeManager getInstance() { */ static String getFileExtension(String fileName) { int dotPosition = fileName.lastIndexOf('.'); - return (dotPosition == -1 || dotPosition == fileName.length() - 1) ? "" : fileName.substring(dotPosition + 1); //$NON-NLS-1$ + return (dotPosition == -1 || dotPosition == fileName.length() - 1) ? "" //$NON-NLS-1$ + : fileName.substring(dotPosition + 1); } protected static ILazySource readBuffer(InputStream contents) { @@ -164,7 +172,8 @@ protected synchronized ContentTypeCatalog getCatalog() { // only remember catalog if building it was successful catalog = newCatalog; } catch (InvalidRegistryObjectException e) { - // the registry has stale objects... just don't remember the returned (incomplete) catalog + // the registry has stale objects... just don't remember the returned + // (incomplete) catalog } newCatalog.organize(); return newCatalog; @@ -178,7 +187,8 @@ public IContentType getContentType(String contentTypeIdentifier) { } @Override - public IContentTypeMatcher getMatcher(final ISelectionPolicy customPolicy, final IScopeContext context) { + public IContentTypeMatcher getMatcher(final ISelectionPolicy customPolicy, + final IScopeContext context) { return new ContentTypeMatcher(customPolicy, context == null ? getContext() : context); } @@ -212,13 +222,16 @@ public void removeContentTypeChangeListener(IContentTypeChangeListener listener) public void fireContentTypeChangeEvent(IContentType type) { IContentType eventObject = type; if (type instanceof ContentType) { - eventObject = new ContentTypeHandler((ContentType) type, ((ContentType) type).getCatalog().getGeneration()); - } else { + eventObject = new ContentTypeHandler((ContentType) type, + ((ContentType) type).getCatalog().getGeneration()); + } + else { eventObject = type; } for (final IContentTypeChangeListener listener : this.contentTypeListeners) { final ContentTypeChangeEvent event = new ContentTypeChangeEvent(eventObject); ISafeRunnable job = new ISafeRunnable() { + @Override public void handleException(Throwable exception) { // already logged in SafeRunner#run() @@ -253,14 +266,17 @@ public final void removeContentType(String contentTypeIdentifier) throws CoreExc } getCatalog().removeContentType(contentType.getId()); // Remove preferences for this content type. - List userDefinedIds = new ArrayList<>(Arrays.asList(getUserDefinedContentTypeIds())); + List userDefinedIds = new ArrayList<>( + Arrays.asList(getUserDefinedContentTypeIds())); userDefinedIds.remove(contentType.getId()); getContext().getNode(ContentType.PREF_USER_DEFINED).put(ContentType.PREF_USER_DEFINED, - userDefinedIds.stream().collect(Collectors.joining(ContentType.PREF_USER_DEFINED__SEPARATOR))); + userDefinedIds.stream() + .collect(Collectors.joining(ContentType.PREF_USER_DEFINED__SEPARATOR))); try { getContext().getNode(ContentType.PREF_USER_DEFINED).flush(); } catch (BackingStoreException e) { - String message = NLS.bind(ContentMessages.content_errorSavingSettings, contentType.getId()); + String message = NLS.bind(ContentMessages.content_errorSavingSettings, + contentType.getId()); IStatus status = new Status(IStatus.ERROR, ContentMessages.OWNER_NAME, 0, message, e); throw new CoreException(status); } @@ -269,19 +285,21 @@ public final void removeContentType(String contentTypeIdentifier) throws CoreExc } @Override - public final IContentType addContentType(String id, String name, IContentType baseType) throws CoreException { + public final IContentType addContentType(String id, String name, IContentType baseType) + throws CoreException { if (id == null) { throw new IllegalArgumentException("Content-type 'id' mustn't be null");//$NON-NLS-1$ } if (id.contains(ContentType.PREF_USER_DEFINED__SEPARATOR)) { - throw new IllegalArgumentException( - "Content-Type id mustn't contain '" + ContentType.PREF_USER_DEFINED__SEPARATOR + '\''); //$NON-NLS-1$ + throw new IllegalArgumentException("Content-Type id mustn't contain '" //$NON-NLS-1$ + + ContentType.PREF_USER_DEFINED__SEPARATOR + '\''); } if (getContentType(id) != null) { throw new IllegalArgumentException("Content-type '" + id + "' already exists.");//$NON-NLS-1$ //$NON-NLS-2$ } - ContentType contentType = ContentType.createContentType(getCatalog(), id, name, (byte) 0, new String[0], - new String[0], new String[0], baseType != null ? baseType.getId() : null, null, null, null); + ContentType contentType = ContentType.createContentType(getCatalog(), id, name, (byte) 0, + new String[0], new String[0], new String[0], + baseType != null ? baseType.getId() : null, null, null, null); getCatalog().addContentType(contentType); // Add preferences for this content type. String currentUserDefined = getContext().getNode(ContentType.PREF_USER_DEFINED) @@ -289,7 +307,8 @@ public final IContentType addContentType(String id, String name, IContentType ba if (currentUserDefined.length() > 0) { currentUserDefined += ContentType.PREF_USER_DEFINED__SEPARATOR; } - getContext().getNode(ContentType.PREF_USER_DEFINED).put(ContentType.PREF_USER_DEFINED, currentUserDefined + id); + getContext().getNode(ContentType.PREF_USER_DEFINED).put(ContentType.PREF_USER_DEFINED, + currentUserDefined + id); contentType.setValidation(ContentType.STATUS_UNKNOWN); IEclipsePreferences contextTypeNode = getContext().getNode(contentType.getId()); contextTypeNode.put(ContentType.PREF_USER_DEFINED__NAME, name); diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeMatcher.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeMatcher.java index 11758ed4a0..0ef373c6f3 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeMatcher.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeMatcher.java @@ -14,7 +14,6 @@ import java.io.*; import java.util.*; import java.util.regex.Pattern; - import org.eclipse.core.internal.content.ContentMessages; import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.content.*; @@ -26,9 +25,9 @@ /** * @since 3.1 */ -@SuppressWarnings({"restriction"}) +@SuppressWarnings({ "restriction" }) public class ContentTypeMatcher implements IContentTypeMatcher { - + private static final Logger log = LoggerFactory.getLogger(ContentTypeMatcher.class); private IScopeContext context; @@ -40,10 +39,13 @@ public ContentTypeMatcher(IContentTypeManager.ISelectionPolicy policy, IScopeCon } @Override - public IContentType findContentTypeFor(InputStream contents, String fileName) throws IOException { + public IContentType findContentTypeFor(InputStream contents, String fileName) + throws IOException { ContentTypeCatalog currentCatalog = getCatalog(); IContentType[] all = currentCatalog.findContentTypesFor(this, contents, fileName); - return all.length > 0 ? new ContentTypeHandler((ContentType) all[0], currentCatalog.getGeneration()) : null; + return all.length > 0 + ? new ContentTypeHandler((ContentType) all[0], currentCatalog.getGeneration()) + : null; } @Override @@ -51,11 +53,14 @@ public IContentType findContentTypeFor(String fileName) { // basic implementation just gets all content types ContentTypeCatalog currentCatalog = getCatalog(); IContentType[] associated = currentCatalog.findContentTypesFor(this, fileName); - return associated.length == 0 ? null : new ContentTypeHandler((ContentType) associated[0], currentCatalog.getGeneration()); + return associated.length == 0 ? null + : new ContentTypeHandler((ContentType) associated[0], + currentCatalog.getGeneration()); } @Override - public IContentType[] findContentTypesFor(InputStream contents, String fileName) throws IOException { + public IContentType[] findContentTypesFor(InputStream contents, String fileName) + throws IOException { ContentTypeCatalog currentCatalog = getCatalog(); IContentType[] types = currentCatalog.findContentTypesFor(this, contents, fileName); IContentType[] result = new IContentType[types.length]; @@ -81,12 +86,14 @@ private ContentTypeCatalog getCatalog() { } @Override - public IContentDescription getDescriptionFor(InputStream contents, String fileName, QualifiedName[] options) throws IOException { + public IContentDescription getDescriptionFor(InputStream contents, String fileName, + QualifiedName[] options) throws IOException { return getCatalog().getDescriptionFor(this, contents, fileName, options); } @Override - public IContentDescription getDescriptionFor(Reader contents, String fileName, QualifiedName[] options) throws IOException { + public IContentDescription getDescriptionFor(Reader contents, String fileName, + QualifiedName[] options) throws IOException { return getCatalog().getDescriptionFor(this, contents, fileName, options); } @@ -99,14 +106,17 @@ public IContentTypeManager.ISelectionPolicy getPolicy() { } /** - * Enumerates all content types whose settings satisfy the given file spec type mask. + * Enumerates all content types whose settings satisfy the given file spec type + * mask. */ @SuppressWarnings("unchecked") - public Collection getDirectlyAssociated(final ContentTypeCatalog catalog, final String fileSpec, final int typeMask) { + public Collection getDirectlyAssociated(final ContentTypeCatalog catalog, + final String fileSpec, final int typeMask) { if ((typeMask & (IContentType.FILE_EXTENSION_SPEC | IContentType.FILE_NAME_SPEC)) == 0) { - throw new IllegalArgumentException("This method only apply to name or extension based associations"); //$NON-NLS-1$ + throw new IllegalArgumentException( + "This method only apply to name or extension based associations"); //$NON-NLS-1$ } - //TODO: make sure we include built-in associations as well + // TODO: make sure we include built-in associations as well final IEclipsePreferences root = context.getNode(ContentTypeManager.CONTENT_TYPE_PREF_NODE); final Set result = new HashSet<>(3); try { @@ -158,16 +168,19 @@ public Collection getMatchingRegexpAssociated(ContentType } public IContentDescription getSpecificDescription(BasicDescription description) { - if (description == null || ContentTypeManager.getInstance().getContext().equals(getContext())) + if (description == null + || ContentTypeManager.getInstance().getContext().equals(getContext())) // no need for specific content descriptions return description; // default description if (description instanceof DefaultDescription) // return an context specific description instead - return new DefaultDescription(new ContentTypeSettings((ContentType) description.getContentTypeInfo(), context)); + return new DefaultDescription(new ContentTypeSettings( + (ContentType) description.getContentTypeInfo(), context)); // non-default description // replace info object with context specific settings - ((ContentDescription) description).setContentTypeInfo(new ContentTypeSettings((ContentType) description.getContentTypeInfo(), context)); + ((ContentDescription) description).setContentTypeInfo( + new ContentTypeSettings((ContentType) description.getContentTypeInfo(), context)); return description; } } diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeSettings.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeSettings.java index 7b6a44be09..1cebcca4ed 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeSettings.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeSettings.java @@ -11,7 +11,6 @@ package eu.esdihumboldt.hale.util.nonosgi.contenttype; import java.util.List; - import org.eclipse.core.internal.content.ContentMessages; import org.eclipse.core.internal.content.Util; import org.eclipse.core.runtime.*; @@ -22,15 +21,17 @@ import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; -@SuppressWarnings({"restriction", "rawtypes"}) +@SuppressWarnings({ "restriction", "rawtypes" }) public class ContentTypeSettings implements IContentTypeSettings, IContentTypeInfo { private ContentType contentType; private IScopeContext context; @SuppressWarnings("unchecked") - static void addFileSpec(IScopeContext context, String contentTypeId, String fileSpec, int type) throws CoreException { - Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context).node(contentTypeId); + static void addFileSpec(IScopeContext context, String contentTypeId, String fileSpec, int type) + throws CoreException { + Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context) + .node(contentTypeId); String key = ContentType.getPreferenceKey(type); List existingValues = Util.parseItemsIntoList(contentTypeNode.get(key, null)); for (int i = 0; i < existingValues.size(); i++) @@ -38,7 +39,7 @@ static void addFileSpec(IScopeContext context, String contentTypeId, String file // don't do anything if already exists return; existingValues.add(fileSpec); - // set new preference value + // set new preference value String newValue = Util.toListString(existingValues.toArray()); ContentType.setPreference(contentTypeNode, key, newValue); try { @@ -51,7 +52,8 @@ static void addFileSpec(IScopeContext context, String contentTypeId, String file } static String[] getFileSpecs(IScopeContext context, String contentTypeId, int type) { - Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context).node(contentTypeId); + Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context) + .node(contentTypeId); return getFileSpecs(contentTypeNode, type); } @@ -61,7 +63,9 @@ static String[] getFileSpecs(Preferences contentTypeNode, int type) { return Util.parseItems(existing); } - public static String internalGetDefaultProperty(ContentType current, final Preferences contentTypePrefs, final QualifiedName key) throws BackingStoreException { + public static String internalGetDefaultProperty(ContentType current, + final Preferences contentTypePrefs, final QualifiedName key) + throws BackingStoreException { String id = current.getId(); if (contentTypePrefs.nodeExists(id)) { Preferences contentTypeNode = contentTypePrefs.node(id); @@ -75,11 +79,14 @@ public static String internalGetDefaultProperty(ContentType current, final Prefe return propertyValue; // try ancestor ContentType baseType = (ContentType) current.getBaseType(); - return baseType == null ? null : internalGetDefaultProperty(baseType, contentTypePrefs, key); + return baseType == null ? null + : internalGetDefaultProperty(baseType, contentTypePrefs, key); } - static void removeFileSpec(IScopeContext context, String contentTypeId, String fileSpec, int type) throws CoreException { - Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context).node(contentTypeId); + static void removeFileSpec(IScopeContext context, String contentTypeId, String fileSpec, + int type) throws CoreException { + Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context) + .node(contentTypeId); String key = ContentType.getPreferenceKey(type); String existing = contentTypeNode.get(key, null); if (existing == null) @@ -113,7 +120,7 @@ public ContentTypeSettings(ContentType contentType, IScopeContext context) { } /* - * @see IContentTypeSettings + * @see IContentTypeSettings */ public void addFileSpec(String fileSpec, int type) throws CoreException { addFileSpec(context, contentType.getId(), fileSpec, type); @@ -128,7 +135,8 @@ public String getDefaultCharset() { } public String getDefaultProperty(final QualifiedName key) { - final Preferences contentTypePrefs = ContentTypeManager.getInstance().getPreferences(context); + final Preferences contentTypePrefs = ContentTypeManager.getInstance() + .getPreferences(context); try { String propertyValue = internalGetDefaultProperty(contentType, contentTypePrefs, key); return "".equals(propertyValue) ? null : propertyValue; //$NON-NLS-1$ @@ -150,12 +158,14 @@ public void removeFileSpec(String fileSpec, int type) throws CoreException { } public void setDefaultCharset(String userCharset) throws CoreException { - Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context).node(contentType.getId()); + Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context) + .node(contentType.getId()); ContentType.setPreference(contentTypeNode, ContentType.PREF_DEFAULT_CHARSET, userCharset); try { contentTypeNode.flush(); } catch (BackingStoreException bse) { - String message = NLS.bind(ContentMessages.content_errorSavingSettings, contentType.getId()); + String message = NLS.bind(ContentMessages.content_errorSavingSettings, + contentType.getId()); IStatus status = new Status(IStatus.ERROR, ContentMessages.OWNER_NAME, 0, message, bse); throw new CoreException(status); } diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeVisitor.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeVisitor.java index c7022dd6c8..12d377805f 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeVisitor.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/ContentTypeVisitor.java @@ -11,6 +11,7 @@ package eu.esdihumboldt.hale.util.nonosgi.contenttype; public interface ContentTypeVisitor { + int CONTINUE = 0; int RETURN = 1; int STOP = 2; diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/DefaultDescription.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/DefaultDescription.java index 7b5f87cbb3..ef9269b279 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/DefaultDescription.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/DefaultDescription.java @@ -14,7 +14,7 @@ import org.eclipse.core.runtime.content.IContentDescription; /** - * A content description for which all properties have default values. + * A content description for which all properties have default values. */ public final class DefaultDescription extends BasicDescription { diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/FileSpec.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/FileSpec.java index 2c2ab2dbf8..b2067b3e5b 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/FileSpec.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/FileSpec.java @@ -13,10 +13,11 @@ import org.eclipse.core.runtime.content.IContentType; /** - * Provides a uniform representation for file specifications, such - * as file names, file extensions and regular expressions. + * Provides a uniform representation for file specifications, such as file + * names, file extensions and regular expressions. */ public class FileSpec { + final static int BASIC_TYPE = IContentType.FILE_EXTENSION_SPEC | IContentType.FILE_NAME_SPEC; private String text; private int type; @@ -46,7 +47,8 @@ public boolean equals(Object other) { } public boolean equals(final String text, final int otherType, final boolean strict) { - return ((!strict && getBasicType(type) == getBasicType(otherType)) || type == otherType) && this.text.equalsIgnoreCase(text); + return ((!strict && getBasicType(type) == getBasicType(otherType)) || type == otherType) + && this.text.equalsIgnoreCase(text); } public int hashCode() { @@ -61,4 +63,3 @@ public String toString() { return getText(); } } - diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/IContentTypeInfo.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/IContentTypeInfo.java index f4c4e1d3f6..605bdde5bb 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/IContentTypeInfo.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/IContentTypeInfo.java @@ -16,14 +16,15 @@ * @since 3.1 */ public abstract interface IContentTypeInfo { + /** - * Returns a reference to the corresponding content type. + * Returns a reference to the corresponding content type. */ public abstract ContentType getContentType(); /** - * Returns the default value for the given property, delegating to the - * ancestor type if necessary. + * Returns the default value for the given property, delegating to the ancestor + * type if necessary. */ public abstract String getDefaultProperty(QualifiedName key); } diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/LowLevelIOException.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/LowLevelIOException.java index b222fd4493..23f3666cd6 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/LowLevelIOException.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/LowLevelIOException.java @@ -14,10 +14,10 @@ import org.eclipse.core.runtime.Assert; /** - * A wrapper for IOExceptions, throw by LazyInputStream/Reader. - * Its purpose is to allow one to differentiate - * between IOExceptions thrown by the base stream/reader from those - * thrown by streams/readers built on top of LazyInputStream/Reader. + * A wrapper for IOExceptions, throw by LazyInputStream/Reader. Its purpose is + * to allow one to differentiate between IOExceptions thrown by the base + * stream/reader from those thrown by streams/readers built on top of + * LazyInputStream/Reader. * * @see LazyInputStream * @see LazyReader diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLContentDescriber.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLContentDescriber.java index 9b0a8073c6..00e1e1f5c0 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLContentDescriber.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLContentDescriber.java @@ -13,7 +13,6 @@ import java.io.*; import java.util.HashMap; import java.util.Map; - import org.eclipse.core.internal.content.TextContentDescriber; import org.eclipse.core.internal.content.Util; import org.eclipse.core.runtime.QualifiedName; @@ -48,9 +47,11 @@ * @see "http://www.w3.org/TR/REC-xml *" * @since org.eclipse.core.contenttype 3.4 */ -@SuppressWarnings({"restriction", "rawtypes"}) +@SuppressWarnings({ "restriction", "rawtypes" }) public class XMLContentDescriber extends TextContentDescriber implements ITextContentDescriber { - private static final QualifiedName[] SUPPORTED_OPTIONS = new QualifiedName[] {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK}; + + private static final QualifiedName[] SUPPORTED_OPTIONS = new QualifiedName[] { + IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK }; private static final String XML_PREFIX = ""; //$NON-NLS-1$ private static final String BOM = "org.eclipse.core.runtime.content.XMLContentDescriber.bom"; //$NON-NLS-1$ @@ -62,7 +63,8 @@ public int describe(InputStream input, IContentDescription description) throws I return describe2(input, description, new HashMap()); } - int describe2(InputStream input, IContentDescription description, Map properties) throws IOException { + int describe2(InputStream input, IContentDescription description, Map properties) + throws IOException { if (!isProcessed(properties)) fillContentProperties(input, description, properties); return internalDescribe(description, properties); @@ -72,7 +74,8 @@ public int describe(Reader input, IContentDescription description) throws IOExce return describe2(input, description, new HashMap()); } - int describe2(Reader input, IContentDescription description, Map properties) throws IOException { + int describe2(Reader input, IContentDescription description, Map properties) + throws IOException { if (!isProcessed(properties)) fillContentProperties(readXMLDecl(input), description, properties); return internalDescribe(description, properties); @@ -86,7 +89,8 @@ private boolean isProcessed(Map properties) { } @SuppressWarnings("unchecked") - private void fillContentProperties(InputStream input, IContentDescription description, Map properties) throws IOException { + private void fillContentProperties(InputStream input, IContentDescription description, + Map properties) throws IOException { byte[] bom = Util.getByteOrderMark(input); String xmlDeclEncoding = "UTF-8"; //$NON-NLS-1$ input.reset(); @@ -103,7 +107,8 @@ else if (bom == IContentDescription.BOM_UTF_16LE) } @SuppressWarnings("unchecked") - private void fillContentProperties(String line, IContentDescription description, Map properties) throws IOException { + private void fillContentProperties(String line, IContentDescription description, Map properties) + throws IOException { // XMLDecl should be the first string (no blanks allowed) if (line != null && line.startsWith(XML_PREFIX)) properties.put(FULL_XML_DECL, new Boolean(true)); @@ -157,7 +162,8 @@ private String readXMLDecl(InputStream input, String encoding) throws IOExceptio int c = 0; int read = 0; - // count is incremented when subsequent read characters match the xmlDeclEnd bytes, + // count is incremented when subsequent read characters match the xmlDeclEnd + // bytes, // the end of xmlDecl is reached, when count equals the xmlDeclEnd length int count = 0; @@ -194,7 +200,7 @@ private String getCharset(String firstLine) { char quoteChar = '"'; int firstQuote = firstLine.indexOf('"', encodingPos); int firstApostrophe = firstLine.indexOf('\'', encodingPos); - //use apostrophe if there is no quote, or an apostrophe comes first + // use apostrophe if there is no quote, or an apostrophe comes first if (firstQuote == -1 || (firstApostrophe != -1 && firstApostrophe < firstQuote)) { quoteChar = '\''; firstQuote = firstApostrophe; @@ -203,7 +209,10 @@ private String getCharset(String firstLine) { return null; int secondQuote = firstLine.indexOf(quoteChar, firstQuote + 1); if (secondQuote == -1) - return isFullXMLDecl(firstLine) ? firstLine.substring(firstQuote + 1, firstLine.lastIndexOf(XML_DECL_END)).trim() : null; + return isFullXMLDecl(firstLine) + ? firstLine.substring(firstQuote + 1, firstLine.lastIndexOf(XML_DECL_END)) + .trim() + : null; return firstLine.substring(firstQuote + 1, secondQuote); } @@ -218,11 +227,14 @@ private int findEncodingPosition(String line) { char c = line.charAt(i); if (c == '=' && !equals) { equals = true; - } else if (c == 0x20 || c == 0x09 || c == 0x0D || c == 0x0A) { + } + else if (c == 0x20 || c == 0x09 || c == 0x0D || c == 0x0A) { // white space characters to ignore - } else if ((c == '"' || c == '\'') && equals) { - return position; - } else { + } + else if ((c == '"' || c == '\'') && equals) { + return position; + } + else { break; } } @@ -240,7 +252,8 @@ private boolean isCharsetValid(String charset) { for (int i = 1; i < charset.length(); i++) { c = charset.charAt(i); - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_' || c == '.') + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') + || c == '-' || c == '_' || c == '.') continue; return false; } diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLRootElementContentDescriber2.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLRootElementContentDescriber2.java index 23c58adeb0..01c04e2562 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLRootElementContentDescriber2.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLRootElementContentDescriber2.java @@ -13,9 +13,7 @@ import java.io.*; import java.util.*; - import javax.xml.parsers.ParserConfigurationException; - import org.eclipse.core.internal.content.ContentMessages; import org.eclipse.core.internal.runtime.RuntimeLog; import org.eclipse.core.runtime.*; @@ -25,50 +23,47 @@ import org.xml.sax.SAXException; /** - * A content describer for detecting the name of the top-level element, - * its namespace and the DTD system identifier in an XML file. + * A content describer for detecting the name of the top-level element, its + * namespace and the DTD system identifier in an XML file. *

        - * This executable extension supports "element" parameter, that - * can be specified more than once. If the - * ":-" method is used, then the value is treated as - * "element" (always just one) + * This executable extension supports "element" parameter, that can be specified + * more than once. If the ":-" method is used, then the value is + * treated as "element" (always just one) *

        *

        * The value of "element" is specified using such a format - * {namespace}name/dtd. The namespace or dtd part - * can be omitted and accepted are values like name/dtd, - * {ns}name and name. + * {namespace}name/dtd. The namespace or dtd part can be omitted + * and accepted are values like name/dtd, {ns}name and + * name. *

        *

        * The describer will detect a document, if it matches at least one "element" - * what means, that dtd, namespace (if specified) and name in "element" - * match those in the document. + * what means, that dtd, namespace (if specified) and name in "element" match + * those in the document. *

        *

        - * If the "element" name part is "*", e.g. {namespace}*, - * it denotes a wildcard match. If the "element" namespace part is empty, - * e.g. {}name, only these documents with the root element - * that belong to the unnamed namespace - * will be detected. + * If the "element" name part is "*", e.g. {namespace}*, it denotes + * a wildcard match. If the "element" namespace part is empty, e.g. + * {}name, only these documents with the root element that belong + * to the unnamed namespace will be detected. *

        *

        * This class should be used instead of {@link XMLRootElementContentDescriber} - * which doesn't detect namespaces and doesn't allow to specify - * more than one set of dtds, root element names and namespaces which - * should be detected. + * which doesn't detect namespaces and doesn't allow to specify more than one + * set of dtds, root element names and namespaces which should be detected. *

        *

        - * This class is not intended to be subclassed or instantiated by clients, - * only to be referenced by the "describer" configuration element in - * extensions to the org.eclipse.core.runtime.contentTypes - * extension point. + * This class is not intended to be subclassed or instantiated by clients, only + * to be referenced by the "describer" configuration element in extensions to + * the org.eclipse.core.runtime.contentTypes extension point. *

        * * @since org.eclipse.core.contenttype 3.3 * @noinstantiate This class is not intended to be instantiated by clients. */ -@SuppressWarnings({"restriction", "rawtypes"}) -public final class XMLRootElementContentDescriber2 extends XMLContentDescriber implements IExecutableExtension { +@SuppressWarnings({ "restriction", "rawtypes" }) +public final class XMLRootElementContentDescriber2 extends XMLContentDescriber + implements IExecutableExtension { static final String DTD = "org.eclipse.core.runtime.content.XMLRootElementContentDescriber2.dtd"; //$NON-NLS-1$ static final String NAMESPACE = "org.eclipse.core.runtime.content.XMLRootElementContentDescriber2.namespace"; //$NON-NLS-1$ @@ -77,18 +72,21 @@ public final class XMLRootElementContentDescriber2 extends XMLContentDescriber i private static final String ELEMENT_TO_FIND = "element"; //$NON-NLS-1$ - /* (Intentionally not included in javadoc) - * The top-level elements we are looking for. This value will be initialized - * by the setInitializationData method. If no value is - * provided, then this means that we don't care what the top-level element - * will be. The list is a collection of QualifiedElement. + /* + * (Intentionally not included in javadoc) The top-level elements we are looking + * for. This value will be initialized by the setInitializationData + * method. If no value is provided, then this means that we don't care what the + * top-level element will be. The list is a collection of + * QualifiedElement. */ private QualifiedElement[] elementsToFind = null; - /* (Intentionally not included in javadoc) - * Simple value holder for root element name, its namespace and dtd. + /* + * (Intentionally not included in javadoc) Simple value holder for root element + * name, its namespace and dtd. */ private class QualifiedElement { + private String namespace; private String element; private String dtd; @@ -119,15 +117,15 @@ public boolean matches(String someNamespace, String someElement, String someDtd) } } - /* (Intentionally not included in javadoc) - * Determines the validation status for the given contents. + /* + * (Intentionally not included in javadoc) Determines the validation status for + * the given contents. * * @param contents the contents to be evaluated - * @return one of the following:
          - *
        • VALID
        • , - *
        • INVALID
        • , - *
        • INDETERMINATE
        • - *
        + * + * @return one of the following:
        • VALID
        • , + *
        • INVALID
        • ,
        • INDETERMINATE
        + * * @throws IOException */ private int checkCriteria(InputSource contents, Map properties) throws IOException { @@ -152,11 +150,13 @@ private int checkCriteria(Map properties) throws IOException { if (!foundOne) return INDETERMINATE; } - // We must be okay then. + // We must be okay then. return VALID; } - /* (Intentionally not included in javadoc) + /* + * (Intentionally not included in javadoc) + * * @see IContentDescriber#describe(InputStream, IContentDescription) */ public int describe(InputStream contents, IContentDescription description) throws IOException { @@ -166,17 +166,20 @@ public int describe(InputStream contents, IContentDescription description) throw /** * @noreference This method is not intended to be referenced by clients. */ - public int describe(InputStream contents, IContentDescription description, Map properties) throws IOException { + public int describe(InputStream contents, IContentDescription description, Map properties) + throws IOException { // call the basic XML describer to do basic recognition if (super.describe2(contents, description, properties) == INVALID) return INVALID; - // super.describe will have consumed some chars, need to rewind + // super.describe will have consumed some chars, need to rewind contents.reset(); - // Check to see if we matched our criteria. + // Check to see if we matched our criteria. return checkCriteria(new InputSource(contents), properties); } - /* (Intentionally not included in javadoc) + /* + * (Intentionally not included in javadoc) + * * @see IContentDescriber#describe(Reader, IContentDescription) */ public int describe(Reader contents, IContentDescription description) throws IOException { @@ -186,7 +189,8 @@ public int describe(Reader contents, IContentDescription description) throws IOE /** * @noreference This method is not intended to be referenced by clients. */ - public int describe(Reader contents, IContentDescription description, Map properties) throws IOException { + public int describe(Reader contents, IContentDescription description, Map properties) + throws IOException { // call the basic XML describer to do basic recognition if (super.describe2(contents, description, properties) == INVALID) return INVALID; @@ -234,17 +238,21 @@ static void fillContentProperties(InputSource input, Map properties) throws IOEx properties.put(RESULT, new Boolean(true)); } - /* (Intentionally not included in javadoc) + /* + * (Intentionally not included in javadoc) + * * @see IExecutableExtension#setInitializationData */ @SuppressWarnings("unchecked") - public void setInitializationData(final IConfigurationElement config, final String propertyName, final Object data) throws CoreException { + public void setInitializationData(final IConfigurationElement config, final String propertyName, + final Object data) throws CoreException { if (data instanceof String) - elementsToFind = new QualifiedElement[] {new QualifiedElement((String) data)}; + elementsToFind = new QualifiedElement[] { new QualifiedElement((String) data) }; else if (data instanceof Hashtable) { List elements = null; - // the describer parameters have to be read again, because "element" parameter can be specified multiple times + // the describer parameters have to be read again, because "element" parameter + // can be specified multiple times // and the given hashtable carries only one of them IConfigurationElement describerElement = config.getChildren("describer")[0]; //$NON-NLS-1$ IConfigurationElement[] params = describerElement.getChildren("parameter"); //$NON-NLS-1$ @@ -266,12 +274,15 @@ else if (data instanceof Hashtable) { qualifiedElements.add(it.next()); } } - elementsToFind = (QualifiedElement[]) qualifiedElements.toArray(new QualifiedElement[qualifiedElements.size()]); + elementsToFind = (QualifiedElement[]) qualifiedElements + .toArray(new QualifiedElement[qualifiedElements.size()]); } if (elementsToFind.length == 0) { - String message = NLS.bind(ContentMessages.content_badInitializationData, XMLRootElementContentDescriber2.class.getName()); - throw new CoreException(new Status(IStatus.ERROR, ContentMessages.OWNER_NAME, 0, message, null)); + String message = NLS.bind(ContentMessages.content_badInitializationData, + XMLRootElementContentDescriber2.class.getName()); + throw new CoreException( + new Status(IStatus.ERROR, ContentMessages.OWNER_NAME, 0, message, null)); } } } diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLRootHandler.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLRootHandler.java index 346c619208..46ebcfa6ba 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLRootHandler.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/contenttype/describer/XMLRootHandler.java @@ -12,9 +12,7 @@ import java.io.IOException; import java.io.StringReader; - import javax.xml.parsers.*; - import org.eclipse.core.internal.content.Activator; import org.xml.sax.*; import org.xml.sax.ext.LexicalHandler; @@ -23,15 +21,16 @@ /** * A content describer for detecting the name of the top-level element of the * DTD system identifier in an XML file. This supports two parameters: - * DTD_TO_FIND and ELEMENT_TO_FIND. This is done - * using the IExecutableExtension mechanism. If the - * ":-" method is used, then the value is treated as the + * DTD_TO_FIND and ELEMENT_TO_FIND. This is done using + * the IExecutableExtension mechanism. If the ":-" + * method is used, then the value is treated as the * ELEMENT_TO_FIND. * * @since 3.0 */ @SuppressWarnings("restriction") public final class XMLRootHandler extends DefaultHandler implements LexicalHandler { + /** * An exception indicating that the parsing should stop. This is usually * triggered when the top-level element has been found. @@ -39,6 +38,7 @@ public final class XMLRootHandler extends DefaultHandler implements LexicalHandl * @since 3.0 */ private class StopParsingException extends SAXException { + /** * All serializable objects should have a stable serialVersionUID */ @@ -58,15 +58,15 @@ public StopParsingException() { */ private boolean checkRoot; /** - * The system identifier for the DTD that was found while parsing the XML. - * This member variable is null unless the file has been - * parsed successful to the point of finding the DTD's system identifier. + * The system identifier for the DTD that was found while parsing the XML. This + * member variable is null unless the file has been parsed + * successful to the point of finding the DTD's system identifier. */ private String dtdFound = null; /** - * This is the name of the top-level element found in the XML file. This - * member variable is null unless the file has been parsed - * successful to the point of finding the top-level element. + * This is the name of the top-level element found in the XML file. This member + * variable is null unless the file has been parsed successful to + * the point of finding the top-level element. */ private String elementFound = null; @@ -76,7 +76,7 @@ public StopParsingException() { * successful to the point of finding the top-level element. */ private String namespaceFound = null; - + public XMLRootHandler(boolean checkRoot) { this.checkRoot = checkRoot; } @@ -95,27 +95,28 @@ public final void comment(final char[] ch, final int start, final int length) { * * @return The newly created parser. * - * @throws ParserConfigurationException - * If a parser of the given configuration cannot be created. - * @throws SAXException - * If something in general goes wrong when creating the parser. - * @throws SAXNotRecognizedException - * If the XMLReader does not recognize the - * lexical handler configuration option. - * @throws SAXNotSupportedException - * If the XMLReader does not support the lexical - * handler configuration option. - */ - private final SAXParser createParser(SAXParserFactory parserFactory) throws ParserConfigurationException, SAXException, SAXNotRecognizedException, SAXNotSupportedException { + * @throws ParserConfigurationException If a parser of the given configuration + * cannot be created. + * @throws SAXException If something in general goes wrong when creating the + * parser. + * @throws SAXNotRecognizedException If the XMLReader does not + * recognize the lexical handler configuration option. + * @throws SAXNotSupportedException If the XMLReader does not + * support the lexical handler configuration option. + */ + private final SAXParser createParser(SAXParserFactory parserFactory) + throws ParserConfigurationException, SAXException, SAXNotRecognizedException, + SAXNotSupportedException { // Initialize the parser. final SAXParser parser = parserFactory.newSAXParser(); final XMLReader reader = parser.getXMLReader(); reader.setProperty("http://xml.org/sax/properties/lexical-handler", this); //$NON-NLS-1$ // disable DTD validation (bug 63625) try { - // be sure validation is "off" or the feature to ignore DTD's will not apply + // be sure validation is "off" or the feature to ignore DTD's will not apply reader.setFeature("http://xml.org/sax/features/validation", false); //$NON-NLS-1$ - reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$ + reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", //$NON-NLS-1$ + false); } catch (SAXNotRecognizedException e) { // not a big deal if the parser does not recognize the features } catch (SAXNotSupportedException e) { @@ -166,7 +167,8 @@ public String getRootNamespace() { return namespaceFound; } - public boolean parseContents(InputSource contents) throws IOException, ParserConfigurationException, SAXException { + public boolean parseContents(InputSource contents) + throws IOException, ParserConfigurationException, SAXException { // Parse the file into we have what we need (or an error occurs). try { SAXParserFactory factory = null; @@ -188,10 +190,12 @@ public boolean parseContents(InputSource contents) throws IOException, ParserCon } /* - * Resolve external entity definitions to an empty string. This is to speed - * up processing of files with external DTDs. Not resolving the contents - * of the DTD is ok, as only the System ID of the DTD declaration is used. - * @see org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String, java.lang.String) + * Resolve external entity definitions to an empty string. This is to speed up + * processing of files with external DTDs. Not resolving the contents of the DTD + * is ok, as only the System ID of the DTD declaration is used. + * + * @see org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String, + * java.lang.String) */ public InputSource resolveEntity(String publicId, String systemId) throws SAXException { return new InputSource(new StringReader("")); //$NON-NLS-1$ @@ -210,9 +214,10 @@ public final void startCDATA() { * (non-Javadoc) * * @see org.xml.sax.ext.LexicalHandler#startDTD(java.lang.String, - * java.lang.String, java.lang.String) + * java.lang.String, java.lang.String) */ - public final void startDTD(final String name, final String publicId, final String systemId) throws SAXException { + public final void startDTD(final String name, final String publicId, final String systemId) + throws SAXException { dtdFound = systemId; // If we don't care about the top-level element, we can stop here. if (!checkRoot) @@ -223,9 +228,10 @@ public final void startDTD(final String name, final String publicId, final Strin * (non-Javadoc) * * @see org.xml.sax.ContentHandler#startElement(java.lang.String, - * java.lang.String, java.lang.String, org.xml.sax.Attributes) + * java.lang.String, java.lang.String, org.xml.sax.Attributes) */ - public final void startElement(final String uri, final String elementName, final String qualifiedName, final Attributes attributes) throws SAXException { + public final void startElement(final String uri, final String elementName, + final String qualifiedName, final Attributes attributes) throws SAXException { elementFound = elementName; namespaceFound = uri; throw new StopParsingException(); diff --git a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/logging/NonOSGiLoggingFilter.java b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/logging/NonOSGiLoggingFilter.java index 5f13b1ae3f..2dfe616ce8 100644 --- a/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/logging/NonOSGiLoggingFilter.java +++ b/ext/nonosgi/eu.esdihumboldt.hale.util.nonosgi/src/eu/esdihumboldt/hale/util/nonosgi/logging/NonOSGiLoggingFilter.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.util.nonosgi.logging; -import org.slf4j.Marker; - import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.turbo.TurboFilter; import ch.qos.logback.core.spi.FilterReply; +import org.slf4j.Marker; /** * Logging filter that suppresses messages that appear in context of an @@ -34,9 +33,9 @@ public class NonOSGiLoggingFilter extends TurboFilter { public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t) { /* - * Filter error on org.eclipse.xsd content type appearing since upgrade - * to Eclipse Photon. - * Hiding this because org.eclipse.xsd is not currently used in hale. + * Filter error on org.eclipse.xsd content type appearing since upgrade to + * Eclipse Photon. Hiding this because org.eclipse.xsd is not currently used in + * hale. */ if ("eu.esdihumboldt.hale.util.nonosgi.contenttype.ContentType".equals(logger.getName())) { if ("Could not create content describer for org.eclipse.xsd. Content type has been disabled." diff --git a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/Activator.java b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/Activator.java index f95c87053f..94ef2c3d03 100644 --- a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/Activator.java +++ b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/Activator.java @@ -11,7 +11,6 @@ package org.eclipse.equinox.nonosgi.internal.registry; import java.util.Properties; - import org.eclipse.osgi.service.debug.DebugOptions; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; @@ -47,13 +46,12 @@ public class Activator implements BundleActivator { public Activator() { Activator.activator = this; } - + /* * (non-Javadoc) * * @see - * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext - * ) + * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) */ public void start(BundleContext bundleContext) throws Exception { this.bundleContext = bundleContext; @@ -96,8 +94,7 @@ public static Activator getDefault() { * @return */ @SuppressWarnings({ "rawtypes", "unchecked" }) - public static boolean getBooleanDebugOption(String option, - boolean defaultValue) { + public static boolean getBooleanDebugOption(String option, boolean defaultValue) { // 1) search param from JVM String s = System.getProperty(DEBUG_PROPERTY); if (!Utils.isEmpty(s)) { @@ -123,14 +120,12 @@ public static boolean getBooleanDebugOption(String option, // Search the DebugOptions OSGi service if (getDefault().debugTracker == null) { - getDefault().debugTracker = new ServiceTracker( - getDefault().bundleContext, DebugOptions.class.getName(), - null); + getDefault().debugTracker = new ServiceTracker(getDefault().bundleContext, + DebugOptions.class.getName(), null); getDefault().debugTracker.open(); } - DebugOptions options = (DebugOptions) getDefault().debugTracker - .getService(); + DebugOptions options = (DebugOptions) getDefault().debugTracker.getService(); if (options != null) { // get the value of the option by using OSGi service DebugOptions return Utils.isTrue(options.getOption(option), defaultValue); diff --git a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/ContributorFactoryNonOSGI.java b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/ContributorFactoryNonOSGI.java index 90d1258539..02bd09f69b 100644 --- a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/ContributorFactoryNonOSGI.java +++ b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/ContributorFactoryNonOSGI.java @@ -32,11 +32,9 @@ public class ContributorFactoryNonOSGI { * Creates registry contributor object based on a "Bundle-SymbolicName". The * symbolicName must not be null. * - * @param symbolicName - * "Bundle-SymbolicName" metadata from Bundle MANIFEST.MF + * @param symbolicName "Bundle-SymbolicName" metadata from Bundle MANIFEST.MF * associated with the contribution - * @return new registry contributor based on the "Bundle-SymbolicName" - * metadata. + * @return new registry contributor based on the "Bundle-SymbolicName" metadata. */ public static RegistryContributor createContributor(String symbolicName) { String id = Long.toString(bundleId++); diff --git a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/DebugHelper.java b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/DebugHelper.java index 3adfb725b0..dc95d41141 100644 --- a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/DebugHelper.java +++ b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/DebugHelper.java @@ -92,7 +92,7 @@ private static String createMessage(String message, int indent) { } s.append("["); s.append(PLUGIN_NAME); - s.append("] "); + s.append("] "); if (message != null) { s.append(message); } diff --git a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/RegistryProviderNonOSGI.java b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/RegistryProviderNonOSGI.java index bdb6a50033..58d3891289 100644 --- a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/RegistryProviderNonOSGI.java +++ b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/RegistryProviderNonOSGI.java @@ -11,7 +11,6 @@ package org.eclipse.equinox.nonosgi.internal.registry; import java.io.File; - import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.RegistryFactory; import org.eclipse.core.runtime.spi.IRegistryProvider; @@ -62,14 +61,13 @@ public IExtensionRegistry getRegistry() { // RegistryStrategy // 1. Create an instance of RegistryStrategy for no OSGi-env. - RegistryStrategy strategy = new RegistryStrategyNonOSGI( - storageDirs, cacheReadOnly, masterRegistryKey); + RegistryStrategy strategy = new RegistryStrategyNonOSGI(storageDirs, cacheReadOnly, + masterRegistryKey); // 2. Create an instance of IExtensionRegistry by using the instance // of // RegistryStrategy - registry = RegistryFactory.createRegistry(strategy, - masterRegistryKey, userRegistryKey); + registry = RegistryFactory.createRegistry(strategy, masterRegistryKey, userRegistryKey); } return registry; } diff --git a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/RegistryStrategyNonOSGI.java b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/RegistryStrategyNonOSGI.java index cd3847aea9..58434739e1 100644 --- a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/RegistryStrategyNonOSGI.java +++ b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/RegistryStrategyNonOSGI.java @@ -18,7 +18,6 @@ import java.util.Enumeration; import java.util.Map; import java.util.ResourceBundle; - import org.eclipse.core.internal.registry.ExtensionRegistry; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.spi.RegistryContributor; @@ -38,8 +37,7 @@ public class RegistryStrategyNonOSGI extends RegistryStrategy { private Object token; - public RegistryStrategyNonOSGI(File[] storageDirs, boolean[] cacheReadOnly, - Object token) { + public RegistryStrategyNonOSGI(File[] storageDirs, boolean[] cacheReadOnly, Object token) { super(storageDirs, cacheReadOnly); this.token = token; } @@ -47,8 +45,7 @@ public RegistryStrategyNonOSGI(File[] storageDirs, boolean[] cacheReadOnly, /* * (non-Javadoc) * - * @see - * org.eclipse.core.runtime.spi.RegistryStrategy#onStart(org.eclipse.core + * @see org.eclipse.core.runtime.spi.RegistryStrategy#onStart(org.eclipse.core * .runtime.IExtensionRegistry, boolean) */ public void onStart(IExtensionRegistry registry, boolean loadedFromCache) { @@ -80,40 +77,34 @@ public void onStart(IExtensionRegistry registry, boolean loadedFromCache) { // Searching URL from the ClassLoader. if (DebugHelper.DEBUG) { startTime = System.currentTimeMillis(); - DebugHelper - .log("Start searching URLs from the ClassLoader....", - 1); + DebugHelper.log("Start searching URLs from the ClassLoader....", 1); } ClassLoader cl = getClass().getClassLoader(); Enumeration pluginURLs = Utils.getPluginXMLs(cl); if (pluginURLs == null || !pluginURLs.hasMoreElements()) { if (DebugHelper.DEBUG) { - DebugHelper.log( - "No founded into the ClassLoader", 1); + DebugHelper.log("No founded into the ClassLoader", 1); } return; } if (DebugHelper.DEBUG) { - DebugHelper.log( - "End searching URLs from the ClassLoader with time=" - + (System.currentTimeMillis() - startTime) - + "(ms)", 1); + DebugHelper.log("End searching URLs from the ClassLoader with time=" + + (System.currentTimeMillis() - startTime) + "(ms)", 1); } // files are present into ClassLoader. // Searching URL from the ClassLoader. if (DebugHelper.DEBUG) { startTime = System.currentTimeMillis(); - DebugHelper - .log("Start searching URLs from the ClassLoader....", - 1); + DebugHelper.log( + "Start searching URLs from the ClassLoader....", 1); } Map manifests = Utils .getManifestsMap(cl); if (DebugHelper.DEBUG) { DebugHelper.log( "End searching URLs from the ClassLoader with time=" - + (System.currentTimeMillis() - startTime) - + "(ms)", 1); + + (System.currentTimeMillis() - startTime) + "(ms)", + 1); } if (DebugHelper.DEBUG) { @@ -127,7 +118,8 @@ public void onStart(IExtensionRegistry registry, boolean loadedFromCache) { try { if (loadPluginXML(url, extensionRegistry, manifests)) { pluginXMLWithNoError++; - } else { + } + else { pluginXMLWithError++; } } catch (RuntimeException e) { @@ -138,25 +130,15 @@ public void onStart(IExtensionRegistry registry, boolean loadedFromCache) { } } if (DebugHelper.DEBUG) { - DebugHelper.log( - "End loading with time=" - + (System.currentTimeMillis() - startTime) - + "(ms)", 1); + DebugHelper.log("End loading with time=" + + (System.currentTimeMillis() - startTime) + "(ms)", 1); } } finally { if (DebugHelper.DEBUG) { - DebugHelper - .log("END RegistryStrategyNonOSGI#onStart: plugin.xml [OK]=<" - + pluginXMLWithNoError - + "/" - + pluginXMLTotal - + ">, plugin.xml [ERROR]=<" - + pluginXMLWithError - + "/" - + pluginXMLTotal - + ">, time=" - + (System.currentTimeMillis() - startGlobalTime) - + "(ms)."); + DebugHelper.log("END RegistryStrategyNonOSGI#onStart: plugin.xml [OK]=<" + + pluginXMLWithNoError + "/" + pluginXMLTotal + ">, plugin.xml [ERROR]=<" + + pluginXMLWithError + "/" + pluginXMLTotal + ">, time=" + + (System.currentTimeMillis() - startGlobalTime) + "(ms)."); } } } @@ -169,8 +151,8 @@ public void onStart(IExtensionRegistry registry, boolean loadedFromCache) { * @param manifests * @return */ - private boolean loadPluginXML(URL pluginManifest, - ExtensionRegistry extensionRegistry, Map manifests) { + private boolean loadPluginXML(URL pluginManifest, ExtensionRegistry extensionRegistry, + Map manifests) { long startTime = System.currentTimeMillis(); if (pluginManifest == null) { return false; @@ -182,8 +164,8 @@ private boolean loadPluginXML(URL pluginManifest, } catch (IOException ex) { is = null; if (DebugHelper.DEBUG) { - DebugHelper.logError(" [ERROR] : (" - + pluginManifest.getPath() + "): ", 1); + DebugHelper.logError(" [ERROR] : (" + pluginManifest.getPath() + "): ", + 1); DebugHelper.logError(ex); } return false; @@ -192,19 +174,16 @@ private boolean loadPluginXML(URL pluginManifest, String symbolicName = null; // Search META-INF/MANIFEST.MF stored int the same plugin.xml folder. - String baseDir = Utils.getBaseDir(pluginManifest, - Constants.PLUGIN_MANIFEST); + String baseDir = Utils.getBaseDir(pluginManifest, Constants.PLUGIN_MANIFEST); URL manifestURL = manifests.get(baseDir); if (manifestURL == null) { // META-INF/MANIFEST.MF doesn't exist for the plugin.xml // ignore it. if (DebugHelper.DEBUG) { - DebugHelper.logError(" [ERROR] : (" - + pluginManifest.getPath() + "): ", 1); - DebugHelper.logError( - " doesn't exist for the . <" - + baseDir - + "META-INF/MANIFEST.MF> not founded.", 2); + DebugHelper.logError(" [ERROR] : (" + pluginManifest.getPath() + "): ", + 1); + DebugHelper.logError(" doesn't exist for the . <" + + baseDir + "META-INF/MANIFEST.MF> not founded.", 2); } // handle special case - plugin.xml is in file system @@ -233,25 +212,23 @@ private boolean loadPluginXML(URL pluginManifest, headers = Headers.parseManifest(manifestURL.openStream()); } catch (Exception e) { if (DebugHelper.DEBUG) { - DebugHelper.logError(" [ERROR] : (" - + pluginManifest.getPath() + "): ", 1); - DebugHelper.logError("Error while parsing MANIFEST.MF=<" - + manifestURL.getPath() + ">", 2); + DebugHelper.logError( + " [ERROR] : (" + pluginManifest.getPath() + "): ", 1); + DebugHelper.logError( + "Error while parsing MANIFEST.MF=<" + manifestURL.getPath() + ">", 2); DebugHelper.logError(e); } return false; } // Get Bundle-SymbolicName from the MANIFEST.MF - symbolicName = (String) headers - .get(Constants.BUNDLE_SYMBOLICNAME); + symbolicName = (String) headers.get(Constants.BUNDLE_SYMBOLICNAME); if (Utils.isEmpty(symbolicName)) { if (DebugHelper.DEBUG) { - DebugHelper.logError(" [ERROR] : (" - + pluginManifest.getPath() + "): ", 1); DebugHelper.logError( - "Cannot found from the MANIFEST.MF=<" - + manifestURL.getPath() + ">", 2); + " [ERROR] : (" + pluginManifest.getPath() + "): ", 1); + DebugHelper.logError("Cannot found from the MANIFEST.MF=<" + + manifestURL.getPath() + ">", 2); } return false; } @@ -265,16 +242,15 @@ private boolean loadPluginXML(URL pluginManifest, } // Create IContributor - RegistryContributor contributor = ContributorFactoryNonOSGI - .createContributor(symbolicName); + RegistryContributor contributor = ContributorFactoryNonOSGI.createContributor(symbolicName); // Test if IContributor doesn't already exists. if (extensionRegistry.hasContributor(contributor)) { if (DebugHelper.DEBUG) { - DebugHelper.logError(" [ERROR] : (" - + pluginManifest.getPath() + "): ", 1); + DebugHelper.logError(" [ERROR] : (" + pluginManifest.getPath() + "): ", + 1); DebugHelper.logError( - "Contributor with id=<" + contributor.getActualId() - + "> already exits.", 2); + "Contributor with id=<" + contributor.getActualId() + "> already exits.", + 2); } return false; } @@ -283,29 +259,29 @@ private boolean loadPluginXML(URL pluginManifest, long timestamp = 0; // Parse the plugin.xml - if (!extensionRegistry.addContribution(is, contributor, true, - pluginManifest.getPath(), translationBundle, token, timestamp)) { + if (!extensionRegistry.addContribution(is, contributor, true, pluginManifest.getPath(), + translationBundle, token, timestamp)) { if (DebugHelper.DEBUG) { - DebugHelper.logError(" [ERROR] : (" - + pluginManifest.getPath() + "): ", 1); + DebugHelper.logError(" [ERROR] : (" + pluginManifest.getPath() + "): ", + 1); DebugHelper.logError("Parsing problems with plugin.xml", 2); } return false; } - if (DebugHelper.DEBUG) { - DebugHelper.log(" [OK] loaded with time=" - + (System.currentTimeMillis() - startTime) - + "(ms) : (" + pluginManifest.getPath() - + ")", 1); + DebugHelper.log( + " [OK] loaded with time=" + (System.currentTimeMillis() - startTime) + + "(ms) : (" + pluginManifest.getPath() + ")", + 1); } return true; } /** - * Look for the project folder in the given folder and its parent folders. - * Used to determine project information when no META-INF/MANIFEST.MF file is present. + * Look for the project folder in the given folder and its parent folders. Used + * to determine project information when no META-INF/MANIFEST.MF file is + * present. * * @param folder the folder to check * @param maxParentChecks the maximum number of parent folder checks @@ -321,7 +297,8 @@ private File findProjectDir(File folder, int maxParentChecks) { // Check if the current directory contains a build.gradle file or a src folder if (files != null) { for (File file : files) { - if ((file.isFile() && file.getName().equals("build.gradle")) || (file.isDirectory() && file.getName().equals("src"))) { + if ((file.isFile() && file.getName().equals("build.gradle")) + || (file.isDirectory() && file.getName().equals("src"))) { return currentDir; } } diff --git a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/Utils.java b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/Utils.java index e179a17195..df04503427 100644 --- a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/Utils.java +++ b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/internal/registry/Utils.java @@ -27,14 +27,14 @@ public class Utils { private static final String TRUE = "true"; /** - * Properties files (coming from fragment linked to this bundle) which - * configure NO OSGi-env. + * Properties files (coming from fragment linked to this bundle) which configure + * NO OSGi-env. */ private static final String NONOSGIREGISTRY_PROPERTIES = "nonosgiregistry.properties"; - + /** - * Return a map of the whole MANIFEST.MF founded into the ClassPath. The key - * map is the baseDir of the URI of the MANIFEST.MF file. + * Return a map of the whole MANIFEST.MF founded into the ClassPath. The key map + * is the baseDir of the URI of the MANIFEST.MF file. * * @param cl * @return @@ -95,8 +95,7 @@ public static Enumeration getPluginXMLs(ClassLoader cl) { * @param resourcePath * @return */ - private static Enumeration getResources(ClassLoader cl, - String resourcePath) { + private static Enumeration getResources(ClassLoader cl, String resourcePath) { try { return cl == null ? ClassLoader.getSystemResources(resourcePath) : cl.getResources(resourcePath); @@ -111,8 +110,7 @@ private static Enumeration getResources(ClassLoader cl, * Checks if a String is empty ("") or null. *

        * - * @param value - * the String to check, may be null + * @param value the String to check, may be null * @return true if the String is empty or null */ public static boolean isEmpty(String value) { @@ -129,13 +127,12 @@ public static boolean isEmpty(String value) { */ public static boolean isTrue(String value, boolean defaultValue) { if (value != null) - return value.equalsIgnoreCase(TRUE); //$NON-NLS-1$ + return value.equalsIgnoreCase(TRUE); // $NON-NLS-1$ return defaultValue; } /** - * Load springclrfactory.properties from OSGi fragments linked to this - * bundle.. + * Load springclrfactory.properties from OSGi fragments linked to this bundle.. * * @param cl * @return @@ -146,9 +143,9 @@ public static Properties load(ClassLoader cl) { Enumeration nonosgiregistryProperties = null; try { - nonosgiregistryProperties = cl == null ? ClassLoader - .getSystemResources(NONOSGIREGISTRY_PROPERTIES) : cl - .getResources(NONOSGIREGISTRY_PROPERTIES); + nonosgiregistryProperties = cl == null + ? ClassLoader.getSystemResources(NONOSGIREGISTRY_PROPERTIES) + : cl.getResources(NONOSGIREGISTRY_PROPERTIES); } catch (IOException e) { if (DebugHelper.DEBUG) { DebugHelper.logError(e); diff --git a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/registry/RegistryFactoryHelper.java b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/registry/RegistryFactoryHelper.java index 9b0a4f4f88..76a13ae4b4 100644 --- a/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/registry/RegistryFactoryHelper.java +++ b/ext/nonosgi/org.eclipse.equinox.nonosgi.registry/src/org/eclipse/equinox/nonosgi/registry/RegistryFactoryHelper.java @@ -41,7 +41,8 @@ public static IExtensionRegistry getRegistry() { if (OSGI_ENV == null) { OSGI_ENV = true; } - } else { + } + else { try { OSGI_ENV = false; // NONE OSGi-env, load the whole "plugin.xml" founded from the @@ -55,30 +56,31 @@ public static IExtensionRegistry getRegistry() { if (DebugHelper.DEBUG) { // Debug mode, trace if (OSGI_ENV) { - DebugHelper.log("Returns IExtensionRegistry from the OSGi-env. Thread=" + Thread.currentThread()); - } else { - DebugHelper.log("Returns IExtensionRegistry from the NO OSGi-env. Thread=" + Thread.currentThread()); + DebugHelper.log("Returns IExtensionRegistry from the OSGi-env. Thread=" + + Thread.currentThread()); + } + else { + DebugHelper.log("Returns IExtensionRegistry from the NO OSGi-env. Thread=" + + Thread.currentThread()); } } return registry; } /** - * Create No OSG-env {@link IExtensionRegistry}. This method is synchronized - * to avoid loading twice the plugin.xml files with multi Thread context. + * Create No OSG-env {@link IExtensionRegistry}. This method is synchronized to + * avoid loading twice the plugin.xml files with multi Thread context. * * @return * @throws CoreException */ - private static synchronized IExtensionRegistry createNoOSGIRegistry() - throws CoreException { + private static synchronized IExtensionRegistry createNoOSGIRegistry() throws CoreException { IExtensionRegistry registry = RegistryFactory.getRegistry(); if (registry != null) { // Registry was already created with another Thread. return registry; } - RegistryFactory - .setDefaultRegistryProvider(new RegistryProviderNonOSGI()); + RegistryFactory.setDefaultRegistryProvider(new RegistryProviderNonOSGI()); return RegistryFactory.getRegistry(); } } diff --git a/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/src/eu/esdihumboldt/hale/io/codelist/skos/reader/SkosCodeList.java b/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/src/eu/esdihumboldt/hale/io/codelist/skos/reader/SkosCodeList.java index bec7737c1a..fae3c953b7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/src/eu/esdihumboldt/hale/io/codelist/skos/reader/SkosCodeList.java +++ b/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/src/eu/esdihumboldt/hale/io/codelist/skos/reader/SkosCodeList.java @@ -1,5 +1,8 @@ package eu.esdihumboldt.hale.io.codelist.skos.reader; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.codelist.CodeList; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; @@ -10,10 +13,8 @@ import java.util.Locale; import java.util.Map; import java.util.Set; - import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; - import org.semanticweb.skos.SKOSAnnotation; import org.semanticweb.skos.SKOSConcept; import org.semanticweb.skos.SKOSConceptScheme; @@ -30,10 +31,6 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.codelist.CodeList; - /** * Reads a SKOS code list and treat concepts as code entries * diff --git a/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/src/eu/esdihumboldt/hale/io/codelist/skos/reader/SkosCodeListReader.java b/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/src/eu/esdihumboldt/hale/io/codelist/skos/reader/SkosCodeListReader.java index fc3334be7d..ae356d0af5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/src/eu/esdihumboldt/hale/io/codelist/skos/reader/SkosCodeListReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/src/eu/esdihumboldt/hale/io/codelist/skos/reader/SkosCodeListReader.java @@ -1,10 +1,5 @@ package eu.esdihumboldt.hale.io.codelist.skos.reader; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.Locale; - import eu.esdihumboldt.hale.common.codelist.CodeList; import eu.esdihumboldt.hale.common.codelist.io.CodeListReader; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -13,6 +8,10 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.Locale; /** * Reads a SKOS code list from rdf file or url diff --git a/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/test/eu/esdihumboldt/hale/io/codelist/skos/test/SkosCodeListTest.java b/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/test/eu/esdihumboldt/hale/io/codelist/skos/test/SkosCodeListTest.java index 49d22dd038..06b2c3c03e 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/test/eu/esdihumboldt/hale/io/codelist/skos/test/SkosCodeListTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.codelist.skos/test/eu/esdihumboldt/hale/io/codelist/skos/test/SkosCodeListTest.java @@ -5,14 +5,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -import org.junit.Test; - import eu.esdihumboldt.hale.common.codelist.CodeList; import eu.esdihumboldt.hale.common.codelist.CodeList.CodeEntry; import eu.esdihumboldt.hale.common.codelist.io.CodeListReader; @@ -20,6 +12,12 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; import eu.esdihumboldt.hale.io.codelist.skos.reader.SkosCodeListReader; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import org.junit.Test; /** * @@ -170,8 +168,8 @@ public void testSKOSFromRDF4_language_en() throws Exception { /** * - * test read SKOS properties in preferred language, as "de" not available, - * it will load "en" by default + * test read SKOS properties in preferred language, as "de" not available, it + * will load "en" by default * * @throws Exception throws exception if something wrong occurs */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/InspireCodeListAdvisor.java b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/InspireCodeListAdvisor.java index df53818c27..3acd66e632 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/InspireCodeListAdvisor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/InspireCodeListAdvisor.java @@ -15,12 +15,15 @@ package eu.esdihumboldt.hale.io.codelist; +import eu.esdihumboldt.hale.common.core.io.impl.DefaultResourceAdvisor; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import eu.esdihumboldt.hale.io.codelist.inspire.reader.INSPIRECodeListReader; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; - import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.StatusLine; @@ -30,11 +33,6 @@ import org.apache.http.client.fluent.Response; import org.eclipse.core.runtime.content.IContentType; -import eu.esdihumboldt.hale.common.core.io.impl.DefaultResourceAdvisor; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; -import eu.esdihumboldt.hale.io.codelist.inspire.reader.INSPIRECodeListReader; - /** * Advisor for the inspire code list content type * @@ -44,8 +42,8 @@ public class InspireCodeListAdvisor extends DefaultResourceAdvisor { @Override public void copyResource(LocatableInputSupplier resource, - final Path target, IContentType resourceType, boolean includeRemote, IOReporter reporter) - throws IOException { + final Path target, IContentType resourceType, boolean includeRemote, + IOReporter reporter) throws IOException { URI uri = resource.getLocation(); String uriScheme = uri.getScheme(); @@ -63,8 +61,8 @@ public Boolean handleResponse(HttpResponse response) HttpEntity entity = response.getEntity(); if (status.getStatusCode() >= 300) { - throw new HttpResponseException(status.getStatusCode(), status - .getReasonPhrase()); + throw new HttpResponseException(status.getStatusCode(), + status.getReasonPhrase()); } if (entity == null) { throw new ClientProtocolException(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/inspire/reader/INSPIRECodeList.java b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/inspire/reader/INSPIRECodeList.java index 400a535b3c..cefb2a9b91 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/inspire/reader/INSPIRECodeList.java +++ b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/inspire/reader/INSPIRECodeList.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.io.codelist.inspire.reader; +import eu.esdihumboldt.hale.common.codelist.CodeList; import java.net.URI; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; -import eu.esdihumboldt.hale.common.codelist.CodeList; - /** * Representation of a INSPIRE code list. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/inspire/reader/INSPIRECodeListReader.java b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/inspire/reader/INSPIRECodeListReader.java index 4a5a47bd9e..9f815902c7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/inspire/reader/INSPIRECodeListReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/inspire/reader/INSPIRECodeListReader.java @@ -1,18 +1,29 @@ package eu.esdihumboldt.hale.io.codelist.inspire.reader; +import eu.esdihumboldt.hale.common.codelist.CodeList; +import eu.esdihumboldt.hale.common.codelist.CodeList.CodeEntry; +import eu.esdihumboldt.hale.common.codelist.io.CodeListReader; +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.util.http.ProxyUtil; +import eu.esdihumboldt.util.http.client.fluent.FluentProxyUtil; +import eu.esdihumboldt.util.io.InputSupplier; +import eu.esdihumboldt.util.resource.Resources; import java.io.IOException; import java.io.InputStream; import java.net.Proxy; import java.net.URI; import java.util.Locale; - import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; - import org.apache.http.HttpEntity; import org.apache.http.HttpHeaders; import org.apache.http.HttpResponse; @@ -29,20 +40,6 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import eu.esdihumboldt.hale.common.codelist.CodeList; -import eu.esdihumboldt.hale.common.codelist.CodeList.CodeEntry; -import eu.esdihumboldt.hale.common.codelist.io.CodeListReader; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.util.http.ProxyUtil; -import eu.esdihumboldt.util.http.client.fluent.FluentProxyUtil; -import eu.esdihumboldt.util.io.InputSupplier; -import eu.esdihumboldt.util.resource.Resources; - /** * Load XML code lists as provided by the INSPIRE registry. * @@ -118,8 +115,8 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) } /** - * Load an XML document via HTTP, providing headers to request proper format - * and language. + * Load an XML document via HTTP, providing headers to request proper format and + * language. * * @param loc the location * @return the XML document @@ -269,9 +266,9 @@ protected String getDefaultTypeName() { /** * This method creates a fluent request for the given URI reference resource - * location, adds header to accept application/xml content type. Sets the - * proxy if proxy is configured. Executes the fluent request and returns the - * fluent response + * location, adds header to accept application/xml content type. Sets the proxy + * if proxy is configured. Executes the fluent request and returns the fluent + * response * * @param uri uri reference of the resource location. * @return Executor, returns the executor for executing fluent request diff --git a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeList.java b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeList.java index 3c7d86a52a..598205eb3b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeList.java +++ b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeList.java @@ -16,6 +16,9 @@ package eu.esdihumboldt.hale.io.codelist.xml.reader; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.codelist.CodeList; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; @@ -24,13 +27,11 @@ import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; - import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; - import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -38,10 +39,6 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.codelist.CodeList; - /** * Reads an XML based code list * diff --git a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeListReader.java b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeListReader.java index 45b330fe11..c1dd9833b0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeListReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/src/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeListReader.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.hale.io.codelist.xml.reader; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; - import eu.esdihumboldt.hale.common.codelist.CodeList; import eu.esdihumboldt.hale.common.codelist.io.CodeListReader; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -29,6 +25,9 @@ import eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider; import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; /** * Reads a code list based on XML diff --git a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/test/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeListTest.java b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/test/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeListTest.java index b6b91b094c..83bb5c9b96 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/test/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeListTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.codelist.xml/test/eu/esdihumboldt/hale/io/codelist/xml/reader/XmlCodeListTest.java @@ -18,22 +18,20 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import eu.esdihumboldt.hale.common.codelist.CodeList; +import eu.esdihumboldt.hale.common.codelist.CodeList.CodeEntry; +import eu.esdihumboldt.hale.common.codelist.io.CodeListReader; +import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; import java.net.URI; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; - import org.junit.Test; -import eu.esdihumboldt.hale.common.codelist.CodeList; -import eu.esdihumboldt.hale.common.codelist.CodeList.CodeEntry; -import eu.esdihumboldt.hale.common.codelist.io.CodeListReader; -import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; - /** * Tests for {@link XmlCodeList}. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/InstanceTableIOConstants.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/InstanceTableIOConstants.java index cd19c2f91a..c5532c5018 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/InstanceTableIOConstants.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/InstanceTableIOConstants.java @@ -35,8 +35,8 @@ public class InstanceTableIOConstants { public static final String USE_SCHEMA = "useSchema"; /** - * Parameter for XLS import Provider to decide which Excel sheet should be - * read. Sheet indices are 0-based. + * Parameter for XLS import Provider to decide which Excel sheet should be read. + * Sheet indices are 0-based. */ public static final String SHEET_INDEX = "sheetIndex"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/PropertyTypeExtension.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/PropertyTypeExtension.java index 981ec2234a..694c06e99d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/PropertyTypeExtension.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/PropertyTypeExtension.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.hale.io.csv; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Class for the property type extension diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/TypenameParameterDescriptor.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/TypenameParameterDescriptor.java index fa514d85ea..6f663f65c7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/TypenameParameterDescriptor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/TypenameParameterDescriptor.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.io.csv; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.parameter.AbstractParameterValueDescriptor; +import javax.xml.namespace.QName; /** * Parameter value descriptor for the typename parameter. diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/propertytype/AbstractPropertyType.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/propertytype/AbstractPropertyType.java index 6e920501af..1cd62b6bd3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/propertytype/AbstractPropertyType.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/propertytype/AbstractPropertyType.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.io.csv.propertytype; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; import eu.esdihumboldt.hale.io.csv.PropertyType; +import javax.xml.namespace.QName; /** * Abstract class for property types diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/CSVConstants.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/CSVConstants.java index 44ceb31de5..4e1185e0c2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/CSVConstants.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/CSVConstants.java @@ -44,8 +44,7 @@ public interface CSVConstants { public static final String PARAM_DECIMAL = "decimal"; /** - * The separating sign for the CSV file to be read (can be '\t' or ',' or ' - * ') + * The separating sign for the CSV file to be read (can be '\t' or ',' or ' ') */ public static final char DEFAULT_SEPARATOR = '\t'; diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/DefaultCSVLookupReader.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/DefaultCSVLookupReader.java index 000825af1c..4bd650fae8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/DefaultCSVLookupReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/DefaultCSVLookupReader.java @@ -15,6 +15,8 @@ package eu.esdihumboldt.hale.io.csv.reader; +import au.com.bytecode.opencsv.CSVReader; +import eu.esdihumboldt.hale.common.core.io.Value; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -24,9 +26,6 @@ import java.util.LinkedHashMap; import java.util.Map; -import au.com.bytecode.opencsv.CSVReader; -import eu.esdihumboldt.hale.common.core.io.Value; - /** * Default lookup table reader for csv files * @@ -35,8 +34,8 @@ public class DefaultCSVLookupReader { /** - * Reads a csv lookup table file. The selected columns specified by - * parameters keyColumn and valueColumn are mapped together. + * Reads a csv lookup table file. The selected columns specified by parameters + * keyColumn and valueColumn are mapped together. * * @param input the inputstream of the csv file * @param charset specific charset of the csv file diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVInstanceCollection.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVInstanceCollection.java index 6f293ed622..284b2e9147 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVInstanceCollection.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVInstanceCollection.java @@ -15,24 +15,6 @@ package eu.esdihumboldt.hale.io.csv.reader.internal; -import java.io.IOException; -import java.text.DateFormat; -import java.text.MessageFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import java.time.format.FormatStyle; -import java.util.Collections; -import java.util.Date; -import java.util.Map; -import java.util.NoSuchElementException; - -import javax.xml.namespace.QName; - -import org.springframework.core.convert.ConversionService; - import au.com.bytecode.opencsv.CSVReader; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; @@ -51,6 +33,21 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.io.csv.reader.CommonSchemaConstants; +import java.io.IOException; +import java.text.DateFormat; +import java.text.MessageFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.Collections; +import java.util.Date; +import java.util.Map; +import java.util.NoSuchElementException; +import javax.xml.namespace.QName; +import org.springframework.core.convert.ConversionService; /** * Instance collection based on a CSV file/stream. diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVInstanceReader.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVInstanceReader.java index 1c6536a39a..229899313d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVInstanceReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVInstanceReader.java @@ -16,8 +16,6 @@ package eu.esdihumboldt.hale.io.csv.reader.internal; -import java.io.IOException; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -29,6 +27,7 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.io.csv.CSVFileIO; import eu.esdihumboldt.hale.io.csv.reader.CSVConstants; +import java.io.IOException; /** * Reads instances from a CSVfile diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVLookupReader.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVLookupReader.java index e5df3a1a77..cd4001e1be 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVLookupReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVLookupReader.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.io.csv.reader.internal; -import java.io.IOException; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; @@ -29,6 +26,8 @@ import eu.esdihumboldt.hale.common.lookup.impl.LookupTableInfoImpl; import eu.esdihumboldt.hale.io.csv.reader.DefaultCSVLookupReader; import eu.esdihumboldt.hale.io.csv.writer.LookupTableExportConstants; +import java.io.IOException; +import java.util.Map; /** * The csv lookup reader class @@ -72,11 +71,11 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) int keyColumn = getParameter(LookupTableExportConstants.LOOKUP_KEY_COLUMN) .as(Integer.class); - int valueColumn = getParameter(LookupTableExportConstants.LOOKUP_VALUE_COLUMN).as( - Integer.class); + int valueColumn = getParameter(LookupTableExportConstants.LOOKUP_VALUE_COLUMN) + .as(Integer.class); - boolean skipFirst = getParameter(LookupTableExportConstants.PARAM_SKIP_FIRST_LINE).as( - Boolean.class); + boolean skipFirst = getParameter(LookupTableExportConstants.PARAM_SKIP_FIRST_LINE) + .as(Boolean.class); DefaultCSVLookupReader reader = new DefaultCSVLookupReader(); Map values = reader.read(getSource().getInput(), getCharset(), diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVSchemaReader.java index cf71c2c182..4bf550cf7a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVSchemaReader.java @@ -15,11 +15,6 @@ */ package eu.esdihumboldt.hale.io.csv.reader.internal; -import java.io.IOException; -import java.util.Arrays; - -import javax.xml.namespace.QName; - import au.com.bytecode.opencsv.CSVReader; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -41,6 +36,9 @@ import eu.esdihumboldt.hale.io.csv.PropertyTypeExtension; import eu.esdihumboldt.hale.io.csv.reader.CSVConstants; import eu.esdihumboldt.hale.io.csv.reader.CommonSchemaConstants; +import java.io.IOException; +import java.util.Arrays; +import javax.xml.namespace.QName; /** * Reads a schema from a CSV file. diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVUtil.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVUtil.java index 8d8ecf6af0..389cf06fb1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/reader/internal/CSVUtil.java @@ -16,16 +16,15 @@ package eu.esdihumboldt.hale.io.csv.reader.internal; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; - import au.com.bytecode.opencsv.CSVParser; import au.com.bytecode.opencsv.CSVReader; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.ImportProvider; import eu.esdihumboldt.hale.io.csv.reader.CSVConstants; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; /** * Utils for the CSVSchemaReader and CSVInstanceReader @@ -48,13 +47,13 @@ public static CSVReader readFirst(ImportProvider provider) throws IOException { } /** - * This method reads/retrieves just one line, either the first after the - * header or the first line after skipping "skipLines". + * This method reads/retrieves just one line, either the first after the header + * or the first line after skipping "skipLines". * * @param provider to get the parameters from * @param skipLines how many lines have to be skipped - * @return a reader containing the first line after (no. of lines - - * skipLines) of the CSV file + * @return a reader containing the first line after (no. of lines - skipLines) + * of the CSV file * @throws IOException */ public static CSVReader readFirst(ImportProvider provider, int skipLines) throws IOException { diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/AbstractAlignmentMappingExport.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/AbstractAlignmentMappingExport.java index 5d6d1cf640..75fe951bb9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/AbstractAlignmentMappingExport.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/AbstractAlignmentMappingExport.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.io.csv.writer; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition; import eu.esdihumboldt.hale.common.align.extension.function.FunctionUtil; import eu.esdihumboldt.hale.common.align.io.impl.AbstractAlignmentWriter; @@ -37,6 +30,12 @@ import eu.esdihumboldt.hale.common.instance.extension.filter.FilterDefinitionManager; import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * Wrapper for all information of the alignment (mapping) saved in a list of @@ -44,8 +43,8 @@ * * @author Patrick Lieb */ -public abstract class AbstractAlignmentMappingExport extends AbstractAlignmentWriter implements - MappingTableConstants { +public abstract class AbstractAlignmentMappingExport extends AbstractAlignmentWriter + implements MappingTableConstants { private Cell currentTypeCell; private boolean includeNamespaces = false; @@ -69,8 +68,8 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) cellTypes = new ArrayList(); includeNamespaces = getParameter(INCLUDE_NAMESPACES).as(Boolean.class); - transformationAndDisabledMode = getParameter(TRANSFORMATION_AND_DISABLED_FOR).as( - Boolean.class); + transformationAndDisabledMode = getParameter(TRANSFORMATION_AND_DISABLED_FOR) + .as(Boolean.class); // disable namespace and transformationAndDisable columns if necessary for (CellType type : CellType.values()) { if (includeNamespaces @@ -265,13 +264,13 @@ private void addCellData(Cell cell) { if (child != null) { // column source properties - cellInfos.get(CellType.SOURCE_PROPERTIES).addText( - child.getName().getLocalPart(), position); + cellInfos.get(CellType.SOURCE_PROPERTIES) + .addText(child.getName().getLocalPart(), position); if (includeNamespaces) // column source properties namespace - cellInfos.get(CellType.SOURCE_PROPERTIES_NAMESPACE).addText( - child.getName().getNamespaceURI(), position); + cellInfos.get(CellType.SOURCE_PROPERTIES_NAMESPACE) + .addText(child.getName().getNamespaceURI(), position); Filter contextFilter; if (childContext.getCondition() != null) { @@ -299,8 +298,8 @@ private void addCellData(Cell cell) { int position = 0; for (Entity entity : cell.getTarget().values()) { // column target type - cellInfos.get(CellType.TARGET_TYPE).addText( - entity.getDefinition().getType().getDisplayName(), position); + cellInfos.get(CellType.TARGET_TYPE) + .addText(entity.getDefinition().getType().getDisplayName(), position); if (includeNamespaces) // column target type namespace @@ -311,13 +310,13 @@ private void addCellData(Cell cell) { PropertyDefinition child = childContext.getChild().asProperty(); if (child != null) { // column target properties - cellInfos.get(CellType.TARGET_PROPERTIES).addText( - child.getName().getLocalPart(), position); + cellInfos.get(CellType.TARGET_PROPERTIES) + .addText(child.getName().getLocalPart(), position); if (includeNamespaces) // column target properties namespace - cellInfos.get(CellType.TARGET_PROPERTIES_NAMESPACE).addText( - child.getName().getNamespaceURI(), position); + cellInfos.get(CellType.TARGET_PROPERTIES_NAMESPACE) + .addText(child.getName().getNamespaceURI(), position); // add dummy to adapt position of target type cellInfos.get(CellType.TARGET_TYPE).addText("", position); @@ -329,8 +328,8 @@ private void addCellData(Cell cell) { } } - FunctionDefinition function = FunctionUtil.getFunction( - cell.getTransformationIdentifier(), getServiceProvider()); + FunctionDefinition function = FunctionUtil + .getFunction(cell.getTransformationIdentifier(), getServiceProvider()); if (function != null) { // column relation name @@ -339,8 +338,8 @@ private void addCellData(Cell cell) { // column cell explanation CellExplanation cellExpl = function.getExplanation(); if (cellExpl != null) { - cellInfos.get(CellType.CELL_EXPLANATION).addText( - function.getExplanation().getExplanation(cell, null), 0); + cellInfos.get(CellType.CELL_EXPLANATION) + .addText(function.getExplanation().getExplanation(cell, null), 0); } } @@ -368,8 +367,8 @@ private void addCellData(Cell cell) { if (transformationAndDisabledMode) { if (AlignmentUtil.isTypeCell(cell)) { currentTypeCell = cell; - cellInfos.get(CellType.TRANSFORMATION_AND_DISABLED).addText( - cell.getTransformationMode().displayName(), 0); + cellInfos.get(CellType.TRANSFORMATION_AND_DISABLED) + .addText(cell.getTransformationMode().displayName(), 0); } else { Set disabledCells = cell.getDisabledFor(); @@ -386,8 +385,7 @@ private void addCellData(Cell cell) { } /** - * @return if the writer mode is configured to display the cells per type - * cell + * @return if the writer mode is configured to display the cells per type cell */ protected boolean isByTypeCell() { String mode = getParameter(PARAMETER_MODE).as(String.class); diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/AbstractTableInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/AbstractTableInstanceWriter.java index 3340112a4e..4d830728b7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/AbstractTableInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/AbstractTableInstanceWriter.java @@ -15,16 +15,6 @@ package eu.esdihumboldt.hale.io.csv.writer; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryCollection; - import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; import eu.esdihumboldt.hale.common.instance.io.impl.AbstractInstanceWriter; import eu.esdihumboldt.hale.common.instance.model.Group; @@ -35,6 +25,13 @@ import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryCollection; /** * Default instance export provider for table files (xls and csv) @@ -57,11 +54,11 @@ public boolean isCancelable() { * * @param instance the Instance to check * @param headerRow the current header row of the table - * @param solveNestedProperties true if nested properties - * should be solved, otherwise false - * @param useSchema true if properties should be defined from - * the schema, otherwise false and properties are - * defined from the Instances + * @param solveNestedProperties true if nested properties should be + * solved, otherwise false + * @param useSchema true if properties should be defined from the + * schema, otherwise false and properties are defined + * from the Instances * @param reporter IOReporter * @return a map of properties with string of localpart of the QName of the * property as key @@ -265,8 +262,7 @@ private void checkValue(Group group, List headerRow, Map * Call this to get an instance collection based on the selected Type * * @param typeName the QName of the typeDefinition - * @return The instance collection for the given type, can be empty - * collection + * @return The instance collection for the given type, can be empty collection */ protected InstanceCollection getInstanceCollection(QName typeName) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/CellInformation.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/CellInformation.java index 96469ab66c..715933fa99 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/CellInformation.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/CellInformation.java @@ -46,8 +46,8 @@ public List getText() { } /** - * The position list belongs to the text list. Each entry in the position - * list is corresponding to the entry in the text list at the same position. + * The position list belongs to the text list. Each entry in the position list + * is corresponding to the entry in the text list at the same position. * * @return the hierarchy levels */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/LookupTableExportConstants.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/LookupTableExportConstants.java index f07006c16b..fe49435701 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/LookupTableExportConstants.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/LookupTableExportConstants.java @@ -38,8 +38,8 @@ public interface LookupTableExportConstants { public static final String PARAM_SKIP_FIRST_LINE = "skip"; /** - * Name of the parameter specifying whether empty strings should be ignored - * and treated as null + * Name of the parameter specifying whether empty strings should be ignored and + * treated as null */ public static final String PARAM_IGNORE_EMPTY_STRING = "ignoreEmptyStrings"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVAlignmentMappingWriter.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVAlignmentMappingWriter.java index edb8a7aef2..62225c15a3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVAlignmentMappingWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVAlignmentMappingWriter.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.io.csv.writer.internal; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.util.List; -import java.util.Map; - import au.com.bytecode.opencsv.CSVWriter; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -28,6 +23,10 @@ import eu.esdihumboldt.hale.io.csv.writer.AbstractAlignmentMappingExport; import eu.esdihumboldt.hale.io.csv.writer.CellInformation; import eu.esdihumboldt.hale.io.csv.writer.CellType; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.util.List; +import java.util.Map; /** * Provider to write the alignment to a csv file diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVInstanceWriter.java index 27f6b07f9e..4d94660f78 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVInstanceWriter.java @@ -15,6 +15,20 @@ package eu.esdihumboldt.hale.io.csv.writer.internal; +import au.com.bytecode.opencsv.CSVWriter; +import com.google.common.io.Files; +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.csv.InstanceTableIOConstants; +import eu.esdihumboldt.hale.io.csv.reader.internal.CSVUtil; +import eu.esdihumboldt.hale.io.csv.writer.AbstractTableInstanceWriter; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -32,27 +46,9 @@ import java.util.List; import java.util.Map; import java.util.NoSuchElementException; - import javax.xml.namespace.QName; - import org.apache.commons.io.FileUtils; -import com.google.common.io.Files; - -import au.com.bytecode.opencsv.CSVWriter; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; -import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.csv.InstanceTableIOConstants; -import eu.esdihumboldt.hale.io.csv.reader.internal.CSVUtil; -import eu.esdihumboldt.hale.io.csv.writer.AbstractTableInstanceWriter; - /** * Provider for exporting instances as csv files * diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVLookupWriter.java b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVLookupWriter.java index 7148711e99..4cafff3167 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVLookupWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/src/eu/esdihumboldt/hale/io/csv/writer/internal/CSVLookupWriter.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.io.csv.writer.internal; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.util.Map; - import au.com.bytecode.opencsv.CSVWriter; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -28,6 +24,9 @@ import eu.esdihumboldt.hale.common.lookup.impl.AbstractLookupExport; import eu.esdihumboldt.hale.io.csv.reader.internal.CSVUtil; import eu.esdihumboldt.hale.io.csv.writer.LookupTableExportConstants; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.util.Map; /** * Writer to export lookup tables as csv files @@ -52,10 +51,10 @@ public boolean isCancelable() { protected IOReport execute(ProgressIndicator progress, IOReporter reporter) throws IOProviderConfigurationException, IOException { - String sourceColumn = getParameter(LookupTableExportConstants.PARAM_SOURCE_COLUMN).as( - String.class); - String targetColumn = getParameter(LookupTableExportConstants.PARAM_TARGET_COLUMN).as( - String.class); + String sourceColumn = getParameter(LookupTableExportConstants.PARAM_SOURCE_COLUMN) + .as(String.class); + String targetColumn = getParameter(LookupTableExportConstants.PARAM_TARGET_COLUMN) + .as(String.class); CSVWriter writer = new CSVWriter(new OutputStreamWriter(getTarget().getOutput()), CSVUtil.getSep(this), CSVUtil.getQuote(this), CSVUtil.getEscape(this)); diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/CSVInstanceReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/CSVInstanceReaderTest.java index f15677399f..29b7dcf54b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/CSVInstanceReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/CSVInstanceReaderTest.java @@ -19,17 +19,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; - -import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.BeforeClass; -import org.junit.Test; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -46,6 +35,14 @@ import eu.esdihumboldt.hale.io.csv.reader.CommonSchemaConstants; import eu.esdihumboldt.hale.io.csv.reader.internal.CSVInstanceReader; import eu.esdihumboldt.hale.io.csv.reader.internal.CSVSchemaReader; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Iterator; +import javax.xml.namespace.QName; +import org.junit.BeforeClass; +import org.junit.Test; /** * Test class for {@link CSVInstanceReader} @@ -122,8 +119,8 @@ public void testReadSimple() throws Exception { /** * Test - read a sample csv schema and data where skip is a boolean. It - * simulates the previous version where the first line was either skipped - * (true) or not (false) + * simulates the previous version where the first line was either skipped (true) + * or not (false) * * @throws Exception , if an error occurs */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/CSVSchemaReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/CSVSchemaReaderTest.java index 8026e670e5..4ad6316a44 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/CSVSchemaReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/CSVSchemaReaderTest.java @@ -20,12 +20,6 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import java.util.Iterator; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.BeforeClass; -import org.junit.Test; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -36,6 +30,10 @@ import eu.esdihumboldt.hale.common.test.TestUtil; import eu.esdihumboldt.hale.io.csv.reader.CommonSchemaConstants; import eu.esdihumboldt.hale.io.csv.reader.internal.CSVSchemaReader; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.util.Iterator; +import org.junit.BeforeClass; +import org.junit.Test; /** * Test Class for CSVSchemaReader @@ -102,8 +100,7 @@ public void testRead() throws Exception { } /** - * Test for no given property names and property types (using default - * settings) + * Test for no given property names and property types (using default settings) * * @throws Exception the Exception thrown if the test fails */ @@ -211,9 +208,9 @@ public void testRead4() throws Exception { } /** - * Test for no given property names and only 2 (of 4) given property types - * (if there are not given 0 or maximum, in this case 4, property types we - * expect an error) + * Test for no given property names and only 2 (of 4) given property types (if + * there are not given 0 or maximum, in this case 4, property types we expect an + * error) * * @throws Exception the Exception thrown if the test fails */ @@ -238,8 +235,7 @@ public void failTest() throws Exception { } /** - * Test for no given type name. So we expect the reporter not to be - * successful. + * Test for no given type name. So we expect the reporter not to be successful. * * @throws Exception the Exception thrown if the test fails */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/writer/CSVInstanceWriterTest.java b/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/writer/CSVInstanceWriterTest.java index 43f1d85173..1d016062ac 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/writer/CSVInstanceWriterTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.csv/test/eu/esdihumboldt/hale/io/csv/writer/CSVInstanceWriterTest.java @@ -18,25 +18,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.eclipse.core.runtime.content.IContentType; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - import au.com.bytecode.opencsv.CSVReader; import eu.esdihumboldt.cst.test.TransformationExample; import eu.esdihumboldt.cst.test.TransformationExamples; @@ -53,6 +34,22 @@ import eu.esdihumboldt.hale.io.csv.InstanceTableIOConstants; import eu.esdihumboldt.hale.io.csv.reader.internal.CSVSchemaReader; import eu.esdihumboldt.hale.io.csv.writer.internal.CSVInstanceWriter; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Iterator; +import java.util.List; +import javax.xml.namespace.QName; +import org.eclipse.core.runtime.content.IContentType; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; /** * Test class for {@link CSVInstanceWriter} @@ -173,9 +170,9 @@ private void testWriteSimpleSchemaFromReader(CSVReader reader) throws IOExceptio } /** - * Test - write simple data, without nested properties and useSchema=true - - * test if order/number of column persisted from original schema when in the - * instance an attribute has no values + * Test - write simple data, without nested properties and useSchema=true - test + * if order/number of column persisted from original schema when in the instance + * an attribute has no values * * @throws Exception , if an error occurs */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingAlignmentWriter.java b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingAlignmentWriter.java index de4dfe422c..10ae0560bc 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingAlignmentWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingAlignmentWriter.java @@ -15,16 +15,6 @@ package eu.esdihumboldt.hale.io.deegree.mapping; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.nio.charset.StandardCharsets; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -import org.eclipse.core.runtime.content.IContentType; - import eu.esdihumboldt.hale.common.align.io.impl.AbstractAlignmentWriter; import eu.esdihumboldt.hale.common.config.ProviderConfig; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -36,6 +26,14 @@ import eu.esdihumboldt.hale.io.deegree.mapping.config.GenericMappingConfiguration; import eu.esdihumboldt.util.config.ConfigYaml; import eu.esdihumboldt.util.io.EntryOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; +import org.eclipse.core.runtime.content.IContentType; /** * Creates a deegree SQL mapping configuration from a schema. diff --git a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingHelper.groovy b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingHelper.groovy index b6f68da458..9f323f0ceb 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingHelper.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingHelper.groovy @@ -15,6 +15,9 @@ package eu.esdihumboldt.hale.io.deegree.mapping +import eu.esdihumboldt.hale.io.deegree.mapping.config.MappingConfiguration +import eu.esdihumboldt.hale.io.deegree.mapping.config.MappingMode +import groovy.transform.CompileStatic import org.deegree.feature.persistence.sql.GeometryStorageParams import org.deegree.feature.persistence.sql.MappedAppSchema import org.deegree.feature.persistence.sql.mapper.AppSchemaMapper @@ -22,10 +25,6 @@ import org.deegree.feature.types.AppSchema import org.deegree.gml.schema.GMLAppSchemaReader import org.deegree.sqldialect.SQLDialect -import eu.esdihumboldt.hale.io.deegree.mapping.config.MappingConfiguration -import eu.esdihumboldt.hale.io.deegree.mapping.config.MappingMode -import groovy.transform.CompileStatic - /** * Helper class to generate DDL and deegree FeatureStore configuration files based on GML schema. */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingSchemaWriter.java b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingSchemaWriter.java index 26226749fe..40362aaf6a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingSchemaWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingSchemaWriter.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.io.deegree.mapping; -import java.io.IOException; -import java.net.URI; - import eu.esdihumboldt.hale.common.config.ProviderConfig; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -28,6 +25,8 @@ import eu.esdihumboldt.hale.common.schema.io.impl.AbstractSchemaWriter; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.io.deegree.mapping.config.GenericMappingConfiguration; +import java.io.IOException; +import java.net.URI; /** * Creates a deegree SQL mapping configuration from a schema. diff --git a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingWriter.java b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingWriter.java index f37faa93a3..192b84f628 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/MappingWriter.java @@ -18,32 +18,6 @@ import static eu.esdihumboldt.hale.io.deegree.mapping.MappingHelper.mapApplicationSchema; import static eu.esdihumboldt.hale.io.deegree.mapping.MappingHelper.readApplicationSchema; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; - -import javax.annotation.Nullable; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamWriter; - -import org.deegree.commons.xml.stax.IndentingXMLStreamWriter; -import org.deegree.feature.persistence.sql.FeatureTypeMapping; -import org.deegree.feature.persistence.sql.MappedAppSchema; -import org.deegree.feature.persistence.sql.config.SQLFeatureStoreConfigWriter; -import org.deegree.feature.persistence.sql.ddl.DDLCreator; -import org.deegree.feature.types.AppSchema; -import org.deegree.feature.types.FeatureType; - import eu.esdihumboldt.hale.common.align.helper.EntityFinder; import eu.esdihumboldt.hale.common.align.model.Alignment; import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; @@ -68,6 +42,29 @@ import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.annotation.Nullable; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; +import org.deegree.commons.xml.stax.IndentingXMLStreamWriter; +import org.deegree.feature.persistence.sql.FeatureTypeMapping; +import org.deegree.feature.persistence.sql.MappedAppSchema; +import org.deegree.feature.persistence.sql.config.SQLFeatureStoreConfigWriter; +import org.deegree.feature.persistence.sql.ddl.DDLCreator; +import org.deegree.feature.types.AppSchema; +import org.deegree.feature.types.FeatureType; /** * Writer for deegree feature mappings based on hale schema and alignment. @@ -152,8 +149,8 @@ public void saveConfig(OutputStream out) throws Exception { * * Note that deegree seems to only support properties to be named here, that * have an XLink attribute group. Also, it is not possible to specify the - * relation to a feature type, or the nesting within a type, which means - * they apply for any feature type and at any level. + * relation to a feature type, or the nesting within a type, which means they + * apply for any feature type and at any level. * * @return the list of qualified names of properties */ @@ -396,8 +393,8 @@ protected Set getTargetTypes() { } /** - * Determine if a hale type definition and a deegree feature type represent - * the same type. + * Determine if a hale type definition and a deegree feature type represent the + * same type. * * @param t1 the hale type definition * @param t2 the deegree feature type diff --git a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/config/GenericMappingConfiguration.java b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/config/GenericMappingConfiguration.java index 0d775a6b34..d8de812a6f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/config/GenericMappingConfiguration.java +++ b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/config/GenericMappingConfiguration.java @@ -15,8 +15,8 @@ package eu.esdihumboldt.hale.io.deegree.mapping.config; +import eu.esdihumboldt.util.config.Config; import java.util.Optional; - import org.deegree.cs.coordinatesystems.ICRS; import org.deegree.cs.persistence.CRSManager; import org.deegree.feature.persistence.sql.GeometryStorageParams; @@ -24,8 +24,6 @@ import org.deegree.sqldialect.SQLDialect; import org.deegree.sqldialect.postgis.PostGISDialect; -import eu.esdihumboldt.util.config.Config; - /** * Mapping configuration based on a generic configuration object. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/config/MappingConfiguration.java b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/config/MappingConfiguration.java index 8f84b21ebf..ccf1d9daeb 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/config/MappingConfiguration.java +++ b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/config/MappingConfiguration.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.io.deegree.mapping.config; import java.util.Optional; - import org.deegree.feature.persistence.sql.GeometryStorageParams; import org.deegree.sqldialect.SQLDialect; @@ -35,8 +34,8 @@ public interface MappingConfiguration { MappingMode getMode(); /** - * Get the mode for generating ID prefixes that should be used (for - * relational mapping). + * Get the mode for generating ID prefixes that should be used (for relational + * mapping). * * @return the mode for generating ID prefixes */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/model/AppSchemaDecorator.java b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/model/AppSchemaDecorator.java index 78294b19c2..e0f3b224cd 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/model/AppSchemaDecorator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/model/AppSchemaDecorator.java @@ -18,9 +18,7 @@ import java.util.List; import java.util.Map; import java.util.Set; - import javax.xml.namespace.QName; - import org.deegree.commons.tom.gml.GMLObjectCategory; import org.deegree.commons.tom.gml.GMLObjectType; import org.deegree.commons.tom.gml.property.PropertyType; diff --git a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/model/MappedAppSchemaCopy.java b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/model/MappedAppSchemaCopy.java index 92bd465b9a..fc0466f975 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/model/MappedAppSchemaCopy.java +++ b/io/plugins/eu.esdihumboldt.hale.io.deegree/src/eu/esdihumboldt/hale/io/deegree/mapping/model/MappedAppSchemaCopy.java @@ -18,7 +18,6 @@ import java.util.List; import java.util.function.Function; import java.util.stream.Stream; - import org.deegree.feature.persistence.sql.FeatureTypeMapping; import org.deegree.feature.persistence.sql.MappedAppSchema; import org.deegree.feature.types.FeatureType; @@ -48,8 +47,8 @@ public MappedAppSchemaCopy(MappedAppSchema ms) { } /** - * Creates a copy of a {@link MappedAppSchema} where all feature type - * mappings can be adapted. + * Creates a copy of a {@link MappedAppSchema} where all feature type mappings + * can be adapted. * * @param ms the original mapped schema * @param adaptMappings the function to adapt the mappings @@ -65,13 +64,13 @@ public MappedAppSchemaCopy(MappedAppSchema ms, } /** - * Creates a copy of a {@link MappedAppSchema} where all feature type - * mappings can be adapted. + * Creates a copy of a {@link MappedAppSchema} where all feature type mappings + * can be adapted. * * @param ms the original mapped schema * @param adaptMappings the function to adapt the mappings - * @param includeFeatureCollections whether to include feature collections - * in the mapping + * @param includeFeatureCollections whether to include feature collections in + * the mapping * @param includeAbstracts whether to include abstract types in the mapping */ public MappedAppSchemaCopy(MappedAppSchema ms, diff --git a/io/plugins/eu.esdihumboldt.hale.io.deegree/test/eu/esdihumboldt/hale/io/deegree/mapping/MappingWriterTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.deegree/test/eu/esdihumboldt/hale/io/deegree/mapping/MappingWriterTest.groovy index b00d112a36..10322e9957 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.deegree/test/eu/esdihumboldt/hale/io/deegree/mapping/MappingWriterTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.deegree/test/eu/esdihumboldt/hale/io/deegree/mapping/MappingWriterTest.groovy @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.io.deegree.mapping -import org.junit.Ignore -import org.junit.Test - import eu.esdihumboldt.hale.common.align.model.Alignment import eu.esdihumboldt.hale.common.core.report.SimpleLog import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchema import eu.esdihumboldt.hale.io.deegree.mapping.config.GenericMappingConfiguration import eu.esdihumboldt.util.config.Config +import org.junit.Ignore +import org.junit.Test /** * Tests for MappingWriter class. diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceReader.java b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceReader.java index c3a8b25e16..2a8d1691f2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceReader.java @@ -15,19 +15,6 @@ package eu.esdihumboldt.hale.io.geopackage; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.springframework.util.StringUtils; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -39,11 +26,21 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; import eu.esdihumboldt.hale.io.geopackage.internal.GeopackageFeatureCollection; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import javax.xml.namespace.QName; import mil.nga.geopackage.GeoPackage; import mil.nga.geopackage.attributes.AttributesDao; import mil.nga.geopackage.features.columns.GeometryColumns; import mil.nga.geopackage.features.user.FeatureDao; import mil.nga.geopackage.manager.GeoPackageManager; +import org.springframework.util.StringUtils; /** * Instance reader for {@link GeoPackage} files. diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceWriter.java index d21b4cc091..ed5185feb3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceWriter.java @@ -15,37 +15,6 @@ package eu.esdihumboldt.hale.io.geopackage; -import java.io.File; -import java.io.IOException; -import java.math.BigInteger; -import java.net.URI; -import java.sql.SQLException; -import java.text.MessageFormat; -import java.time.Instant; -import java.time.LocalDate; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import org.geotools.geometry.jts.JTS; -import org.geotools.referencing.CRS; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.MultiLineString; -import org.locationtech.jts.geom.MultiPoint; -import org.locationtech.jts.geom.MultiPolygon; -import org.locationtech.jts.geom.Point; -import org.locationtech.jts.geom.Polygon; -import org.locationtech.jts.io.WKBWriter; -import org.opengis.referencing.crs.CoordinateReferenceSystem; -import org.opengis.referencing.operation.MathTransform; -import org.springframework.core.convert.ConversionException; - import eu.esdihumboldt.hale.common.convert.ConversionUtil; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -72,6 +41,21 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; import eu.esdihumboldt.hale.common.schema.model.constraint.type.PrimaryKey; +import java.io.File; +import java.io.IOException; +import java.math.BigInteger; +import java.net.URI; +import java.sql.SQLException; +import java.text.MessageFormat; +import java.time.Instant; +import java.time.LocalDate; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; import mil.nga.geopackage.BoundingBox; import mil.nga.geopackage.GeoPackage; import mil.nga.geopackage.attributes.AttributesColumn; @@ -94,6 +78,19 @@ import mil.nga.geopackage.user.UserCoreRow; import mil.nga.sf.util.ByteReader; import mil.nga.sf.wkb.GeometryReader; +import org.geotools.geometry.jts.JTS; +import org.geotools.referencing.CRS; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.MultiLineString; +import org.locationtech.jts.geom.MultiPoint; +import org.locationtech.jts.geom.MultiPolygon; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; +import org.locationtech.jts.io.WKBWriter; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.operation.MathTransform; +import org.springframework.core.convert.ConversionException; /** * Writes features to a GeoPackage file. @@ -118,8 +115,8 @@ public class GeopackageInstanceWriter extends AbstractGeoInstanceWriter { public static final String DEFAULT_SPATIAL_INDEX_TYPE = "rtree"; /** - * The parameter name for the flag specifying if tables should be created - * for all mapping-relevant types, even if they're empty. Defaults to + * The parameter name for the flag specifying if tables should be created for + * all mapping-relevant types, even if they're empty. Defaults to * false. */ public static final String PARAM_CREATE_EMPTY_TABLES = "createEmptyTables"; @@ -208,10 +205,10 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) geoPackage = GeoPackageManager.open(file, true); /* - * XXX Not sure how to make a transaction work (running into - * different kinds of errors in the tests with this) Might be that - * the tables would have to be created first (with auto-commit on) - * and the transaction only used for inserting the data. + * XXX Not sure how to make a transaction work (running into different kinds of + * errors in the tests with this) Might be that the tables would have to be + * created first (with auto-commit on) and the transaction only used for + * inserting the data. */ // connection = geoPackage.getConnection().getConnection(); // connection.setAutoCommit(false); @@ -227,9 +224,8 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) * Set sortedSet = getSortedSchemas( * getTargetSchema().getMappingRelevantTypes()); * - * for (TypeDefinition td : sortedSet) { - * writeInstances(geoPackage, instances.select(new - * TypeFilter(td)), progress, reporter); } + * for (TypeDefinition td : sortedSet) { writeInstances(geoPackage, + * instances.select(new TypeFilter(td)), progress, reporter); } */ } diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaBuilder.java b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaBuilder.java index b1ffce45e2..d8f670c377 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaBuilder.java +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaBuilder.java @@ -15,23 +15,6 @@ package eu.esdihumboldt.hale.io.geopackage; -import java.net.URI; -import java.sql.SQLException; -import java.time.Instant; -import java.time.LocalDate; -import java.util.Collections; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.MultiLineString; -import org.locationtech.jts.geom.MultiPoint; -import org.locationtech.jts.geom.MultiPolygon; -import org.locationtech.jts.geom.Point; -import org.locationtech.jts.geom.Polygon; - import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import eu.esdihumboldt.hale.common.schema.model.Schema; @@ -49,6 +32,13 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchema; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; +import java.net.URI; +import java.sql.SQLException; +import java.time.Instant; +import java.time.LocalDate; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; import mil.nga.geopackage.GeoPackage; import mil.nga.geopackage.attributes.AttributesDao; import mil.nga.geopackage.core.srs.SpatialReferenceSystem; @@ -59,6 +49,13 @@ import mil.nga.geopackage.user.UserColumn; import mil.nga.geopackage.user.UserDao; import mil.nga.geopackage.user.UserTable; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.MultiLineString; +import org.locationtech.jts.geom.MultiPoint; +import org.locationtech.jts.geom.MultiPolygon; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; /** * Class that derives a hale schema from a {@link GeoPackage}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaReader.java index 0faa2d9daa..1c51bdcbe1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaReader.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.io.geopackage; -import java.io.File; -import java.io.IOException; -import java.net.URI; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.persist.AbstractCachedSchemaReader; +import java.io.File; +import java.io.IOException; +import java.net.URI; import mil.nga.geopackage.GeoPackage; import mil.nga.geopackage.manager.GeoPackageManager; diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSpatialIndexType.java b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSpatialIndexType.java index 9bd7a71690..0af0f64cad 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSpatialIndexType.java +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/GeopackageSpatialIndexType.java @@ -28,15 +28,13 @@ public enum GeopackageSpatialIndexType { /** - * RTree spatial index, see - * http://www.geopackage.org/spec121/#extension_rtree + * RTree spatial index, see http://www.geopackage.org/spec121/#extension_rtree */ RTREE("RTree Spatial Index", "rtree"), /** * NGA Geometry Index, see - * http://ngageoint.github.io/GeoPackage/docs/extensions/geometry-index. - * html + * http://ngageoint.github.io/GeoPackage/docs/extensions/geometry-index. html */ NGA("NGA Geometry Index", "nga"), diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/internal/GeopackageFeatureCollection.java b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/internal/GeopackageFeatureCollection.java index 7c29f59f2b..fa86dc2b27 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/internal/GeopackageFeatureCollection.java +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/internal/GeopackageFeatureCollection.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.io.geopackage.internal; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.util.StringUtils; - import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.instance.model.Filter; import eu.esdihumboldt.hale.common.instance.model.Instance; @@ -32,6 +28,9 @@ import mil.nga.geopackage.features.columns.GeometryColumns; import mil.nga.geopackage.user.UserDao; import mil.nga.geopackage.user.UserResultSet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; /** * Instance collection based on a GeoPackage feature table. @@ -49,11 +48,10 @@ private class FeaturesIterator implements InstanceIterator { private UserResultSet currentResults; /** - * States if the row at the current cursor position was already - * consumed. + * States if the row at the current cursor position was already consumed. * - * Initially the result set points to the row before the first row, - * which by definition is consumed. + * Initially the result set points to the row before the first row, which by + * definition is consumed. */ private boolean consumed = true; @@ -195,12 +193,10 @@ public void close() { private final SimpleLog log = SimpleLog.fromLogger(logger); /** - * Create a new instance collection for features in a GeoPackage feature - * table. + * Create a new instance collection for features in a GeoPackage feature table. * * @param features the feature DAO - * @param geometryColumns the geometry columns to derive CRS information - * from + * @param geometryColumns the geometry columns to derive CRS information from * @param type the type associated to the feature table */ public GeopackageFeatureCollection(UserDao features, @@ -213,8 +209,7 @@ public GeopackageFeatureCollection(UserDao features, * feature table. * * @param features the feature DAO - * @param geometryColumns the geometry columns to derive CRS information - * from + * @param geometryColumns the geometry columns to derive CRS information from * @param type the type associated to the feature table * @param where WHERE clause to filter table data */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/internal/TableInstanceBuilder.groovy b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/internal/TableInstanceBuilder.groovy index f8c1123184..d59225bd9b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/internal/TableInstanceBuilder.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/src/eu/esdihumboldt/hale/io/geopackage/internal/TableInstanceBuilder.groovy @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.io.geopackage.internal -import java.sql.SQLException -import java.util.function.Function - -import javax.xml.namespace.QName - -import org.locationtech.jts.io.WKBReader - import eu.esdihumboldt.hale.common.align.helper.GeometryPropertyFinder import eu.esdihumboldt.hale.common.core.report.SimpleLog import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty @@ -38,10 +31,14 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.property.NillableFlag import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryMetadata import eu.esdihumboldt.hale.io.geopackage.GeopackageSchemaBuilder import groovy.transform.CompileStatic +import java.sql.SQLException +import java.util.function.Function +import javax.xml.namespace.QName import mil.nga.geopackage.core.srs.SpatialReferenceSystem import mil.nga.geopackage.features.columns.GeometryColumns import mil.nga.geopackage.features.user.FeatureResultSet import mil.nga.geopackage.user.UserResultSet +import org.locationtech.jts.io.WKBReader /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageApiTest.java b/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageApiTest.java index 4c46db7927..de9d23beff 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageApiTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageApiTest.java @@ -24,12 +24,10 @@ import java.nio.file.StandardCopyOption; import java.util.List; import java.util.function.Consumer; - -import org.junit.Test; - import mil.nga.geopackage.GeoPackage; import mil.nga.geopackage.features.user.FeatureDao; import mil.nga.geopackage.manager.GeoPackageManager; +import org.junit.Test; /** * Tests using the Geopackage API. These are mostly intended to verify that the diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceReaderTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceReaderTest.groovy index ba650090a9..3f55a82cd7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceReaderTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceReaderTest.groovy @@ -15,18 +15,11 @@ package eu.esdihumboldt.hale.io.geopackage -import eu.esdihumboldt.util.test.AbstractPlatformTest - -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.* import static org.junit.Assert.assertEquals import static org.junit.Assert.assertNotNull import static org.junit.Assert.assertTrue -import java.util.function.Consumer - -import org.junit.Test -import org.locationtech.jts.geom.Geometry - import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator import eu.esdihumboldt.hale.common.core.io.report.IOReport import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier @@ -37,8 +30,12 @@ import eu.esdihumboldt.hale.common.instance.model.ResourceIterator import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.test.TestUtil +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import java.util.function.Consumer +import org.junit.Test +import org.locationtech.jts.geom.Geometry /** * Tests loading GeoPackage instances. @@ -264,5 +261,4 @@ class GeopackageInstanceReaderTest extends AbstractPlatformTest { .isNotNull() } as Consumer) } - } diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceWriterTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceWriterTest.groovy index 8a59eae9bd..b98461dd97 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceWriterTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageInstanceWriterTest.groovy @@ -15,23 +15,9 @@ package eu.esdihumboldt.hale.io.geopackage -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static org.junit.Assert.assertEquals import static org.junit.Assert.assertTrue -import java.nio.file.Files -import java.nio.file.Path -import java.time.Instant -import java.time.LocalDate -import java.util.function.Consumer - -import javax.xml.namespace.QName - -import org.junit.Test -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.Point - import eu.esdihumboldt.cst.functions.geometric.GeometryHelperFunctions import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator import eu.esdihumboldt.hale.common.core.io.report.IOReport @@ -46,8 +32,18 @@ import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding import eu.esdihumboldt.hale.common.schema.model.constraint.type.PrimaryKey import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.transform.CompileStatic +import java.nio.file.Files +import java.nio.file.Path +import java.time.Instant +import java.time.LocalDate +import java.util.function.Consumer +import javax.xml.namespace.QName import mil.nga.geopackage.manager.GeoPackageManager +import org.junit.Test +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.Point /** * Tests for writing instances to GeoPackage. diff --git a/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaReaderTest.java index f9773bd9be..11282889e9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.geopackage/test/eu/esdihumboldt/hale/io/geopackage/GeopackageSchemaReaderTest.java @@ -19,15 +19,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.io.IOException; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; -import java.util.stream.Collectors; - -import org.junit.Test; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -37,6 +28,13 @@ import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import java.util.stream.Collectors; +import org.junit.Test; /** * Tests loading a GeoPackage schema. diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/AbstractGeometryHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/AbstractGeometryHandler.java index 72a8661fb3..1cf51cb2bf 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/AbstractGeometryHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/AbstractGeometryHandler.java @@ -18,9 +18,7 @@ import java.util.Collections; import java.util.Set; - import javax.xml.namespace.QName; - import org.locationtech.jts.geom.GeometryFactory; /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/CRSFinder.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/CRSFinder.java index d2987e4156..14bfff98d6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/CRSFinder.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/CRSFinder.java @@ -16,16 +16,14 @@ package eu.esdihumboldt.hale.io.gml.geometry; -import javax.xml.namespace.QName; - -import org.geotools.gml2.SrsSyntax; - import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; import eu.esdihumboldt.hale.common.instance.helper.InstanceTraversalCallback; import eu.esdihumboldt.hale.common.instance.model.Group; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; +import javax.xml.namespace.QName; +import org.geotools.gml2.SrsSyntax; /** * Finds a CRS definition in a GML instance. The first valid definition found diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/FixedConstraintsGeometryHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/FixedConstraintsGeometryHandler.java index c3d4daae9f..3b35f89695 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/FixedConstraintsGeometryHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/FixedConstraintsGeometryHandler.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.io.gml.geometry; -import java.util.Collection; -import java.util.Collections; - import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import java.util.Collection; +import java.util.Collections; /** * Base class for geometry handlers that provide fixed type constraints. @@ -46,9 +45,8 @@ public Iterable getTypeConstraints(TypeDefinition type) } /** - * Check if the given type definition is supported by the geometry handler. - * This implementation assumes the type is valid. Override to change this - * behavior. + * Check if the given type definition is supported by the geometry handler. This + * implementation assumes the type is valid. Override to change this behavior. * * @param type the type definition to check * @throws GeometryNotSupportedException if the check failed diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GMLConstants.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GMLConstants.java index 84d24e78c4..0a6008e4e8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GMLConstants.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GMLConstants.java @@ -23,8 +23,8 @@ public interface GMLConstants { /** - * The core part of the GML namespace that is independent of the version - * number (and is the namespace of GML versions up to 3.1.1). + * The core part of the GML namespace that is independent of the version number + * (and is the namespace of GML versions up to 3.1.1). */ public static final String GML_NAMESPACE_CORE = "http://www.opengis.net/gml"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GMLGeometryUtil.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GMLGeometryUtil.java index 98c7192961..368cc172c4 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GMLGeometryUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GMLGeometryUtil.java @@ -16,6 +16,15 @@ package eu.esdihumboldt.hale.io.gml.geometry; +import com.google.common.base.Splitter; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.convert.ConversionUtil; +import eu.esdihumboldt.hale.common.core.io.IOProvider; +import eu.esdihumboldt.hale.common.instance.helper.BreadthFirstInstanceTraverser; +import eu.esdihumboldt.hale.common.instance.helper.PropertyResolver; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; @@ -26,23 +35,10 @@ import java.util.Iterator; import java.util.List; import java.util.Locale; - import javax.xml.namespace.QName; - -import org.springframework.core.convert.ConversionException; - -import com.google.common.base.Splitter; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.convert.ConversionUtil; -import eu.esdihumboldt.hale.common.core.io.IOProvider; -import eu.esdihumboldt.hale.common.instance.helper.BreadthFirstInstanceTraverser; -import eu.esdihumboldt.hale.common.instance.helper.PropertyResolver; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; +import org.springframework.core.convert.ConversionException; /** * Utility methods for reading GML geometries from an {@link Instance} model. @@ -218,8 +214,8 @@ private static String getAttributeValue(Instance coordinates, QName propertyName * @param directPosition the direct position instance * @return the coordinate or null if the instance contains not * direct position - * @throws GeometryNotSupportedException if no valid coordinate could be - * created from the direct position + * @throws GeometryNotSupportedException if no valid coordinate could be created + * from the direct position */ public static Coordinate parseDirectPosition(Instance directPosition) throws GeometryNotSupportedException { @@ -256,8 +252,8 @@ else if (values.size() >= 3) { * @param srsDimension the Dimension of the instance * @return the array of the coordinates or null if the instance * contains not a PosList - * @throws GeometryNotSupportedException if no valid coordinate could be - * created from the PosList + * @throws GeometryNotSupportedException if no valid coordinate could be created + * from the PosList */ public static Coordinate[] parsePosList(Instance posList, int srsDimension) throws GeometryNotSupportedException { @@ -272,14 +268,13 @@ public static Coordinate[] parsePosList(Instance posList, int srsDimension) List values = ConversionUtil.getAsList(value, Double.class, true); /* - * Filter null values that may have been created because of - * whitespace, e.g. at the end or beginning of the list. + * Filter null values that may have been created because of whitespace, e.g. at + * the end or beginning of the list. * - * XXX An alternative would be trimming the list string before - * splitting it (in SimpleTypeUtil.convertFromXml), though I am - * not sure what the behavior actually should be according to - * XML Schema (is whitespace at the beginning/end just ignored - * or not?) + * XXX An alternative would be trimming the list string before splitting it (in + * SimpleTypeUtil.convertFromXml), though I am not sure what the behavior + * actually should be according to XML Schema (is whitespace at the + * beginning/end just ignored or not?) */ values.removeAll(Collections.singleton(null)); @@ -333,8 +328,7 @@ else if (srsDimension == 3) { * * @param instance the coord instance * @return the coordinate - * @throws GeometryNotSupportedException if a valid coordinate can't be - * created + * @throws GeometryNotSupportedException if a valid coordinate can't be created */ public static Coordinate parseCoord(Instance instance) throws GeometryNotSupportedException { double x = Double.NaN; @@ -362,12 +356,11 @@ public static Coordinate parseCoord(Instance instance) throws GeometryNotSupport } /** - * Find the CRS definition to be associated with the geometry contained in - * the given instance. + * Find the CRS definition to be associated with the geometry contained in the + * given instance. * * @param instance the given instance - * @return the CRS definition or null if none could be - * identified + * @return the CRS definition or null if none could be identified */ public static CRSDefinition findCRS(Instance instance) { BreadthFirstInstanceTraverser traverser = new BreadthFirstInstanceTraverser(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/Geometries.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/Geometries.java index 801918fb41..5c30510cf4 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/Geometries.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/Geometries.java @@ -16,17 +16,8 @@ package eu.esdihumboldt.hale.io.gml.geometry; -import java.io.IOException; -import java.lang.reflect.Modifier; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -34,6 +25,12 @@ import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.util.reflection.ReflectionHelper; +import java.io.IOException; +import java.lang.reflect.Modifier; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; /** * Manages geometry handlers. diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GeometryHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GeometryHandler.java index 74d449179f..ddc49e2347 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GeometryHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/GeometryHandler.java @@ -16,10 +16,6 @@ package eu.esdihumboldt.hale.io.gml.geometry; -import java.util.Set; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; @@ -27,6 +23,8 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType; +import java.util.Set; +import javax.xml.namespace.QName; /** * Provides support for configuring geometry schema types and reading geometry @@ -46,8 +44,7 @@ public interface GeometryHandler { public Set getSupportedTypes(); /** - * Get the type constraints to associated with a geometry type definition. - *
        + * Get the type constraints to associated with a geometry type definition.
        *
        * This method should at least return the {@link Binding} and * {@link GeometryType} constraints. Usually the binding should be @@ -67,8 +64,8 @@ public Iterable getTypeConstraints(TypeDefinition type) * @param instance the instance * @param srsDimension the dimension of the instance * @param reader the I/O provider to get reader value - * @return the geometry value derived from the instance, the return type - * should match the {@link Binding} created in + * @return the geometry value derived from the instance, the return type should + * match the {@link Binding} created in * {@link #getTypeConstraints(TypeDefinition)}. * @throws GeometryNotSupportedException if the type definition doesn't * represent a geometry type supported by the handler diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/constraint/GeometryFactory.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/constraint/GeometryFactory.java index ae956b6f03..54f955bec4 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/constraint/GeometryFactory.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/constraint/GeometryFactory.java @@ -67,9 +67,9 @@ public boolean isInheritable() { * @param instance the instance * @param srsDimension the dimension of the instance * @param reader the I/O Provider to get value - * @return the geometry value derived from the instance, the return type - * should match the {@link Binding}, may be null if no - * geometry could be created or if no geometry handler is associated + * @return the geometry value derived from the instance, the return type should + * match the {@link Binding}, may be null if no geometry + * could be created or if no geometry handler is associated */ public Object createGeometry(Instance instance, int srsDimension, IOProvider reader) { if (handler == null) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcByCenterPointHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcByCenterPointHandler.java index 2b68636fd8..3c5192ba65 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcByCenterPointHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcByCenterPointHandler.java @@ -15,20 +15,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.Point; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.convert.ConversionUtil; @@ -50,6 +36,17 @@ import eu.esdihumboldt.util.geometry.interpolation.model.Angle; import eu.esdihumboldt.util.geometry.interpolation.model.Arc; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.Point; /** * Handler for Arc by center point geometries. diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcHandler.java index 6ed0af593b..5144d7309a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcHandler.java @@ -15,16 +15,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LineString; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -40,6 +30,13 @@ import eu.esdihumboldt.util.geometry.interpolation.InterpolationAlgorithm; import eu.esdihumboldt.util.geometry.interpolation.model.Arc; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByPointsImpl; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LineString; /** * Handler for Arc geometries diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcStringHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcStringHandler.java index c6d4b1a216..c7a23f297d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcStringHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/ArcStringHandler.java @@ -15,17 +15,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LineString; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -43,6 +32,14 @@ import eu.esdihumboldt.util.geometry.interpolation.model.ArcString; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByPointsImpl; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcStringImpl; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LineString; /** * Handler for ArcString geometries. diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CircleByCenterPointHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CircleByCenterPointHandler.java index 0a82d545ca..088a4a8969 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CircleByCenterPointHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CircleByCenterPointHandler.java @@ -15,20 +15,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.Point; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.convert.ConversionUtil; @@ -50,6 +36,17 @@ import eu.esdihumboldt.util.geometry.interpolation.model.Angle; import eu.esdihumboldt.util.geometry.interpolation.model.Arc; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.Point; /** * Handler for circle by center point geometries diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CircleHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CircleHandler.java index 97b15c2dc7..df8bc1e1b8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CircleHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CircleHandler.java @@ -15,16 +15,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LineString; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -42,6 +32,13 @@ import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByPointsImpl; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LineString; /** * Handler for Circle geometries. diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CurveHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CurveHandler.java index dc73f5fd2a..9590539de8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CurveHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/CurveHandler.java @@ -15,17 +15,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.LineString; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -38,6 +27,14 @@ import eu.esdihumboldt.hale.io.gml.geometry.GMLGeometryUtil; import eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory; import eu.esdihumboldt.util.geometry.CurveHelper; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.LineString; /** * Handler for building curve geometries. @@ -98,8 +95,8 @@ protected Geometry combine(LineString[] lineStrings, IOProvider reader) { if (GMLGeometryUtil.isCombineCompositesEnabled(reader) && GMLGeometryUtil.is2D(lineStrings)) { /* - * XXX Third dimension curves are not supported, because CurveHelper - * uses Coordinate.equals(...) which does only a 2D check. + * XXX Third dimension curves are not supported, because CurveHelper uses + * Coordinate.equals(...) which does only a 2D check. */ try { diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/EnvelopeHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/EnvelopeHandler.java index cfeb508648..c08f9c8e68 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/EnvelopeHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/EnvelopeHandler.java @@ -16,21 +16,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.MultiPoint; -import org.locationtech.jts.geom.Point; -import org.locationtech.jts.geom.Polygon; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; import eu.esdihumboldt.hale.common.instance.geometry.InterpolationHelper; @@ -46,6 +31,18 @@ import eu.esdihumboldt.hale.io.gml.geometry.GeometryHandler; import eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException; import eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.MultiPoint; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; /** * Handler for envelope geometries diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/GenericGeometryHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/GenericGeometryHandler.java index 2c1ee1d196..93cb858149 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/GenericGeometryHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/GenericGeometryHandler.java @@ -16,21 +16,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryCollection; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.Point; -import org.locationtech.jts.geom.Polygon; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; import eu.esdihumboldt.hale.common.instance.geometry.GeometryFinder; @@ -50,6 +35,18 @@ import eu.esdihumboldt.hale.io.gml.geometry.GeometryHandler; import eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException; import eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryCollection; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; /** * Generic geometry handler for AbstractGeometryType. @@ -181,8 +178,8 @@ static Class findClosestCommonSuperclass(Class findClosestCommonSuperclass(Class> createGeometry(Instance instance, List> childGeometries, CRSDefinition defaultCrs, IOProvider reader) - throws GeometryNotSupportedException { + throws GeometryNotSupportedException { List geomList = new ArrayList(); @@ -285,7 +282,8 @@ else if (commonGeomType.equals(Point.class)) { if (geom != null) { // returned combined property CRSDefinition crs = (commonCrs != null && commonCrs.getCrsDef() != null) - ? (commonCrs.getCrsDef()) : (defaultCrs); + ? (commonCrs.getCrsDef()) + : (defaultCrs); return Collections.> singleton( new DefaultGeometryProperty(crs, geom)); } diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/LineStringHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/LineStringHandler.java index d6b2b22a49..1f27d32a1e 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/LineStringHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/LineStringHandler.java @@ -16,20 +16,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.Point; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; import eu.esdihumboldt.hale.common.instance.geometry.InterpolationHelper; @@ -44,6 +30,17 @@ import eu.esdihumboldt.hale.io.gml.geometry.GMLGeometryUtil; import eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException; import eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.Point; /** * Handler for linestring geometries diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/LinearRingHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/LinearRingHandler.java index 81917358a9..86cfe238db 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/LinearRingHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/LinearRingHandler.java @@ -16,16 +16,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.LinearRing; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -41,6 +31,13 @@ import eu.esdihumboldt.hale.io.gml.geometry.GeometryHandler; import eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException; import eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.LinearRing; /** * Handler for linear ring geometries @@ -76,7 +73,7 @@ public Object createGeometry(Instance instance, int srsDimension, IOProvider rea */ protected GeometryProperty createGeometry(Instance instance, int srsDimension, boolean allowTryOtherDimension, IOProvider reader) - throws GeometryNotSupportedException { + throws GeometryNotSupportedException { LinearRing ring = null; LineStringHandler handler = new LineStringHandler(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/PointHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/PointHandler.java index 1b49072671..eed673b376 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/PointHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/PointHandler.java @@ -16,17 +16,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.Point; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; import eu.esdihumboldt.hale.common.instance.geometry.InterpolationHelper; @@ -43,6 +32,14 @@ import eu.esdihumboldt.hale.io.gml.geometry.GeometryHandler; import eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException; import eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Point; /** * Handler for point geometries. diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/PolygonHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/PolygonHandler.java index ed22efd7ea..f278ae9376 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/PolygonHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/PolygonHandler.java @@ -16,18 +16,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.LinearRing; -import org.locationtech.jts.geom.Polygon; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -45,6 +33,15 @@ import eu.esdihumboldt.hale.io.gml.geometry.GeometryHandler; import eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException; import eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.LinearRing; +import org.locationtech.jts.geom.Polygon; /** * Handler for polygon geometries diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/RingHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/RingHandler.java index a6f016aa39..88a4b9e20f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/RingHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/RingHandler.java @@ -16,17 +16,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LinearRing; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -42,6 +31,14 @@ import eu.esdihumboldt.hale.io.gml.geometry.GeometryHandler; import eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException; import eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LinearRing; /** * Handler for ring geometries (parsed to {@link LinearRing}s). @@ -79,7 +76,7 @@ public Object createGeometry(Instance instance, int srsDimension, IOProvider rea */ protected GeometryProperty createGeometry(Instance instance, int srsDimension, boolean allowTryOtherDimension, IOProvider reader) - throws GeometryNotSupportedException { + throws GeometryNotSupportedException { LinearRing ring = null; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/SurfaceHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/SurfaceHandler.java index cd5f7f4e78..0b8546ef19 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/SurfaceHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.geometry/src/eu/esdihumboldt/hale/io/gml/geometry/handler/SurfaceHandler.java @@ -15,17 +15,6 @@ package eu.esdihumboldt.hale.io.gml.geometry.handler; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.Polygon; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.cst.functions.geometric.extent.ExtentTransformation; @@ -41,6 +30,14 @@ import eu.esdihumboldt.hale.io.gml.geometry.FixedConstraintsGeometryHandler; import eu.esdihumboldt.hale.io.gml.geometry.GMLGeometryUtil; import eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.Polygon; /** * Handler for building surface geometries. @@ -100,8 +97,8 @@ protected Geometry combine(Polygon[] polygons, IOProvider reader) { if (GMLGeometryUtil.isCombineCompositesEnabled(reader) && GMLGeometryUtil.is2D(polygons)) { /* - * It was found that the UNION calculation as below seems to ignore - * the third dimension. So only handle 2D polygons. + * It was found that the UNION calculation as below seems to ignore the third + * dimension. So only handle 2D polygons. */ try { @@ -114,9 +111,8 @@ protected Geometry combine(Polygon[] polygons, IOProvider reader) { } else { /* - * Probably a MultiPolygon, for instance for polygons - * that only touch each other in one point or for 3D - * polygons. + * Probably a MultiPolygon, for instance for polygons that only touch each + * other in one point or for 3D polygons. */ log.debug("Could not combine surface to single polygon"); } diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/CityGMLConstants.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/CityGMLConstants.java index 53a92592ff..a0f80c3dbc 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/CityGMLConstants.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/CityGMLConstants.java @@ -23,8 +23,8 @@ public interface CityGMLConstants { /** - * The local name of the member element of the root element where city - * objects occur. + * The local name of the member element of the root element where city objects + * occur. */ public static final String CITY_OBJECT_MEMBER_ELEMENT = "cityObjectMember"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/InspireUtil.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/InspireUtil.java index 51b6b3317b..7308b2651e 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/InspireUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/InspireUtil.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.io.gml; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import javax.xml.namespace.QName; /** * Inspire GML related utilities. @@ -39,8 +38,8 @@ public static XmlElement findSpatialDataSet(XmlIndex index) { } // first try with default namespace - XmlElement result = index.getElements().get( - new QName(DEFAULT_INSPIRE_NAMESPACE_BASETYPES, ELEMENT_SPATIAL_DATASET)); + XmlElement result = index.getElements() + .get(new QName(DEFAULT_INSPIRE_NAMESPACE_BASETYPES, ELEMENT_SPATIAL_DATASET)); if (result == null) { // then try with namespace prefix diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/SimpleTypeUtil.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/SimpleTypeUtil.java index b0fd4d3542..60fe931157 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/SimpleTypeUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/SimpleTypeUtil.java @@ -16,14 +16,16 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype; +import eu.esdihumboldt.hale.common.core.HalePlatform; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; - import javax.xml.XMLConstants; - import org.apache.xmlbeans.GDate; import org.apache.xmlbeans.GDateBuilder; import org.apache.xmlbeans.XmlAnySimpleType; @@ -40,11 +42,6 @@ import org.springframework.core.convert.ConversionException; import org.springframework.core.convert.ConversionService; -import eu.esdihumboldt.hale.common.core.HalePlatform; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType; - /** * Utility methods used for simple type conversion * @@ -85,8 +82,8 @@ public class SimpleTypeUtil { * @param the type of the value * @param value the value * @param type the type definition of the simple type - * @return the string representation of the value or null if - * the value is null + * @return the string representation of the value or null if the + * value is null */ public static String convertToXml(T value, TypeDefinition type) { if (value == null) { @@ -151,14 +148,14 @@ else if (simpleTypeValue != null && simpleTypeValue instanceof XmlAnySimpleType) } /** - * Convert a string belonging to a XML simple type to the binding specified - * by the given type definition. + * Convert a string belonging to a XML simple type to the binding specified by + * the given type definition. * * @param value the string value * @param type the type definition - * @return null if the string was null, the - * converted object with the binding type if possible, otherwise the - * original string + * @return null if the string was null, the converted + * object with the binding type if possible, otherwise the original + * string */ public static Object convertFromXml(String value, TypeDefinition type) { if (value == null) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigDecimalToXmlDecimal.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigDecimalToXmlDecimal.java index 55fe904035..bebc08a498 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigDecimalToXmlDecimal.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigDecimalToXmlDecimal.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.math.BigDecimal; - import org.apache.xmlbeans.XmlDecimal; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigIntegerToXmlInteger.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigIntegerToXmlInteger.java index a01ae09aab..1f6fbec70d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigIntegerToXmlInteger.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/BigIntegerToXmlInteger.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.math.BigInteger; - import org.apache.xmlbeans.XmlInteger; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlDate.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlDate.java index 7a92ea7bb4..e093402b1a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlDate.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlDate.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.util.Date; - import org.apache.xmlbeans.XmlDate; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlDateTime.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlDateTime.java index 6b35034a40..f4ce69c544 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlDateTime.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlDateTime.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.util.Date; - import org.apache.xmlbeans.XmlDateTime; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlTime.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlTime.java index fd77f78592..f2e654122f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlTime.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/DateToXmlTime.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.util.Date; - import org.apache.xmlbeans.GDate; import org.apache.xmlbeans.XmlTime; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlDate.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlDate.java index c75870fa34..4437aeda8b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlDate.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlDate.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.util.Date; - import org.apache.xmlbeans.XmlDate; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlDateTime.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlDateTime.java index 64801f8b23..659cfec851 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlDateTime.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlDateTime.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.util.Date; - import org.apache.xmlbeans.XmlDateTime; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlTime.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlTime.java index 6ee4fbd92b..849c7ad58b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlTime.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/StringToXmlTime.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.util.Date; - import org.apache.xmlbeans.XmlTime; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateTimeToDate.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateTimeToDate.java index 4f4441dfe6..e76f976fb7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateTimeToDate.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateTimeToDate.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.util.Date; - import org.apache.xmlbeans.XmlDateTime; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateTimeToTimestamp.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateTimeToTimestamp.java index 05b49eca72..9ca65a17a4 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateTimeToTimestamp.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateTimeToTimestamp.java @@ -18,7 +18,6 @@ import java.sql.Timestamp; import java.util.Date; - import org.apache.xmlbeans.XmlDateTime; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToDate.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToDate.java index fabb6efd36..09f62cbf76 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToDate.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToDate.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.util.Date; - import org.apache.xmlbeans.XmlDate; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToSQLDate.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToSQLDate.java index ef752dbbba..eb6a5c49e8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToSQLDate.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToSQLDate.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.sql.Date; - import org.apache.xmlbeans.XmlDate; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToTimestamp.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToTimestamp.java index abc7766530..c36ad90b90 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToTimestamp.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDateToTimestamp.java @@ -18,7 +18,6 @@ import java.sql.Timestamp; import java.util.Date; - import org.apache.xmlbeans.XmlDate; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDecimalToBigDecimal.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDecimalToBigDecimal.java index c21d76f784..0d668096d6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDecimalToBigDecimal.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlDecimalToBigDecimal.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.math.BigDecimal; - import org.apache.xmlbeans.XmlDecimal; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlIntegerToBigInteger.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlIntegerToBigInteger.java index 92099fc83c..d43dc8867a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlIntegerToBigInteger.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlIntegerToBigInteger.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.math.BigInteger; - import org.apache.xmlbeans.XmlInteger; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlTimeToDate.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlTimeToDate.java index 39af2800ef..bb4374c235 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlTimeToDate.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlTimeToDate.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.internal.simpletype.converters; import java.util.Date; - import org.apache.xmlbeans.XmlTime; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlTimeToTimestamp.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlTimeToTimestamp.java index 97445d3578..939c1c7edd 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlTimeToTimestamp.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/internal/simpletype/converters/XmlTimeToTimestamp.java @@ -18,7 +18,6 @@ import java.sql.Timestamp; import java.util.Date; - import org.apache.xmlbeans.XmlTime; import org.springframework.core.convert.converter.Converter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollection.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollection.java index 338aae6c81..4cc84eacbf 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollection.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollection.java @@ -16,28 +16,6 @@ package eu.esdihumboldt.hale.io.gml.reader.internal; -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Deque; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import javax.annotation.Nullable; -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -66,6 +44,26 @@ import eu.esdihumboldt.hale.io.xsd.constraint.XmlAttributeFlag; import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Deque; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import javax.annotation.Nullable; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; /** * Instance collection based on an XML/GML input stream @@ -92,8 +90,7 @@ public class GmlInstanceIterator implements InstanceIterator { private TypeDefinition nextType; /** - * The index in the stream for the element returned next with - * {@link #next()} + * The index in the stream for the element returned next with {@link #next()} */ private int elementIndex = 0; @@ -103,8 +100,8 @@ public class GmlInstanceIterator implements InstanceIterator { private boolean rootEncountered = false; /** - * Variable for tracking current type to be able to determine types - * based on internal nested elements. + * Variable for tracking current type to be able to determine types based on + * internal nested elements. * * Uses a linked list to allow null items. */ @@ -367,15 +364,15 @@ private TypeDefinition findType(TypeDefinition parentType, QName elementName) { } /** - * Process an eventual exception / error report document. This method is - * called at the START_ELEMENT event of the root element. + * Process an eventual exception / error report document. This method is called + * at the START_ELEMENT event of the root element. * * @throws XMLStreamException if an error occurs parsing the document */ private void processExceptionReport() throws XMLStreamException { /* - * This code is very specific, handling certain cases of error - * documents that may be encountered. + * This code is very specific, handling certain cases of error documents that + * may be encountered. */ QName elementName = reader.getName(); @@ -456,8 +453,8 @@ else if (insideEvent == XMLStreamConstants.START_ELEMENT) { // WFS 1.0.0 Exception Report /* - * Seems to be returned even by some WFS 1.1/WFS 2 services and - * without proper namespace definition. + * Seems to be returned even by some WFS 1.1/WFS 2 services and without proper + * namespace definition. */ StringBuilder message = new StringBuilder( "Document is a OGC ServiceExceptionReport"); @@ -579,8 +576,8 @@ public synchronized Instance next() { } /** - * Get the type of the next instance. Must be called after - * {@link #hasNext()} but before {@link #next()} or {@link #skip()} + * Get the type of the next instance. Must be called after {@link #hasNext()} + * but before {@link #next()} or {@link #skip()} * * @return the type of the next instance */ @@ -678,16 +675,16 @@ public synchronized void close() { * * @param source the source * @param sourceSchema the source schema - * @param restrictToFeatures if only instances that are GML features shall - * be loaded + * @param restrictToFeatures if only instances that are GML features shall be + * loaded * @param ignoreRoot if the root element should be ignored for creating * instances even if it is recognized as an allowed instance type - * @param strict if associating elements with properties should be done - * strictly according to the schema, otherwise a fall-back is - * used trying to populate values also on invalid property paths - * @param ignoreNamespaces if parsing of the XML instances should allow - * types and properties with namespaces that differ from those - * defined in the schema + * @param strict if associating elements with properties should be done strictly + * according to the schema, otherwise a fall-back is used trying to + * populate values also on invalid property paths + * @param ignoreNamespaces if parsing of the XML instances should allow types + * and properties with namespaces that differ from those defined in + * the schema * @param crsProvider CRS provider in case no CRS is specified, may be * null * @param provider the I/O provider to get values diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/StreamGmlReader.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/StreamGmlReader.java index 0bc4af7784..58d7194204 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/StreamGmlReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/StreamGmlReader.java @@ -16,9 +16,6 @@ package eu.esdihumboldt.hale.io.gml.reader.internal; -import java.io.IOException; -import java.io.InputStream; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -31,6 +28,8 @@ import eu.esdihumboldt.hale.common.instance.io.impl.AbstractInstanceReader; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.io.gml.reader.internal.wfs.WfsBackedGmlInstanceCollection; +import java.io.IOException; +import java.io.InputStream; /** * Reads XML/GML from a stream @@ -41,37 +40,36 @@ public class StreamGmlReader extends AbstractInstanceReader { /** - * The name of the parameter specifying if the root element should be - * ignored and thus not be loaded as an instance. Parameter value defaults - * to true. + * The name of the parameter specifying if the root element should be ignored + * and thus not be loaded as an instance. Parameter value defaults to + * true. */ public static final String PARAM_IGNORE_ROOT = "ignoreRoot"; /** - * The name of the parameter specifying if parsing of the XML instances - * should happen strictly according to the schema or if also invalid - * property paths will be allowed. Parameter value defaults to - * false. + * The name of the parameter specifying if parsing of the XML instances should + * happen strictly according to the schema or if also invalid property paths + * will be allowed. Parameter value defaults to false. */ public static final String PARAM_STRICT = "strict"; /** - * The name of the parameter specifying if parsing of the XML instances - * should allow types and properties with namespaces that differ from those - * defined in the schema. Parameter value defaults to false. + * The name of the parameter specifying if parsing of the XML instances should + * allow types and properties with namespaces that differ from those defined in + * the schema. Parameter value defaults to false. */ public static final String PARAM_IGNORE_NAMESPACES = "ignoreNamespaces"; /** - * The name of the parameter specifying if pagination should be activated - * for WFS GetFeature requests. + * The name of the parameter specifying if pagination should be activated for + * WFS GetFeature requests. */ public static final String PARAM_PAGINATE_REQUEST = "paginateRequest"; /** * The name of the parameter specifying the maximum number of features to - * retrieve per single WFS GetFeature request. Only useful if source is a - * WFS GetFeature request URI. + * retrieve per single WFS GetFeature request. Only useful if source is a WFS + * GetFeature request URI. */ public static final String PARAM_FEATURES_PER_WFS_REQUEST = "featuresPerWfsRequest"; @@ -82,8 +80,8 @@ public class StreamGmlReader extends AbstractInstanceReader { public static final String PARAM_TMP_DIR_PATH = "tmpDirPath"; /** - * The name of the parameter specifying if hale should ignore the total - * number of features reported by the WFS. + * The name of the parameter specifying if hale should ignore the total number + * of features reported by the WFS. */ public static final String PARAM_IGNORE_NUMBER_MATCHED = "ignoreNumberMatched"; @@ -91,8 +89,8 @@ public class StreamGmlReader extends AbstractInstanceReader { * The name of the parameter specifying if the selection of mapping relevant * types for instances that are processed should be ignored. * - * Essentially if this is enabled the behavior is like if any type in the - * schema is classified as mapping relevant. + * Essentially if this is enabled the behavior is like if any type in the schema + * is classified as mapping relevant. */ public static final String PARAM_IGNORE_MAPPING_RELEVANT = "ignoreMappingRelevant"; @@ -109,8 +107,8 @@ public class StreamGmlReader extends AbstractInstanceReader { /** * Constructor * - * @param restrictToFeatures if only instances that are GML features shall - * be loaded + * @param restrictToFeatures if only instances that are GML features shall be + * loaded */ public StreamGmlReader(boolean restrictToFeatures) { super(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/GroupPath.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/GroupPath.java index d65be97e7b..1709df6c71 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/GroupPath.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/GroupPath.java @@ -20,18 +20,16 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; -import java.util.ArrayList; -import java.util.List; -import java.util.Stack; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.instance.model.MutableGroup; import eu.esdihumboldt.hale.common.instance.model.impl.DefaultGroup; import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.property.ChoiceFlag; +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; +import javax.xml.namespace.QName; /** * Represents a path of groups in two parts, the existing parent @@ -49,10 +47,9 @@ public class GroupPath { /** * Create a group path * - * @param parents the list of parent groups, may neither be - * null nor empty - * @param children the list of child definition groups, may be - * null + * @param parents the list of parent groups, may neither be null + * nor empty + * @param children the list of child definition groups, may be null */ public GroupPath(List parents, List children) { super(); @@ -80,8 +77,8 @@ public List getChildren() { /** * Create groups for the children in the path (which are only represented as - * definitions). May only be called if the path is valid. This will also - * update the path to include the groups instead of the definitions. + * definitions). May only be called if the path is valid. This will also update + * the path to include the groups instead of the definitions. * * @return the list of created groups * @@ -116,8 +113,8 @@ protected List createChildGroups() { } /** - * Determines if the group path in this configuration is valid in respect to - * the creation of new groups based on the contained definition groups. + * Determines if the group path in this configuration is valid in respect to the + * creation of new groups based on the contained definition groups. * * @return if the path is valid */ @@ -149,12 +146,12 @@ public boolean isValid() { } /** - * Determines if the adding a property value for the given property to the - * last element in the path is allowed. + * Determines if the adding a property value for the given property to the last + * element in the path is allowed. * * @param propertyName the property name - * @param strict states if additional checks are applied apart from whether - * the property exists + * @param strict states if additional checks are applied apart from whether the + * property exists * @param ignoreNamespaces if a property with a differing namespace may be * accepted * @return if adding the property value to the last element in the path is @@ -176,15 +173,14 @@ public boolean allowAdd(QName propertyName, boolean strict, boolean ignoreNamesp else { // check last child DefinitionGroup child = children.get(children.size() - 1); - ChildDefinition property = GroupUtil - .findChild(child, propertyName, ignoreNamespaces); + ChildDefinition property = GroupUtil.findChild(child, propertyName, + ignoreNamespaces); if (property == null) { return false; } - if (child instanceof GroupPropertyDefinition - && ((GroupPropertyDefinition) child).getConstraint(ChoiceFlag.class) - .isEnabled()) { + if (child instanceof GroupPropertyDefinition && ((GroupPropertyDefinition) child) + .getConstraint(ChoiceFlag.class).isEnabled()) { // group is a choice return true; } diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/GroupUtil.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/GroupUtil.java index bf623dd38f..07e47eeb86 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/GroupUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/GroupUtil.java @@ -16,18 +16,6 @@ package eu.esdihumboldt.hale.io.gml.reader.internal.instance; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; - -import javax.annotation.Nullable; -import javax.xml.namespace.QName; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.instance.model.Group; @@ -43,6 +31,16 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.property.ChoiceFlag; import eu.esdihumboldt.hale.common.schema.model.constraint.type.IgnoreOrderFlag; import eu.esdihumboldt.hale.io.xsd.constraint.XmlAttributeFlag; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Nullable; +import javax.xml.namespace.QName; /** * Utility methods regarding group handling @@ -56,11 +54,11 @@ public class GroupUtil { /** * Determine the property definition for the given property name. * - * @param groups the stack of the current group objects. The topmost element - * is the current group object + * @param groups the stack of the current group objects. The topmost element is + * the current group object * @param propertyName the property name - * @param allowFallback states if falling back to non-strict mode is allowed - * for determining the property definition + * @param allowFallback states if falling back to non-strict mode is allowed for + * determining the property definition * @param ignoreNamespaces if a property with a differing namespace may be * accepted * @return the group property or null if none is found @@ -73,14 +71,14 @@ static GroupProperty determineProperty(List groups, QName property /** * Determine the property definition for the given property name. * - * @param groups the stack of the current group objects. The topmost element - * is the current group object + * @param groups the stack of the current group objects. The topmost element is + * the current group object * @param propertyName the property name - * @param strict states if for assessing possible property definitions - * strict checks regarding the structure are applied - * @param allowFallback states if with strict mode being enabled, falling - * back to non-strict mode is allowed (this will not be - * propagated to subsequent calls) + * @param strict states if for assessing possible property definitions strict + * checks regarding the structure are applied + * @param allowFallback states if with strict mode being enabled, falling back + * to non-strict mode is allowed (this will not be propagated to + * subsequent calls) * @param ignoreNamespaces if a property with a differing namespace may be * accepted * @return the group property or null if none is found @@ -99,19 +97,18 @@ private static GroupProperty determineProperty(List groups, QName /* * Policy: find the property as high in the hierarchy as possible * - * This might lead to problems with some special schemas, e.g. if a - * group is defined that allows unbounded occurrences of an element X - * and the parent type allows one occurrence there will be trouble if we - * have more than two or three of those elements (depending on group and - * element cardinalities). + * This might lead to problems with some special schemas, e.g. if a group is + * defined that allows unbounded occurrences of an element X and the parent type + * allows one occurrence there will be trouble if we have more than two or three + * of those elements (depending on group and element cardinalities). * - * If this really poses a problem in the practice we might need - * configuration parameters to use different policies. IMHO (ST) in well - * designed schemas this problem will not occur. + * If this really poses a problem in the practice we might need configuration + * parameters to use different policies. IMHO (ST) in well designed schemas this + * problem will not occur. * - * This problem only arises because we read all the data from the stream - * and don't know anything about what comes ahead - another possibility - * could be to change this behavior where needed. + * This problem only arises because we read all the data from the stream and + * don't know anything about what comes ahead - another possibility could be to + * change this behavior where needed. */ // preferred 1: property of a parent group @@ -206,9 +203,9 @@ private static GroupProperty determineProperty(List groups, QName if (strict && allowFallback) { // fall-back: property in any group without validity checks // XXX though allowClose will still be strict - log.warn(MessageFormat - .format("Could not find valid property path for {0}, source data might be invalid regarding the source schema.", - propertyName)); + log.warn(MessageFormat.format( + "Could not find valid property path for {0}, source data might be invalid regarding the source schema.", + propertyName)); return determineProperty(groups, propertyName, false, false, ignoreNamespaces); } @@ -220,8 +217,7 @@ private static GroupProperty determineProperty(List groups, QName * * @param parent the parent type or group * @param propertyName the property name - * @param ignoreNamespaces if matches with differing namespace should be - * allowed + * @param ignoreNamespaces if matches with differing namespace should be allowed * @return the child definition or null */ @Nullable @@ -243,17 +239,17 @@ static ChildDefinition findChild(DefinitionGroup parent, QName propertyName, } /** - * Determines if a property value for the given property name may be added - * to the given group and returns the corresponding property definition. + * Determines if a property value for the given property name may be added to + * the given group and returns the corresponding property definition. * * @param group the group * @param propertyName the property name - * @param strict states if additional checks are applied apart from whether - * the property exists + * @param strict states if additional checks are applied apart from whether the + * property exists * @param ignoreNamespaces if a property with a differing namespace may be * accepted - * @return the property definition or null if none is found or - * no value may be added + * @return the property definition or null if none is found or no + * value may be added */ private static PropertyDefinition determineDirectProperty(MutableGroup group, QName propertyName, boolean strict, boolean ignoreNamespaces) { @@ -267,19 +263,17 @@ private static PropertyDefinition determineDirectProperty(MutableGroup group, } /** - * Determine the property definition for the given property name in - * sub-groups of the given group stack. + * Determine the property definition for the given property name in sub-groups + * of the given group stack. * - * @param paths the group paths whose children shall be checked for the - * property + * @param paths the group paths whose children shall be checked for the property * @param propertyName the property name - * @param leafs the queue is populated with the leafs in the explored - * definition group tree that are not processed because of the - * max descent, may be null if no population is - * needed + * @param leafs the queue is populated with the leafs in the explored definition + * group tree that are not processed because of the max descent, may + * be null if no population is needed * @param maxDescent the maximum descent, -1 for no maximum descent - * @param strict states if additional checks are applied apart from whether - * the property exists + * @param strict states if additional checks are applied apart from whether the + * property exists * @param ignoreNamespaces if a property with a differing namespace may be * accepted * @return the property definition or null if none is found @@ -326,10 +320,10 @@ private static GroupProperty determineSubProperty(Queue paths, QName .getAllChildren(lastDef); for (ChildDefinition child : children) { - if (child.asGroup() != null - && (path.getChildren() == null || !path.getChildren().contains( - child.asGroup()))) { // (check for - // definition cycle) + if (child.asGroup() != null && (path.getChildren() == null + || !path.getChildren().contains(child.asGroup()))) { // (check for + // definition + // cycle) List childDefs = new ArrayList(); if (path.getChildren() != null) { childDefs.addAll(path.getChildren()); @@ -371,15 +365,16 @@ private static boolean allowClose(MutableGroup currentGroup) { } if (currentGroup.getDefinition() instanceof GroupPropertyDefinition - && ((GroupPropertyDefinition) currentGroup.getDefinition()).getConstraint( - ChoiceFlag.class).isEnabled()) { + && ((GroupPropertyDefinition) currentGroup.getDefinition()) + .getConstraint(ChoiceFlag.class).isEnabled()) { // group is a choice Iterator it = currentGroup.getPropertyNames().iterator(); if (it.hasNext()) { // choice has at least on value set -> check cardinality for the // corresponding property QName name = it.next(); - return isValidCardinality(currentGroup, currentGroup.getDefinition().getChild(name)); + return isValidCardinality(currentGroup, + currentGroup.getDefinition().getChild(name)); } // else check all children like below } @@ -404,8 +399,8 @@ private static boolean allowClose(MutableGroup currentGroup) { * * @param group the group * @param childDef the child definition - * @return if the minimum cardinality of the child definition is matched in - * the group + * @return if the minimum cardinality of the child definition is matched in the + * group */ static boolean isValidCardinality(Group group, ChildDefinition childDef) { Cardinality cardinality = null; @@ -435,12 +430,12 @@ else if (childDef.asGroup() != null) { } /** - * Determines if another value of the given property may be added to the - * given group. + * Determines if another value of the given property may be added to the given + * group. * * @param group the group, null represents an empty group - * @param groupDef the definition of the given group, may be - * null if the group is not null + * @param groupDef the definition of the given group, may be null + * if the group is not null * @param propertyName the property name * @return if another property value may be added to the group */ @@ -527,9 +522,9 @@ else if (def instanceof TypeDefinition) { } /** - * Determines if another value of the given property may be added to the - * given group based on values available in the group and the order of the - * child definitions in the given definition group. + * Determines if another value of the given property may be added to the given + * group based on values available in the group and the order of the child + * definitions in the given definition group. * * @param group the group, null represents an empty group * @param propertyName the property name @@ -549,12 +544,13 @@ private static boolean allowAddCheckOrder(Group group, QName propertyName, } else { // ignore XML attributes - if (childDef.asProperty() != null - && childDef.asProperty().getConstraint(XmlAttributeFlag.class).isEnabled()) { + if (childDef.asProperty() != null && childDef.asProperty() + .getConstraint(XmlAttributeFlag.class).isEnabled()) { continue; } // ignore groups that contain no elements - if (childDef.asGroup() != null && !StreamGmlHelper.hasElements(childDef.asGroup())) { + if (childDef.asGroup() != null + && !StreamGmlHelper.hasElements(childDef.asGroup())) { continue; } @@ -583,8 +579,8 @@ private static boolean allowAddCheckOrder(Group group, QName propertyName, } /** - * Determines if another value of the given property may be added to the - * given group based on the cardinality of the property. + * Determines if another value of the given property may be added to the given + * group based on the cardinality of the property. * * @param group the group * @param propertyName the property name diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/StreamGmlHelper.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/StreamGmlHelper.java index 46e2909740..09124d4f73 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/StreamGmlHelper.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/StreamGmlHelper.java @@ -18,25 +18,7 @@ import static com.google.common.base.Preconditions.checkState; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.Stack; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - import com.google.common.collect.Iterables; -import org.locationtech.jts.geom.Geometry; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -61,6 +43,21 @@ import eu.esdihumboldt.hale.io.gml.reader.internal.StreamGmlReader; import eu.esdihumboldt.hale.io.xsd.constraint.XmlAttributeFlag; import eu.esdihumboldt.hale.io.xsd.constraint.XmlMixedFlag; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.Stack; +import java.util.concurrent.atomic.AtomicInteger; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import org.locationtech.jts.geom.Geometry; /** * Utility methods for instances from {@link XMLStreamReader}s @@ -80,19 +77,19 @@ public abstract class StreamGmlHelper { * @param type the definition of the instance type * @param indexInStream the index of the instance in the stream or * null - * @param strict if associating elements with properties should be done - * strictly according to the schema, otherwise a fall-back is - * used trying to populate values also on invalid property paths + * @param strict if associating elements with properties should be done strictly + * according to the schema, otherwise a fall-back is used trying to + * populate values also on invalid property paths * @param srsDimension the dimension of the instance or null * @param crsProvider CRS provider in case no CRS is specified, may be * null * @param parentType the type of the topmost instance - * @param propertyPath the property path down from the topmost instance, may - * be null + * @param propertyPath the property path down from the topmost instance, may be + * null * @param allowNull if a null result is allowed - * @param ignoreNamespaces if parsing of the XML instances should allow - * types and properties with namespaces that differ from those - * defined in the schema + * @param ignoreNamespaces if parsing of the XML instances should allow types + * and properties with namespaces that differ from those defined in + * the schema * @param ioProvider the I/O Provider to get value * @return the parsed instance, may be null if allowNull is * true @@ -116,19 +113,19 @@ public static Instance parseInstance(XMLStreamReader reader, TypeDefinition type * @param type the definition of the instance type * @param indexInStream the index of the instance in the stream or * null - * @param strict if associating elements with properties should be done - * strictly according to the schema, otherwise a fall-back is - * used trying to populate values also on invalid property paths + * @param strict if associating elements with properties should be done strictly + * according to the schema, otherwise a fall-back is used trying to + * populate values also on invalid property paths * @param srsDimension the dimension of the instance or null * @param crsProvider CRS provider in case no CRS is specified, may be * null * @param parentType the type of the topmost instance - * @param propertyPath the property path down from the topmost instance, may - * be null + * @param propertyPath the property path down from the topmost instance, may be + * null * @param allowNull if a null result is allowed - * @param ignoreNamespaces if parsing of the XML instances should allow - * types and properties with namespaces that differ from those - * defined in the schema + * @param ignoreNamespaces if parsing of the XML instances should allow types + * and properties with namespaces that differ from those defined in + * the schema * @param ioProvider the I/O Provider to get value * @param crs The CRSDefinition to use for geometries * @return the parsed instance, may be null if allowNull is @@ -219,10 +216,9 @@ public static Instance parseInstance(XMLStreamReader reader, TypeDefinition type if (allowNull && isNil && Iterables.isEmpty(instance.getPropertyNames())) { // no value should be created /* - * XXX returning null here then results in problems during - * adding other properties to the parent group, as mandatory - * elements are expected to appear, and it will warn about - * possible invalid data loaded + * XXX returning null here then results in problems during adding other + * properties to the parent group, as mandatory elements are expected to appear, + * and it will warn about possible invalid data loaded */ // return null; } @@ -230,9 +226,9 @@ public static Instance parseInstance(XMLStreamReader reader, TypeDefinition type // instance value if (!hasElements(type)) { /* - * Value can only be determined if there are no documents, - * because otherwise elements have already been processed in - * parseProperties and we are already past END_ELEMENT. + * Value can only be determined if there are no documents, because otherwise + * elements have already been processed in parseProperties and we are already + * past END_ELEMENT. */ if (type.getConstraint(HasValueFlag.class).isEnabled()) { // try to get text value @@ -245,8 +241,8 @@ public static Instance parseInstance(XMLStreamReader reader, TypeDefinition type } else { /* - * XXX For a mixed type currently ignore elements and parse only - * attributes and text. + * XXX For a mixed type currently ignore elements and parse only attributes and + * text. */ // instance properties (attributes only) @@ -280,12 +276,11 @@ public static Instance parseInstance(XMLStreamReader reader, TypeDefinition type } } catch (Exception e) { /* - * Catch IllegalArgumentException that e.g. occurs if a linear - * ring has to few points. NullPointerExceptions may occur - * because an internal geometry could not be created. + * Catch IllegalArgumentException that e.g. occurs if a linear ring has to few + * points. NullPointerExceptions may occur because an internal geometry could + * not be created. * - * XXX a problem is that these messages will not appear in the - * report + * XXX a problem is that these messages will not appear in the report */ log.error("Error creating geometry", e); } @@ -340,16 +335,15 @@ public static Instance parseInstance(XMLStreamReader reader, TypeDefinition type /** * Read the text value of the current element from the stream. The stream is - * expected to be at {@link XMLStreamConstants#START_ELEMENT}. For mixed - * content elements the text content is concatenated and the elements - * ignored. + * expected to be at {@link XMLStreamConstants#START_ELEMENT}. For mixed content + * elements the text content is concatenated and the elements ignored. * * FIXME different handling for mixed types? * * @param reader the XML stream reader * @return the element text - * @throws XMLStreamException if an error occurs reading from the stream or - * the element ends prematurely + * @throws XMLStreamException if an error occurs reading from the stream or the + * element ends prematurely */ private static String readText(XMLStreamReader reader) throws XMLStreamException { checkState(reader.getEventType() == XMLStreamConstants.START_ELEMENT); @@ -396,9 +390,9 @@ else if (eventType == XMLStreamConstants.END_ELEMENT) { * * @param reader the XML stream reader * @param group the group to populate with properties - * @param strict if associating elements with properties should be done - * strictly according to the schema, otherwise a fall-back is - * used trying to populate values also on invalid property paths + * @param strict if associating elements with properties should be done strictly + * according to the schema, otherwise a fall-back is used trying to + * populate values also on invalid property paths * @param srsDimension the dimension of the instance or null * @param crsProvider CRS provider in case no CRS is specified, may be * null @@ -407,9 +401,9 @@ else if (eventType == XMLStreamConstants.END_ELEMENT) { * @param parentType the type of the topmost instance * @param propertyPath the property path down from the topmost instance * @param onlyAttributes if only attributes should be parsed - * @param ignoreNamespaces if parsing of the XML instances should allow - * types and properties with namespaces that differ from those - * defined in the schema + * @param ignoreNamespaces if parsing of the XML instances should allow types + * and properties with namespaces that differ from those defined in + * the schema * @param ioProvider the I/O Provider to get value * @throws XMLStreamException if parsing the properties failed */ @@ -594,8 +588,8 @@ private static void addSimpleProperty(MutableGroup group, PropertyDefinition pro } /** - * Convert a string value from a XML simple type to the binding defined by - * the given type. + * Convert a string value from a XML simple type to the binding defined by the + * given type. * * @param type the type associated with the value * @param value the value diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/StreamGmlInstance.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/StreamGmlInstance.java index a2d9e5359a..4b9c806de8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/StreamGmlInstance.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/instance/StreamGmlInstance.java @@ -31,8 +31,8 @@ public class StreamGmlInstance extends DefaultInstance implements Identifiable { private final int indexInStream; /** - * Copy constructor. Creates an instance based on the properties and values - * of the given instance. + * Copy constructor. Creates an instance based on the properties and values of + * the given instance. * * @param instance the instance to copy * @param indexInStream the index of the instance in the stream diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/wfs/WfsBackedGmlInstanceCollection.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/wfs/WfsBackedGmlInstanceCollection.java index 90a00d58af..b4723725f1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/wfs/WfsBackedGmlInstanceCollection.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/reader/internal/wfs/WfsBackedGmlInstanceCollection.java @@ -15,22 +15,6 @@ package eu.esdihumboldt.hale.io.gml.reader.internal.wfs; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; - -import org.apache.commons.io.FileUtils; -import org.apache.http.NameValuePair; -import org.apache.http.client.utils.URIBuilder; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -50,6 +34,20 @@ import eu.esdihumboldt.hale.io.gml.reader.internal.GmlInstanceCollection; import eu.esdihumboldt.hale.io.gml.reader.internal.GmlInstanceCollection.GmlInstanceIterator; import eu.esdihumboldt.hale.io.gml.reader.internal.instance.StreamGmlInstance; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import org.apache.commons.io.FileUtils; +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URIBuilder; /** * Instance collection based on a GML input stream from WFS requests.
        @@ -118,26 +116,25 @@ public class WfsBackedGmlInstanceCollection implements InstanceCollection { * * @param source the source * @param sourceSchema the source schema - * @param restrictToFeatures if only instances that are GML features shall - * be loaded + * @param restrictToFeatures if only instances that are GML features shall be + * loaded * @param ignoreRoot if the root element should be ignored for creating * instances even if it is recognized as an allowed instance type - * @param strict if associating elements with properties should be done - * strictly according to the schema, otherwise a fall-back is - * used trying to populate values also on invalid property paths - * @param ignoreNamespaces if parsing of the XML instances should allow - * types and properties with namespaces that differ from those - * defined in the schema + * @param strict if associating elements with properties should be done strictly + * according to the schema, otherwise a fall-back is used trying to + * populate values also on invalid property paths + * @param ignoreNamespaces if parsing of the XML instances should allow types + * and properties with namespaces that differ from those defined in + * the schema * @param crsProvider CRS provider in case no CRS is specified, may be * null * @param provider the I/O provider to get values - * @param featuresPerRequest Number of features to retrieve at most with one - * WFS GetFeature request, or {@value #UNLIMITED} to disable - * pagination - * @param ignoreNumberMatched If featuresPerRequest is set, ignore the - * number of matches reported by the WFS - * @throws URISyntaxException thrown if the WFS request URL cannot be - * generated from the source location URI + * @param featuresPerRequest Number of features to retrieve at most with one WFS + * GetFeature request, or {@value #UNLIMITED} to disable pagination + * @param ignoreNumberMatched If featuresPerRequest is set, ignore the number of + * matches reported by the WFS + * @throws URISyntaxException thrown if the WFS request URL cannot be generated + * from the source location URI */ public WfsBackedGmlInstanceCollection(LocatableInputSupplier source, TypeIndex sourceSchema, boolean restrictToFeatures, boolean ignoreRoot, boolean strict, @@ -153,27 +150,26 @@ public WfsBackedGmlInstanceCollection(LocatableInputSuppliernull * @param provider the I/O provider to get values - * @param featuresPerRequest Number of features to retrieve at most with one - * WFS GetFeature request, or {@value #UNLIMITED} to disable - * pagination - * @param ignoreNumberMatched If featuresPerRequest is set, ignore the - * number of matches reported by the WFS + * @param featuresPerRequest Number of features to retrieve at most with one WFS + * GetFeature request, or {@value #UNLIMITED} to disable pagination + * @param ignoreNumberMatched If featuresPerRequest is set, ignore the number of + * matches reported by the WFS * @param tmpDirPath tmp dir path to download all wfs files - * @throws URISyntaxException thrown if the WFS request URL cannot be - * generated from the source location URI + * @throws URISyntaxException thrown if the WFS request URL cannot be generated + * from the source location URI */ public WfsBackedGmlInstanceCollection(LocatableInputSupplier source, TypeIndex sourceSchema, boolean restrictToFeatures, boolean ignoreRoot, boolean strict, @@ -271,9 +267,8 @@ public WfsBackedGmlInstanceCollection(LocatableInputSupplierfalse. + * The parameter specifying whether a dataset feed should be created, defaults + * to false. */ public static final String PARAM_SPATIAL_DATA_SET_CREATE_FEED = "inspire.sds.create_feed"; @@ -219,8 +215,8 @@ protected Pair extractGeometry(Object value, boolean al } /** - * @see StreamGmlWriter#writeAdditionalElements(XMLStreamWriter, - * TypeDefinition, IOReporter) + * @see StreamGmlWriter#writeAdditionalElements(XMLStreamWriter, TypeDefinition, + * IOReporter) */ @Override protected void writeAdditionalElements(XMLStreamWriter writer, diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/XPlanGmlInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/XPlanGmlInstanceWriter.java index fd3a0b81e5..fd51e9bf99 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/XPlanGmlInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/XPlanGmlInstanceWriter.java @@ -15,23 +15,6 @@ package eu.esdihumboldt.hale.io.gml.writer; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -50,6 +33,21 @@ import eu.esdihumboldt.hale.io.gml.writer.internal.StreamGmlWriter; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import eu.esdihumboldt.util.Pair; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; /** * Writes instances to a XPlanGML XPlanAuszug @@ -127,8 +125,8 @@ private void partitionByPlan(ProgressIndicator progress, IOReporter reporter) final Set planTypes = collectPlanTypes(getTargetSchema().getTypes()); /* - * Split instances into plan and non-plan instances. Associate the ID of - * a plan with its plan type and the plan instance. + * Split instances into plan and non-plan instances. Associate the ID of a plan + * with its plan type and the plan instance. */ final XMLInspector gadget = new XMLInspector(); final DefaultInstanceCollection nonPlanInstances = new DefaultInstanceCollection(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/XmlWrapper.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/XmlWrapper.java index ad627d9155..1b092e5567 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/XmlWrapper.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/XmlWrapper.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.io.gml.writer; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.io.gml.writer.internal.StreamGmlWriter; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; /** * Wraps the output of a {@link StreamGmlWriter}. @@ -30,8 +29,7 @@ public interface XmlWrapper { /** * Configure the stream writer after the initial setup by - * {@link StreamGmlWriter}, but before the document is started to be - * written. + * {@link StreamGmlWriter}, but before the document is started to be written. * * @param writer the stream writer * @param reporter the reporter to report any messages to @@ -48,9 +46,8 @@ public interface XmlWrapper { public void startWrap(XMLStreamWriter writer, IOReporter reporter) throws XMLStreamException; /** - * End the elements started in - * {@link #startWrap(XMLStreamWriter, IOReporter)} to yield a valid XML - * document. + * End the elements started in {@link #startWrap(XMLStreamWriter, IOReporter)} + * to yield a valid XML document. * * @param writer the stream writer * @param reporter the reporter to report any messages to diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/DefaultMultipartHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/DefaultMultipartHandler.java index ee1ef77383..bf6380fd91 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/DefaultMultipartHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/DefaultMultipartHandler.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.io.gml.writer.internal; +import com.google.common.io.Files; +import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import eu.esdihumboldt.util.Pair; import java.io.File; import java.net.URI; import java.nio.file.Path; import java.nio.file.Paths; -import com.google.common.io.Files; - -import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; -import eu.esdihumboldt.util.Pair; - /** * Handler that adds an incrementing number to the target file name. * @@ -40,10 +38,9 @@ public String getTargetFilename(InstanceCollection part, URI location) { } /** - * Return the file name without extension and the extension as a - * {@link Pair}. If the file name ends with .xml.gz or - * .gml.gz, this will also be the returned extension (and not - * gz). + * Return the file name without extension and the extension as a {@link Pair}. + * If the file name ends with .xml.gz or .gml.gz, this + * will also be the returned extension (and not gz). * * @param filename File name to split * @return Pair of name and extension diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/ExtentPartsHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/ExtentPartsHandler.java index e2593ac90a..df6407fb6d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/ExtentPartsHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/ExtentPartsHandler.java @@ -15,6 +15,9 @@ package eu.esdihumboldt.hale.io.gml.writer.internal; +import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import eu.esdihumboldt.hale.common.instance.model.ext.helper.InstanceCollectionDecorator; +import eu.esdihumboldt.util.Pair; import java.io.File; import java.net.URI; import java.nio.file.Path; @@ -22,10 +25,6 @@ import java.util.Map; import java.util.stream.Collectors; -import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; -import eu.esdihumboldt.hale.common.instance.model.ext.helper.InstanceCollectionDecorator; -import eu.esdihumboldt.util.Pair; - /** * Handler for writing instances split by spatial extent. * @@ -34,8 +33,7 @@ public class ExtentPartsHandler implements MultipartHandler { /** - * Key to be used for instances that do not have exactly one geometry - * property. + * Key to be used for instances that do not have exactly one geometry property. */ public static final String KEY_NO_GEOMETRY = "NOGEOM"; @@ -76,8 +74,7 @@ public String getTreeKey() { * Create the handler * * @param keyToTargetMapping Mapping between tree key and target file - * @param idToKeyMapping Mapping between the GML IDs and the associated tree - * key + * @param idToKeyMapping Mapping between the GML IDs and the associated tree key */ public ExtentPartsHandler(Map keyToTargetMapping, Map idToKeyMapping) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/GmlWriterUtil.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/GmlWriterUtil.java index 387ad13ae4..c975bffb0a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/GmlWriterUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/GmlWriterUtil.java @@ -16,17 +16,6 @@ package eu.esdihumboldt.hale.io.gml.writer.internal; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.UUID; - -import javax.annotation.Nullable; -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.instance.model.Group; @@ -44,6 +33,15 @@ import eu.esdihumboldt.hale.io.xsd.constraint.XmlAttributeFlag; import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.UUID; +import javax.annotation.Nullable; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; /** * Utility methods used for the GML writer @@ -232,11 +230,11 @@ private static void writeAtt(XMLStreamWriter writer, String value, PropertyDefin * * @param writer the XML stream writer * @param type the type definition - * @param parent the parent object, may be null. If it is set - * the value for the ID will be tried to be retrieved from the - * parent object, otherwise a random ID will be generated - * @param onlyIfNotSet if the ID shall only be written if no value is set in - * the parent object + * @param parent the parent object, may be null. If it is set the + * value for the ID will be tried to be retrieved from the parent + * object, otherwise a random ID will be generated + * @param onlyIfNotSet if the ID shall only be written if no value is set in the + * parent object * @throws XMLStreamException if an error occurs writing the ID */ public static void writeRequiredID(XMLStreamWriter writer, DefinitionGroup type, Group parent, @@ -250,11 +248,11 @@ public static void writeRequiredID(XMLStreamWriter writer, DefinitionGroup type, * * @param writer the XML stream writer * @param type the type definition - * @param parent the parent object, may be null. If it is set - * the value for the ID will be tried to be retrieved from the - * parent object, otherwise a random ID will be generated - * @param onlyIfNotSet if the ID shall only be written if no value is set in - * the parent object + * @param parent the parent object, may be null. If it is set the + * value for the ID will be tried to be retrieved from the parent + * object, otherwise a random ID will be generated + * @param onlyIfNotSet if the ID shall only be written if no value is set in the + * parent object * @param desiredId a desired identifier or null * @throws XMLStreamException if an error occurs writing the ID */ @@ -304,8 +302,7 @@ && isID(prop.getPropertyType())) { } /** - * Write the opening element of a {@link PathElement} to the given stream - * writer + * Write the opening element of a {@link PathElement} to the given stream writer * * @param writer the stream writer * @param step the path element @@ -331,8 +328,8 @@ public static void writeStartPathElement(XMLStreamWriter writer, PathElement ste } /** - * Collect all property definitions defined by the given child definitions, - * i.e. returns a flattened version of the children. + * Collect all property definitions defined by the given child definitions, i.e. + * returns a flattened version of the children. * * @param children the child definitions * @return the property definitions @@ -357,8 +354,8 @@ else if (child.asGroup() != null) { * * @param children the children * @param basePath the base path - * @param elementsOnly if only properties representing an XML element should - * be considered + * @param elementsOnly if only properties representing an XML element should be + * considered * @return the child paths, each ending with a property element */ public static Collection collectPropertyPaths( diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/LocalReferenceUpdater.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/LocalReferenceUpdater.java index 130a1ac109..9705b18eba 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/LocalReferenceUpdater.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/LocalReferenceUpdater.java @@ -15,13 +15,11 @@ package eu.esdihumboldt.hale.io.gml.writer.internal; +import eu.esdihumboldt.util.io.IOUtils; import java.net.URI; import java.util.Map; - import org.apache.http.client.utils.URIBuilder; -import eu.esdihumboldt.util.io.IOUtils; - /** * Reference updater that updates local references (starting with * "#" ) to relative references according to an ID->target map. diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/MultipartHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/MultipartHandler.java index c384712dc0..7b9bbb0ad0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/MultipartHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/MultipartHandler.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.io.gml.writer.internal; -import java.net.URI; - import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import java.net.URI; /** * Interface for handlers that control writing instances to multiple XML/GML @@ -37,9 +36,8 @@ public interface MultipartHandler { String getTargetFilename(InstanceCollection part, URI originalTarget); /** - * Extension point to provide a stream writer with special capabilities. - * Returns the provided writer unless overridden by the handler - * implementation. + * Extension point to provide a stream writer with special capabilities. Returns + * the provided writer unless overridden by the handler implementation. * * @param writer Original writer * @param target Output target diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/PerTypePartsHandler.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/PerTypePartsHandler.java index 9e45a5cbc6..f9059f992a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/PerTypePartsHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/PerTypePartsHandler.java @@ -15,20 +15,18 @@ package eu.esdihumboldt.hale.io.gml.writer.internal; +import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import eu.esdihumboldt.hale.common.instance.model.impl.SingleTypeInstanceCollection; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.util.Pair; import java.io.File; import java.net.URI; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Map; import java.util.stream.Collectors; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; -import eu.esdihumboldt.hale.common.instance.model.impl.SingleTypeInstanceCollection; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.util.Pair; - /** * Handler for writing instances split by feature type. * @@ -43,8 +41,8 @@ public class PerTypePartsHandler implements MultipartHandler { * Create the handler * * @param typeToTargetMapping Mapping between feature type and target file - * @param idToTypeMapping Mapping between the GML IDs and the associated - * feature type + * @param idToTypeMapping Mapping between the GML IDs and the associated feature + * type */ public PerTypePartsHandler(Map typeToTargetMapping, Map idToTypeMapping) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/PrefixAwareStreamWriterDecorator.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/PrefixAwareStreamWriterDecorator.java index 52e18e8d4f..1bdd92bf33 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/PrefixAwareStreamWriterDecorator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/PrefixAwareStreamWriterDecorator.java @@ -17,7 +17,6 @@ import java.util.HashMap; import java.util.Map; - import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/ReferenceUpdatingStreamWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/ReferenceUpdatingStreamWriter.java index e0980cbf20..b1cbe5caab 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/ReferenceUpdatingStreamWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/ReferenceUpdatingStreamWriter.java @@ -18,7 +18,6 @@ import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.springframework.util.StringUtils; /** @@ -46,8 +45,8 @@ public ReferenceUpdatingStreamWriter(XMLStreamWriter decoratee, ReferenceUpdater } /** - * Create the writer that updates the specified attribute. If the attribute - * to update contains only a local part (i.e. no prefix and namespace are + * Create the writer that updates the specified attribute. If the attribute to + * update contains only a local part (i.e. no prefix and namespace are * specified), all attributes with that local part will be updated. * * @param decoratee Writer to decorate diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/SchemaDecorator.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/SchemaDecorator.java index 3cca06b6a4..081fe2a4d6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/SchemaDecorator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/SchemaDecorator.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.io.gml.writer.internal; +import eu.esdihumboldt.hale.common.schema.model.Schema; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.net.URI; import java.util.Collection; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.schema.model.Schema; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Schema decorator. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter.java index 14d2f82c3a..bc6a142982 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter.java @@ -16,49 +16,6 @@ package eu.esdihumboldt.hale.io.gml.writer.internal; -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.text.DecimalFormat; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Queue; -import java.util.Set; -import java.util.TreeSet; -import java.util.stream.Collectors; - -import javax.annotation.Nullable; -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - -import org.geotools.geometry.jts.JTS; -import org.geotools.gml3.GML; -import org.geotools.referencing.CRS; -import org.locationtech.jts.geom.Envelope; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.Point; -import org.opengis.geometry.MismatchedDimensionException; -import org.opengis.referencing.FactoryException; -import org.opengis.referencing.crs.CoordinateReferenceSystem; -import org.opengis.referencing.operation.MathTransform; -import org.opengis.referencing.operation.TransformException; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -132,6 +89,46 @@ import eu.esdihumboldt.util.geometry.quadtree.FixedBoundaryQuadtree; import eu.esdihumboldt.util.geometry.quadtree.QuadtreeBuilder; import eu.esdihumboldt.util.geometry.quadtree.QuadtreeNodeVisitor; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.math.BigDecimal; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.DecimalFormat; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Queue; +import java.util.Set; +import java.util.TreeSet; +import java.util.stream.Collectors; +import javax.annotation.Nullable; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; +import org.geotools.geometry.jts.JTS; +import org.geotools.gml3.GML; +import org.geotools.referencing.CRS; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.Point; +import org.opengis.geometry.MismatchedDimensionException; +import org.opengis.referencing.FactoryException; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.operation.MathTransform; +import org.opengis.referencing.operation.TransformException; /** * Writes GML/XML using a {@link XMLStreamWriter} @@ -155,14 +152,14 @@ public class StreamGmlWriter extends AbstractGeoInstanceWriter private static final ALogger log = ALoggerFactory.getLogger(StreamGmlWriter.class); /** - * The parameter name for the flag specifying if a geometry should be - * simplified before writing it, if possible. Defaults to true. + * The parameter name for the flag specifying if a geometry should be simplified + * before writing it, if possible. Defaults to true. */ public static final String PARAM_SIMPLIFY_GEOMETRY = "gml.geometry.simplify"; /** - * The parameter name for the flag specifying if the output should be - * indented. Defaults to false. + * The parameter name for the flag specifying if the output should be indented. + * Defaults to false. */ public static final String PARAM_PRETTY_PRINT = "xml.pretty"; @@ -173,8 +170,8 @@ public class StreamGmlWriter extends AbstractGeoInstanceWriter public static final String PARAM_CONTAINER_ID = "xml.containerId"; /** - * The parameter name of the flag specifying if nilReason attributes should - * be omitted if an element is not nil. + * The parameter name of the flag specifying if nilReason attributes should be + * omitted if an element is not nil. */ public static final String PARAM_OMIT_NIL_REASON = "xml.notNil.omitNilReason"; @@ -185,14 +182,14 @@ public class StreamGmlWriter extends AbstractGeoInstanceWriter public static final String PARAM_ADD_CODESPACE = "xml.add.codespace"; /** - * The name of the parameter specifying how the output of geometry - * coordinates should be formatted. + * The name of the parameter specifying how the output of geometry coordinates + * should be formatted. */ public static final String PARAM_GEOMETRY_FORMAT = "geometry.write.decimalFormat"; /** - * The name of the parameter specifying how the output of Double values - * should be formatted. + * The name of the parameter specifying how the output of Double values should + * be formatted. */ public static final String PARAM_DECIMAL_FORMAT = "xml.decimalFormat"; @@ -212,8 +209,8 @@ public class StreamGmlWriter extends AbstractGeoInstanceWriter public static final String PARAM_PARTITION_BY_EXTENT = "partition.byExtent"; /** - * Name of the parameter to specify how much instances a tile can hold at - * most before it is split up + * Name of the parameter to specify how much instances a tile can hold at most + * before it is split up */ public static final String PARAM_PARTITION_BY_EXTENT_MAX_NODES = "partition.byExtent.maxInstancesPerTile"; @@ -223,14 +220,14 @@ public class StreamGmlWriter extends AbstractGeoInstanceWriter public static final String PARAM_PARTITION_BY_EXTENT_MODE = "partition.byExtent.mode"; /** - * Value for extent partitioning mode to use the bounding box of the dataset - * as the quadtree boundary + * Value for extent partitioning mode to use the bounding box of the dataset as + * the quadtree boundary */ public static final String PARTITION_BY_EXTENT_MODE_DATASET = "dataset"; /** - * Value for extent partitioning mode to use the world (WGS 84) as the - * quadtree boundary + * Value for extent partitioning mode to use the world (WGS 84) as the quadtree + * boundary */ public static final String PARTITION_BY_EXTENT_MODE_WORLD = "world"; @@ -250,8 +247,7 @@ public class StreamGmlWriter extends AbstractGeoInstanceWriter public static final String PARTITION_MODE_CUT = "cut"; /** - * Value for partitioning mode parameter that keeps related instances - * together. + * Value for partitioning mode parameter that keeps related instances together. */ public static final String PARTITION_MODE_RELATED = "related"; @@ -343,8 +339,8 @@ public List getValidationSchemas() { } /** - * Add a schema that should be included for validation. Should be called - * before or in + * Add a schema that should be included for validation. Should be called before + * or in * {@link #write(InstanceCollection, OutputStream, ProgressIndicator, IOReporter)} * prior to writing the schema locations, but after {@link #init()} * @@ -511,8 +507,9 @@ public InstanceCollection next() { }; final Map keyToTargetMapping = new HashMap<>(); - keyToRefsMapping.keySet().stream().forEach(k -> keyToTargetMapping.put(k, - new File(ExtentPartsHandler.getTargetFilename(k, getTarget().getLocation())) + keyToRefsMapping.keySet().stream() + .forEach(k -> keyToTargetMapping.put(k, new File( + ExtentPartsHandler.getTargetFilename(k, getTarget().getLocation())) .toURI())); final ExtentPartsHandler handler = new ExtentPartsHandler(keyToTargetMapping, @@ -573,7 +570,7 @@ private void partitionByFeatureType(ProgressIndicator progress, IOReporter repor final Map typeToTargetMapping = new HashMap<>(); types.stream().forEach(t -> typeToTargetMapping.put(t, new File( PerTypePartsHandler.getTargetFilename(t.getName(), getTarget().getLocation())) - .toURI())); + .toURI())); final PerTypePartsHandler handler = new PerTypePartsHandler(typeToTargetMapping, idToTypeMapping); final PerTypeInstanceCollection instancesPerType = PerTypeInstanceCollection @@ -600,8 +597,8 @@ private void partitionByThreshold(ProgressIndicator progress, IOReporter reporte } /** - * Get the instance collection partitioner based on the provider - * configuration of the partitioning mode. + * Get the instance collection partitioner based on the provider configuration + * of the partitioning mode. * * @param provider the I/O provider * @param log the log @@ -628,12 +625,10 @@ public static InstanceCollectionPartitioner getPartitioner(IOProvider provider, * Write the given {@link InstanceCollection}s to multiple files using the * configured target as a base file name.
        *
        - * Parts can only be written if the configured target is a URI to a local - * file. + * Parts can only be written if the configured target is a URI to a local file. * * @param instanceCollections the parts to write - * @param handler Handler that provides the parts' file names and an XML - * writer + * @param handler Handler that provides the parts' file names and an XML writer * @param progress Progress indicator * @param reporter the reporter to use for the execution report * @throws IOException if an I/O operation fails @@ -850,8 +845,8 @@ public static XmlIndex getXMLIndex(SchemaSpace schemas) { } /** - * Create and configure an XMLStreamWriter that writes to the - * given OutputStream + * Create and configure an XMLStreamWriter that writes to the given + * OutputStream * * @param outStream OutputStream to write to * @param reporter the reporter @@ -916,8 +911,8 @@ protected PrefixAwareStreamWriter createWriter(OutputStream outStream, IOReporte /** * Create and setup the type index and the GML namespace (Initializes - * {@link #gmlNs} and {@link #targetIndex}, resets {@link #geometryWriter} - * and {@link #additionalSchemas}). + * {@link #gmlNs} and {@link #targetIndex}, resets {@link #geometryWriter} and + * {@link #additionalSchemas}). */ protected void init() { // reset target index @@ -1126,8 +1121,8 @@ protected String getCombinedTaskName(String taskName, String subtaskName) { } /* - * Add schema for container to validation schemas, if the namespace - * differs from the main namespace or additional schemas. + * Add schema for container to validation schemas, if the namespace differs from + * the main namespace or additional schemas. * * Needed for validation based on schemaLocation attribute. */ @@ -1215,8 +1210,8 @@ public URI getLocation() { TypeDefinition type = instance.getDefinition(); /* - * Skip all objects that are no features when writing to a - * GML feature collection. + * Skip all objects that are no features when writing to a GML feature + * collection. */ boolean skip = useFeatureCollection && !GmlWriterUtil.isFeatureType(type); if (skip) { @@ -1283,8 +1278,8 @@ public URI getLocation() { } /** - * Strip the fragment from a location (as it usually represents line and - * column numbers) + * Strip the fragment from a location (as it usually represents line and column + * numbers) * * @param location the location * @return the location w/o fragment @@ -1303,9 +1298,9 @@ protected String getTaskName() { } /** - * This method is called after the container element is started and filled - * with needed attributes. The default implementation ensures that a - * mandatory boundedBy of GML 2 FeatureCollection is written. + * This method is called after the container element is started and filled with + * needed attributes. The default implementation ensures that a mandatory + * boundedBy of GML 2 FeatureCollection is written. * * @param writer the XML stream writer * @param containerDefinition the container type definition @@ -1329,8 +1324,8 @@ protected void writeAdditionalElements(XMLStreamWriter writer, } /** - * Get the for an I/O provider configured target container element, assuming - * the I/O provider uses the {@link #PARAM_ROOT_ELEMENT_NAMESPACE} and + * Get the for an I/O provider configured target container element, assuming the + * I/O provider uses the {@link #PARAM_ROOT_ELEMENT_NAMESPACE} and * {@value #PARAM_ROOT_ELEMENT_NAME} parameters for this. * * @param provider the I/O provider @@ -1441,8 +1436,8 @@ public URI getLocation() { } /** - * Find a matching attribute for the given member type in the given - * container type + * Find a matching attribute for the given member type in the given container + * type * * @param container the container type * @param containerName the container element name @@ -1566,8 +1561,8 @@ protected void writeMember(Instance instance, TypeDefinition type, IOReporter re * @param allowElements if element properties may be written * @param parentIsNil if the parent property is nil * @param report the reporter - * @param withinInspireType if the properties are contained within an - * INSPIRE feature type + * @param withinInspireType if the properties are contained within an INSPIRE + * feature type * @param parentIsGmlIdentifier if the parent of the properties is a GML * identifier element * @throws XMLStreamException if writing the properties fails @@ -1598,13 +1593,12 @@ private void writeProperties(Group group, DefinitionGroup definition, boolean al * * @param parent the parent group * @param children the child definitions - * @param attributes true if attribute properties shall be - * written, false if element properties shall be - * written + * @param attributes true if attribute properties shall be written, + * false if element properties shall be written * @param parentIsNil if the parent property is nil * @param report the reporter - * @param withinInspireType if the properties are contained within an - * INSPIRE feature type + * @param withinInspireType if the properties are contained within an INSPIRE + * feature type * @param parentIsGmlIdentifier if the parent of the properties is a GML * identifier element * @throws XMLStreamException if writing the attributes/elements fails @@ -1824,8 +1818,8 @@ else if (hasOnlyNilReason) { // possible /* - * XXX open question: should xsi:nil be there also if there - * are other attributes than nilReason? + * XXX open question: should xsi:nil be there also if there are other attributes + * than nilReason? */ writeElementValue(null, propDef); @@ -1841,8 +1835,7 @@ else if (hasOnlyNilReason) { * * @param group the group to test * @return true if the group has the nilReason attribute and no - * other children, or no children at all, false - * otherwise + * other children, or no children at all, false otherwise */ private boolean hasOnlyNilReason(Group group) { int count = 0; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/AbstractTypeMatcher.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/AbstractTypeMatcher.java index de759e0574..0729ad0f1e 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/AbstractTypeMatcher.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/AbstractTypeMatcher.java @@ -16,19 +16,17 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry; +import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.AbstractFlag; +import eu.esdihumboldt.hale.io.gml.writer.internal.GmlWriterUtil; import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Queue; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.AbstractFlag; -import eu.esdihumboldt.hale.io.gml.writer.internal.GmlWriterUtil; - /** * Abstract type matcher. Finds candidates matching a custom parameter. * @@ -53,8 +51,8 @@ private static class PathCandidate { * * @param type the associated type * @param path the definition path - * @param checkedTypes the type definitions that have already been - * checked (to prevent cycles) + * @param checkedTypes the type definitions that have already been checked (to + * prevent cycles) */ public PathCandidate(TypeDefinition type, DefinitionPath path, HashSet checkedTypes) { @@ -115,8 +113,9 @@ public List findCandidates(TypeDefinition elementType, QName ele public List findCandidates(TypeDefinition elementType, QName elementName, boolean unique, T matchParam, int maxDepth) { Queue candidates = new LinkedList(); - PathCandidate base = new PathCandidate(elementType, new DefinitionPath(elementType, - elementName, unique), new HashSet()); + PathCandidate base = new PathCandidate(elementType, + new DefinitionPath(elementType, elementName, unique), + new HashSet()); candidates.add(base); List results = new ArrayList<>(); @@ -174,7 +173,7 @@ public List findCandidates(TypeDefinition elementType, QName ele @SuppressWarnings("unchecked") Iterable> children = (Iterable>) ((basePath .isEmpty() || basePath.getLastElement().isProperty()) ? (type.getChildren()) - : (type.getDeclaredChildren())); + : (type.getDeclaredChildren())); Iterable childPaths = GmlWriterUtil.collectPropertyPaths(children, basePath, true); for (DefinitionPath childPath : childPaths) { @@ -197,8 +196,8 @@ public List findCandidates(TypeDefinition elementType, QName ele // step down sub-types - elements may be downcast using xsi:type if (!type.getConstraint(AbstractFlag.class).isEnabled()) { /* - * don't do it for abstract types as they have no element that - * may be used XXX is this true? + * don't do it for abstract types as they have no element that may be used XXX + * is this true? */ for (@SuppressWarnings("unused") diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/DefinitionPath.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/DefinitionPath.java index e998bc85e3..6fadd430c8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/DefinitionPath.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/DefinitionPath.java @@ -16,20 +16,18 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.property.Cardinality; import eu.esdihumboldt.hale.io.gml.writer.internal.StreamGmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; /** * Represents a path in a type definition hierarchy (regarding subtypes and @@ -103,9 +101,9 @@ public boolean isDowncast() { @Override public void prepareWrite(XMLStreamWriter writer) throws XMLStreamException { // add xsi:type - writer.writeAttribute(StreamGmlWriter.SCHEMA_INSTANCE_NS, "type", getType().getName() - .getLocalPart()); // XXX namespace needed for - // the attribute value? + writer.writeAttribute(StreamGmlWriter.SCHEMA_INSTANCE_NS, "type", + getType().getName().getLocalPart()); // XXX namespace needed for + // the attribute value? } /** @@ -260,8 +258,8 @@ else if (!type.equals(other.type)) // } /** - * Path element representing a group. XXX a {@link DefinitionPath} that is - * used for writing should never end on a {@link GroupElement}! + * Path element representing a group. XXX a {@link DefinitionPath} that is used + * for writing should never end on a {@link GroupElement}! * * @author Simon Templer */ @@ -516,8 +514,9 @@ public DefinitionPath(TypeDefinition firstType, QName elementName, boolean uniqu * @param elements the path elements */ public DefinitionPath(List elements) { - this(elements.get(elements.size() - 1).getType(), elements.get(elements.size() - 1) - .getName(), elements.get(elements.size() - 1).isUnique()); + this(elements.get(elements.size() - 1).getType(), + elements.get(elements.size() - 1).getName(), + elements.get(elements.size() - 1).isUnique()); steps.addAll(elements); } @@ -630,8 +629,8 @@ public TypeDefinition getGeometryCompatibleType() { /** * @param geometryWriter the geometryWriter to set - * @param geometryCompatibleType the type that was identified as compatible - * type by the writer + * @param geometryCompatibleType the type that was identified as compatible type + * by the writer */ public void setGeometryWriter(GeometryWriter geometryWriter, TypeDefinition geometryCompatibleType) { @@ -676,11 +675,11 @@ public QName getLastName() { } /** - * Get if the last element in the path is unique, which means that it cannot - * be repeated XXX not if last is a group + * Get if the last element in the path is unique, which means that it cannot be + * repeated XXX not if last is a group * - * @return if the last element in the path is unique, which means that it - * cannot be repeated + * @return if the last element in the path is unique, which means that it cannot + * be repeated */ public boolean isLastUnique() { return lastUnique; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/Descent.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/Descent.java index ee7372fece..b797b6b51d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/Descent.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/Descent.java @@ -16,15 +16,13 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry; +import eu.esdihumboldt.hale.io.gml.writer.internal.GmlWriterUtil; import java.text.MessageFormat; import java.util.List; import java.util.ListIterator; - import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import eu.esdihumboldt.hale.io.gml.writer.internal.GmlWriterUtil; - /** * Represents a descent in the document, must be used to end elements started * with @@ -81,12 +79,12 @@ public void close() throws XMLStreamException { * * @param writer the XML stream writer * @param descendPath the path to descend - * @param previousDescent the previous descent, that will be closed or - * partially closed as needed, may be null - * @param generateRequiredIDs if required IDs shall be generated for the - * path elements - * @return the descent that was opened, it must be closed to close the - * opened elements + * @param previousDescent the previous descent, that will be closed or partially + * closed as needed, may be null + * @param generateRequiredIDs if required IDs shall be generated for the path + * elements + * @return the descent that was opened, it must be closed to close the opened + * elements * @throws XMLStreamException if an error occurs writing the coordinates */ public static Descent descend(XMLStreamWriter writer, DefinitionPath descendPath, @@ -99,14 +97,14 @@ public static Descent descend(XMLStreamWriter writer, DefinitionPath descendPath * * @param writer the XML stream writer * @param descendPath the path to descend - * @param previousDescent the previous descent, that will be closed or - * partially closed as needed, may be null - * @param generateRequiredIDs if required IDs shall be generated for the - * path elements - * @param allowFullClose if it is allowed to fully close the previous - * descent regardless of element uniqueness - * @return the descent that was opened, it must be closed to close the - * opened elements + * @param previousDescent the previous descent, that will be closed or partially + * closed as needed, may be null + * @param generateRequiredIDs if required IDs shall be generated for the path + * elements + * @param allowFullClose if it is allowed to fully close the previous descent + * regardless of element uniqueness + * @return the descent that was opened, it must be closed to close the opened + * elements * @throws XMLStreamException if an error occurs writing the coordinates */ public static Descent descend(XMLStreamWriter writer, DefinitionPath descendPath, @@ -172,11 +170,9 @@ public static Descent descend(XMLStreamWriter writer, DefinitionPath descendPath } if (!endedSomething) { - throw new IllegalStateException( - MessageFormat - .format("Previous path ''{0}'' has only unique common elements with path ''{1}'', therefore a sequence of both is not possible", - previousDescent.getPath().toString(), - descendPath.toString())); + throw new IllegalStateException(MessageFormat.format( + "Previous path ''{0}'' has only unique common elements with path ''{1}'', therefore a sequence of both is not possible", + previousDescent.getPath().toString(), descendPath.toString())); } } else { diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/GeometryConverterRegistry.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/GeometryConverterRegistry.java index cb1d0dc60c..c41ddf7b30 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/GeometryConverterRegistry.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/GeometryConverterRegistry.java @@ -16,6 +16,11 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.MultiLineStringToLineString; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.MultiPointToPoint; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.MultiPolygonToMultiLineString; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.MultiPolygonToPolygon; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.PolygonToLineString; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -25,15 +30,8 @@ import java.util.Map; import java.util.Queue; import java.util.Set; - import org.locationtech.jts.geom.Geometry; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.MultiLineStringToLineString; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.MultiPointToPoint; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.MultiPolygonToMultiLineString; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.MultiPolygonToPolygon; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters.PolygonToLineString; - /** * Registry for {@link GeometryConverter}s * diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/GeometryWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/GeometryWriter.java index 3aaf0fd9fc..eb12ecc65f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/GeometryWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/GeometryWriter.java @@ -16,17 +16,14 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.text.DecimalFormat; import java.util.Set; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Geometry writer interface. A geometry holds information about compatibility * and encoding patterns for a certain geometry type. @@ -45,12 +42,11 @@ public interface GeometryWriter { public Class getGeometryType(); /** - * Get the compatible types' names for the geometry type that can be handled - * by this writer. The compatible types serve as entry points for the - * matching. + * Get the compatible types' names for the geometry type that can be handled by + * this writer. The compatible types serve as entry points for the matching. * - * @return the type names, a null namespace in a name - * references the GML namespace + * @return the type names, a null namespace in a name references + * the GML namespace */ public Set getCompatibleTypes(); @@ -68,22 +64,20 @@ public interface GeometryWriter { /** * Write a geometry. * - * At this point we can assume that the wrapping element matches one of the - * base patterns. The corresponding element name and its type definition are - * given. + * At this point we can assume that the wrapping element matches one of the base + * patterns. The corresponding element name and its type definition are given. * * @param writer the XML stream writer * @param geometry the geometry to write * @param elementType the last type definition in the matching path * @param elementName the corresponding element name * @param gmlNs the GML namespace - * @param decimalFormatter a decimal formatter to format geometry - * coordinates + * @param decimalFormatter a decimal formatter to format geometry coordinates * @throws XMLStreamException if an error occurs writing the geometry */ public void write(XMLStreamWriter writer, T geometry, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException; + throws XMLStreamException; /** * Determines if a geometry is valid to be written with the writer. diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/PathElement.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/PathElement.java index d3a2fbd035..3ce26699a9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/PathElement.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/PathElement.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Path element in a definition path * @@ -31,8 +30,7 @@ public interface PathElement { /** - * Get the path element name. This is either a property, group or sub-type - * name. + * Get the path element name. This is either a property, group or sub-type name. * * @return the element name */ @@ -41,8 +39,8 @@ public interface PathElement { /** * Get the path element type definition. * - * @return the path element type definition, , may be null if - * the element is transient + * @return the path element type definition, , may be null if the + * element is transient */ public abstract TypeDefinition getType(); @@ -55,8 +53,8 @@ public interface PathElement { public abstract boolean isProperty(); /** - * Determines if the the path element is transient and thus doesn't - * represent an element. + * Determines if the the path element is transient and thus doesn't represent an + * element. * * @return if the element is transient */ @@ -71,16 +69,14 @@ public interface PathElement { public boolean isDowncast(); /** - * Determines if this path element represents an element that can't be - * repeated. + * Determines if this path element represents an element that can't be repeated. * * @return if this path element represents an element that can't be repeated */ public boolean isUnique(); /** - * Write additional attributes/elements after the path element has been - * started. + * Write additional attributes/elements after the path element has been started. * * @param writer the XML stream writer * @throws XMLStreamException if an error occurs writing XML to the stream diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/StreamGeometryWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/StreamGeometryWriter.java index 77280acbd5..bcc65065bc 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/StreamGeometryWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/StreamGeometryWriter.java @@ -16,25 +16,6 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Nullable; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryCollection; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; @@ -62,6 +43,22 @@ import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers.PointWriter; import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers.PolygonWriter; import eu.esdihumboldt.hale.io.xsd.constraint.XmlAttributeFlag; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.annotation.Nullable; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryCollection; /** * Write geometries for a GML document. @@ -78,8 +75,8 @@ public class StreamGeometryWriter extends AbstractTypeMatcher writer) { * @param writer the XML stream writer * @param geometry the geometry * @param property the geometry property - * @param srsName the SRS name of a common SRS for the whole document, may - * be null + * @param srsName the SRS name of a common SRS for the whole document, may be + * null * @param report the reporter - * @param decimalFormatter a decimal formatter to format geometry - * coordinates + * @param decimalFormatter a decimal formatter to format geometry coordinates * @throws XMLStreamException if any error occurs writing the geometry */ public void write(XMLStreamWriter writer, Geometry geometry, PropertyDefinition property, String srsName, IOReporter report, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { // write eventual required id GmlWriterUtil.writeRequiredID(writer, property.getPropertyType(), null, false); @@ -325,8 +321,8 @@ public int priority(DefinitionPath path) { * * General - prefer simple types over composite types * - * MultiPolygons - prefer MultiSurface over - * CompositeSurface, because it is more flexible + * MultiPolygons - prefer MultiSurface over CompositeSurface, because it is more + * flexible * * MultiLineString - rely on validity check */ @@ -381,8 +377,8 @@ public List findCandidates(PropertyDefinition property, * @param writer the XML stream writer * @param geometry the geometry * @param path the definition path to use - * @param srsName the SRS name of a common SRS for the whole document, may - * be null + * @param srsName the SRS name of a common SRS for the whole document, may be + * null * @param decimalFormatter a decimal formatter for geometry values * @throws XMLStreamException if writing the geometry fails */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/AbstractGeometryCollectionConverter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/AbstractGeometryCollectionConverter.java index 03ed1aef13..cca7380851 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/AbstractGeometryCollectionConverter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/AbstractGeometryCollectionConverter.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryConverter; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryCollection; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryConverter; - /** * Converts a {@link GeometryCollection} to a single {@link Geometry}. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/AbstractGeometryConverter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/AbstractGeometryConverter.java index c7856b060a..cd6f1e710d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/AbstractGeometryConverter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/AbstractGeometryConverter.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryConverter; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryConverter; - /** * Abstract geometry converter implementation providing access to a * {@link GeometryFactory} @@ -31,8 +30,8 @@ * @param the source geometry type * @param the target geometry type */ -public abstract class AbstractGeometryConverter implements - GeometryConverter { +public abstract class AbstractGeometryConverter + implements GeometryConverter { /** * The geometry factory diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiLineStringToLineString.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiLineStringToLineString.java index 12a5a32b0b..7665063de9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiLineStringToLineString.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiLineStringToLineString.java @@ -29,8 +29,8 @@ * @partner 01 / Fraunhofer Institute for Computer Graphics Research * @version $Id$ */ -public class MultiLineStringToLineString extends - AbstractGeometryCollectionConverter { +public class MultiLineStringToLineString + extends AbstractGeometryCollectionConverter { /** * Default constructor diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiPolygonToMultiLineString.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiPolygonToMultiLineString.java index 6bd838af33..893ce3b165 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiPolygonToMultiLineString.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiPolygonToMultiLineString.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryConverter; import java.util.ArrayList; import java.util.List; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.MultiLineString; import org.locationtech.jts.geom.MultiPolygon; import org.locationtech.jts.geom.Polygon; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryConverter; - /** * Converts a {@link Polygon} to a {@link MultiLineString}. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiPolygonToPolygon.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiPolygonToPolygon.java index c5b6455b41..22628ccf4f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiPolygonToPolygon.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/MultiPolygonToPolygon.java @@ -26,8 +26,8 @@ * @partner 01 / Fraunhofer Institute for Computer Graphics Research * @version $Id$ */ -public class MultiPolygonToPolygon extends - AbstractGeometryCollectionConverter { +public class MultiPolygonToPolygon + extends AbstractGeometryCollectionConverter { /** * Default constructor diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/PolygonToLineString.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/PolygonToLineString.java index ec927a13eb..196b34f8cb 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/PolygonToLineString.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/PolygonToLineString.java @@ -12,13 +12,12 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.converters; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryConverter; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.Polygon; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryConverter; - /** * Converts a {@link Polygon} to a {@link LineString}. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractGeometryWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractGeometryWriter.java index 38a7978a18..1cec5e7d9b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractGeometryWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractGeometryWriter.java @@ -16,28 +16,25 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; +import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; +import eu.esdihumboldt.util.format.DecimalFormatUtil; import java.text.DecimalFormat; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; -import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; -import eu.esdihumboldt.util.format.DecimalFormatUtil; - /** * Abstract geometry writer implementation * @@ -87,8 +84,8 @@ public Set getCompatibleTypes() { } /** - * Add a compatible type. A {@link Pattern#GML_NAMESPACE_PLACEHOLDER} - * namespace references the GML namespace. + * Add a compatible type. A {@link Pattern#GML_NAMESPACE_PLACEHOLDER} namespace + * references the GML namespace. * * @param typeName the type name */ @@ -106,12 +103,12 @@ public Class getGeometryType() { /** * Verify the verification end point. After reaching the end-point of a - * verification pattern this method is called with the - * {@link TypeDefinition} of the end-point to assure the needed structure is - * present (e.g. a DirectPositionListType element). If no verification - * pattern is present the end-point of the matched base pattern will be - * verified. The default implementation checks for properties with any of - * the types supported for writing coordinates. + * verification pattern this method is called with the {@link TypeDefinition} of + * the end-point to assure the needed structure is present (e.g. a + * DirectPositionListType element). If no verification pattern is present the + * end-point of the matched base pattern will be verified. The default + * implementation checks for properties with any of the types supported for + * writing coordinates. * * @see #SUPPORTED_COORDINATES_TYPES * @@ -143,8 +140,7 @@ protected boolean verifyEndPoint(TypeDefinition endPoint) { * @param elementName the encompassing element name * @param gmlNs the GML namespace * @param unique if the path's start element cannot be repeated - * @param decimalFormatter a decimal formatter to format geometry - * coordinates + * @param decimalFormatter a decimal formatter to format geometry coordinates * @throws XMLStreamException if an error occurs writing the coordinates */ protected static void descendAndWriteCoordinates(XMLStreamWriter writer, Pattern descendPattern, @@ -166,8 +162,7 @@ protected static void descendAndWriteCoordinates(XMLStreamWriter writer, Pattern * @param coordinates the coordinates to write * @param elementType the type of the encompassing element * @param gmlNs the GML namespace - * @param decimalFormatter a decimal formatter to format geometry - * coordinates + * @param decimalFormatter a decimal formatter to format geometry coordinates * @throws XMLStreamException if an error occurs writing the coordinates */ protected static void writeCoordinates(XMLStreamWriter writer, Coordinate[] coordinates, @@ -202,9 +197,8 @@ protected static void writeCoordinates(XMLStreamWriter writer, Coordinate[] coor * @param gmlNs the GML namespace * @param posName the name of the desired DirectPositionType property, or * null if any - * @param decimalFormatter a decimal formatter to format geometry - * coordinates or null to use - * Double.toString() + * @param decimalFormatter a decimal formatter to format geometry coordinates or + * null to use Double.toString() * @return if writing the coordinates was successful * @throws XMLStreamException if an error occurs writing the coordinates */ @@ -263,8 +257,7 @@ protected static boolean writePos(XMLStreamWriter writer, Coordinate[] coordinat * @param coordinates the coordinates to write * @param elementType the type of the encompassing element * @param gmlNs the GML namespace - * @param decimalFormatter a decimal formatter to format geometry - * coordinates + * @param decimalFormatter a decimal formatter to format geometry coordinates * @return if writing the coordinates was successful * @throws XMLStreamException if an error occurs writing the coordinates */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractMultiPolygonWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractMultiPolygonWriter.java index 9bb5c2099a..486cebec7d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractMultiPolygonWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractMultiPolygonWriter.java @@ -16,20 +16,17 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.MultiPolygon; import org.locationtech.jts.geom.Polygon; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * Base class for writing {@link MultiPolygon}s, compatible types need to be * added. @@ -65,13 +62,13 @@ public AbstractMultiPolygonWriter() { } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, MultiPolygon geometry, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { for (int i = 0; i < geometry.getNumGeometries(); i++) { if (i > 0) { writer.writeStartElement(elementName.getNamespaceURI(), elementName.getLocalPart()); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractPathMatcher.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractPathMatcher.java index ca40b935e7..310ecc8f95 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractPathMatcher.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/AbstractPathMatcher.java @@ -16,18 +16,16 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.DefinitionPath; import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; +import java.util.HashSet; +import java.util.Set; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; /** * Abstract pattern based path matcher @@ -44,8 +42,8 @@ public abstract class AbstractPathMatcher { private final Set verifyPatterns = new HashSet(); /** - * Add a base pattern. When matching the path the pattern path is appended - * to the base path. + * Add a base pattern. When matching the path the pattern path is appended to + * the base path. * * @param pattern the pattern string * @see Pattern#parse(String) @@ -62,9 +60,9 @@ public void addBasePattern(String pattern) { /** * Add a verification pattern. If a match for a base pattern is found the - * verification patterns will be used to verify the structure. For a path to - * be accepted, all verification patterns must match and the resulting - * end-points of the verification patterns must be valid. + * verification patterns will be used to verify the structure. For a path to be + * accepted, all verification patterns must match and the resulting end-points + * of the verification patterns must be valid. * * @see #verifyEndPoint(TypeDefinition) * @@ -83,9 +81,9 @@ public void addVerificationPattern(String pattern) { /** * Add a verification pattern. If a match for a base pattern is found the - * verification patterns will be used to verify the structure. For a path to - * be accepted, all verification patterns must match and the resulting - * end-points of the verification patterns must be valid. + * verification patterns will be used to verify the structure. For a path to be + * accepted, all verification patterns must match and the resulting end-points + * of the verification patterns must be valid. * * @see #verifyEndPoint(TypeDefinition) * @@ -143,9 +141,9 @@ public DefinitionPath match(TypeDefinition type, DefinitionPath basePath, String } /* - * now either all verification patterns matched and the - * end-points were valid, or no verification patterns were - * specified and the base pattern end-point was valid + * now either all verification patterns matched and the end-points were valid, + * or no verification patterns were specified and the base pattern end-point was + * valid */ return path; } @@ -163,26 +161,25 @@ public DefinitionPath match(TypeDefinition type, DefinitionPath basePath, String * @param elementName the encompassing element name * @param defaultNs the pattern default namespace * @param unique if the path's start element cannot be repeated - * @return the descent that was opened, it must be closed to close the - * opened elements + * @return the descent that was opened, it must be closed to close the opened + * elements * @throws XMLStreamException if an error occurs writing the coordinates */ public static Descent descend(XMLStreamWriter writer, Pattern descendPattern, TypeDefinition elementType, QName elementName, String defaultNs, boolean unique) throws XMLStreamException { - DefinitionPath path = descendPattern.match(elementType, new DefinitionPath(elementType, - elementName, unique), defaultNs); + DefinitionPath path = descendPattern.match(elementType, + new DefinitionPath(elementType, elementName, unique), defaultNs); return Descent.descend(writer, path, null, true); } /** * Verify the verification end point. After reaching the end-point of a - * verification pattern this method is called with the - * {@link TypeDefinition} of the end-point to assure the needed structure is - * present (e.g. a DirectPositionListType element). If no verification - * pattern is present the end-point of the matched base pattern will be - * verified. + * verification pattern this method is called with the {@link TypeDefinition} of + * the end-point to assure the needed structure is present (e.g. a + * DirectPositionListType element). If no verification pattern is present the + * end-point of the matched base pattern will be verified. * * @param endPoint the end-point type definition * diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CompositeSurfaceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CompositeSurfaceWriter.java index 62be673265..ba8e7dce1c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CompositeSurfaceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CompositeSurfaceWriter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; import javax.xml.namespace.QName; - import org.locationtech.jts.geom.MultiPolygon; /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CurveSingleSegmentWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CurveSingleSegmentWriter.java index f2ba9df352..8ba40fe5a0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CurveSingleSegmentWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CurveSingleSegmentWriter.java @@ -16,18 +16,15 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * {@link LineString} writer for Curves * @@ -50,13 +47,13 @@ public CurveSingleSegmentWriter() { } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, LineString geometry, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { writeCoordinates(writer, geometry.getCoordinates(), elementType, gmlNs, decimalFormatter); } diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CurveWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CurveWriter.java index 3815f0979d..8e49c200c3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CurveWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/CurveWriter.java @@ -16,22 +16,19 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; +import eu.esdihumboldt.util.geometry.CurveHelper; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.MultiLineString; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; -import eu.esdihumboldt.util.geometry.CurveHelper; - /** * {@link MultiLineString} writer * @@ -56,13 +53,13 @@ public CurveWriter() { } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, MultiLineString geometry, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { // reorder segments geometry = CurveHelper.combineCurve(geometry, geometry.getFactory(), false); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/EnvelopeWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/EnvelopeWriter.java index fe5b1c6bdc..4f6eb42f23 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/EnvelopeWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/EnvelopeWriter.java @@ -16,20 +16,17 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Envelope; import org.locationtech.jts.geom.Geometry; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Writes geometries as Envelope. * @@ -62,7 +59,7 @@ public EnvelopeWriter() { @Override public void write(XMLStreamWriter writer, Geometry geom, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { // write envelope Envelope envelope = geom.getEnvelopeInternal(); if (!envelope.isNull()) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LegacyMultiPolygonWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LegacyMultiPolygonWriter.java index 004b2d6c7c..f9af6dd119 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LegacyMultiPolygonWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LegacyMultiPolygonWriter.java @@ -16,20 +16,17 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.MultiPolygon; import org.locationtech.jts.geom.Polygon; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * Writes {@link MultiPolygon}s * @@ -55,17 +52,22 @@ public LegacyMultiPolygonWriter() { addBasePattern("**/surfaceMember"); //$NON-NLS-1$ // verification patterns (from LegacyPolygonWriter) - addVerificationPattern("*/Polygon/outerBoundaryIs/LinearRing"); // both exterior //$NON-NLS-1$ - addVerificationPattern("*/Polygon/innerBoundaryIs/LinearRing"); // and interior elements must be present for contained polygons //$NON-NLS-1$ + addVerificationPattern("*/Polygon/outerBoundaryIs/LinearRing"); // both //$NON-NLS-1$ + // exterior + addVerificationPattern("*/Polygon/innerBoundaryIs/LinearRing"); // and //$NON-NLS-1$ + // interior elements must be + // present for contained + // polygons } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, MultiPolygon geometry, TypeDefinition elementType, - QName elementName, String gmlNs, DecimalFormat decimalFormatter) throws XMLStreamException { + QName elementName, String gmlNs, DecimalFormat decimalFormatter) + throws XMLStreamException { for (int i = 0; i < geometry.getNumGeometries(); i++) { if (i > 0) { writer.writeStartElement(elementName.getNamespaceURI(), elementName.getLocalPart()); @@ -75,8 +77,8 @@ public void write(XMLStreamWriter writer, MultiPolygon geometry, TypeDefinition elementType, elementName, gmlNs, false); Polygon poly = (Polygon) geometry.getGeometryN(i); - polygonWriter.write(writer, poly, descent.getPath().getLastType(), descent.getPath() - .getLastElement().getName(), gmlNs, decimalFormatter); + polygonWriter.write(writer, poly, descent.getPath().getLastType(), + descent.getPath().getLastElement().getName(), gmlNs, decimalFormatter); descent.close(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LegacyPolygonWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LegacyPolygonWriter.java index bc1af390fc..cbe3d04a0f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LegacyPolygonWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LegacyPolygonWriter.java @@ -16,19 +16,16 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.Polygon; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * {@link Polygon} writer for GML 2 type polygons * @@ -52,26 +49,30 @@ public LegacyPolygonWriter() { // verification patterns addVerificationPattern("*/outerBoundaryIs/LinearRing"); // both exterior //$NON-NLS-1$ - addVerificationPattern("*/innerBoundaryIs/LinearRing"); // and interior elements must be present //$NON-NLS-1$ + addVerificationPattern("*/innerBoundaryIs/LinearRing"); // and interior //$NON-NLS-1$ + // elements must be present } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat ) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat ) */ @Override public void write(XMLStreamWriter writer, Polygon polygon, TypeDefinition elementType, - QName elementName, String gmlNs, DecimalFormat decimalFormatter) throws XMLStreamException { + QName elementName, String gmlNs, DecimalFormat decimalFormatter) + throws XMLStreamException { // write exterior ring LineString exterior = polygon.getExteriorRing(); descendAndWriteCoordinates(writer, Pattern.parse("*/outerBoundaryIs/LinearRing"), //$NON-NLS-1$ - exterior.getCoordinates(), elementType, elementName, gmlNs, false, decimalFormatter); + exterior.getCoordinates(), elementType, elementName, gmlNs, false, + decimalFormatter); // write interior rings for (int i = 0; i < polygon.getNumInteriorRing(); i++) { LineString interior = polygon.getInteriorRingN(i); descendAndWriteCoordinates(writer, Pattern.parse("*/innerBoundaryIs/LinearRing"), //$NON-NLS-1$ - interior.getCoordinates(), elementType, elementName, gmlNs, false, decimalFormatter); + interior.getCoordinates(), elementType, elementName, gmlNs, false, + decimalFormatter); } } diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LineStringWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LineStringWriter.java index 3c959c5b83..9c8f262a98 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LineStringWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/LineStringWriter.java @@ -16,18 +16,15 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * Writer for {@link LineString}s * @@ -50,13 +47,13 @@ public LineStringWriter() { } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, LineString geometry, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { writeCoordinates(writer, geometry.getCoordinates(), elementType, gmlNs, decimalFormatter); } diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiCurveWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiCurveWriter.java index a3650d4e7f..07cff342f2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiCurveWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiCurveWriter.java @@ -16,20 +16,17 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.MultiLineString; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * Writes {@link MultiLineString} in gml:MultiCurveTypes * @@ -55,13 +52,13 @@ public MultiCurveWriter() { } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, MultiLineString geometry, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { for (int i = 0; i < geometry.getNumGeometries(); i++) { if (i > 0) { writer.writeStartElement(elementName.getNamespaceURI(), elementName.getLocalPart()); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiLineStringWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiLineStringWriter.java index cf9f0554c8..33b065c038 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiLineStringWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiLineStringWriter.java @@ -16,20 +16,17 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.MultiLineString; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * Writes {@link MultiLineString} in gml:MultiLineStringTypes * @@ -45,7 +42,22 @@ public MultiLineStringWriter() { super(MultiLineString.class); // compatible types to serve as entry point - addCompatibleType(new QName("http://www.opengis.net/gml", "MultiLineStringType")); // restrict to "old" gml namespace (is depreceated since 3.0) -> use Curve instead in GML 3.2 //$NON-NLS-1$ //$NON-NLS-2$ + addCompatibleType(new QName("http://www.opengis.net/gml", "MultiLineStringType")); // restrict //$NON-NLS-1$ //$NON-NLS-2$ + // to + // "old" + // gml + // namespace + // (is + // depreceated + // since + // 3.0) + // -> + // use + // Curve + // instead + // in + // GML + // 3.2 // patterns for matching inside compatible types addBasePattern("*/lineStringMember"); //$NON-NLS-1$ @@ -55,12 +67,13 @@ public MultiLineStringWriter() { } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, MultiLineString geometry, TypeDefinition elementType, - QName elementName, String gmlNs, DecimalFormat decimalFormatter) throws XMLStreamException { + QName elementName, String gmlNs, DecimalFormat decimalFormatter) + throws XMLStreamException { for (int i = 0; i < geometry.getNumGeometries(); i++) { if (i > 0) { writer.writeStartElement(elementName.getNamespaceURI(), elementName.getLocalPart()); @@ -70,7 +83,8 @@ public void write(XMLStreamWriter writer, MultiLineString geometry, TypeDefiniti elementType, elementName, gmlNs, false); LineString line = (LineString) geometry.getGeometryN(i); - writeCoordinates(writer, line.getCoordinates(), descent.getPath().getLastType(), gmlNs, decimalFormatter); + writeCoordinates(writer, line.getCoordinates(), descent.getPath().getLastType(), gmlNs, + decimalFormatter); descent.close(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiPointWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiPointWriter.java index 5449950c3b..72b823dadc 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiPointWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiPointWriter.java @@ -16,20 +16,17 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.MultiPoint; import org.locationtech.jts.geom.Point; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.Descent; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * Write {@link MultiPoint}s * @@ -57,13 +54,13 @@ public MultiPointWriter() { } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, MultiPoint geometry, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { for (int i = 0; i < geometry.getNumGeometries(); i++) { if (i > 0) { writer.writeStartElement(elementName.getNamespaceURI(), elementName.getLocalPart()); diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiPolygonWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiPolygonWriter.java index 1adb4015a0..d6990534fc 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiPolygonWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/MultiPolygonWriter.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; import javax.xml.namespace.QName; - import org.locationtech.jts.geom.MultiPolygon; /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/Pattern.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/Pattern.java index 929440c550..72600893c0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/Pattern.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/Pattern.java @@ -16,19 +16,17 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.GmlWriterUtil; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.DefinitionPath; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.List; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.GmlWriterUtil; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.DefinitionPath; - /** * Represents a pattern for matching an abstract path * @@ -115,12 +113,12 @@ public QName getName() { public static final String GML_NAMESPACE_PLACEHOLDER = "_____________gml_____________"; /** - * Parse a pattern from the given string. Pattern elements must be separated - * by /. Valid elements are * (one XML element - * with any name), ** (any number of XML elements with any - * name) and an XML element name. An XML element name may also include a - * namespace, the namespace must be wrapped by quotes ("). If - * no namespace is specified the GML namespace is assumed. + * Parse a pattern from the given string. Pattern elements must be separated by + * /. Valid elements are * (one XML element with any + * name), ** (any number of XML elements with any name) and an XML + * element name. An XML element name may also include a namespace, the namespace + * must be wrapped by quotes ("). If no namespace is specified the + * GML namespace is assumed. * * @param pattern the pattern string * @@ -174,14 +172,14 @@ else if (part.equals(WILDCARD_ANY)) { String namespace = part.substring(1, index).trim(); String name = part.substring(index + 1).trim(); - elements.add(new PatternElement(ElementType.NAMED_ELEMENT, new QName( - namespace, name))); + elements.add(new PatternElement(ElementType.NAMED_ELEMENT, + new QName(namespace, name))); } } else { // element name only, assuming GML namespace - elements.add(new PatternElement(ElementType.NAMED_ELEMENT, new QName( - GML_NAMESPACE_PLACEHOLDER, part))); + elements.add(new PatternElement(ElementType.NAMED_ELEMENT, + new QName(GML_NAMESPACE_PLACEHOLDER, part))); } } } @@ -290,8 +288,8 @@ else if (fPath == null) { * @param type the type definition * @param path the definition path * @param gmlNs the GML namespace - * @param checkedTypes the type definitions that have already been checked - * (to prevent cycles) + * @param checkedTypes the type definitions that have already been checked (to + * prevent cycles) * @param remainingElements the remaining elements to match * * @return the new path if there is a match, null otherwise @@ -412,14 +410,15 @@ private static DefinitionPath match(TypeDefinition type, DefinitionPath path, St // step down properties @java.lang.SuppressWarnings("unchecked") - Iterable> children = (Iterable>) ((path.isEmpty()) ? (type - .getChildren()) : (type.getDeclaredChildren())); - Iterable childPaths = GmlWriterUtil.collectPropertyPaths(children, - path, true); + Iterable> children = (Iterable>) ((path.isEmpty()) + ? (type.getChildren()) + : (type.getDeclaredChildren())); + Iterable childPaths = GmlWriterUtil.collectPropertyPaths(children, path, + true); for (DefinitionPath childPath : childPaths) { DefinitionPath candidate = match(childPath.getLastType(), childPath, gmlNs, - new HashSet(checkedTypes), new ArrayList( - remainingElements)); + new HashSet(checkedTypes), + new ArrayList(remainingElements)); if (candidate != null) { return candidate; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PointWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PointWriter.java index e950fb7c9d..f6cb17597f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PointWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PointWriter.java @@ -16,18 +16,15 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.Point; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * {@link Point} writer * @@ -51,13 +48,13 @@ public PointWriter() { } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, Point geometry, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { writeCoordinates(writer, geometry.getCoordinates(), elementType, gmlNs, decimalFormatter); } diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PolygonWriter.java b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PolygonWriter.java index c13feb90c6..1bc1e190e5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PolygonWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/src/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PolygonWriter.java @@ -16,19 +16,16 @@ package eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; import java.text.DecimalFormat; - import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.Polygon; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.GeometryWriter; - /** * {@link Polygon} writer * @@ -59,13 +56,13 @@ public PolygonWriter() { } /** - * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, - * QName, String, DecimalFormat) + * @see GeometryWriter#write(XMLStreamWriter, Geometry, TypeDefinition, QName, + * String, DecimalFormat) */ @Override public void write(XMLStreamWriter writer, Polygon polygon, TypeDefinition elementType, QName elementName, String gmlNs, DecimalFormat decimalFormatter) - throws XMLStreamException { + throws XMLStreamException { // write exterior ring LineString exterior = polygon.getExteriorRing(); descendAndWriteCoordinates(writer, Pattern.parse("*/exterior/LinearRing"), //$NON-NLS-1$ diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollectionTest.java b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollectionTest.java index 3d376af1cc..4877688528 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollectionTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollectionTest.java @@ -21,17 +21,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.io.IOException; -import java.math.BigDecimal; -import java.net.URI; -import java.util.Collection; - -import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.BeforeClass; -import org.junit.Test; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; @@ -46,6 +35,14 @@ import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.io.IOException; +import java.math.BigDecimal; +import java.net.URI; +import java.util.Collection; +import javax.xml.namespace.QName; +import org.junit.BeforeClass; +import org.junit.Test; /** * Tests for {@link GmlInstanceCollection} @@ -65,8 +62,8 @@ public static void waitForServices() { } /** - * Test loading a simple XML file with one instance, containing mixed - * content elements. + * Test loading a simple XML file with one instance, containing mixed content + * elements. * * @throws Exception if an error occurs */ @@ -95,9 +92,8 @@ public void testLoadMixed() throws Exception { assertTrue(item1 instanceof Instance); /* - * XXX mixed content properties currently are treated rather - * special, currently ignoring elements and only using the - * attributes and text. + * XXX mixed content properties currently are treated rather special, currently + * ignoring elements and only using the attributes and text. */ Object[] note1 = ((Instance) item1).getProperty(new QName(ns, "note")); @@ -312,8 +308,7 @@ public void testLoadChoice() throws Exception { } /** - * Test loading a simple XML file with one instance including an - * group. + * Test loading a simple XML file with one instance including an group. * * @throws Exception if an error occurs */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/reader/internal/StreamGmlReaderTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/reader/internal/StreamGmlReaderTest.groovy index bcd6f90961..9ccc01bd7c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/reader/internal/StreamGmlReaderTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/reader/internal/StreamGmlReaderTest.groovy @@ -15,13 +15,7 @@ package eu.esdihumboldt.hale.io.gml.reader.internal -import eu.esdihumboldt.util.test.AbstractPlatformTest - -import static org.junit.Assert.*; - -import org.junit.Ignore -import org.junit.Test -import org.opengis.referencing.crs.CoordinateReferenceSystem +import static org.junit.Assert.* import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier @@ -33,7 +27,11 @@ import eu.esdihumboldt.hale.common.instance.model.ext.InstanceIterator import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.transform.CompileStatic +import org.junit.Ignore +import org.junit.Test +import org.opengis.referencing.crs.CoordinateReferenceSystem /** * Tests for {@link StreamGmlReader} diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy index 37880c804c..f8d6580a31 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriter2Test.groovy @@ -15,19 +15,8 @@ package eu.esdihumboldt.hale.io.gml.writer.internal -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static org.junit.Assert.* -import java.util.function.Consumer - -import org.junit.BeforeClass -import org.junit.Ignore -import org.junit.Test -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.LineString -import org.locationtech.jts.geom.MultiLineString - import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.core.io.report.IOReport import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier @@ -47,7 +36,15 @@ import eu.esdihumboldt.hale.common.test.TestUtil import eu.esdihumboldt.hale.io.gml.writer.GmlInstanceWriter import eu.esdihumboldt.hale.io.xsd.model.XmlIndex import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.transform.CompileStatic +import java.util.function.Consumer +import org.junit.BeforeClass +import org.junit.Ignore +import org.junit.Test +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.LineString +import org.locationtech.jts.geom.MultiLineString /** * GML writer tests with a focus on geometries. diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriterTest.java b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriterTest.java index 40d8329515..b7f16eb8ad 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriterTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/StreamGmlWriterTest.java @@ -21,35 +21,6 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.LinearRing; -import org.locationtech.jts.geom.MultiLineString; -import org.locationtech.jts.geom.MultiPoint; -import org.locationtech.jts.geom.MultiPolygon; -import org.locationtech.jts.geom.Point; -import org.locationtech.jts.geom.Polygon; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -84,6 +55,31 @@ import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader; import eu.esdihumboldt.util.geometry.WindingOrder; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import javax.xml.namespace.QName; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.LinearRing; +import org.locationtech.jts.geom.MultiLineString; +import org.locationtech.jts.geom.MultiPoint; +import org.locationtech.jts.geom.MultiPolygon; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; /** * Tests for {@link StreamGmlWriter}. @@ -479,8 +475,7 @@ public void testGeometry_2_MultiLineString() throws Exception { } /** - * Test writing a {@link MultiLineString} to a GML 3.2 geometry primitive - * type + * Test writing a {@link MultiLineString} to a GML 3.2 geometry primitive type * * @throws Exception if an error occurs */ @@ -502,8 +497,7 @@ public void testGeometryPrimitive_32_MultiLineString() throws Exception { } /** - * Test writing a {@link MultiLineString} to a GML 3.2 geometry primitive - * type + * Test writing a {@link MultiLineString} to a GML 3.2 geometry primitive type * * @throws Exception if an error occurs */ @@ -525,8 +519,7 @@ public void testGeometryPrimitive_32_MultiLineString_Curve1() throws Exception { } /** - * Test writing a {@link MultiLineString} to a GML 3.2 geometry primitive - * type + * Test writing a {@link MultiLineString} to a GML 3.2 geometry primitive type * * @throws Exception if an error occurs */ @@ -548,8 +541,7 @@ public void testGeometryPrimitive_32_MultiLineString_Curve2() throws Exception { } /** - * Test writing a {@link MultiLineString} to a GML 3.2 geometry aggregate - * type + * Test writing a {@link MultiLineString} to a GML 3.2 geometry aggregate type * * @throws Exception if an error occurs */ @@ -638,8 +630,8 @@ public void testGeometryAggregate_32_MultiPolygon() throws Exception { } /** - * Test writing a {@link MultiPolygon} to a GML 3.2 geometry primitive type - * with Winding Order in CounterClockWise + * Test writing a {@link MultiPolygon} to a GML 3.2 geometry primitive type with + * Winding Order in CounterClockWise * * @throws Exception if an error occurs */ @@ -661,8 +653,8 @@ public void testGeometryPrimitive_32_MultiPolygon_WindingOrder_CCW() throws Exce } /** - * Test writing a {@link MultiPolygon} to a GML 3.2 geometry primitive type - * with Winding Order in ClockWise + * Test writing a {@link MultiPolygon} to a GML 3.2 geometry primitive type with + * Winding Order in ClockWise * * @throws Exception if an error occurs */ @@ -685,8 +677,8 @@ public void testGeometryPrimitive_32_MultiPolygon_WindingOrder_CW() throws Excep } /** - * Test writing a {@link MultiPolygon} to a GML 3.2 geometry primitive type - * with Winding Order in ClockWise + * Test writing a {@link MultiPolygon} to a GML 3.2 geometry primitive type with + * Winding Order in ClockWise * * @throws Exception if an error occurs */ @@ -709,14 +701,14 @@ public void testGeometryPrimitive_32_MultiPolygon_WindingOrder() throws Exceptio } /** - * Create a feature, fill it with values, write it as GML, validate the GML - * and load the GML file again to compare the loaded values with the ones - * that were written + * Create a feature, fill it with values, write it as GML, validate the GML and + * load the GML file again to compare the loaded values with the ones that were + * written * * @param elementName the element name of the feature type to use, if * null a random element will be used - * @param targetSchema the schema to use, the first element will be used for - * the type of the feature + * @param targetSchema the schema to use, the first element will be used for the + * type of the feature * @param values the values to set on the feature * @param testName the name of the test * @param srsName the SRS name @@ -729,21 +721,21 @@ private IOReport fillFeatureTest(String elementName, URI targetSchema, } /** - * Create a feature, fill it with values, write it as GML, validate the GML - * and load the GML file again to compare the loaded values with the ones - * that were written + * Create a feature, fill it with values, write it as GML, validate the GML and + * load the GML file again to compare the loaded values with the ones that were + * written * * @param elementName the element name of the feature type to use, if * null a random element will be used - * @param targetSchema the schema to use, the first element will be used for - * the type of the feature + * @param targetSchema the schema to use, the first element will be used for the + * type of the feature * @param values the values to set on the feature * @param testName the name of the test * @param srsName the SRS name * @param skipValueTest if the check for equality shall be skipped * @param expectWriteFail if the GML writing is expected to fail - * @return the validation report or the GML writing report if writing - * expected to fail + * @return the validation report or the GML writing report if writing expected + * to fail * @throws Exception if any error occurs */ private IOReport fillFeatureTest(String elementName, URI targetSchema, @@ -754,22 +746,22 @@ private IOReport fillFeatureTest(String elementName, URI targetSchema, } /** - * Create a feature, fill it with values, write it as GML, validate the GML - * and load the GML file again to compare the loaded values with the ones - * that were written + * Create a feature, fill it with values, write it as GML, validate the GML and + * load the GML file again to compare the loaded values with the ones that were + * written * * @param elementName the element name of the feature type to use, if * null a random element will be used - * @param targetSchema the schema to use, the first element will be used for - * the type of the feature + * @param targetSchema the schema to use, the first element will be used for the + * type of the feature * @param values the values to set on the feature * @param testName the name of the test * @param srsName the SRS name * @param skipValueTest if the check for equality shall be skipped * @param expectWriteFail if the GML writing is expected to fail * @param windingOrderParam winding order parameter or null - * @return the validation report or the GML writing report if writing - * expected to fail + * @return the validation report or the GML writing report if writing expected + * to fail * @throws Exception if any error occurs */ private IOReport fillFeatureTest(String elementName, URI targetSchema, @@ -1023,8 +1015,8 @@ public static InstanceCollection loadGML(URI sourceData, Schema schema) * @param xmlLocation the location of the XML file * @param validationSchemas schemas needed for validation * @return the validation report - * @throws IOProviderConfigurationException if the validator is not - * configured correctly + * @throws IOProviderConfigurationException if the validator is not configured + * correctly * @throws IOException if I/O operations fail */ public static IOReport validate(URI xmlLocation, List validationSchemas) diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/PolygonToLineStringTest.java b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/PolygonToLineStringTest.java index 4ab0566fc6..52e6310f52 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/PolygonToLineStringTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/converters/PolygonToLineStringTest.java @@ -19,7 +19,6 @@ import static org.junit.Assert.assertEquals; import org.junit.Test; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.LinearRing; diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PatternTest.java b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PatternTest.java index b215276c48..9054be47a4 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PatternTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml/test/eu/esdihumboldt/hale/io/gml/writer/internal/geometry/writers/PatternTest.java @@ -22,13 +22,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.junit.Ignore; -import org.junit.Test; - import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.AbstractFlag; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition; @@ -37,6 +30,10 @@ import eu.esdihumboldt.hale.io.gml.writer.internal.geometry.PathElement; import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; +import java.util.List; +import javax.xml.namespace.QName; +import org.junit.Ignore; +import org.junit.Test; /** * Tests for {@link Pattern} @@ -110,24 +107,24 @@ private TypeDefinition createCurveType() { curve.getConstraint(XmlElements.class).addElement(curveElement); // create the segments property for curve - TypeDefinition segArray = new DefaultTypeDefinition(new QName(GML_NS, - "CurveSegmentArrayPropertyType")); //$NON-NLS-1$ + TypeDefinition segArray = new DefaultTypeDefinition( + new QName(GML_NS, "CurveSegmentArrayPropertyType")); //$NON-NLS-1$ new DefaultPropertyDefinition(new QName("segments"), curve, segArray); // create the AbstractCurveSegement property for segArray - DefaultTypeDefinition absSeg = new DefaultTypeDefinition(new QName(GML_NS, - "AbstractCurveSegementType")); //$NON-NLS-1$ + DefaultTypeDefinition absSeg = new DefaultTypeDefinition( + new QName(GML_NS, "AbstractCurveSegementType")); //$NON-NLS-1$ absSeg.setConstraint(AbstractFlag.ENABLED); new DefaultPropertyDefinition(new QName("AbstractCurveSegment"), segArray, absSeg); // add dummy sub-type - DefaultTypeDefinition subtype = new DefaultTypeDefinition(new QName( - "somespace", "SomeSegmentType")); //$NON-NLS-1$ //$NON-NLS-2$ + DefaultTypeDefinition subtype = new DefaultTypeDefinition( + new QName("somespace", "SomeSegmentType")); //$NON-NLS-1$ //$NON-NLS-2$ subtype.setSuperType(absSeg); // create the LineStringSegmentType sub-type - DefaultTypeDefinition lineSeg = new DefaultTypeDefinition(new QName(GML_NS, - "LineStringSegmentType")); //$NON-NLS-1$ + DefaultTypeDefinition lineSeg = new DefaultTypeDefinition( + new QName(GML_NS, "LineStringSegmentType")); //$NON-NLS-1$ lineSeg.setSuperType(absSeg); XmlElement lineSegElement = new XmlElement(new QName(GML_NS, "LineStringSegment"), lineSeg, new QName(GML_NS, "AbstractCurveSegment")); diff --git a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/GroovySnippets.java b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/GroovySnippets.java index 58aef96783..f88e914e93 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/GroovySnippets.java +++ b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/GroovySnippets.java @@ -15,21 +15,19 @@ package eu.esdihumboldt.hale.io.groovy.snippets; +import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import groovy.lang.Binding; +import groovy.lang.Closure; +import groovy.lang.GroovyObjectSupport; +import groovy.lang.Script; import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; - import org.codehaus.groovy.runtime.InvokerHelper; -import eu.esdihumboldt.hale.common.core.service.ServiceProvider; -import groovy.lang.Binding; -import groovy.lang.Closure; -import groovy.lang.GroovyObjectSupport; -import groovy.lang.Script; - /** * Access snippets in Groovy binding. * @@ -38,8 +36,7 @@ public class GroovySnippets extends GroovyObjectSupport { /** - * Binding of the marker variable that specifies that the snippet runs in - * hale. + * Binding of the marker variable that specifies that the snippet runs in hale. */ public static final String BINDING_HALE_MARKER = "runs_in_hale"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/AbstractSnippetReader.java b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/AbstractSnippetReader.java index 35848cab7f..daec33d942 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/AbstractSnippetReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/AbstractSnippetReader.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.io.groovy.snippets.impl; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider; import eu.esdihumboldt.hale.io.groovy.snippets.Snippet; import eu.esdihumboldt.hale.io.groovy.snippets.SnippetReader; +import java.util.Map; /** * Base class for snippet readers. diff --git a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/FileSnippet.java b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/FileSnippet.java index 6bdfe98587..73a6dc94c5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/FileSnippet.java +++ b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/FileSnippet.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.groovy.snippets.impl; -import java.io.File; -import java.nio.charset.Charset; - import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.io.groovy.snippets.Snippet; import groovy.lang.Script; +import java.io.File; +import java.nio.charset.Charset; /** * Snippet that is reloaded when the underlying file has changed. diff --git a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/SnippetReaderImpl.java b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/SnippetReaderImpl.java index 6e222f0da1..727303f716 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/SnippetReaderImpl.java +++ b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/SnippetReaderImpl.java @@ -15,14 +15,6 @@ package eu.esdihumboldt.hale.io.groovy.snippets.impl; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.nio.charset.Charset; - -import org.apache.commons.io.IOUtils; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -33,6 +25,12 @@ import eu.esdihumboldt.util.groovy.sandbox.GroovyService; import groovy.lang.Binding; import groovy.lang.Script; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.nio.charset.Charset; +import org.apache.commons.io.IOUtils; /** * Default snippet reader. diff --git a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/SnippetServiceImpl.java b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/SnippetServiceImpl.java index 5df6dc0377..38b80d3af6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/SnippetServiceImpl.java +++ b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/SnippetServiceImpl.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.io.groovy.snippets.impl; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - import eu.esdihumboldt.hale.io.groovy.snippets.Snippet; import eu.esdihumboldt.hale.io.groovy.snippets.SnippetService; import eu.esdihumboldt.util.groovy.sandbox.GroovyService; import eu.esdihumboldt.util.groovy.sandbox.GroovyServiceListener; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; /** * Default snippet service implementation. diff --git a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/URISnippet.java b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/URISnippet.java index ae473b28ff..c3e5dfd6ce 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/URISnippet.java +++ b/io/plugins/eu.esdihumboldt.hale.io.groovy/src/eu/esdihumboldt/hale/io/groovy/snippets/impl/URISnippet.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.groovy.snippets.impl; -import java.net.URI; -import java.nio.charset.Charset; - import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; import eu.esdihumboldt.hale.common.core.service.ServiceProvider; import eu.esdihumboldt.hale.io.groovy.snippets.Snippet; import groovy.lang.Script; +import java.net.URI; +import java.nio.charset.Charset; /** * Snippet that is already loaded. diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/BasePathManager.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/BasePathManager.java index a1e1951c67..86f225d3f3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/BasePathManager.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/BasePathManager.java @@ -36,8 +36,8 @@ public interface BasePathManager extends BasePathResolver { * Set the base path of a hale connect microservice (e.g. * "https://users.haleconnect.com/v1" for the user service) * - * @param service service to set the base path for, usually one of the - * constants defined in {@link HaleConnectServices} + * @param service service to set the base path for, usually one of the constants + * defined in {@link HaleConnectServices} * @param basePath Base path to set */ void setBasePath(String service, String basePath); diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/BasePathResolver.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/BasePathResolver.java index c9e97b0e1d..7a764999f6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/BasePathResolver.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/BasePathResolver.java @@ -27,8 +27,8 @@ public interface BasePathResolver { * * The resolver must make sure that the base path does not end with a '/'. * - * @param service The service to resolve the base path of, usually one of - * the constants in {@link HaleConnectServices} + * @param service The service to resolve the base path of, usually one of the + * constants in {@link HaleConnectServices} * @return the base path if it could be resolved, null otherwise */ String getBasePath(String service); diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectException.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectException.java index b40a21fa41..09b1dae69f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectException.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectException.java @@ -67,15 +67,15 @@ public HaleConnectException(String message, Throwable cause) { /** * Creates a HaleConnectException * - * @param message the detail message (which is saved for later retrieval by - * the {@link #getMessage()} method). + * @param message the detail message (which is saved for later retrieval by the + * {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the * {@link #getCause()} method). (A null value is * permitted, and indicates that the cause is nonexistent or * unknown.) * @param statusCode The status code returned by the hale connect service - * @param responseHeaders The response headers of the service response (may - * be null) + * @param responseHeaders The response headers of the service response (may be + * null) */ public HaleConnectException(String message, Throwable cause, int statusCode, Map> responseHeaders) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectInputSupplier.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectInputSupplier.java index a78295cc40..9f94a6f5d2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectInputSupplier.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectInputSupplier.java @@ -15,21 +15,19 @@ package eu.esdihumboldt.hale.io.haleconnect; -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; - import com.haleconnect.api.projectstore.v1.ApiException; import com.haleconnect.api.projectstore.v1.ApiResponse; import com.haleconnect.api.projectstore.v1.api.BucketsApi; import com.haleconnect.api.projectstore.v1.api.FilesApi; import com.haleconnect.api.projectstore.v1.model.BucketDetail; - import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; import eu.esdihumboldt.hale.io.haleconnect.internal.ProjectStoreHelper; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; /** * I/O supplier for projects imported from hale connect diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectService.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectService.java index b721e28757..2ee2f287de 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectService.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectService.java @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.io.haleconnect; -import java.io.File; -import java.io.InputStream; -import java.util.List; - import com.google.common.util.concurrent.ListenableFuture; - import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import eu.esdihumboldt.hale.io.haleconnect.project.SharingOptions; +import java.io.File; +import java.io.InputStream; +import java.util.List; /** * Facade for the hale connect microservices @@ -147,9 +145,9 @@ public interface HaleConnectService { * RESOURCE_ constants defined in * {@link HaleConnectService}. * @param role The assumed role. This has to be either user (to - * test if the user has a permission in his own right) or the ID - * of an organisation (to test if a user has a permission on - * behalf of an organisation). + * test if the user has a permission in his own right) or the ID of + * an organisation (to test if a user has a permission on behalf of + * an organisation). * @param permission the permission to test, usually one of the * PERMISSION_ constants defined in * {@link HaleConnectService}. @@ -168,8 +166,8 @@ boolean testUserPermission(String resourceType, String role, String permission) * * @param owner Owner of the project * @param projectId ID of the project - * @return Information on the specified project or null if the project does - * not exist + * @return Information on the specified project or null if the project does not + * exist * @throws HaleConnectException thrown on any API exception */ HaleConnectProjectInfo getProject(Owner owner, String projectId) throws HaleConnectException; @@ -178,9 +176,9 @@ boolean testUserPermission(String resourceType, String role, String permission) * Get a list of available hale connect transformation projects * * @param contextOrganisation If provided, projects owned by the given - * organisation will be returned if the currently logged in user - * has sufficient permissions. If null is passed, - * projects owned by the current user will be returned. + * organisation will be returned if the currently logged in user has + * sufficient permissions. If null is passed, projects + * owned by the current user will be returned. * @return a list of available projects * @throws HaleConnectException thrown on any API error */ @@ -191,9 +189,9 @@ List getProjects(String contextOrganisation) * Get a list of available hale connect transformation projects * * @param contextOrganisation If provided, projects owned by the given - * organisation will be returned if the currently logged in user - * has sufficient permissions. If null is passed, - * projects owned by the current user will be returned. + * organisation will be returned if the currently logged in user has + * sufficient permissions. If null is passed, projects + * owned by the current user will be returned. * @return {@link ListenableFuture} of the result * @throws HaleConnectException thrown on any API error */ @@ -245,8 +243,7 @@ boolean uploadProjectFile(String projectId, Owner owner, File file, ProgressIndi * @param file the file to upload * @param progress a progress indicator * @return a {@link ListenableFuture} whose value will be set to true upon - * successful completion of the request or false when the request - * fails + * successful completion of the request or false when the request fails * @throws HaleConnectException thrown on any API exception */ ListenableFuture uploadProjectFileAsync(String projectId, Owner owner, File file, diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectUrnBuilder.groovy b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectUrnBuilder.groovy index 067734c6ed..1b450655df 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectUrnBuilder.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/HaleConnectUrnBuilder.groovy @@ -15,11 +15,9 @@ package eu.esdihumboldt.hale.io.haleconnect; -import java.text.MessageFormat; - -import org.apache.commons.lang.StringUtils; - import groovy.transform.CompileStatic +import java.text.MessageFormat +import org.apache.commons.lang.StringUtils /** * Helper for building and decomposing hale-connect project URNs. diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/OwnerType.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/OwnerType.java index d552df9f55..cbbb196399 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/OwnerType.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/OwnerType.java @@ -23,6 +23,7 @@ * @author Florian Esser */ public enum OwnerType { + /** * A user */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ApiClientHelper.groovy b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ApiClientHelper.groovy index 7ad8c23051..aee680a0d3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ApiClientHelper.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ApiClientHelper.groovy @@ -17,13 +17,11 @@ package eu.esdihumboldt.hale.io.haleconnect.internal import static com.squareup.okhttp.CipherSuite.* -import java.text.MessageFormat - import com.squareup.okhttp.ConnectionSpec import com.squareup.okhttp.TlsVersion - import eu.esdihumboldt.hale.io.haleconnect.BasePathResolver import eu.esdihumboldt.util.http.ProxyUtil +import java.text.MessageFormat /** * Helper class for the ApiClient classes of the different hale connect APIs diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/BucketServiceHelper.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/BucketServiceHelper.java index 33ecd1255b..5a029d9486 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/BucketServiceHelper.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/BucketServiceHelper.java @@ -17,7 +17,6 @@ import com.haleconnect.api.bucket.v1.ApiClient; import com.haleconnect.api.bucket.v1.api.BucketsApi; - import eu.esdihumboldt.hale.io.haleconnect.BasePathResolver; import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServices; diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/HaleConnectServiceImpl.groovy b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/HaleConnectServiceImpl.groovy index 3511db72d7..d59ed9a065 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/HaleConnectServiceImpl.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/HaleConnectServiceImpl.groovy @@ -15,51 +15,48 @@ package eu.esdihumboldt.hale.io.haleconnect.internal; -import java.text.MessageFormat; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArraySet; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.atomic.AtomicLong; - -import org.apache.commons.lang.StringUtils; - import com.google.common.util.concurrent.AbstractFuture -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.SettableFuture; -import com.haleconnect.api.projectstore.v1.ApiCallback; -import com.haleconnect.api.projectstore.v1.api.BucketsApi; -import com.haleconnect.api.projectstore.v1.api.FilesApi; -import com.haleconnect.api.projectstore.v1.api.PermissionsApi; -import com.haleconnect.api.projectstore.v1.model.BucketDetail; -import com.haleconnect.api.projectstore.v1.model.BucketIdent; -import com.haleconnect.api.projectstore.v1.model.Feedback; -import com.haleconnect.api.projectstore.v1.model.NewBucket; -import com.haleconnect.api.user.v1.ApiException; -import com.haleconnect.api.user.v1.api.LoginApi; -import com.haleconnect.api.user.v1.api.OrganisationsApi; -import com.haleconnect.api.user.v1.api.UsersApi; -import com.haleconnect.api.user.v1.model.Credentials; +import com.google.common.util.concurrent.ListenableFuture +import com.google.common.util.concurrent.SettableFuture +import com.haleconnect.api.projectstore.v1.ApiCallback +import com.haleconnect.api.projectstore.v1.api.BucketsApi +import com.haleconnect.api.projectstore.v1.api.FilesApi +import com.haleconnect.api.projectstore.v1.api.PermissionsApi +import com.haleconnect.api.projectstore.v1.model.BucketDetail +import com.haleconnect.api.projectstore.v1.model.BucketIdent +import com.haleconnect.api.projectstore.v1.model.Feedback +import com.haleconnect.api.projectstore.v1.model.NewBucket +import com.haleconnect.api.user.v1.ApiException +import com.haleconnect.api.user.v1.api.LoginApi +import com.haleconnect.api.user.v1.api.OrganisationsApi +import com.haleconnect.api.user.v1.api.UsersApi +import com.haleconnect.api.user.v1.model.Credentials import com.haleconnect.api.user.v1.model.OrganisationInfo -import com.haleconnect.api.user.v1.model.Token; -import com.haleconnect.api.user.v1.model.UserInfo; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; -import eu.esdihumboldt.hale.io.haleconnect.BasePathManager; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectException; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectInputSupplier; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectOrganisationInfo; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectProjectInfo; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectService; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServiceListener; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectSession; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectUrnBuilder; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectUserInfo; -import eu.esdihumboldt.hale.io.haleconnect.Owner; -import eu.esdihumboldt.hale.io.haleconnect.project.SharingOptions; +import com.haleconnect.api.user.v1.model.Token +import com.haleconnect.api.user.v1.model.UserInfo +import de.fhg.igd.slf4jplus.ALogger +import de.fhg.igd.slf4jplus.ALoggerFactory +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier +import eu.esdihumboldt.hale.io.haleconnect.BasePathManager +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectException +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectInputSupplier +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectOrganisationInfo +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectProjectInfo +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectService +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServiceListener +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectSession +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectUrnBuilder +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectUserInfo +import eu.esdihumboldt.hale.io.haleconnect.Owner +import eu.esdihumboldt.hale.io.haleconnect.project.SharingOptions import groovy.transform.CompileStatic +import java.text.MessageFormat +import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.CopyOnWriteArraySet +import java.util.concurrent.ExecutionException +import java.util.concurrent.atomic.AtomicLong +import org.apache.commons.lang.StringUtils /** * hale connect service facade implementation @@ -733,5 +730,4 @@ public class HaleConnectServiceImpl implements HaleConnectService, BasePathManag return true; } - } diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/HaleConnectSessionImpl.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/HaleConnectSessionImpl.java index 133b4d1cc9..4185fe019a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/HaleConnectSessionImpl.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/HaleConnectSessionImpl.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.io.haleconnect.internal; +import com.haleconnect.api.user.v1.model.UserInfo; +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectSession; import java.util.ArrayList; import java.util.List; import java.util.Map; -import com.haleconnect.api.user.v1.model.UserInfo; - -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectSession; - /** * hale connect session details * diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ProjectServiceHelper.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ProjectServiceHelper.java index 03fb38ab20..745d9321a7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ProjectServiceHelper.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ProjectServiceHelper.java @@ -17,7 +17,6 @@ import com.haleconnect.api.project.v0_1.ApiClient; import com.haleconnect.api.project.v0_1.api.ProjectApi; - import eu.esdihumboldt.hale.io.haleconnect.BasePathResolver; import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServices; diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ProjectStoreHelper.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ProjectStoreHelper.java index 9d21ddeea4..320d0138e2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ProjectStoreHelper.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/ProjectStoreHelper.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.hale.io.haleconnect.internal; -import java.util.HashMap; -import java.util.Map; - import com.google.gson.reflect.TypeToken; import com.haleconnect.api.projectstore.v1.ApiClient; import com.haleconnect.api.projectstore.v1.ApiResponse; @@ -30,10 +27,11 @@ import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.RequestBody; - import eu.esdihumboldt.hale.io.haleconnect.BasePathResolver; import eu.esdihumboldt.hale.io.haleconnect.HaleConnectException; import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServices; +import java.util.HashMap; +import java.util.Map; /** * Helper class for the project store API diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/UserServiceHelper.groovy b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/UserServiceHelper.groovy index 71aa1458a7..e138d1c515 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/UserServiceHelper.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/internal/UserServiceHelper.groovy @@ -15,20 +15,18 @@ package eu.esdihumboldt.hale.io.haleconnect.internal; -import org.apache.commons.lang.StringUtils; - -import com.haleconnect.api.user.v1.ApiClient; -import com.haleconnect.api.user.v1.api.LoginApi; -import com.haleconnect.api.user.v1.api.OrganisationsApi; -import com.haleconnect.api.user.v1.api.PermissionsApi; -import com.haleconnect.api.user.v1.api.UsersApi; -import com.haleconnect.api.user.v1.model.Credentials; - -import eu.esdihumboldt.hale.io.haleconnect.BasePathResolver; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServices; -import eu.esdihumboldt.hale.io.haleconnect.Owner; -import eu.esdihumboldt.hale.io.haleconnect.OwnerType; +import com.haleconnect.api.user.v1.ApiClient +import com.haleconnect.api.user.v1.api.LoginApi +import com.haleconnect.api.user.v1.api.OrganisationsApi +import com.haleconnect.api.user.v1.api.PermissionsApi +import com.haleconnect.api.user.v1.api.UsersApi +import com.haleconnect.api.user.v1.model.Credentials +import eu.esdihumboldt.hale.io.haleconnect.BasePathResolver +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServices +import eu.esdihumboldt.hale.io.haleconnect.Owner +import eu.esdihumboldt.hale.io.haleconnect.OwnerType import groovy.transform.CompileStatic +import org.apache.commons.lang.StringUtils /** * Helper class for the user service API diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/HaleConnectProjectReader.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/HaleConnectProjectReader.java index f97937cc36..227aa38c59 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/HaleConnectProjectReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/HaleConnectProjectReader.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.io.haleconnect.project; -import java.io.IOException; -import java.net.URI; -import java.text.MessageFormat; - import eu.esdihumboldt.hale.common.core.io.ExportProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -35,6 +31,9 @@ import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServices; import eu.esdihumboldt.hale.io.haleconnect.HaleConnectUrnBuilder; import eu.esdihumboldt.hale.io.haleconnect.Owner; +import java.io.IOException; +import java.net.URI; +import java.text.MessageFormat; /** * Project reader that reads a project archive and adds additional information @@ -81,11 +80,10 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) Value.of(HaleConnectProjectWriter.HALECONNECT_CONTENT_TYPE_ID)); /* - * Don't overwrite the target of the save configuration which is, at - * this point, set to the temporary location of the extracted - * project archive. The reason for this is to make sure that - * PathUpdate can correctly resolve all relative resource paths. - * (https://github.com/halestudio/hale/issues/506) + * Don't overwrite the target of the save configuration which is, at this point, + * set to the temporary location of the extracted project archive. The reason + * for this is to make sure that PathUpdate can correctly resolve all relative + * resource paths. (https://github.com/halestudio/hale/issues/506) */ // saveConfig.getProviderConfiguration().put(ExportProvider.PARAM_TARGET, // Value.of(source.getLocation())); diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/HaleConnectProjectWriter.groovy b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/HaleConnectProjectWriter.groovy index 4a59f013fb..613eaa9640 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/HaleConnectProjectWriter.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/HaleConnectProjectWriter.groovy @@ -15,34 +15,33 @@ package eu.esdihumboldt.hale.io.haleconnect.project; -import java.nio.file.Files; -import java.text.MessageFormat; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.core.HalePlatform; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.Value; +import de.fhg.igd.slf4jplus.ALogger +import de.fhg.igd.slf4jplus.ALoggerFactory +import eu.esdihumboldt.hale.common.core.HalePlatform +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator +import eu.esdihumboldt.hale.common.core.io.Value import eu.esdihumboldt.hale.common.core.io.project.ProjectWriter.ProjectWriterMode -import eu.esdihumboldt.hale.common.core.io.project.impl.ArchiveProjectWriter; -import eu.esdihumboldt.hale.common.core.io.project.model.Project; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.MutableTargetIOReport; -import eu.esdihumboldt.hale.common.core.io.report.impl.DefaultIOReporter; -import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableURI; -import eu.esdihumboldt.hale.common.core.io.supplier.NoStreamOutputSupplier; -import eu.esdihumboldt.hale.io.haleconnect.BasePathResolver; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectException; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectProjectInfo; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectService; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServices; -import eu.esdihumboldt.hale.io.haleconnect.HaleConnectUrnBuilder; -import eu.esdihumboldt.hale.io.haleconnect.Owner; -import eu.esdihumboldt.hale.io.haleconnect.OwnerType; +import eu.esdihumboldt.hale.common.core.io.project.impl.ArchiveProjectWriter +import eu.esdihumboldt.hale.common.core.io.project.model.Project +import eu.esdihumboldt.hale.common.core.io.report.IOReport +import eu.esdihumboldt.hale.common.core.io.report.IOReporter +import eu.esdihumboldt.hale.common.core.io.report.MutableTargetIOReport +import eu.esdihumboldt.hale.common.core.io.report.impl.DefaultIOReporter +import eu.esdihumboldt.hale.common.core.io.supplier.Locatable +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableURI +import eu.esdihumboldt.hale.common.core.io.supplier.NoStreamOutputSupplier +import eu.esdihumboldt.hale.io.haleconnect.BasePathResolver +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectException +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectProjectInfo +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectService +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectServices +import eu.esdihumboldt.hale.io.haleconnect.HaleConnectUrnBuilder +import eu.esdihumboldt.hale.io.haleconnect.Owner +import eu.esdihumboldt.hale.io.haleconnect.OwnerType import groovy.transform.CompileStatic +import java.nio.file.Files +import java.text.MessageFormat /** * Saves a project (optonally including all related resources) as a ZIP archive @@ -295,7 +294,7 @@ public class HaleConnectProjectWriter extends ArchiveProjectWriter { @Override public IOReporter createReporter() { if (!(haleConnect instanceof BasePathResolver) - || !HaleConnectUrnBuilder.isValidProjectUrn(getTarget().getLocation())) { + || !HaleConnectUrnBuilder.isValidProjectUrn(getTarget().getLocation())) { return super.createReporter(); } @@ -319,7 +318,6 @@ public class HaleConnectProjectWriter extends ArchiveProjectWriter { String clientBasePath = resolver.getBasePath(HaleConnectServices.WEB_CLIENT); return HaleConnectUrnBuilder.buildClientAccessUrl(clientBasePath, owner, projectId); - } catch (Throwable t) { return targetUri; } diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/SharingOptions.groovy b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/SharingOptions.groovy index a366b4dd81..79dd79e4ce 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/SharingOptions.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/SharingOptions.groovy @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.io.haleconnect.project import com.google.gson.annotations.SerializedName - import groovy.transform.Immutable /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/SimpleProjectReader.java b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/SimpleProjectReader.java index 5036688e82..43d3d069d1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/SimpleProjectReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.haleconnect/src/eu/esdihumboldt/hale/io/haleconnect/project/SimpleProjectReader.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.io.haleconnect.project; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -28,6 +24,9 @@ import eu.esdihumboldt.hale.io.haleconnect.HaleConnectService; import eu.esdihumboldt.hale.io.haleconnect.HaleConnectUrnBuilder; import eu.esdihumboldt.hale.io.haleconnect.Owner; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; /** * Project reader for hale connect that does not require a special input diff --git a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/MappingExporter.java b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/MappingExporter.java index 146ae32f2f..3627d714d9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/MappingExporter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/MappingExporter.java @@ -15,19 +15,6 @@ package eu.esdihumboldt.hale.io.html.svg.mapping; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.StringWriter; -import java.io.Writer; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - import eu.esdihumboldt.hale.common.align.io.impl.AbstractAlignmentWriter; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -43,6 +30,18 @@ import groovy.json.JsonOutput; import groovy.lang.Writable; import groovy.text.GStringTemplateEngine; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * Exports an alignment as HTML mapping documentation based on diff --git a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/AlignmentJson.groovy b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/AlignmentJson.groovy index 8947bc4e15..164bc172aa 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/AlignmentJson.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/AlignmentJson.groovy @@ -15,18 +15,11 @@ package eu.esdihumboldt.hale.io.html.svg.mapping.json -import java.time.Instant -import java.time.format.DateTimeFormatter -import java.util.Map.Entry - -import org.w3c.dom.Element - -import com.vladsch.flexmark.html.HtmlRenderer; -import com.vladsch.flexmark.parser.Parser; -import com.vladsch.flexmark.profile.pegdown.Extensions; +import com.vladsch.flexmark.html.HtmlRenderer +import com.vladsch.flexmark.parser.Parser +import com.vladsch.flexmark.profile.pegdown.Extensions import com.vladsch.flexmark.profile.pegdown.PegdownOptionsAdapter -import com.vladsch.flexmark.util.data.DataHolder; - +import com.vladsch.flexmark.util.data.DataHolder import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition import eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition import eu.esdihumboldt.hale.common.align.extension.function.FunctionUtil @@ -51,6 +44,10 @@ import eu.esdihumboldt.util.groovy.json.JsonStreamBuilder import eu.esdihumboldt.util.xml.XmlUtil import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import java.time.Instant +import java.time.format.DateTimeFormatter +import java.util.Map.Entry +import org.w3c.dom.Element /** * Alignment JSON representation helper. diff --git a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/ExtendedCellRepresentation.groovy b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/ExtendedCellRepresentation.groovy index 13afd52d7b..a7c6e85bc6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/ExtendedCellRepresentation.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/ExtendedCellRepresentation.groovy @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.html.svg.mapping.json import com.google.common.collect.HashMultimap import com.google.common.collect.Multimap - import eu.esdihumboldt.hale.common.align.extension.function.FunctionDefinition import eu.esdihumboldt.hale.common.align.extension.function.FunctionUtil import eu.esdihumboldt.hale.common.align.io.impl.internal.EntityDefinitionToJaxb @@ -125,5 +124,4 @@ class ExtendedCellRepresentation implements CellJsonExtension { jaxbJson.writeEntity(json, xentity) } } - } diff --git a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonMappingExporter.groovy b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonMappingExporter.groovy index 717405aab1..416d80fe13 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonMappingExporter.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonMappingExporter.groovy @@ -15,8 +15,6 @@ package eu.esdihumboldt.hale.io.html.svg.mapping.json; -import java.nio.charset.StandardCharsets - import eu.esdihumboldt.hale.common.align.io.impl.AbstractAlignmentWriter import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException import eu.esdihumboldt.hale.common.core.io.ProgressIndicator @@ -25,6 +23,7 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReporter import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl import eu.esdihumboldt.util.groovy.json.JsonStreamBuilder import groovy.transform.CompileStatic +import java.nio.charset.StandardCharsets /** * Exports an alignment to a JSON representation. diff --git a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonValueRepresentation.java b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonValueRepresentation.java index 0d7bee7484..f2db74140d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonValueRepresentation.java +++ b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonValueRepresentation.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.io.html.svg.mapping.json; -import java.io.StringReader; -import java.io.StringWriter; - -import org.w3c.dom.Element; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.Value; @@ -27,6 +22,9 @@ import eu.esdihumboldt.hale.common.core.io.extension.ComplexValueExtension; import eu.esdihumboldt.util.xml.XmlUtil; import groovy.json.JsonSlurper; +import java.io.StringReader; +import java.io.StringWriter; +import org.w3c.dom.Element; /** * Value representation as JSON. diff --git a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonXML.java b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonXML.java index d967313865..2a3e993cd2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonXML.java +++ b/io/plugins/eu.esdihumboldt.hale.io.html.svg/src/eu/esdihumboldt/hale/io/html/svg/mapping/json/JsonXML.java @@ -15,13 +15,18 @@ package eu.esdihumboldt.hale.io.html.svg.mapping.json; +import de.odysseus.staxon.json.JsonXMLConfig; +import de.odysseus.staxon.json.JsonXMLConfigBuilder; +import de.odysseus.staxon.json.JsonXMLInputFactory; +import de.odysseus.staxon.json.JsonXMLOutputFactory; +import de.odysseus.staxon.json.stream.impl.JsonStreamFactoryImpl; +import de.odysseus.staxon.xml.util.PrettyXMLStreamWriter; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.Reader; import java.io.StringWriter; import java.io.Writer; import java.nio.charset.StandardCharsets; - import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -39,17 +44,9 @@ import javax.xml.transform.TransformerFactoryConfigurationError; import javax.xml.transform.stax.StAXResult; import javax.xml.transform.stax.StAXSource; - import org.w3c.dom.Document; import org.xml.sax.SAXException; -import de.odysseus.staxon.json.JsonXMLConfig; -import de.odysseus.staxon.json.JsonXMLConfigBuilder; -import de.odysseus.staxon.json.JsonXMLInputFactory; -import de.odysseus.staxon.json.JsonXMLOutputFactory; -import de.odysseus.staxon.json.stream.impl.JsonStreamFactoryImpl; -import de.odysseus.staxon.xml.util.PrettyXMLStreamWriter; - @SuppressWarnings("javadoc") public class JsonXML { @@ -57,12 +54,12 @@ public static void toJson(Reader xmlReader, Writer jsonWriter) throws XMLStreamException, FactoryConfigurationError, TransformerConfigurationException, TransformerException, TransformerFactoryConfigurationError { /* - * If we want to insert JSON array boundaries for multiple elements, we - * need to set the autoArray property. If our XML source - * was decorated with <?xml-multiple?> processing - * instructions, we'd set the multiplePI property instead. - * With the autoPrimitive property set, element text gets - * automatically converted to JSON primitives (number, boolean, null). + * If we want to insert JSON array boundaries for multiple elements, we need to + * set the autoArray property. If our XML source was decorated with + * <?xml-multiple?> processing instructions, we'd set the + * multiplePI property instead. With the autoPrimitive + * property set, element text gets automatically converted to JSON primitives + * (number, boolean, null). */ JsonXMLConfig config = new JsonXMLConfigBuilder().namespaceDeclarations(true) .autoArray(true).autoPrimitive(true).prettyPrint(false).build(); @@ -90,12 +87,11 @@ public static void toXML(Reader jsonReader, Writer xmlWriter) throws XMLStreamException, FactoryConfigurationError, TransformerConfigurationException, TransformerException, TransformerFactoryConfigurationError { /* - * If the multiplePI property is set to true, - * the StAXON reader will generate <xml-multiple> - * processing instructions which would be copied to the XML output. - * These can be used by StAXON when converting back to JSON to trigger - * array starts. Set to false if you don't need to go back - * to JSON. + * If the multiplePI property is set to true, the + * StAXON reader will generate <xml-multiple> processing + * instructions which would be copied to the XML output. These can be used by + * StAXON when converting back to JSON to trigger array starts. Set to + * false if you don't need to go back to JSON. */ JsonXMLConfig config = new JsonXMLConfigBuilder().multiplePI(false).build(); /* @@ -123,8 +119,8 @@ public static Document toDOM(Reader jsonReader) TransformerException, TransformerFactoryConfigurationError, ParserConfigurationException, IOException, SAXException { /* - * Sadly not working like this - we get a NullPointerException because - * during the transformation setXmlVersion is called with null + * Sadly not working like this - we get a NullPointerException because during + * the transformation setXmlVersion is called with null */ // JsonXMLConfig config = new JsonXMLConfigBuilder().multiplePI(false).build(); // // Create source (JSON). diff --git a/io/plugins/eu.esdihumboldt.hale.io.html.svg/test/eu/esdihumboldt/hale/io/html/svg/MappingExporterTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.html.svg/test/eu/esdihumboldt/hale/io/html/svg/MappingExporterTest.groovy index 28b1668728..84ddee2173 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.html.svg/test/eu/esdihumboldt/hale/io/html/svg/MappingExporterTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.html.svg/test/eu/esdihumboldt/hale/io/html/svg/MappingExporterTest.groovy @@ -15,11 +15,7 @@ package eu.esdihumboldt.hale.io.html.svg -import eu.esdihumboldt.util.test.AbstractPlatformTest -import org.junit.Test - -import java.nio.file.Files -import java.nio.file.Path +import static org.junit.Assert.* import eu.esdihumboldt.cst.test.TransformationExample import eu.esdihumboldt.cst.test.TransformationExamples @@ -27,9 +23,11 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReport import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace import eu.esdihumboldt.hale.io.html.svg.mapping.MappingExporter +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.transform.CompileStatic - -import static org.junit.Assert.* +import java.nio.file.Files +import java.nio.file.Path +import org.junit.Test /** * Tests for {@link MappingExporter}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.html.svg/test/eu/esdihumboldt/hale/io/html/svg/json/JsonMappingExporterTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.html.svg/test/eu/esdihumboldt/hale/io/html/svg/json/JsonMappingExporterTest.groovy index dc4f49f90d..d459b9f2da 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.html.svg/test/eu/esdihumboldt/hale/io/html/svg/json/JsonMappingExporterTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.html.svg/test/eu/esdihumboldt/hale/io/html/svg/json/JsonMappingExporterTest.groovy @@ -15,13 +15,7 @@ package eu.esdihumboldt.hale.io.html.svg.json -import eu.esdihumboldt.util.test.AbstractPlatformTest -import org.junit.Test - -import java.nio.file.Files -import java.nio.file.Path - -import org.osgi.framework.Version +import static org.junit.Assert.* import eu.esdihumboldt.cst.test.TransformationExample import eu.esdihumboldt.cst.test.TransformationExamples @@ -32,9 +26,12 @@ import eu.esdihumboldt.hale.common.core.io.report.IOReport import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace import eu.esdihumboldt.hale.io.html.svg.mapping.json.JsonMappingExporter +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.json.JsonSlurper - -import static org.junit.Assert.* +import java.nio.file.Files +import java.nio.file.Path +import org.junit.Test +import org.osgi.framework.Version /** * Tests for {@link JsonMappingExporter}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.instancebuilder/src/eu/esdihumboldt/hale/io/instancebuilder/InstanceBuilderReader.java b/io/plugins/eu.esdihumboldt.hale.io.instancebuilder/src/eu/esdihumboldt/hale/io/instancebuilder/InstanceBuilderReader.java index 101f1550ec..69cde02ce8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.instancebuilder/src/eu/esdihumboldt/hale/io/instancebuilder/InstanceBuilderReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.instancebuilder/src/eu/esdihumboldt/hale/io/instancebuilder/InstanceBuilderReader.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.io.instancebuilder; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.Collections; - -import org.codehaus.groovy.control.CompilerConfiguration; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -34,6 +27,11 @@ import groovy.lang.Binding; import groovy.lang.GroovyShell; import groovy.util.DelegatingScript; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Collections; +import org.codehaus.groovy.control.CompilerConfiguration; /** * Instance reader that runs a Groovy script against an instance builder. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessConnectionConfigurer.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessConnectionConfigurer.java index 52d721c723..efe094fedd 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessConnectionConfigurer.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessConnectionConfigurer.java @@ -1,10 +1,9 @@ package eu.esdihumboldt.hale.io.jdbc.msaccess; -import java.sql.Connection; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.io.jdbc.extension.ConnectionConfigurer; +import java.sql.Connection; import net.ucanaccess.jdbc.UcanaccessConnection; /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessInstanceReader.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessInstanceReader.java index 27c08ec98e..6c83d6ecee 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessInstanceReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessInstanceReader.java @@ -15,6 +15,8 @@ package eu.esdihumboldt.hale.io.jdbc.msaccess; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import eu.esdihumboldt.hale.io.jdbc.JDBCInstanceReader; import java.io.File; import java.io.InputStream; import java.io.UnsupportedEncodingException; @@ -23,9 +25,6 @@ import java.sql.DriverManager; import java.sql.SQLException; import java.text.MessageFormat; - -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; -import eu.esdihumboldt.hale.io.jdbc.JDBCInstanceReader; import net.ucanaccess.jdbc.UcanaccessConnection; /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessJdbcIOSupplier.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessJdbcIOSupplier.java index f6c28617e6..f9183d152c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessJdbcIOSupplier.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessJdbcIOSupplier.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.io.jdbc.msaccess; +import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; import java.io.File; import java.net.URI; -import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; - /** * I/O supplier for Microsoft Access databases. Converts a file path to a JDBC * URI and viceversa. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessSchemaReader.java index ebc8b9e754..ef385161c3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessSchemaReader.java @@ -15,6 +15,8 @@ package eu.esdihumboldt.hale.io.jdbc.msaccess; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; import java.io.File; import java.io.InputStream; import java.io.UnsupportedEncodingException; @@ -23,9 +25,6 @@ import java.sql.DriverManager; import java.sql.SQLException; import java.text.MessageFormat; - -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; -import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; import net.ucanaccess.jdbc.UcanaccessConnection; /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessSchemaReaderAdvisor.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessSchemaReaderAdvisor.java index 93479b57af..44f491946c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessSchemaReaderAdvisor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessSchemaReaderAdvisor.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.io.jdbc.msaccess; -import java.util.regex.Pattern; - import eu.esdihumboldt.hale.io.jdbc.extension.JDBCSchemaReaderAdvisor; +import java.util.regex.Pattern; import schemacrawler.schemacrawler.InclusionRule; import schemacrawler.schemacrawler.SchemaCrawlerOptions; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessURIBuilder.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessURIBuilder.java index b106a00f4f..af76c5a29e 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessURIBuilder.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/src/eu/esdihumboldt/hale/io/jdbc/msaccess/MsAccessURIBuilder.java @@ -1,5 +1,6 @@ package eu.esdihumboldt.hale.io.jdbc.msaccess; +import eu.esdihumboldt.hale.io.jdbc.extension.URIBuilder; import java.io.File; import java.io.UnsupportedEncodingException; import java.net.URI; @@ -7,8 +8,6 @@ import java.net.URLEncoder; import java.text.MessageFormat; -import eu.esdihumboldt.hale.io.jdbc.extension.URIBuilder; - /** * Create JDBC URIs for Ms Access database. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/reader/MsAccessInstanceReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/reader/MsAccessInstanceReaderTest.java index ffcffae8ce..e4f39304ee 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/reader/MsAccessInstanceReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/reader/MsAccessInstanceReaderTest.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.io.jdbc.msaccess.reader; -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Test; - import eu.esdihumboldt.hale.io.jdbc.msaccess.test.MsAccessDataReader; import eu.esdihumboldt.hale.io.jdbc.msaccess.test.MsAccessDataReaderTestSuit; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import org.junit.Test; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/reader/MsAccessSchemaReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/reader/MsAccessSchemaReaderTest.java index 73119fde22..1871d425d9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/reader/MsAccessSchemaReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/reader/MsAccessSchemaReaderTest.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.jdbc.msaccess.reader; -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Ignore; -import org.junit.Test; - import eu.esdihumboldt.hale.io.jdbc.msaccess.test.MsAccessDataReader; import eu.esdihumboldt.hale.io.jdbc.msaccess.test.MsAccessDataReaderAccdb; import eu.esdihumboldt.hale.io.jdbc.msaccess.test.MsAccessDataReaderTestSuit; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import org.junit.Ignore; +import org.junit.Test; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/test/MsAccessDataReaderTestSuit.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/test/MsAccessDataReaderTestSuit.java index 94e4dc03c6..a153b802aa 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/test/MsAccessDataReaderTestSuit.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.msaccess/test/eu/esdihumboldt/hale/io/jdbc/msaccess/test/MsAccessDataReaderTestSuit.java @@ -19,15 +19,10 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.io.IOException; -import java.util.Collection; - import com.google.common.io.ByteSink; import com.google.common.io.ByteSource; import com.google.common.io.Files; import com.google.common.io.Resources; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -39,6 +34,9 @@ import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; import eu.esdihumboldt.hale.io.jdbc.msaccess.MsAccessInstanceReader; import eu.esdihumboldt.hale.io.jdbc.msaccess.MsAccessSchemaReader; +import java.io.File; +import java.io.IOException; +import java.util.Collection; /** * Abstract suit class to test Access database @@ -96,8 +94,8 @@ public void createSourceTempFile() throws IOException { } /** - * Generates a random path (within the system's temporary folder) for the - * source database. + * Generates a random path (within the system's temporary folder) for the source + * database. * * @return the absolute path of the source temp file */ @@ -202,8 +200,7 @@ public Schema readSchema(File sourceFile) throws Exception { } /** - * Reads instances from from a MsAccess database file with the provided - * schema. + * Reads instances from from a MsAccess database file with the provided schema. * * @param sourceSchema the schema of the source database * @param sourceFile the file of the source database. @@ -227,8 +224,8 @@ public InstanceCollection readInstances(Schema sourceSchema, File sourceFile) th } /** - * Check table names should not be in excluded table list (UCA_METADATA - * table list) + * Check table names should not be in excluded table list (UCA_METADATA table + * list) * * @param tableNames table names collection return from Schema */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlConnectionConfigurer.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlConnectionConfigurer.java index 8df594b0aa..ebb38beee5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlConnectionConfigurer.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlConnectionConfigurer.java @@ -15,13 +15,11 @@ package eu.esdihumboldt.hale.io.jdbc.mssql; -import java.sql.ResultSet; - import com.microsoft.sqlserver.jdbc.SQLServerConnection; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.io.jdbc.extension.ConnectionConfigurer; +import java.sql.ResultSet; /** * A connection configurer for MS SQL Server database diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlConnectionHelper.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlConnectionHelper.java index ffe73c7fb0..c44f43168a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlConnectionHelper.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlConnectionHelper.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.jdbc.mssql; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URLDecoder; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.io.jdbc.extension.ConnectionHelper; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URLDecoder; /** * Connection helper for Ms SQL server diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlGeometries.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlGeometries.java index 23120e7223..171f42bdab 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlGeometries.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlGeometries.java @@ -15,24 +15,8 @@ package eu.esdihumboldt.hale.io.jdbc.mssql; -import java.sql.ResultSet; -import java.sql.Statement; -import java.util.function.Supplier; - -import org.geotools.geometry.jts.CurvedGeometryFactory; -import org.geotools.geometry.jts.JTS; -import org.geotools.geometry.jts.WKTReader2; -import org.geotools.referencing.CRS; -import org.opengis.referencing.crs.CoordinateReferenceSystem; -import org.opengis.referencing.operation.MathTransform; - import com.google.common.io.BaseEncoding; import com.microsoft.sqlserver.jdbc.SQLServerConnection; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.io.ParseException; -import org.locationtech.jts.io.WKTReader; - import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; @@ -44,6 +28,19 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; import eu.esdihumboldt.hale.io.jdbc.GeometryAdvisor; import eu.esdihumboldt.hale.io.jdbc.mssql.util.SRSUtil; +import java.sql.ResultSet; +import java.sql.Statement; +import java.util.function.Supplier; +import org.geotools.geometry.jts.CurvedGeometryFactory; +import org.geotools.geometry.jts.JTS; +import org.geotools.geometry.jts.WKTReader2; +import org.geotools.referencing.CRS; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.io.ParseException; +import org.locationtech.jts.io.WKTReader; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.operation.MathTransform; import schemacrawler.schema.BaseColumn; import schemacrawler.schema.ColumnDataType; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlSchemaSelector.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlSchemaSelector.java index c85da54d3e..3faefb5e4c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlSchemaSelector.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlSchemaSelector.java @@ -15,6 +15,9 @@ package eu.esdihumboldt.hale.io.jdbc.mssql; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.io.jdbc.extension.SchemaSelector; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; @@ -22,10 +25,6 @@ import java.util.ArrayList; import java.util.List; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.io.jdbc.extension.SchemaSelector; - /** * A Schema Selector for MS SQL server database * diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlURIBuilder.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlURIBuilder.java index 6a90c49528..6f5ffaabff 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlURIBuilder.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/MsSqlURIBuilder.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.jdbc.mssql; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URLEncoder; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.io.jdbc.extension.URIBuilder; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URLEncoder; /** * Create JDBC Uri for MS SQL database diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/util/SRSUtil.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/util/SRSUtil.java index 8c9428fc53..4fe9535214 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/util/SRSUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/src/eu/esdihumboldt/hale/io/jdbc/mssql/util/SRSUtil.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.io.jdbc.mssql.util; +import com.microsoft.sqlserver.jdbc.SQLServerConnection; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import java.sql.ResultSet; import java.sql.Statement; import java.util.HashMap; import java.util.Map; -import com.microsoft.sqlserver.jdbc.SQLServerConnection; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; - /** * Cache for SRS codes * @@ -36,13 +34,13 @@ public abstract class SRSUtil { private static final ALogger log = ALoggerFactory.getLogger(SRSUtil.class); /** - * get SRS code. First find in cache, if unsuccessful then get from database - * and also store in cache. + * get SRS code. First find in cache, if unsuccessful then get from database and + * also store in cache. * * @param srId a spatial reference id attached to object * @param con A {@link SQLServerConnection} object - * @return String value of SRS code or null if absent in cache - * and fail to load from database + * @return String value of SRS code or null if absent in cache and + * fail to load from database */ public static String getSRS(int srId, SQLServerConnection con) { if (cache.get(srId) == null) { @@ -70,8 +68,8 @@ public static String getAuthorityName(int srId, SQLServerConnection con) { } /** - * get SRS text. First find in cache, if unsuccessful then get from database - * and also store in cache. + * get SRS text. First find in cache, if unsuccessful then get from database and + * also store in cache. * * @param srId a spatial reference id attached to object * @param con A {@link SQLServerConnection} object diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/test/eu/esdihumboldt/hale/io/jdbc/mssql/test/MsSQLServer14Test.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/test/eu/esdihumboldt/hale/io/jdbc/mssql/test/MsSQLServer14Test.java index 929d06a6e0..d9eb6ecf23 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/test/eu/esdihumboldt/hale/io/jdbc/mssql/test/MsSQLServer14Test.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/test/eu/esdihumboldt/hale/io/jdbc/mssql/test/MsSQLServer14Test.java @@ -18,13 +18,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.net.URI; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -34,6 +27,11 @@ import eu.esdihumboldt.hale.io.jdbc.JDBCInstanceReader; import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; import eu.esdihumboldt.hale.io.jdbc.mssql.MsSqlURIBuilder; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.net.URI; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; @@ -143,8 +141,7 @@ private Schema readSchema() throws Exception { } /** - * Reads instances from from a MsAccess database file with the provided - * schema. + * Reads instances from from a MsAccess database file with the provided schema. * * @param sourceSchema the schema of the source database * @return the read instances diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/test/eu/esdihumboldt/hale/io/jdbc/mssql/test/MsSqlDataReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/test/eu/esdihumboldt/hale/io/jdbc/mssql/test/MsSqlDataReaderTest.java index 0f227b7aac..8bcd0accd6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/test/eu/esdihumboldt/hale/io/jdbc/mssql/test/MsSqlDataReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.mssql/test/eu/esdihumboldt/hale/io/jdbc/mssql/test/MsSqlDataReaderTest.java @@ -5,20 +5,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.net.URI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -33,6 +19,16 @@ import eu.esdihumboldt.hale.io.jdbc.JDBCInstanceReader; import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; import eu.esdihumboldt.hale.io.jdbc.mssql.MsSqlURIBuilder; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.xml.namespace.QName; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.locationtech.jts.geom.Geometry; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; @@ -206,8 +202,7 @@ private Schema readSchema() throws Exception { } /** - * Reads instances from from a MsAccess database file with the provided - * schema. + * Reads instances from from a MsAccess database file with the provided schema. * * @param sourceSchema the schema of the source database * @return the read instances diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostGISConnectionConfigurer.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostGISConnectionConfigurer.java index 64da1f94b6..8ea1c34cac 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostGISConnectionConfigurer.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostGISConnectionConfigurer.java @@ -16,16 +16,14 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.io.jdbc.extension.ConnectionConfigurer; import java.sql.SQLException; - import org.postgis.PGbox3d; import org.postgis.PGgeometry; import org.postgresql.PGConnection; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.io.jdbc.extension.ConnectionConfigurer; - /** * Configures a connection to support PostGIS data types. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostGISGeometries.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostGISGeometries.java index 2a08048f6e..3772161669 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostGISGeometries.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostGISGeometries.java @@ -15,20 +15,26 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; +import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; +import eu.esdihumboldt.hale.common.instance.geometry.impl.WKTDefinition; +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryMetadata; +import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; +import eu.esdihumboldt.hale.io.jdbc.GeometryAdvisor; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.function.Supplier; - import org.geotools.geometry.jts.JTS; import org.geotools.geometry.jts.WKTReader2; import org.geotools.referencing.CRS; -import org.opengis.referencing.crs.CoordinateReferenceSystem; -import org.opengis.referencing.operation.MathTransform; -import org.postgis.PGgeometry; -import org.postgresql.PGConnection; - import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LinearRing; import org.locationtech.jts.geom.MultiLineString; @@ -36,19 +42,10 @@ import org.locationtech.jts.geom.MultiPolygon; import org.locationtech.jts.geom.Point; import org.locationtech.jts.geom.Polygon; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.core.report.SimpleLog; -import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; -import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; -import eu.esdihumboldt.hale.common.instance.geometry.impl.WKTDefinition; -import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; -import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryMetadata; -import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; -import eu.esdihumboldt.hale.io.jdbc.GeometryAdvisor; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.operation.MathTransform; +import org.postgis.PGgeometry; +import org.postgresql.PGConnection; import schemacrawler.schema.BaseColumn; import schemacrawler.schema.ColumnDataType; @@ -64,9 +61,9 @@ public class PostGISGeometries implements GeometryAdvisor { @Override public boolean isFixedType(ColumnDataType columnType) { /* - * Concrete information on geometry type and SRS is not stored in the - * column but as metadata in the database. Therefore every column has to - * be configured on its own. + * Concrete information on geometry type and SRS is not stored in the column but + * as metadata in the database. Therefore every column has to be configured on + * its own. */ return false; } @@ -82,8 +79,8 @@ public Class configureGeometryColumnType(PGConnection connec Statement stmt = con.createStatement(); // Get the srid, dimension and geometry type /* - * FIXME this query should also take into account the schema and - * possibly the column name. + * FIXME this query should also take into account the schema and possibly the + * column name. */ ResultSet rs = stmt.executeQuery( "SELECT srid,type,coord_dimension FROM geometry_columns WHERE f_table_name = " @@ -187,9 +184,9 @@ public Object convertGeometry(GeometryProperty geom, TypeDefinition columnTyp pGeometry = new PGgeometry(targetGeometry.toText()); try { /* - * FIXME This assumes that the code is the same as the SRID, which - * often is the case, but we cannot rely on that. Should the SRID be - * stored as additional information in the geometry metadata? + * FIXME This assumes that the code is the same as the SRID, which often is the + * case, but we cannot rely on that. Should the SRID be stored as additional + * information in the geometry metadata? */ pGeometry.getGeometry().setSrid(Integer.parseInt(columnTypeMetadata.getSrs())); } catch (Exception e) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostSchemaSelector.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostSchemaSelector.java index 9a5472cec9..74c448f3b3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostSchemaSelector.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostSchemaSelector.java @@ -15,6 +15,9 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.io.jdbc.extension.SchemaSelector; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; @@ -22,10 +25,6 @@ import java.util.ArrayList; import java.util.List; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.io.jdbc.extension.SchemaSelector; - /** * PostgreSQL Schema Selector * diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostURIBuilder.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostURIBuilder.java index 2e0507b5ff..b409638cc9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostURIBuilder.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/PostURIBuilder.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql; -import java.net.URI; - import eu.esdihumboldt.hale.io.jdbc.extension.URIBuilder; +import java.net.URI; /** * Create JDBC URIs for postgresql/PostGIS. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/internal/Activator.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/internal/Activator.java index 05c24278eb..37127753d1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/internal/Activator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/src/eu/esdihumboldt/hale/io/jdbc/postgresql/internal/Activator.java @@ -17,13 +17,13 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql.internal; import java.sql.DriverManager; - import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; /** * Bundle activator. It registers the PostgreSQL driver with the * {@link DriverManager}. + * * @author Simon Templer */ public class Activator implements BundleActivator { @@ -40,9 +40,9 @@ static BundleContext getContext() { @Override public void start(BundleContext bundleContext) throws Exception { Activator.context = bundleContext; - + Class.forName("org.postgresql.Driver"); - + // DriverManager.registerDriver(new Driver()); } diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/AutoGenKeyReferenceIT.groovy b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/AutoGenKeyReferenceIT.groovy index 1ab2e99277..3e8fa51194 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/AutoGenKeyReferenceIT.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/AutoGenKeyReferenceIT.groovy @@ -15,16 +15,15 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql.test; -import org.junit.Test - -import ru.yandex.qatools.allure.annotations.Features -import ru.yandex.qatools.allure.annotations.Stories import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder import eu.esdihumboldt.hale.common.instance.model.InstanceCollection import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest import eu.esdihumboldt.hale.io.jdbc.test.DBConfigInstance import groovy.sql.Sql +import org.junit.Test +import ru.yandex.qatools.allure.annotations.Features +import ru.yandex.qatools.allure.annotations.Stories /** * Unit test for checking writing og the instances which has reference and @@ -93,4 +92,3 @@ public class AutoGenKeyReferenceIT extends AbstractDBTest { InstanceCollection coll = readInstances(schema); } } - diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/CheckComplexTypeOrderIT.groovy b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/CheckComplexTypeOrderIT.groovy index e88f2d5eee..505b6655b8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/CheckComplexTypeOrderIT.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/CheckComplexTypeOrderIT.groovy @@ -17,16 +17,15 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql.test; import static org.junit.Assert.* -import org.junit.Test - -import ru.yandex.qatools.allure.annotations.Features -import ru.yandex.qatools.allure.annotations.Stories import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder import eu.esdihumboldt.hale.common.instance.model.InstanceCollection import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest import eu.esdihumboldt.hale.io.jdbc.test.DBConfigInstance import groovy.sql.Sql +import org.junit.Test +import ru.yandex.qatools.allure.annotations.Features +import ru.yandex.qatools.allure.annotations.Stories diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/CheckSortingForCyclicTypesTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/CheckSortingForCyclicTypesTest.groovy index f7e3ee8143..aad3d2a0a0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/CheckSortingForCyclicTypesTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/CheckSortingForCyclicTypesTest.groovy @@ -17,17 +17,15 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql.test; import static org.junit.Assert.* -import javax.xml.namespace.QName - -import org.junit.Test - -import ru.yandex.qatools.allure.annotations.Features -import ru.yandex.qatools.allure.annotations.Stories import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition import eu.esdihumboldt.hale.io.jdbc.JDBCInstanceWriter +import javax.xml.namespace.QName +import org.junit.Test +import ru.yandex.qatools.allure.annotations.Features +import ru.yandex.qatools.allure.annotations.Stories /** * Test to check the sorting of the cyclic reference between the types diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/DatabaseIT.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/DatabaseIT.java index a9e2b08685..0e2bdd27e9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/DatabaseIT.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/DatabaseIT.java @@ -17,14 +17,12 @@ import static org.junit.Assert.assertTrue; +import eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest; +import eu.esdihumboldt.hale.io.jdbc.test.DBConfigInstance; import java.sql.Connection; import java.sql.SQLException; - import org.junit.Test; import org.postgresql.PGConnection; - -import eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest; -import eu.esdihumboldt.hale.io.jdbc.test.DBConfigInstance; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/MultiDimensionalArraysIT.groovy b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/MultiDimensionalArraysIT.groovy index 1d09504808..83fa03817c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/MultiDimensionalArraysIT.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/MultiDimensionalArraysIT.groovy @@ -17,9 +17,6 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql.test import static org.junit.Assert.* -import org.junit.Before -import org.junit.Test - import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder import eu.esdihumboldt.hale.common.instance.model.InstanceCollection import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil @@ -28,6 +25,8 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.common.schema.model.constraint.property.Cardinality import eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest import groovy.sql.Sql +import org.junit.Before +import org.junit.Test import ru.yandex.qatools.allure.annotations.Features import ru.yandex.qatools.allure.annotations.Stories @@ -124,10 +123,12 @@ class MultiDimensionalArraysIT extends AbstractDBTest { puzzle ([ ['A', 'B', 'C'] as String[], - ['X', 'Y', 'Z'] as String[]] as String[][]) + ['X', 'Y', 'Z'] as String[] + ] as String[][]) puzzle ([ ['a', 'b', 'c'] as String[], - ['x', 'y', 'z'] as String[]] as String[][]) + ['x', 'y', 'z'] as String[] + ] as String[][]) } } @@ -139,5 +140,4 @@ class MultiDimensionalArraysIT extends AbstractDBTest { int count = readAndCountInstances(instances, schema, gType) assertEquals(1, count) } - } diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/OneDimensionalArraysIT.groovy b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/OneDimensionalArraysIT.groovy index 6245f7ff9e..e1bb3f4b5a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/OneDimensionalArraysIT.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/OneDimensionalArraysIT.groovy @@ -17,9 +17,6 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql.test import static org.junit.Assert.* -import org.junit.Before -import org.junit.Test - import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder import eu.esdihumboldt.hale.common.instance.model.InstanceCollection import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil @@ -28,6 +25,8 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.common.schema.model.constraint.property.Cardinality import eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest import groovy.sql.Sql +import org.junit.Before +import org.junit.Test import ru.yandex.qatools.allure.annotations.Features import ru.yandex.qatools.allure.annotations.Stories @@ -146,5 +145,4 @@ class OneDimensionalArraysIT extends AbstractDBTest { int count = readAndCountInstances(instances, schema, gType) assertEquals(1, count) } - } diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/PostDataTypesIT.groovy b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/PostDataTypesIT.groovy index 0e2542497d..9750c90066 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/PostDataTypesIT.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/PostDataTypesIT.groovy @@ -17,14 +17,6 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql.test import static org.junit.Assert.* -import java.sql.Date -import java.sql.Timestamp - -import org.junit.Test -import org.locationtech.jts.geom.Coordinate -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.GeometryFactory - import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder @@ -37,6 +29,12 @@ import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest import groovy.sql.Sql +import java.sql.Date +import java.sql.Timestamp +import org.junit.Test +import org.locationtech.jts.geom.Coordinate +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.GeometryFactory import ru.yandex.qatools.allure.annotations.Features import ru.yandex.qatools.allure.annotations.Stories @@ -105,7 +103,8 @@ public class PostDataTypesIT extends AbstractDBTest { b_array ([0, 1, i, 1, 0] as byte[]) geometry_test new DefaultGeometryProperty(new CodeDefinition("EPSG:4326", null), gf.createLineString([ new Coordinate(0, 0), - new Coordinate(i, i)] as Coordinate[])) + new Coordinate(i, i) + ] as Coordinate[])) hire_date Date.valueOf("2015-04-$i") last_login new Timestamp(c.getTimeInMillis()) share_price new Double(i) @@ -195,6 +194,5 @@ public class PostDataTypesIT extends AbstractDBTest { m.put("DECIMAL", BigDecimal.class); m.put("GEOMETRY", GeometryProperty.class); return Collections.unmodifiableMap(m); - } } diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/ReadWriteIT.groovy b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/ReadWriteIT.groovy index 35d4e10b85..4788a4bc32 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/ReadWriteIT.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/ReadWriteIT.groovy @@ -17,15 +17,6 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql.test import static org.junit.Assert.* -import org.junit.Test - -import ru.yandex.qatools.allure.annotations.Features -import ru.yandex.qatools.allure.annotations.Stories - -import org.locationtech.jts.geom.Coordinate -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.GeometryFactory - import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder @@ -36,6 +27,12 @@ import eu.esdihumboldt.hale.common.test.TestUtil import eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest import eu.esdihumboldt.hale.io.jdbc.test.DBConfigInstance import groovy.sql.Sql +import org.junit.Test +import org.locationtech.jts.geom.Coordinate +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.GeometryFactory +import ru.yandex.qatools.allure.annotations.Features +import ru.yandex.qatools.allure.annotations.Stories /** @@ -89,7 +86,8 @@ class ReadWriteIT extends AbstractDBTest{ name "Some feature $i" geom new DefaultGeometryProperty(new CodeDefinition("EPSG:4326", null), gf.createLineString([ new Coordinate(0, 0), - new Coordinate(i, i)] as Coordinate[])) + new Coordinate(i, i) + ] as Coordinate[])) dat([0, 1, i, 1, 0] as byte[]) } } @@ -108,5 +106,4 @@ class ReadWriteIT extends AbstractDBTest{ assertEquals(20, count) } - } diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/WriteInstanceOrderIT.groovy b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/WriteInstanceOrderIT.groovy index 9600bf1d0f..0740d5e1ef 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/WriteInstanceOrderIT.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.postgresql/test/eu/esdihumboldt/hale/io/jdbc/postgresql/test/WriteInstanceOrderIT.groovy @@ -15,15 +15,6 @@ package eu.esdihumboldt.hale.io.jdbc.postgresql.test; -import org.junit.Test - -import ru.yandex.qatools.allure.annotations.Features -import ru.yandex.qatools.allure.annotations.Stories - -import org.locationtech.jts.geom.Coordinate -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.GeometryFactory - import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder @@ -32,6 +23,12 @@ import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.io.jdbc.test.AbstractDBTest import eu.esdihumboldt.hale.io.jdbc.test.DBConfigInstance import groovy.sql.Sql +import org.junit.Test +import org.locationtech.jts.geom.Coordinate +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.GeometryFactory +import ru.yandex.qatools.allure.annotations.Features +import ru.yandex.qatools.allure.annotations.Stories /** * test the order of the instances to be written to the database, as unorder @@ -98,7 +95,8 @@ public class WriteInstanceOrderIT extends AbstractDBTest { name "test $i" geom new DefaultGeometryProperty(new CodeDefinition("EPSG:4326", null), gf.createLineString([ new Coordinate(0, 0), - new Coordinate(i, i)] as Coordinate[])) + new Coordinate(i, i) + ] as Coordinate[])) } testtable{ test_id i diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteConnectionConfigurer.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteConnectionConfigurer.java index b9df47d25e..ac4a5626a4 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteConnectionConfigurer.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteConnectionConfigurer.java @@ -1,15 +1,13 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.io.jdbc.extension.ConnectionConfigurer; import java.sql.SQLException; import java.sql.Statement; - import org.sqlite.SQLiteConnection; import org.sqlite.core.DB; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.io.jdbc.extension.ConnectionConfigurer; - /** * * Enables SpatiaLite extension on the given {@link SQLiteConnection}. If native diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteGeometries.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteGeometries.java index 19310488ed..c43084d419 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteGeometries.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteGeometries.java @@ -1,21 +1,5 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.function.Supplier; - -import org.geotools.geometry.jts.JTS; -import org.geotools.referencing.CRS; -import org.opengis.referencing.crs.CoordinateReferenceSystem; -import org.opengis.referencing.operation.MathTransform; -import org.sqlite.SQLiteConnection; - -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.io.WKTReader; -import org.locationtech.jts.io.WKTWriter; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.SimpleLog; @@ -34,6 +18,19 @@ import eu.esdihumboldt.hale.io.jdbc.spatialite.internal.SpatiaLiteSupport; import eu.esdihumboldt.hale.io.jdbc.spatialite.internal.SpatiaLiteSupportFactory; import eu.esdihumboldt.hale.io.jdbc.spatialite.internal.SrsMetadata; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.function.Supplier; +import org.geotools.geometry.jts.JTS; +import org.geotools.referencing.CRS; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.io.WKTReader; +import org.locationtech.jts.io.WKTWriter; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.operation.MathTransform; +import org.sqlite.SQLiteConnection; import schemacrawler.schema.BaseColumn; import schemacrawler.schema.ColumnDataType; @@ -49,9 +46,9 @@ public class SpatiaLiteGeometries implements GeometryAdvisor { @Override public boolean isFixedType(ColumnDataType columnType) { /* - * Concrete information on geometry type and SRS is not stored in the - * column but as metadata in the database. Therefore every column has to - * be configured on its own. + * Concrete information on geometry type and SRS is not stored in the column but + * as metadata in the database. Therefore every column has to be configured on + * its own. */ return false; } @@ -162,12 +159,11 @@ private Object encodeGeometryValue(Geometry value, String srid, int dimension, // convert JTS geometry to SpatiaLite's internal BLOB format WKTWriter wktWriter = new WKTWriter(dimension); /* - * Note: WKTWriter does produce wrong WKT (as of the OGC specification) - * for 3D geometries. For example does produce "MULTIPOLGON" instead of + * Note: WKTWriter does produce wrong WKT (as of the OGC specification) for 3D + * geometries. For example does produce "MULTIPOLGON" instead of * "MULTIPOLYGON Z". * - * This is why we use the GeomFromEWKT function. See also - * http://postgis. + * This is why we use the GeomFromEWKT function. See also http://postgis. * refractions.net/docs/using_postgis_dbmanagement.html#EWKB_EWKT */ String sqlGeomFromText = "SELECT GeomFromEWKT(?)"; @@ -228,34 +224,33 @@ private Geometry decodeGeometryValue(Object geom, // WKB format /* - * We could use the WKT - but the JTS WKTReader does not support - * properly encoded 3D geometries (e.g. "MULTIPOLYON Z" instead of just - * "MULTIPOLYGON") + * We could use the WKT - but the JTS WKTReader does not support properly + * encoded 3D geometries (e.g. "MULTIPOLYON Z" instead of just "MULTIPOLYGON") */ // String sqlGeomAsWKX = "SELECT ST_AsText(?)"; /* - * We could use the 2D WKT - but this will reduce all 3D geometries to a - * 2D projection. + * We could use the 2D WKT - but this will reduce all 3D geometries to a 2D + * projection. */ // String sqlGeomAsWKX = "SELECT AsWKT(?)"; /* - * We could use the WKB - but the JTS WKBReader does not properly - * support geometry type codes of 1000 and above (e.g. 1007 for a - * GeometryCollection with Z coordinate) + * We could use the WKB - but the JTS WKBReader does not properly support + * geometry type codes of 1000 and above (e.g. 1007 for a GeometryCollection + * with Z coordinate) */ // String sqlGeomAsWKX = "SELECT ST_AsBinary(?)"; /* - * We could use the EWKB - but the JTS WKBReader does not handle that - * properly as well (wrong geometry type extracted, 3D not recognized). + * We could use the EWKB - but the JTS WKBReader does not handle that properly + * as well (wrong geometry type extracted, 3D not recognized). */ // String sqlGeomAsWKX = "SELECT AsEWKB(?)"; /* - * We can use the EWKT - but the JTS WKTReader will fail if there is a - * preceding SRID (which we can remove). + * We can use the EWKT - but the JTS WKTReader will fail if there is a preceding + * SRID (which we can remove). */ String sqlGeomAsWKX = "SELECT AsEWKT(?)"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteJdbcIOSupplier.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteJdbcIOSupplier.java index d3752c0883..0a46a1b8a8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteJdbcIOSupplier.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteJdbcIOSupplier.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite; +import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; import java.io.File; import java.net.URI; -import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; - /** * I/O supplier for SpatiaLite databases. Converts a file path to a JDBC URI and * viceversa. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteURIBuilder.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteURIBuilder.java index d09b0dc1cf..eb6261179c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteURIBuilder.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatiaLiteURIBuilder.java @@ -1,8 +1,7 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite; -import java.net.URI; - import eu.esdihumboldt.hale.io.jdbc.extension.URIBuilder; +import java.net.URI; /** * Create JDBC URIs for SQLite/SpatiaLite. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatialLiteSchemaReaderAdvisor.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatialLiteSchemaReaderAdvisor.java index da32449cc5..e0851e0576 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatialLiteSchemaReaderAdvisor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/SpatialLiteSchemaReaderAdvisor.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite; +import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; +import eu.esdihumboldt.hale.io.jdbc.extension.JDBCSchemaReaderAdvisor; import java.util.regex.Pattern; - import schemacrawler.schemacrawler.DatabaseSpecificOverrideOptions; import schemacrawler.schemacrawler.InclusionRule; import schemacrawler.schemacrawler.InformationSchemaViews; import schemacrawler.schemacrawler.SchemaCrawlerOptions; -import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; -import eu.esdihumboldt.hale.io.jdbc.extension.JDBCSchemaReaderAdvisor; /** * Adapts {@link JDBCSchemaReader} behavior for SpatialLite. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/AbstractSpatiaLiteSupport.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/AbstractSpatiaLiteSupport.java index 38b8e3795b..68e896c008 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/AbstractSpatiaLiteSupport.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/AbstractSpatiaLiteSupport.java @@ -15,17 +15,14 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.internal; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; - -import org.sqlite.SQLiteConnection; - import org.locationtech.jts.geom.Geometry; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; +import org.sqlite.SQLiteConnection; /** * Base implementation of {@link SpatiaLiteSupport} interface. @@ -84,7 +81,8 @@ public SrsMetadata getSrsMetadata(SQLiteConnection conn, int srid) { try { // String sqlMeta = - // "SELECT auth_srid, auth_name, srs_wkt AS srtext FROM spatial_ref_sys WHERE srid = ?"; + // "SELECT auth_srid, auth_name, srs_wkt AS srtext FROM spatial_ref_sys WHERE + // srid = ?"; String sqlMeta = getSrsMetadataSQL(); stmt = conn.prepareStatement(sqlMeta); stmt.setInt(1, srid); @@ -160,10 +158,9 @@ public SrsMetadata getSrsMetadata(SQLiteConnection conn, String auth, int code) * Template method, implementation is provided by subclasses. *

        * - * @param coordDimension the value of the coord_dimension - * column - * @return the dimensionality of the geometry coordinates (either 2, 3, 4 or - * -1 in case of error) + * @param coordDimension the value of the coord_dimension column + * @return the dimensionality of the geometry coordinates (either 2, 3, 4 or -1 + * in case of error) */ protected abstract int getCoordDimensionAsInt(Object coordDimension); @@ -181,8 +178,8 @@ public SrsMetadata getSrsMetadata(SQLiteConnection conn, String auth, int code) /** * Return a SpatiaLite version dependent SQL query selecting at least three - * columns: auth_srid (integer), auth_name - * (string) and srtext (string). + * columns: auth_srid (integer), auth_name (string) + * and srtext (string). *

        * Template method, implementation is provided by subclasses. *

        @@ -194,8 +191,8 @@ public SrsMetadata getSrsMetadata(SQLiteConnection conn, String auth, int code) /** * Return a SpatiaLite version dependent SQL query selecting at least three - * columns: auth_srid (integer), auth_name - * (string), srtext (string) and srid (integer). + * columns: auth_srid (integer), auth_name (string), + * srtext (string) and srid (integer). *

        * Template method, implementation is provided by subclasses. *

        @@ -206,8 +203,7 @@ public SrsMetadata getSrsMetadata(SQLiteConnection conn, String auth, int code) protected abstract String getSrsMetadataFromAuthSQL(); /** - * Utility method to close a {@link ResultSet} and a {@link Statement} - * instance. + * Utility method to close a {@link ResultSet} and a {@link Statement} instance. * * @param stmt the {@link Statement} to close * @param rs the {@link ResultSet} to close diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/Activator.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/Activator.java index f4db2f941e..d22b8b7b03 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/Activator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/Activator.java @@ -1,7 +1,6 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.internal; import java.sql.DriverManager; - import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteHelper.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteHelper.java index ccca0109ee..1e20e2b89e 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteHelper.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteHelper.java @@ -15,20 +15,17 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.internal; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; - import org.sqlite.SQLiteConnection; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; - /** * Helper for SpatiaLite. * @@ -43,8 +40,7 @@ public class SpatiaLiteHelper { * * @param connection the database connection * @return true if the SpatiaLite module is loaded, - * false if it is not or the status cannot be - * determined + * false if it is not or the status cannot be determined */ private static boolean isSpatiaLiteLoaded(SQLiteConnection connection) { PreparedStatement statement = null; @@ -80,17 +76,17 @@ private static boolean isSpatiaLiteLoaded(SQLiteConnection connection) { .weakKeys().build(); /** - * Determine if SpatiaLite is loaded for the given connection. If not, - * reports to the user about the misconfiguration. A report is done only - * once per unique connection. + * Determine if SpatiaLite is loaded for the given connection. If not, reports + * to the user about the misconfiguration. A report is done only once per unique + * connection. * * @param connection the database connection * @param error if the report should be an error, otherwise it is a warning * @return true if the SpatiaLite module is loaded, - * false if it is not or the status cannot be - * determined + * false if it is not or the status cannot be determined */ - public static boolean isSpatialLiteLoadedReport(final SQLiteConnection connection, boolean error) { + public static boolean isSpatialLiteLoadedReport(final SQLiteConnection connection, + boolean error) { try { Boolean result = loadedCache.getIfPresent(connection); if (result != null) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteSupport.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteSupport.java index 7f8918e4d8..79ae071db8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteSupport.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteSupport.java @@ -26,8 +26,7 @@ public interface SpatiaLiteSupport { /** - * Extract metadata about the geometry type of the specified geometry - * column. + * Extract metadata about the geometry type of the specified geometry column. * * @param conn connection to SpatiaLite DB * @param tableName table name diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteSupportFactory.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteSupportFactory.java index 7b474e3429..51cb4e4773 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteSupportFactory.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/internal/SpatiaLiteSupportFactory.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.internal; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.concurrent.ConcurrentHashMap; - import org.sqlite.SQLiteConnection; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; - /** * Factory to create {@link SpatiaLiteSupport} instances matching the version of * the connected database. @@ -60,11 +58,10 @@ public static SpatiaLiteSupportFactory getInstance() { * Create a {@link SpatiaLiteSupport} instances matching the version of the * connected database. *

        - * {@link SpatiaLiteSupport} instances are internally cached; the connection - * URL is used as cache key, so if the method is invoked multiple times - * providing connection objects pointing to the same physical DB, only one - * instance of {@link SpatiaLiteSupport} is created and re-used multiple - * times. + * {@link SpatiaLiteSupport} instances are internally cached; the connection URL + * is used as cache key, so if the method is invoked multiple times providing + * connection objects pointing to the same physical DB, only one instance of + * {@link SpatiaLiteSupport} is created and re-used multiple times. *

        * * @param connection the DB connection diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteInstanceReader.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteInstanceReader.java index 720cdb13aa..651b8eb566 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteInstanceReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteInstanceReader.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.reader.internal; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; @@ -30,6 +24,11 @@ import eu.esdihumboldt.hale.common.instance.io.util.InstanceReaderDecorator; import eu.esdihumboldt.hale.io.jdbc.JDBCInstanceReader; import eu.esdihumboldt.hale.io.jdbc.spatialite.SpatiaLiteJdbcIOSupplier; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.Map; /** * Reads instances from a SpatiaLite DB. Wraps {@link JDBCInstanceReader}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteSchemaReader.java index a84f7ef5f2..4514824480 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteSchemaReader.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.reader.internal; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; @@ -30,6 +24,11 @@ import eu.esdihumboldt.hale.common.schema.io.util.SchemaReaderDecorator; import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; import eu.esdihumboldt.hale.io.jdbc.spatialite.SpatiaLiteJdbcIOSupplier; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.Map; /** * Reads a schema from a SpatiaLite DB. Wraps {@link JDBCSchemaReader}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/writer/internal/SpatiaLiteInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/writer/internal/SpatiaLiteInstanceWriter.java index bbb27dcdca..68a4876bd5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/writer/internal/SpatiaLiteInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/src/eu/esdihumboldt/hale/io/jdbc/spatialite/writer/internal/SpatiaLiteInstanceWriter.java @@ -15,17 +15,16 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.writer.internal; -import java.io.File; -import java.io.OutputStream; -import java.net.URI; -import java.util.Map; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; import eu.esdihumboldt.hale.common.instance.io.util.InstanceWriterDecorator; import eu.esdihumboldt.hale.io.jdbc.JDBCInstanceWriter; import eu.esdihumboldt.hale.io.jdbc.spatialite.SpatiaLiteJdbcIOSupplier; +import java.io.File; +import java.io.OutputStream; +import java.net.URI; +import java.util.Map; /** * Writes instances to a SpatiaLite DB. Wraps {@link JDBCInstanceWriter}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteInstanceReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteInstanceReaderTest.java index 998c9feece..fbe81b8be2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteInstanceReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteInstanceReaderTest.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.reader.internal; -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Test; - import eu.esdihumboldt.hale.common.test.TestUtil; import eu.esdihumboldt.hale.io.jdbc.spatialite.test.SpatiaLiteTestSuite; import eu.esdihumboldt.hale.io.jdbc.spatialite.test.SpatiaLiteTestSuiteVersion3; import eu.esdihumboldt.hale.io.jdbc.spatialite.test.SpatiaLiteTestSuiteVersion4; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import org.junit.Test; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteSchemaReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteSchemaReaderTest.java index 350b36420b..ec8be357b0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteSchemaReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/reader/internal/SpatiaLiteSchemaReaderTest.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.reader.internal; -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Test; - import eu.esdihumboldt.hale.common.test.TestUtil; import eu.esdihumboldt.hale.io.jdbc.spatialite.test.SpatiaLiteTestSuite; import eu.esdihumboldt.hale.io.jdbc.spatialite.test.SpatiaLiteTestSuiteVersion3; import eu.esdihumboldt.hale.io.jdbc.spatialite.test.SpatiaLiteTestSuiteVersion4; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import org.junit.Test; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; @@ -43,8 +42,8 @@ public static void waitForServices() { } /** - * Invoke {@link SpatiaLiteTestSuite#schemaReaderTest()} on the test suite - * class for SpatiaLite version 3 or less. + * Invoke {@link SpatiaLiteTestSuite#schemaReaderTest()} on the test suite class + * for SpatiaLite version 3 or less. * * @throws Exception if an error occurs */ @@ -56,8 +55,8 @@ public void testReadVersion3() throws Exception { } /** - * Invoke {@link SpatiaLiteTestSuite#schemaReaderTest()} on the test suite - * class for SpatiaLite version 4 or higher. + * Invoke {@link SpatiaLiteTestSuite#schemaReaderTest()} on the test suite class + * for SpatiaLite version 4 or higher. * * @throws Exception if an error occurs */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/test/SpatiaLiteTestSuite.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/test/SpatiaLiteTestSuite.java index 74ce51035f..edea30085d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/test/SpatiaLiteTestSuite.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/test/SpatiaLiteTestSuite.java @@ -5,29 +5,10 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.File; -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; -import org.sqlite.SQLiteConfig; - import com.google.common.io.ByteSink; import com.google.common.io.ByteSource; import com.google.common.io.Files; import com.google.common.io.Resources; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; @@ -43,6 +24,21 @@ import eu.esdihumboldt.hale.io.jdbc.spatialite.reader.internal.SpatiaLiteInstanceReader; import eu.esdihumboldt.hale.io.jdbc.spatialite.reader.internal.SpatiaLiteSchemaReader; import eu.esdihumboldt.hale.io.jdbc.spatialite.writer.internal.SpatiaLiteInstanceWriter; +import java.io.File; +import java.io.IOException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Geometry; +import org.sqlite.SQLiteConfig; /** * Class exposing methods with test logic, which are run by SpatiaLite test @@ -112,23 +108,23 @@ public abstract class SpatiaLiteTestSuite { * @throws IOException if temp file can't be created */ public void createSourceTempFile() throws IOException { - ByteSource source = Resources.asByteSource(SpatiaLiteTestSuite.class - .getResource(SOURCE_DB_LOCATION)); + ByteSource source = Resources + .asByteSource(SpatiaLiteTestSuite.class.getResource(SOURCE_DB_LOCATION)); ByteSink dest = Files.asByteSink(new File(getSourceTempFilePath())); source.copyTo(dest); } /** - * Copies the target database to a temporary file and deletes all instances - * in it. + * Copies the target database to a temporary file and deletes all instances in + * it. * * @throws IOException if temp file can't be created or instances can't be * deleted */ public void createTargetTempFile() throws IOException { - ByteSource source = Resources.asByteSource(SpatiaLiteTestSuite.class - .getResource(SOURCE_DB_LOCATION)); + ByteSource source = Resources + .asByteSource(SpatiaLiteTestSuite.class.getResource(SOURCE_DB_LOCATION)); ByteSink dest = Files.asByteSink(new File(getTargetTempFilePath())); source.copyTo(dest); @@ -170,10 +166,9 @@ public void deleteTargetTempFile() { } /** - * Generates a random path (within the system's temporary folder) for the - * source database. The random number used to construct the path is saved in - * a static variable and thus the path will remain constant for the whole - * run. + * Generates a random path (within the system's temporary folder) for the source + * database. The random number used to construct the path is saved in a static + * variable and thus the path will remain constant for the whole run. * * @return the absolute path of the source temp file */ @@ -182,10 +177,9 @@ public String getSourceTempFilePath() { } /** - * Generates a random path (within the system's temporary folder) for the - * target database. The random number used to construct the path is saved in - * a static variable and thus the path will remain constant for the whole - * run. + * Generates a random path (within the system's temporary folder) for the target + * database. The random number used to construct the path is saved in a static + * variable and thus the path will remain constant for the whole run. * * @return the absolute path of the target temp file */ @@ -275,8 +269,8 @@ public void instanceReaderTest() throws Exception { } /** - * Test - reads data from a source SpatiaLite database, writes them to a - * target SpatiaLite database and checks the results. + * Test - reads data from a source SpatiaLite database, writes them to a target + * SpatiaLite database and checks the results. * * @throws Exception if an error occurs */ @@ -402,8 +396,7 @@ public Schema readSchema(String sourceFilePath) throws Exception { * @param sourceSchema the schema of the source database * @param sourceFilePath the path to the source database file * @return the read instances - * @throws Exception any exception thrown by - * {@link SpatiaLiteInstanceReader} + * @throws Exception any exception thrown by {@link SpatiaLiteInstanceReader} */ public InstanceCollection readInstances(Schema sourceSchema, String sourceFilePath) throws Exception { @@ -426,8 +419,7 @@ public InstanceCollection readInstances(Schema sourceSchema, String sourceFilePa * @param schema the target schema * @param targetFilePath the path to the target database file * @param instances the instances to write - * @throws Exception any exception thrown by - * {@link SpatiaLiteInstanceWriter} + * @throws Exception any exception thrown by {@link SpatiaLiteInstanceWriter} */ public void writeInstances(Schema schema, String targetFilePath, InstanceCollection instances) throws Exception { @@ -446,9 +438,9 @@ public void writeInstances(Schema schema, String targetFilePath, InstanceCollect } /** - * Checks the property definitions and values of the provided instances. - * Values will be checked for just one instance (the one with - * {@link #PROPERTY_ID_NAME} = {@link #PROPERTY_ID_VALUE}). + * Checks the property definitions and values of the provided instances. Values + * will be checked for just one instance (the one with {@link #PROPERTY_ID_NAME} + * = {@link #PROPERTY_ID_VALUE}). * * @param instances the instances to check * @param propertyMap the expected property names / values @@ -480,8 +472,8 @@ public void checkInstances(InstanceCollection instances, Map pro @SuppressWarnings("null") Object value = instance.getProperty(QName.valueOf(propertyName))[0]; if (value instanceof GeometryProperty) { - assertTrue(((Geometry) propertyMap.get(propertyName)).equalsExact( - ((GeometryProperty) value).getGeometry(), 0.000001)); + assertTrue(((Geometry) propertyMap.get(propertyName)) + .equalsExact(((GeometryProperty) value).getGeometry(), 0.000001)); } else { assertEquals(propertyMap.get(propertyName), value); diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/writer/internal/SpatiaLiteInstanceWriterTest.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/writer/internal/SpatiaLiteInstanceWriterTest.java index 06c489ae5b..8bdde32936 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/writer/internal/SpatiaLiteInstanceWriterTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.spatialite/test/eu/esdihumboldt/hale/io/jdbc/spatialite/writer/internal/SpatiaLiteInstanceWriterTest.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.jdbc.spatialite.writer.internal; -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Test; - import eu.esdihumboldt.hale.common.test.TestUtil; import eu.esdihumboldt.hale.io.jdbc.spatialite.test.SpatiaLiteTestSuite; import eu.esdihumboldt.hale.io.jdbc.spatialite.test.SpatiaLiteTestSuiteVersion3; import eu.esdihumboldt.hale.io.jdbc.spatialite.test.SpatiaLiteTestSuiteVersion4; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import org.junit.Test; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/AbstractDBTest.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/AbstractDBTest.java index f85155190a..432baf4ead 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/AbstractDBTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/AbstractDBTest.java @@ -21,20 +21,6 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.lang.reflect.Field; -import java.net.URI; -import java.sql.Connection; -import java.sql.SQLException; -import java.sql.Types; -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.After; -import org.junit.Before; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.supplier.NoStreamInputSupplier; @@ -59,6 +45,18 @@ import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; import eu.esdihumboldt.hale.io.jdbc.SQLSchemaReader; import eu.esdihumboldt.hale.io.jdbc.constraints.SQLType; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.lang.reflect.Field; +import java.net.URI; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Types; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.Before; /** * Base class for database tests. @@ -76,8 +74,8 @@ public abstract class AbstractDBTest extends AbstractPlatformTest { private URI jdbcUri; /** - * @param imageParams the config parameters required while creating and - * starting the container. + * @param imageParams the config parameters required while creating and starting + * the container. * */ public AbstractDBTest(DBImageParameters imageParams) { @@ -87,8 +85,8 @@ public AbstractDBTest(DBImageParameters imageParams) { /** * Create a new database test class. * - * @param configName the name of the docker configuration to use for ramping - * up the database + * @param configName the name of the docker configuration to use for ramping up + * the database * @param contextClass the class in which context (class loader) the * configuration is defined */ @@ -99,8 +97,8 @@ public AbstractDBTest(String configName, Class contextClass) { /** * Setup host and database. * - * @throws InterruptedException thrown while creating, starting or - * inspecting a container. + * @throws InterruptedException thrown while creating, starting or inspecting a + * container. */ @Before public void setupDB() throws InterruptedException { @@ -252,12 +250,12 @@ protected Schema readSchema(String sql, String typeName) throws Exception { * It checks if the binding of a data type read from schema and the expected * binding are equal. * - * @param map It maps a data type with a binding class to be expected. e.g. - * for postgresql db, for data type VARCHAR, the expected binding - * class is String.class + * @param map It maps a data type with a binding class to be expected. e.g. for + * postgresql db, for data type VARCHAR, the expected binding class + * is String.class * @param schema the schema read. - * @throws Exception exception may thrown while getting the value of a - * static or instance field of type int. + * @throws Exception exception may thrown while getting the value of a static or + * instance field of type int. */ protected void checkBindingAndSqlType(Schema schema, Map> map) throws Exception { @@ -336,8 +334,8 @@ protected InstanceCollection readInstances(Schema schema) throws Exception { } /** - * Read the instances from the db, check if it is same as instances written - * to the db. + * Read the instances from the db, check if it is same as instances written to + * the db. * * @param originalInstances instance created and written to db * @param schema schema read diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/DBConfigInstance.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/DBConfigInstance.java index 7c17088331..fe28c6768b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/DBConfigInstance.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/DBConfigInstance.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.io.jdbc.test; import eu.esdihumboldt.hale.common.test.docker.config.DockerConfigInstance; - import java.util.HashSet; import java.util.List; import java.util.Set; @@ -49,8 +48,8 @@ public DBConfigInstance(String confKey, ClassLoader cl) { @Override public String getJDBCURL(int port, String hostName) { - return new StringBuilder().append(getStartURI()).append(hostName).append(COLON) - .append(port).append(FORW_SLASH).append(getDatabase()).toString(); + return new StringBuilder().append(getStartURI()).append(hostName).append(COLON).append(port) + .append(FORW_SLASH).append(getDatabase()).toString(); } /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/DBImageParameters.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/DBImageParameters.java index 8027ed1192..c17c20043a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/DBImageParameters.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc.test/src/eu/esdihumboldt/hale/io/jdbc/test/DBImageParameters.java @@ -32,8 +32,8 @@ public interface DBImageParameters extends ContainerParameters { */ String START_URL = "startURL"; /** - * Configuration key for a DB uptime which is the time taken by docker - * database image to get started + * Configuration key for a DB uptime which is the time taken by docker database + * image to get started */ String DB_UPTIME = "dbUPTime"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/GeometryAdvisor.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/GeometryAdvisor.java index ccde9859ba..ade0c1c0e1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/GeometryAdvisor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/GeometryAdvisor.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.io.jdbc; -import java.util.function.Supplier; - -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; @@ -26,6 +22,8 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; +import java.util.function.Supplier; +import org.locationtech.jts.geom.Geometry; import schemacrawler.schema.BaseColumn; import schemacrawler.schema.ColumnDataType; @@ -41,13 +39,13 @@ public interface GeometryAdvisor { /** - * Determines if for a column type detected as geometry type and associated - * to this advisor is a fixed type, i.e. if it is to be configured the same - * for all columns where it is used. + * Determines if for a column type detected as geometry type and associated to + * this advisor is a fixed type, i.e. if it is to be configured the same for all + * columns where it is used. * * @param columnType the column data type - * @return if there should be only one type definition for all columns with - * the given type + * @return if there should be only one type definition for all columns with the + * given type */ public boolean isFixedType(ColumnDataType columnType); @@ -56,12 +54,12 @@ public interface GeometryAdvisor { * * @param connection the JDBC connection * @param column the geometry column - * @param type the type definition associated to the column. It may be - * adapted by adding custom constraints, but {@link GeometryType} - * and {@link Binding} will be set by the caller + * @param type the type definition associated to the column. It may be adapted + * by adding custom constraints, but {@link GeometryType} and + * {@link Binding} will be set by the caller * @param log the log - * @return the geometry type that should be used for the - * {@link GeometryType} binding + * @return the geometry type that should be used for the {@link GeometryType} + * binding */ public Class configureGeometryColumnType(C connection, BaseColumn column, DefaultTypeDefinition type, SimpleLog log); @@ -71,8 +69,8 @@ public Class configureGeometryColumnType(C connection, BaseC * * @param geom the geometry property value consisting of geometry and the * associated CRS definition - * @param columnType the type definition of the associated geometry column - * that was previously configured using + * @param columnType the type definition of the associated geometry column that + * was previously configured using * {@link #configureGeometryColumnType(Object, BaseColumn, DefaultTypeDefinition, SimpleLog)} * @param connection Connection * @param log the log @@ -86,8 +84,8 @@ public Object convertGeometry(GeometryProperty geom, TypeDefinition columnTyp * Convert a geometry read from the database to a geometry property. * * @param geom the geometry read from the database - * @param columnType the type definition of the associated geometry column - * that was previously configured using + * @param columnType the type definition of the associated geometry column that + * was previously configured using * {@link #configureGeometryColumnType(Object, BaseColumn, DefaultTypeDefinition, SimpleLog)} * @param connection The connection * @param crsProvider The CRS provider diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCConnection.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCConnection.java index 94f2a1b2b6..2126d01099 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCConnection.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCConnection.java @@ -16,14 +16,7 @@ package eu.esdihumboldt.hale.io.jdbc; -import java.net.URI; -import java.sql.Connection; -import java.sql.Driver; -import java.sql.DriverManager; -import java.sql.SQLException; - import com.google.common.base.Preconditions; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.ExportProvider; @@ -33,6 +26,11 @@ import eu.esdihumboldt.hale.io.jdbc.extension.DriverConfiguration; import eu.esdihumboldt.hale.io.jdbc.extension.DriverConfigurationExtension; import eu.esdihumboldt.hale.io.jdbc.extension.internal.ConnectionConfigurerExtension; +import java.net.URI; +import java.sql.Connection; +import java.sql.Driver; +import java.sql.DriverManager; +import java.sql.SQLException; /** * Helper class that should be used to create JDBC connections, as it includes @@ -81,8 +79,7 @@ public static Connection getConnection(URI jdbcUri, String user, String password } /** - * Get a connection to a database, as configured in the given import - * provider. + * Get a connection to a database, as configured in the given import provider. * * @param jdbcImportProvider the import provider * @return the database connection @@ -93,8 +90,7 @@ public static Connection getConnection(ImportProvider jdbcImportProvider) throws } /** - * Get a connection to a database, as configured in the given export - * provider. + * Get a connection to a database, as configured in the given export provider. * * @param jdbcExportProvider the export provider * @return the database connection diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCConstants.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCConstants.java index 57ee579dbb..5ff6d9f575 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCConstants.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCConstants.java @@ -39,8 +39,8 @@ public interface JDBCConstants { public static final String PARAM_PASSWORD = "jdbc.password"; /** - * Parameter name for the selected schemas. The value is a comma-separated - * list of schema names. + * Parameter name for the selected schemas. The value is a comma-separated list + * of schema names. */ public static final String SCHEMAS = "schemas"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCInstanceReader.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCInstanceReader.java index df97c935a9..604c037780 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCInstanceReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCInstanceReader.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.io.jdbc; -import java.io.IOException; -import java.sql.Connection; -import java.sql.SQLException; -import java.sql.SQLSyntaxErrorException; -import java.util.HashMap; -import java.util.Map; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -36,6 +29,12 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.io.jdbc.constraints.DatabaseTable; import eu.esdihumboldt.hale.io.jdbc.constraints.SQLQuery; +import java.io.IOException; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.SQLSyntaxErrorException; +import java.util.HashMap; +import java.util.Map; /** * Reads instances from a JDBC database. @@ -80,8 +79,7 @@ public Connection getConnection() throws SQLException { } /** - * To test Connection. Override this to load the customized connection - * testing + * To test Connection. Override this to load the customized connection testing * * @return true if connection succeeded or null * @throws SQLException if connection could not be made. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCInstanceWriter.java index 2755a0e81d..c3b90464ee 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCInstanceWriter.java @@ -16,24 +16,6 @@ package eu.esdihumboldt.hale.io.jdbc; -import java.io.IOException; -import java.sql.Array; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -59,6 +41,22 @@ import eu.esdihumboldt.hale.io.jdbc.constraints.SQLArray; import eu.esdihumboldt.hale.io.jdbc.constraints.SQLType; import eu.esdihumboldt.hale.io.jdbc.constraints.internal.GeometryAdvisorConstraint; +import java.io.IOException; +import java.sql.Array; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.xml.namespace.QName; /** * Writes instance to a database through a JDBC connection. @@ -174,16 +172,16 @@ protected boolean isWriteUnordered() { } /** - * Write instances to a database connection Auto incremental keys are - * written to the database with the new generated values, and updated the - * foreign key values with this newly generated auto incremental values of - * the referenced column. + * Write instances to a database connection Auto incremental keys are written to + * the database with the new generated values, and updated the foreign key + * values with this newly generated auto incremental values of the referenced + * column. * *

        * Limitation: *

        - * This implementation for auto generated key insert is supported only for - * those tables which has only single auto generated fields. + * This implementation for auto generated key insert is supported only for those + * tables which has only single auto generated fields. * * @param connection the database connection * @param instances the instances to write @@ -292,12 +290,11 @@ private void writeInstances(Connection connection, InstanceCollection instances, /** * - * This helps to store the mapping of the old value to the auto generated - * value for a particular type. If same type appears twice that means the - * sorting and filtering of the types has not been done properly. + * This helps to store the mapping of the old value to the auto generated value + * for a particular type. If same type appears twice that means the sorting and + * filtering of the types has not been done properly. * - * @param type a type definition whose child has the auto incremented - * constraint + * @param type a type definition whose child has the auto incremented constraint * @param orgId original id as string * @param genId auto incremented id */ @@ -321,29 +318,29 @@ private Object processLookupId(Object orgId) { /** * - * Retrieves the target schema and orders it based on the references, so - * that there should not be any integrity constrain violation exception. + * Retrieves the target schema and orders it based on the references, so that + * there should not be any integrity constrain violation exception. *

        * Algorithm for sorting *

        * The steps for sorting the types based on references are as follows: *
          *
        1. Create a new set for the sorted types
        2. - *
        3. Create a visited type map to keep hold of the types whose references - * have already been checked. + *
        4. Create a visited type map to keep hold of the types whose references have + * already been checked. * *
        5. Iterate over the types that needs to be sorted *
            - *
          1. If the type is already in the visited map means references for this - * type have already been checked. (Again checking could lead to cyclic - * referencing in the infinite loop)
          2. + *
          3. If the type is already in the visited map means references for this type + * have already been checked. (Again checking could lead to cyclic referencing + * in the infinite loop)
          4. *
          5. Exit the current recursion.
          6. *
          7. Iterate over the child definition of the types and check for the * referenced types
          8. - *
          9. If there are reference types then iterate over each referenced type - * and recurse to the step (3.1) with this iterated referenced type
          10. - *
          11. Traverse till the type whose childs do not have any reference, add - * this type to the sorted set first
          12. + *
          13. If there are reference types then iterate over each referenced type and + * recurse to the step (3.1) with this iterated referenced type
          14. + *
          15. Traverse till the type whose childs do not have any reference, add this + * type to the sorted set first
          16. *
          17. Add the iterated type
          18. * *
          @@ -374,10 +371,10 @@ public Set getSortedSchemas(Collection } /** - * gets the list of the referenced type definitions. This is used for - * sorting the types based on the references. This method recursively calls - * itself till it finds a type which does not have any reference and that - * type to the sorted list as first element. + * gets the list of the referenced type definitions. This is used for sorting + * the types based on the references. This method recursively calls itself till + * it finds a type which does not have any reference and that type to the sorted + * list as first element. * * @param td type definition of the reference * @return list of type definitions of referenced @@ -412,8 +409,8 @@ private List getReferencesTd(TypeDefinition td) { } /** - * Filters the set of properties to only contain properties that can be used - * for inserting (e. g. no groups). + * Filters the set of properties to only contain properties that can be used for + * inserting (e. g. no groups). * * @param type the type definition * @param properties the available properties @@ -435,8 +432,8 @@ private void filterInsertProperties(TypeDefinition type, Set properties) * Currently, auto incremented fields are not inserted into the statement. * * @param type the type definition - * @param properties the set properties of the instance for which this - * statement is + * @param properties the set properties of the instance for which this statement + * is * @param typeStatements the already created statements * @param connection the database connection * @return the insert statement @@ -507,12 +504,12 @@ private PreparedStatement getInsertStatement(TypeDefinition type, Set pro /** * Populate a prepared insert statement with values from the given instance. * Checks if the property has auto incremental constraint, if it has then it - * maps the original old id to the id that is auto incremented while - * inserting the value. This mapping is used when inserting the foreign key - * values associated with those auto incremented column ids whose value has - * been changed. Thus, insertion of the foreign key wont fail. It will - * either execute the statement directly or add it into the batches - * depending upon the auto incremented flag. + * maps the original old id to the id that is auto incremented while inserting + * the value. This mapping is used when inserting the foreign key values + * associated with those auto incremented column ids whose value has been + * changed. Thus, insertion of the foreign key wont fail. It will either execute + * the statement directly or add it into the batches depending upon the auto + * incremented flag. * * * @param statement the insert statement diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCProvider.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCProvider.java index c803a51c1d..79998c4d2f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCProvider.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCProvider.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.io.jdbc; +import eu.esdihumboldt.hale.common.core.io.IOProvider; import java.sql.Connection; import java.sql.SQLException; -import eu.esdihumboldt.hale.common.core.io.IOProvider; - /** * Common interface for JDBC I/O providers. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCSchemaReader.java index 2760a9bf49..19013319c9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCSchemaReader.java @@ -19,24 +19,6 @@ import static eu.esdihumboldt.hale.io.jdbc.JDBCUtil.quote; import static eu.esdihumboldt.hale.io.jdbc.JDBCUtil.unquote; -import java.io.IOException; -import java.net.URI; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Types; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; @@ -73,11 +55,25 @@ import eu.esdihumboldt.hale.io.jdbc.extension.internal.GeometryTypeExtension; import eu.esdihumboldt.hale.io.jdbc.extension.internal.GeometryTypeInfo; import eu.esdihumboldt.hale.io.jdbc.extension.internal.SchemaReaderAdvisorExtension; +import java.io.IOException; +import java.net.URI; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Types; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Geometry; import schemacrawler.schema.BaseColumn; import schemacrawler.schema.Catalog; import schemacrawler.schema.Column; import schemacrawler.schema.ColumnDataType; -//import schemacrawler.schema.Database; import schemacrawler.schema.IndexColumn; import schemacrawler.schema.PrimaryKey; import schemacrawler.schema.ResultsColumn; @@ -358,8 +354,8 @@ private String getQuotedValue(String value) { * definition is created, too, if necessary. * * @param schema the schema the table belongs to - * @param tableType the type definition of the parent table this column - * belongs too + * @param tableType the type definition of the parent table this column belongs + * too * @param column the column to get or create a property definition for * @param overallNamespace the database namespace * @param namespace the schema namespace @@ -512,9 +508,8 @@ public static TypeDefinition getOrCreateColumnType(BaseColumn column, CustomType cust = CustomTypeExtension.getInstance().getCustomType(localName, connection); /* - * Oracle jdbc was returning sqltype -6 for NUMBER data type, but it is - * bound to boolean by Types.java class. Configured the sqltype 6 for - * NUMBER data type. + * Oracle jdbc was returning sqltype -6 for NUMBER data type, but it is bound to + * boolean by Types.java class. Configured the sqltype 6 for NUMBER data type. */ if (cust != null) { type.setConstraint(SQLType.get(cust.getSQLType())); @@ -586,14 +581,15 @@ public static TypeDefinition getOrCreateColumnType(BaseColumn column, /* * Postgres: * - * Dimensions and size are not part of the schema, they can - * only be determined for a value. + * Dimensions and size are not part of the schema, they can only be determined + * for a value. */ // XXX for now, stick to what we can determine int dimension = SQLArray.UNKNOWN_DIMENSION; String specificTypeName = (itemType != null) - ? (itemType.getDatabaseSpecificTypeName()) : (null); + ? (itemType.getDatabaseSpecificTypeName()) + : (null); type.setConstraint( new SQLArray(elementBinding, specificTypeName, dimension, null)); @@ -712,7 +708,7 @@ else if (columns.size() == 1) { Collections. singletonList(getOrCreateProperty(schema, type, table.getColumn(columns.get(0).getName()), overallNamespace, namespace, types, connection, reporter, catalog) - .getName()))); + .getName()))); } } diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCTableCollection.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCTableCollection.java index 69584578cd..9a354c1a87 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCTableCollection.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCTableCollection.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.io.jdbc; -import java.net.URI; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.report.LogAware; @@ -38,6 +32,11 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.io.jdbc.constraints.DatabaseTable; import eu.esdihumboldt.hale.io.jdbc.constraints.SQLQuery; +import java.net.URI; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; /** * Instance collection for instances belonging to a specific database table or a @@ -65,11 +64,10 @@ private class JDBCTableIterator implements InstanceIterator { // private final int currentOffset = 0; /** - * States if the row at the current cursor position was already - * consumed. + * States if the row at the current cursor position was already consumed. * - * Initially the result set points to the row before the first row, - * which by definition is consumed. + * Initially the result set points to the row before the first row, which by + * definition is consumed. */ private boolean consumed = true; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCUtil.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCUtil.java index be86ecbbc0..6f2279b479 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/JDBCUtil.java @@ -15,20 +15,18 @@ package eu.esdihumboldt.hale.io.jdbc; +import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoService; +import eu.esdihumboldt.hale.common.core.io.project.ProjectVariableReplacer; +import eu.esdihumboldt.hale.common.core.service.ServiceProvider; +import eu.esdihumboldt.hale.io.jdbc.extension.JDBCSchemaReaderAdvisor; import java.net.URI; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLFeatureNotSupportedException; import java.sql.Statement; - import javax.annotation.Nullable; -import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoService; -import eu.esdihumboldt.hale.common.core.io.project.ProjectVariableReplacer; -import eu.esdihumboldt.hale.common.core.service.ServiceProvider; -import eu.esdihumboldt.hale.io.jdbc.extension.JDBCSchemaReaderAdvisor; - /** * JDBC utility methods. * @@ -38,8 +36,7 @@ public class JDBCUtil { /** - * Removes one pair of leading/trailing quotes ("x" or 'x' or `x` becomes - * x). + * Removes one pair of leading/trailing quotes ("x" or 'x' or `x` becomes x). * * @param s the string to remove quotes from * @return the string with one pair of quotes less if possible diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/SQLSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/SQLSchemaReader.java index 9c1dd70f48..79166db74a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/SQLSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/SQLSchemaReader.java @@ -20,15 +20,6 @@ import static eu.esdihumboldt.hale.io.jdbc.JDBCUtil.determineQuoteString; import static eu.esdihumboldt.hale.io.jdbc.JDBCUtil.unquote; -import java.io.IOException; -import java.net.URI; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Text; @@ -51,6 +42,13 @@ import eu.esdihumboldt.hale.io.jdbc.constraints.SQLQuery; import eu.esdihumboldt.hale.io.jdbc.extension.JDBCSchemaReaderAdvisor; import eu.esdihumboldt.hale.io.jdbc.extension.internal.SchemaReaderAdvisorExtension; +import java.io.IOException; +import java.net.URI; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import javax.xml.namespace.QName; import schemacrawler.schema.Catalog; import schemacrawler.schema.ResultsColumn; import schemacrawler.schema.ResultsColumns; @@ -250,8 +248,8 @@ protected Schema loadFromSource(ProgressIndicator progress, IOReporter reporter) * Gets or creates a property definition for the given column. Its type * definition is created, too, if necessary. * - * @param tableType the type definition of the parent table this column - * belongs too + * @param tableType the type definition of the parent table this column belongs + * too * @param column the column to get or create a property definition for * @param namespace the schema namespace * @param typeIndex the type index diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/TableInstanceBuilder.groovy b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/TableInstanceBuilder.groovy index 3d5b68a54f..886d77bbf8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/TableInstanceBuilder.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/TableInstanceBuilder.groovy @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.io.jdbc -import java.lang.reflect.Array -import java.sql.Connection -import java.sql.ResultSet -import java.sql.SQLException -import java.util.function.Supplier - import eu.esdihumboldt.hale.common.core.report.SimpleLog import eu.esdihumboldt.hale.common.instance.geometry.CRSProvider import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder @@ -35,6 +29,11 @@ import eu.esdihumboldt.hale.io.jdbc.constraints.internal.GeometryAdvisorConstrai import eu.esdihumboldt.hale.io.jdbc.extension.internal.GeometryTypeExtension import eu.esdihumboldt.hale.io.jdbc.extension.internal.GeometryTypeInfo import groovy.transform.CompileStatic +import java.lang.reflect.Array +import java.sql.Connection +import java.sql.ResultSet +import java.sql.SQLException +import java.util.function.Supplier /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/DatabaseTable.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/DatabaseTable.java index 4f502869ed..9556732472 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/DatabaseTable.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/DatabaseTable.java @@ -60,13 +60,13 @@ public DatabaseTable(String schemaName, String tableName) { } /** - * Create a constraint with the given schema and table names and quotation - * usage decision as boolean value + * Create a constraint with the given schema and table names and quotation usage + * decision as boolean value * * @param schemaName the schema name, may be null * @param tableName the table name - * @param useQuote true if quotation needed in {@link #getFullTableName}, - * else false + * @param useQuote true if quotation needed in {@link #getFullTableName}, else + * false */ public DatabaseTable(String schemaName, String tableName, boolean useQuote) { super(); @@ -77,8 +77,8 @@ public DatabaseTable(String schemaName, String tableName, boolean useQuote) { } /** - * @return the schema name of the database table, may be null - * or empty + * @return the schema name of the database table, may be null or + * empty */ public String getSchemaName() { return schemaName; @@ -133,8 +133,7 @@ public boolean isTable() { } /** - * @return the boolean value for quotation usage in - * {@link #getFullTableName}. + * @return the boolean value for quotation usage in {@link #getFullTableName}. */ public boolean useQuote() { return useQuote; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/DefaultValue.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/DefaultValue.java index 8109f3095d..a9826e4854 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/DefaultValue.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/DefaultValue.java @@ -26,6 +26,7 @@ */ @Constraint(mutable = false) public class DefaultValue implements PropertyConstraint { + private static final Object NO_DEFAULT = new Object(); private final Object value; @@ -47,9 +48,9 @@ public DefaultValue(Object value) { } /** - * Returns the set default value. If no default value was set, - * null will be returned. Use {@link #isSet()} to - * differentiate between null as default value. + * Returns the set default value. If no default value was set, null + * will be returned. Use {@link #isSet()} to differentiate between + * null as default value. * * @return the set default value, or null if none was set */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLArray.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLArray.java index 3696b1c95d..30d8d25eb6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLArray.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLArray.java @@ -15,16 +15,14 @@ package eu.esdihumboldt.hale.io.jdbc.constraints; +import eu.esdihumboldt.hale.common.schema.model.Constraint; +import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import java.util.ArrayList; import java.util.Collections; import java.util.List; - import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; -import eu.esdihumboldt.hale.common.schema.model.Constraint; -import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; - /** * Constraint with information on an SQL array type. * @@ -98,8 +96,8 @@ public Class getElementType() { } /** - * @return the array dimension, {#value UNKNOWN_DIMENSION} if the dimension - * is unknown + * @return the array dimension, {#value UNKNOWN_DIMENSION} if the dimension is + * unknown */ public int getDimension() { return dimension; diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLQuery.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLQuery.java index 4373a59d7e..d60ec60528 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLQuery.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLQuery.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.io.jdbc.constraints; -import javax.annotation.Nullable; - import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import javax.annotation.Nullable; /** * Constraint for types representing SQL queries. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLType.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLType.java index a8dd446220..1bc0e5a4cf 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLType.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/SQLType.java @@ -16,18 +16,19 @@ package eu.esdihumboldt.hale.io.jdbc.constraints; -import java.util.HashMap; -import java.util.Map; - import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import java.util.HashMap; +import java.util.Map; /** * Constraint for the SQL type. + * * @author Kai Schwierczek */ @Constraint(mutable = false) public class SQLType implements TypeConstraint { + private static final Map types = new HashMap(); private final int type; @@ -64,8 +65,7 @@ public SQLType() { } /** - * Returns the set SQL type. If no type was set it is - * {@link Integer#MIN_VALUE}. + * Returns the set SQL type. If no type was set it is {@link Integer#MIN_VALUE}. * * @see java.sql.Types * @return the set SQL type or {@link Integer#MIN_VALUE} diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/factory/SQLArrayFactory.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/factory/SQLArrayFactory.java index 686c65b8b0..8ee12be390 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/factory/SQLArrayFactory.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/constraints/factory/SQLArrayFactory.java @@ -15,11 +15,8 @@ package eu.esdihumboldt.hale.io.jdbc.constraints.factory; -import java.util.List; - import com.google.common.base.Function; import com.google.common.collect.Collections2; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueList; import eu.esdihumboldt.hale.common.core.io.ValueProperties; @@ -29,6 +26,7 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.factory.TypeResolver; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; import eu.esdihumboldt.hale.io.jdbc.constraints.SQLArray; +import java.util.List; /** * Value conversion for {@link SQLArray} constraint. diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/ConnectionConfigurer.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/ConnectionConfigurer.java index 3a1a0a0d14..819603fe58 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/ConnectionConfigurer.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/ConnectionConfigurer.java @@ -16,16 +16,17 @@ package eu.esdihumboldt.hale.io.jdbc.extension; - /** * Interface for extensions configuring a certain connection type. + * * @author Simon Templer * @param the concrete connection type */ public interface ConnectionConfigurer { - + /** * Configure a connection after it has been established. + * * @param connection the JDBC connection */ public void configureConnection(T connection); diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/DriverConfiguration.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/DriverConfiguration.java index ba101d2577..5c0c700f75 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/DriverConfiguration.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/DriverConfiguration.java @@ -16,18 +16,15 @@ package eu.esdihumboldt.hale.io.jdbc.extension; -import java.net.URI; -import java.sql.Driver; -import java.sql.SQLException; - -import org.eclipse.core.runtime.IConfigurationElement; - import com.google.common.base.Throwables; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; +import java.net.URI; +import java.sql.Driver; +import java.sql.SQLException; +import org.eclipse.core.runtime.IConfigurationElement; /** * JDBC driver configuration. @@ -55,8 +52,7 @@ public class DriverConfiguration implements Identifiable { private final boolean isFileBased; /** - * Create a connection configuration from a corresponding configuration - * element. + * Create a connection configuration from a corresponding configuration element. * * @param elementId the identifier * @param element the configuration element @@ -142,8 +138,7 @@ public boolean matchURIPrefix(URI jdbcUri) { /** * Loading a driver * - * @return Driver the {@link Driver} implements instance or - * null + * @return Driver the {@link Driver} implements instance or null * * @throws ClassNotFoundException throws a Class not found exception */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/DriverConfigurationExtension.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/DriverConfigurationExtension.java index 1d04bcd07c..0fc2fabb4b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/DriverConfigurationExtension.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/DriverConfigurationExtension.java @@ -16,12 +16,10 @@ package eu.esdihumboldt.hale.io.jdbc.extension; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import java.net.URI; - import org.eclipse.core.runtime.IConfigurationElement; -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; - /** * Extension for {@link ConnectionConfigurer}s. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/JDBCSchemaReaderAdvisor.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/JDBCSchemaReaderAdvisor.java index 9f45ce1aaa..3f85afe0f1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/JDBCSchemaReaderAdvisor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/JDBCSchemaReaderAdvisor.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.hale.io.jdbc.extension; +import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; import javax.annotation.Nullable; - import schemacrawler.schemacrawler.SchemaCrawlerOptions; -import eu.esdihumboldt.hale.io.jdbc.JDBCSchemaReader; /** * Advisor for the behavior of a {@link JDBCSchemaReader}. @@ -28,20 +27,18 @@ public interface JDBCSchemaReaderAdvisor { /** - * Adapt the options passed to SchemaCrawler to retrieve the database - * schema. + * Adapt the options passed to SchemaCrawler to retrieve the database schema. * * @param options the schema crawler options */ void configureSchemaCrawler(SchemaCrawlerOptions options); /** - * Determine the path that should be included in the namespace for table - * types. + * Determine the path that should be included in the namespace for table types. * * @param path the JDBC URI path - * @return the string to use for the namespace in addition to the protocol, - * e.g. the database name + * @return the string to use for the namespace in addition to the protocol, e.g. + * the database name */ @Nullable String adaptPathForNamespace(String path); diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/ConnectionConfiguration.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/ConnectionConfiguration.java index 0d46b2284d..12f3d86400 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/ConnectionConfiguration.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/ConnectionConfiguration.java @@ -16,22 +16,21 @@ package eu.esdihumboldt.hale.io.jdbc.extension.internal; -import java.sql.Connection; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.io.jdbc.extension.ConnectionConfigurer; +import java.sql.Connection; +import org.eclipse.core.runtime.IConfigurationElement; /** * Applies a {@link ConnectionConfigurer}. + * * @author Simon Templer */ public class ConnectionConfiguration implements Identifiable { - + private static final ALogger log = ALoggerFactory.getLogger(ConnectionConfiguration.class); private final String elementId; @@ -39,18 +38,18 @@ public class ConnectionConfiguration implements Identifiable { private final Class> configurerClass; /** - * Create a connection configuration from a corresponding - * configuration element. + * Create a connection configuration from a corresponding configuration element. + * * @param elementId the identifier * @param element the configuration element */ @SuppressWarnings("unchecked") - public ConnectionConfiguration(String elementId, - IConfigurationElement element) { + public ConnectionConfiguration(String elementId, IConfigurationElement element) { this.elementId = elementId; - + connectionType = ExtensionUtil.loadClass(element, "type"); - configurerClass = (Class>) ExtensionUtil.loadClass(element, "configurer"); + configurerClass = (Class>) ExtensionUtil + .loadClass(element, "configurer"); } /** @@ -60,11 +59,11 @@ public ConnectionConfiguration(String elementId, public String getId() { return elementId; } - + /** - * Apply the configuration to a connection. Does nothing - * if the configuration is not applicable for this type of - * connection. + * Apply the configuration to a connection. Does nothing if the configuration is + * not applicable for this type of connection. + * * @param connection the database connection */ @SuppressWarnings("unchecked") diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/ConnectionConfigurerExtension.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/ConnectionConfigurerExtension.java index af280dcbc3..1c2f52d147 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/ConnectionConfigurerExtension.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/ConnectionConfigurerExtension.java @@ -16,28 +16,28 @@ package eu.esdihumboldt.hale.io.jdbc.extension.internal; -import java.sql.Connection; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import eu.esdihumboldt.hale.io.jdbc.extension.ConnectionConfigurer; +import java.sql.Connection; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link ConnectionConfigurer}s. + * * @author Simon Templer */ public class ConnectionConfigurerExtension extends IdentifiableExtension { - + /** * Identifier of the JDBC configuration extension point. */ public static final String EXTENSION_ID = "eu.esdihumboldt.hale.io.jdbc.config"; - + private static ConnectionConfigurerExtension instance; - + /** * Get the extension instance. + * * @return the extension instance */ public static ConnectionConfigurerExtension getInstance() { @@ -46,7 +46,7 @@ public static ConnectionConfigurerExtension getInstance() { } return instance; } - + /** * Default constructor */ @@ -63,21 +63,21 @@ protected String getIdAttributeName() { } /** - * @see de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension#create(java.lang.String, org.eclipse.core.runtime.IConfigurationElement) + * @see de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension#create(java.lang.String, + * org.eclipse.core.runtime.IConfigurationElement) */ @Override - protected ConnectionConfiguration create(String elementId, - IConfigurationElement element) { + protected ConnectionConfiguration create(String elementId, IConfigurationElement element) { if (element.getName().equals("connection")) { return new ConnectionConfiguration(elementId, element); } return null; } - + /** - * Apply the configurations to a connection. Nothing is done for - * configurations that are not applicable for this type of - * connection. + * Apply the configurations to a connection. Nothing is done for configurations + * that are not applicable for this type of connection. + * * @param connection the database connection */ public void applyAll(Connection connection) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/CustomType.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/CustomType.java index 2de4c2b162..5d61b38239 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/CustomType.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/CustomType.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.io.jdbc.extension.internal; -import java.sql.Connection; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; +import java.sql.Connection; +import org.eclipse.core.runtime.IConfigurationElement; /** * Configures the custom types information @@ -71,8 +69,8 @@ public int getSQLType() { /** * @param connection current connection - * @return true if current connection is an instance of configured - * connection type. + * @return true if current connection is an instance of configured connection + * type. */ public boolean isInstance(Connection connection) { return connectionType.isInstance(connection); diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/CustomTypeExtension.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/CustomTypeExtension.java index b860d5c7b9..7bfd94b285 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/CustomTypeExtension.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/CustomTypeExtension.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.io.jdbc.extension.internal; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import java.sql.Connection; - import org.eclipse.core.runtime.IConfigurationElement; -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; - /** * TODO Type description * diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/GeometryTypeExtension.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/GeometryTypeExtension.java index d43cef69ff..09e5083c5b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/GeometryTypeExtension.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/GeometryTypeExtension.java @@ -16,22 +16,22 @@ package eu.esdihumboldt.hale.io.jdbc.extension.internal; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import java.sql.Connection; - import org.eclipse.core.runtime.IConfigurationElement; -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; - /** * Extension for identifying geometry types. + * * @author Simon Templer */ public class GeometryTypeExtension extends IdentifiableExtension { - + private static GeometryTypeExtension instance; - + /** * Get the extension instance. + * * @return the extension instance */ public static GeometryTypeExtension getInstance() { @@ -40,7 +40,7 @@ public static GeometryTypeExtension getInstance() { } return instance; } - + /** * Default constructor */ @@ -57,11 +57,11 @@ protected String getIdAttributeName() { } /** - * @see de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension#create(java.lang.String, org.eclipse.core.runtime.IConfigurationElement) + * @see de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension#create(java.lang.String, + * org.eclipse.core.runtime.IConfigurationElement) */ @Override - protected GeometryTypeInfo create(String elementId, - IConfigurationElement element) { + protected GeometryTypeInfo create(String elementId, IConfigurationElement element) { if (element.getName().equals("geometrytype")) { return new GeometryTypeInfo(elementId, element); } @@ -69,12 +69,13 @@ protected GeometryTypeInfo create(String elementId, } /** - * Get the geometry type info associated to a type name and connection type, - * if any. + * Get the geometry type info associated to a type name and connection type, if + * any. + * * @param name the (column) type name * @param connection the database connection * @return the geometry type info or null if there is none - * associated + * associated */ public GeometryTypeInfo getTypeInfo(String name, Connection connection) { for (GeometryTypeInfo info : getElements()) { @@ -82,8 +83,8 @@ public GeometryTypeInfo getTypeInfo(String name, Connection connection) { return info; } } - + return null; } - + } diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/GeometryTypeInfo.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/GeometryTypeInfo.java index 882376c20f..8c14f3a717 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/GeometryTypeInfo.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/GeometryTypeInfo.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.io.jdbc.extension.internal; -import java.sql.Connection; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import eu.esdihumboldt.hale.io.jdbc.GeometryAdvisor; import eu.esdihumboldt.hale.io.jdbc.constraints.internal.GeometryAdvisorConstraint; +import java.sql.Connection; +import org.eclipse.core.runtime.IConfigurationElement; /** * Holds information about a geometry type. @@ -41,8 +39,7 @@ public class GeometryTypeInfo implements Identifiable { private final GeometryAdvisorConstraint constraint; /** - * Create a connection configuration from a corresponding configuration - * element. + * Create a connection configuration from a corresponding configuration element. * * @param elementId the identifier * @param element the configuration element diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/SchemaReaderAdvisorDescriptor.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/SchemaReaderAdvisorDescriptor.java index 5936d005aa..1e7496b8a5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/SchemaReaderAdvisorDescriptor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/SchemaReaderAdvisorDescriptor.java @@ -15,22 +15,20 @@ package eu.esdihumboldt.hale.io.jdbc.extension.internal; -import java.sql.Connection; - import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; import eu.esdihumboldt.hale.io.jdbc.extension.JDBCSchemaReaderAdvisor; +import java.sql.Connection; /** * Descriptor for a {@link JDBCSchemaReaderAdvisor} extension. * * @author Simon Templer */ -public interface SchemaReaderAdvisorDescriptor extends - ExtensionObjectFactory { +public interface SchemaReaderAdvisorDescriptor + extends ExtensionObjectFactory { /** - * Determines if the advisor applies to a database with the given - * connection. + * Determines if the advisor applies to a database with the given connection. * * @param connection the database connection * @return if the advisor should be used for the database diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/SchemaReaderAdvisorExtension.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/SchemaReaderAdvisorExtension.java index 8787607bf8..965f2936c5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/SchemaReaderAdvisorExtension.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/src/eu/esdihumboldt/hale/io/jdbc/extension/internal/SchemaReaderAdvisorExtension.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.io.jdbc.extension.internal; -import java.sql.Connection; - -import javax.annotation.Nullable; - -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import de.fhg.igd.eclipse.util.extension.ExtensionUtil; @@ -28,23 +22,26 @@ import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.io.jdbc.extension.DriverConfigurationExtension; import eu.esdihumboldt.hale.io.jdbc.extension.JDBCSchemaReaderAdvisor; +import java.sql.Connection; +import javax.annotation.Nullable; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for {@link JDBCSchemaReaderAdvisor}s. * * @author Simon Templer */ -public class SchemaReaderAdvisorExtension extends - AbstractExtension { +public class SchemaReaderAdvisorExtension + extends AbstractExtension { private static final ALogger log = ALoggerFactory.getLogger(SchemaReaderAdvisorExtension.class); /** * Default factory for {@link JDBCSchemaReaderAdvisor}s. */ - private static class ConfigurationFactory extends - AbstractConfigurationFactory implements - SchemaReaderAdvisorDescriptor { + private static class ConfigurationFactory + extends AbstractConfigurationFactory + implements SchemaReaderAdvisorDescriptor { private final Class connectionType; @@ -124,9 +121,8 @@ public JDBCSchemaReaderAdvisor getAdvisor(Connection connection) { try { return factory.createExtensionObject(); } catch (Exception e) { - log.error( - "Could not create JDBC schema reader advisor " - + factory.getIdentifier(), e); + log.error("Could not create JDBC schema reader advisor " + + factory.getIdentifier(), e); } } } diff --git a/io/plugins/eu.esdihumboldt.hale.io.jdbc/test/eu/esdihumboldt/hale/io/jdbc/test/constraints/factory/GeometryMetadataFactoryTest.java b/io/plugins/eu.esdihumboldt.hale.io.jdbc/test/eu/esdihumboldt/hale/io/jdbc/test/constraints/factory/GeometryMetadataFactoryTest.java index 95ee474e99..7d95d8d6a3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.jdbc/test/eu/esdihumboldt/hale/io/jdbc/test/constraints/factory/GeometryMetadataFactoryTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.jdbc/test/eu/esdihumboldt/hale/io/jdbc/test/constraints/factory/GeometryMetadataFactoryTest.java @@ -19,13 +19,12 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Test; - import eu.esdihumboldt.hale.common.schema.model.constraint.factory.extension.ValueConstraintExtension; import eu.esdihumboldt.hale.common.schema.model.constraint.factory.extension.ValueConstraintFactoryDescriptor; import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryMetadata; import eu.esdihumboldt.hale.common.schema.model.constraint.type.factory.GeometryMetadataFactory; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import org.junit.Test; /** * Tests related to the geometry metadata value constraint factory. @@ -35,8 +34,7 @@ public class GeometryMetadataFactoryTest extends AbstractPlatformTest { /** - * Test if alias "jdbc.geometry" for geometry metadata constraint is - * working. + * Test if alias "jdbc.geometry" for geometry metadata constraint is working. */ @Test public void testAlias() { diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceReader.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceReader.java index 5f2f253ed6..bcf91915a7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceReader.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.io.json; -import java.io.IOException; - -import javax.xml.namespace.QName; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -36,6 +32,8 @@ import eu.esdihumboldt.hale.io.json.internal.JsonInstanceProcessor; import eu.esdihumboldt.hale.io.json.internal.JsonReadMode; import eu.esdihumboldt.hale.io.json.internal.JsonToInstance; +import java.io.IOException; +import javax.xml.namespace.QName; /** * Reader for Json/GeoJson data. @@ -71,8 +69,8 @@ public String getSampleDescription() { public static final String PARAM_DEFAULT_TYPE = "defaultType"; /** - * Name of the parameter that specifies if the default type should be used - * for all instances (i.e. use no other mechanisms to detect the type). + * Name of the parameter that specifies if the default type should be used for + * all instances (i.e. use no other mechanisms to detect the type). */ public static final String PARAM_FORCE_DEFAULT_TYPE = "forceDefaultType"; @@ -156,8 +154,8 @@ public JsonReadMode getReadMode() { } /** - * Set the default type to use for read instances. Other mechanisms to - * determine the type may take precedence. + * Set the default type to use for read instances. Other mechanisms to determine + * the type may take precedence. * * @param defaultType the name of the default type to use */ @@ -184,11 +182,11 @@ public QName getDefaultType() { /** * Set if the default type specified should be forced to be used for all - * instances. This disables any other mechanisms to determine the type of - * the instance. + * instances. This disables any other mechanisms to determine the type of the + * instance. * - * @param force true if the configured default type should - * always be used, false otherwise + * @param force true if the configured default type should always + * be used, false otherwise */ public void setForceDefaultType(boolean force) { setParameter(PARAM_FORCE_DEFAULT_TYPE, Value.of(force)); diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceWriter.java index 0fb5b99b45..df9b31fe27 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceWriter.java @@ -15,14 +15,6 @@ package eu.esdihumboldt.hale.io.json; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.nio.charset.Charset; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -32,6 +24,13 @@ import eu.esdihumboldt.hale.common.instance.io.impl.AbstractInstanceWriter; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.io.json.internal.InstanceToJson; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.nio.charset.Charset; /** * Writes instances as JSON. @@ -52,9 +51,9 @@ public JsonInstanceWriter() { /** * - * Note: The GeoJson output follows the RFC SPEC but extends it similar to - * the draft version 6 by attributes for namespace prefix definitions and - * specific feature type: http://wiki.geojson.org/GeoJSON_draft_version_6 + * Note: The GeoJson output follows the RFC SPEC but extends it similar to the + * draft version 6 by attributes for namespace prefix definitions and specific + * feature type: http://wiki.geojson.org/GeoJSON_draft_version_6 * * @param useGeoJsonFeatures if the output should be valid GeoJson output */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonSchemaReader.java index fedd613d5f..e020d678d4 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonSchemaReader.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.io.json; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URI; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -35,6 +30,10 @@ import eu.esdihumboldt.hale.io.json.internal.JsonReadMode; import eu.esdihumboldt.hale.io.json.internal.NamespaceManager; import eu.esdihumboldt.hale.io.json.internal.schema.JsonToSchema; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URI; /** * Reader for a schema from a Json/GeoJson data file. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/AbstractJsonInstanceProcessor.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/AbstractJsonInstanceProcessor.java index ba7c25c9e3..4705e215a4 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/AbstractJsonInstanceProcessor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/AbstractJsonInstanceProcessor.java @@ -15,17 +15,16 @@ package eu.esdihumboldt.hale.io.json.internal; -import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; - import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; /** * Abstract class for processing instances from JSON. @@ -160,17 +159,16 @@ public T readInstance(JsonParser parser) throws IOException { } /* - * Note: It would be nice to use the streaming API to process the - * complete JSON, but in that case we would rely for some things on - * information being provided in a certain order, which we can't rely - * on. + * Note: It would be nice to use the streaming API to process the complete JSON, + * but in that case we would rely for some things on information being provided + * in a certain order, which we can't rely on. * * Example cases where order does matter: * * - detecting if GeoJson is used * - * - determining a schema type automatically (based on @type field or - * event structure) [not done yet] + * - determining a schema type automatically (based on @type field or event + * structure) [not done yet] */ Map fields = readFieldsAsTree(parser); @@ -183,8 +181,8 @@ public T readInstance(JsonParser parser) throws IOException { /** * Process an instance given its root object fields. * - * The default implementation determines whether the fields represent a - * GeoJson object and continue processing based on that. + * The default implementation determines whether the fields represent a GeoJson + * object and continue processing based on that. * * @param fields the object's root fields * @return the processing result diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IgnoreNamespaces.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IgnoreNamespaces.java index bdd46431e6..af5217d178 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IgnoreNamespaces.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IgnoreNamespaces.java @@ -40,8 +40,8 @@ public void setPrefix(String namespace, String prefix) { } /** - * This is the overridden method and will always return an empty string for - * the prefix + * This is the overridden method and will always return an empty string for the + * prefix * * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#getPrefix(java.lang.String) */ @@ -52,8 +52,8 @@ public String getPrefix(String namespace) { } /** - * This method will not add any desired prefix to the namespace and will - * ignore the call + * This method will not add any desired prefix to the namespace and will ignore + * the call * * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#addNamespace(java.lang.String, * java.util.Optional) @@ -66,8 +66,7 @@ public String addNamespace(String namespace, Optional desiredPrefix) { } /** - * This method will not add any prefix to the namespace and will ignore the - * call + * This method will not add any prefix to the namespace and will ignore the call * * @param prefixes a map of namespaces to prefixes * @@ -79,8 +78,8 @@ public void addPrefixes(Map prefixes) { } /** - * Return null as we don't want to add any namespace. The caller should - * handle null checks. + * Return null as we don't want to add any namespace. The caller should handle + * null checks. * * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#getNamespaces() */ @@ -90,8 +89,8 @@ public Map getNamespaces() { } /** - * Return null as we don't want to add any namespace. The caller should - * handle null checks. + * Return null as we don't want to add any namespace. The caller should handle + * null checks. * * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#getNamespace(java.lang.String) */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IncludeNamespaces.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IncludeNamespaces.java index 4f3d161dc1..3aa71f65f5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IncludeNamespaces.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IncludeNamespaces.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.io.json.internal; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import java.util.Collections; import java.util.Map; import java.util.Optional; import java.util.OptionalInt; import java.util.regex.Matcher; import java.util.regex.Pattern; - import javax.xml.XMLConstants; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; - /** * Class that manages the namespaces and can be used to include the namespaces * in the geoJson or Json exported files. Not thread safe. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceToJson.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceToJson.java index e4c8d95b21..1b4a6b424e 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceToJson.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceToJson.java @@ -15,30 +15,10 @@ package eu.esdihumboldt.hale.io.json.internal; -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map.Entry; -import java.util.function.Function; - -import javax.xml.namespace.QName; - -import org.geotools.geojson.geom.GeometryJSON; -import org.geotools.geometry.jts.JTS; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryCollection; -import org.opengis.referencing.operation.MathTransform; - import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Multimap; - import eu.esdihumboldt.cst.functions.geometric.GeometryHelperFunctions; import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty; @@ -59,6 +39,22 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; import eu.esdihumboldt.util.Pair; import eu.esdihumboldt.util.geometry.WindingOrder; +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; +import java.util.function.Function; +import javax.xml.namespace.QName; +import org.geotools.geojson.geom.GeometryJSON; +import org.geotools.geometry.jts.JTS; +import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryCollection; +import org.opengis.referencing.operation.MathTransform; /** * Class to generate instance to JSON. @@ -79,9 +75,9 @@ public class InstanceToJson implements InstanceJsonConstants { /** * - * Note: The GeoJson output follows the RFC SPEC but extends it similar to - * the draft version 6 by attributes for namespace prefix definitions and - * specific feature type: http://wiki.geojson.org/GeoJSON_draft_version_6 + * Note: The GeoJson output follows the RFC SPEC but extends it similar to the + * draft version 6 by attributes for namespace prefix definitions and specific + * feature type: http://wiki.geojson.org/GeoJSON_draft_version_6 * * @param geoJson if the output should be valid GeoJson output */ @@ -92,9 +88,9 @@ public InstanceToJson(boolean geoJson) { /** * - * Note: The GeoJson output follows the RFC SPEC but extends it similar to - * the draft version 6 by attributes for namespace prefix definitions and - * specific feature type: http://wiki.geojson.org/GeoJSON_draft_version_6 + * Note: The GeoJson output follows the RFC SPEC but extends it similar to the + * draft version 6 by attributes for namespace prefix definitions and specific + * feature type: http://wiki.geojson.org/GeoJSON_draft_version_6 * * @param geoJson if the output should be valid GeoJson output */ @@ -106,8 +102,8 @@ public InstanceToJson(boolean geoJson, int decimals) { * * @param geoJson geojson * @param namespaces namespace - * @param decimals the number of decimals to use when encoding floating - * point numbers + * @param decimals the number of decimals to use when encoding floating point + * numbers */ public InstanceToJson(boolean geoJson, NamespaceManager namespaces, int decimals) { super(); @@ -656,8 +652,7 @@ protected void writeGeometryValue(JsonGenerator jsonGen, GeometryProperty geo // correct winding order as per right-hand rule, i.e., // exterior rings are counterclockwise, and holes are // clockwise. - geom = WindingOrder.unifyWindingOrder(geometry, true, - geomProp.getCRSDefinition().getCRS()); + geom = WindingOrder.unifyWindingOrder(geometry, true, geomProp.getCRSDefinition().getCRS()); // FIXME what to do in case of an invalid geometry? diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceBuilder.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceBuilder.groovy index a8ce64b3ef..09c5d397dc 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceBuilder.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceBuilder.groovy @@ -14,16 +14,8 @@ */ package eu.esdihumboldt.hale.io.json.internal -import java.util.Map.Entry - -import javax.xml.namespace.QName - -import org.geotools.geojson.geom.GeometryJSON -import org.locationtech.jts.geom.Geometry - import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ObjectNode - import eu.esdihumboldt.hale.common.align.helper.EntityFinder import eu.esdihumboldt.hale.common.align.model.AlignmentUtil import eu.esdihumboldt.hale.common.align.model.EntityDefinition @@ -40,6 +32,10 @@ import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag +import java.util.Map.Entry +import javax.xml.namespace.QName +import org.geotools.geojson.geom.GeometryJSON +import org.locationtech.jts.geom.Geometry /** * Instance builder for Json/GeoJson. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceCollection.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceCollection.java index 27f2f87df0..e9808b3a8b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceCollection.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceCollection.java @@ -15,20 +15,10 @@ package eu.esdihumboldt.hale.io.json.internal; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.nio.charset.Charset; -import java.util.Map; -import java.util.NoSuchElementException; - import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.ObjectMapper; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.instance.model.Filter; @@ -42,6 +32,14 @@ import eu.esdihumboldt.hale.common.instance.model.impl.PseudoInstanceReference; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.util.io.InputSupplier; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.charset.Charset; +import java.util.Map; +import java.util.NoSuchElementException; /** * Instance collection backed by a Json document. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceProcessor.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceProcessor.java index 967f86ce9f..6a2c2f7b9f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceProcessor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceProcessor.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.hale.io.json.internal; -import java.io.IOException; -import java.io.Reader; -import java.util.function.Consumer; - import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.io.Reader; +import java.util.function.Consumer; /** * Interface for classes processing individual instances coming from Json. @@ -39,10 +38,9 @@ public interface JsonInstanceProcessor { * @param the processing result type per instance * @param json the Json reader * @param processor the instance processor - * @param handler a handler for individual instance processing results, may - * be null - * @param limit the maximum limit of instances to process, negative for no - * limit + * @param handler a handler for individual instance processing results, may be + * null + * @param limit the maximum limit of instances to process, negative for no limit * * @throws JsonParseException if the Json cannot be parsed * @throws IOException if an error occurs processing the Json @@ -78,8 +76,8 @@ static void process(final Reader json, final JsonInstanceProcessor proces void init(JsonParser parser) throws JsonParseException, IOException; /** - * Read a single instance from the given parser. It is expected that the - * current position of the parser is at the start of an object. + * Read a single instance from the given parser. It is expected that the current + * position of the parser is at the start of an object. * * @param parser the JSON parser * @return the parsed instance diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonReadMode.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonReadMode.java index aee83bb2ec..5ad1b3ce39 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonReadMode.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonReadMode.java @@ -23,8 +23,7 @@ public enum JsonReadMode { /** - * Auto detection of mode to use (limited to FeatureCollection and Json - * array). + * Auto detection of mode to use (limited to FeatureCollection and Json array). */ auto("Auto-detection (supports GeoJson FeatureCollection and root Json array)"), /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonToInstance.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonToInstance.java index 0b890b45f5..54f822f5fc 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonToInstance.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonToInstance.java @@ -15,24 +15,21 @@ package eu.esdihumboldt.hale.io.json.internal; -import java.util.Collection; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; - import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; /** * Class to read instances from JSON. @@ -60,10 +57,10 @@ public class JsonToInstance extends AbstractJsonInstanceProcessor * @param expectGeoJson if the input is expected to be GeoJson * @param defaultType the feature type to use for all features or * null - * @param forceDefault if the default type should be always used (disables - * other mechanisms to determine the type) - * @param schema if a schema is specified, the feature type may be - * determined based on the schema + * @param forceDefault if the default type should be always used (disables other + * mechanisms to determine the type) + * @param schema if a schema is specified, the feature type may be determined + * based on the schema */ public JsonToInstance(boolean expectGeoJson, TypeDefinition defaultType, boolean forceDefault, TypeIndex schema, SimpleLog log) { @@ -77,10 +74,10 @@ public JsonToInstance(boolean expectGeoJson, TypeDefinition defaultType, boolean * @param expectGeoJson if the input is expected to be GeoJson * @param defaultType the default type to use for all features or * null - * @param forceDefault if the default type should be always used (disables - * other mechanisms to determine the type) - * @param schema if a schema is specified, the feature type may be - * determined based on the schema + * @param forceDefault if the default type should be always used (disables other + * mechanisms to determine the type) + * @param schema if a schema is specified, the feature type may be determined + * based on the schema */ public JsonToInstance(JsonReadMode mode, boolean expectGeoJson, TypeDefinition defaultType, boolean forceDefault, TypeIndex schema, SimpleLog log) { @@ -95,10 +92,10 @@ public JsonToInstance(JsonReadMode mode, boolean expectGeoJson, TypeDefinition d * @param expectGeoJson if the input is expected to be GeoJson * @param defaultType the feature type to use for all features or * null - * @param forceDefault if the default type should be always used (disables - * other mechanisms to determine the type) - * @param schema if a schema is specified, the feature type may be - * determined based on the schema + * @param forceDefault if the default type should be always used (disables other + * mechanisms to determine the type) + * @param schema if a schema is specified, the feature type may be determined + * based on the schema * @param namespaces the namespace manager */ public JsonToInstance(JsonReadMode mode, boolean expectGeoJson, TypeDefinition defaultType, @@ -127,8 +124,8 @@ public JsonToInstance(JsonReadMode mode, boolean expectGeoJson, TypeDefinition d /** * Determine default type if none is specified. * - * Note: This functionality should be removed once any kind of - * auto-detection based on the actual content is implemented. + * Note: This functionality should be removed once any kind of auto-detection + * based on the actual content is implemented. */ private static TypeDefinition determineDefaultType(TypeIndex schema, SimpleLog log) { if (schema == null) { @@ -170,10 +167,10 @@ protected Instance processInstance(Map fields, ObjectNode geom // determine schema type /* - * Currently only configuration of a fixed type that should be assumed - * for all features is supported. This could be extended later with some - * form of type detection (e.g. using the information in @type in case - * the data was written with InstanceToJson) + * Currently only configuration of a fixed type that should be assumed for all + * features is supported. This could be extended later with some form of type + * detection (e.g. using the information in @type in case the data was written + * with InstanceToJson) */ TypeDefinition type = defaultType; diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/NamespaceManager.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/NamespaceManager.java index b382a016a5..9a0bf15c88 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/NamespaceManager.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/NamespaceManager.java @@ -54,8 +54,8 @@ public interface NamespaceManager { public void setPrefix(String namespace, String prefix); /** - * Get the prefix associated to the given namespace. Associates a new prefix - * if none was associated before. + * Get the prefix associated to the given namespace. Associates a new prefix if + * none was associated before. * * @param namespace the namespace * @return the prefix @@ -72,8 +72,8 @@ public interface NamespaceManager { public String addNamespace(String namespace, Optional desiredPrefix); /** - * Add namespace prefixes from a map. Tries to reuse the given prefixes - * where possible. + * Add namespace prefixes from a map. Tries to reuse the given prefixes where + * possible. * * @param prefixes a map of namespaces to prefixes */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/TransformCache.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/TransformCache.java index 73a9b0b52b..26b8e19fd9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/TransformCache.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/TransformCache.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.io.json.internal; +import eu.esdihumboldt.util.groovy.collector.GenericCollector; import org.geotools.referencing.CRS; import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.operation.MathTransform; -import eu.esdihumboldt.util.groovy.collector.GenericCollector; - /** * MathTransform to transform source CRS to target CRS. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonProperty.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonProperty.groovy index 739c768e57..79b676c908 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonProperty.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonProperty.groovy @@ -15,23 +15,11 @@ package eu.esdihumboldt.hale.io.json.internal.schema -import javax.xml.namespace.QName - -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.GeometryCollection -import org.locationtech.jts.geom.LineString -import org.locationtech.jts.geom.MultiLineString -import org.locationtech.jts.geom.MultiPoint -import org.locationtech.jts.geom.MultiPolygon -import org.locationtech.jts.geom.Point -import org.locationtech.jts.geom.Polygon - import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ArrayNode import com.fasterxml.jackson.databind.node.ObjectNode import com.google.common.collect.HashMultiset import com.google.common.collect.Multiset - import eu.esdihumboldt.hale.common.core.report.SimpleLog import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup import eu.esdihumboldt.hale.common.schema.model.TypeDefinition @@ -41,6 +29,15 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition import groovy.transform.Canonical import groovy.transform.CompileStatic +import javax.xml.namespace.QName +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.GeometryCollection +import org.locationtech.jts.geom.LineString +import org.locationtech.jts.geom.MultiLineString +import org.locationtech.jts.geom.MultiPoint +import org.locationtech.jts.geom.MultiPolygon +import org.locationtech.jts.geom.Point +import org.locationtech.jts.geom.Polygon /** * Information collected on a Json property across different instances. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonToSchema.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonToSchema.java index 20b1195a74..dda9116561 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonToSchema.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonToSchema.java @@ -15,13 +15,8 @@ package eu.esdihumboldt.hale.io.json.internal.schema; -import java.util.Map; - -import javax.xml.namespace.QName; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; - import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; @@ -30,6 +25,8 @@ import eu.esdihumboldt.hale.io.json.internal.JsonReadMode; import eu.esdihumboldt.hale.io.json.internal.JsonToInstance; import eu.esdihumboldt.hale.io.json.internal.NamespaceManager; +import java.util.Map; +import javax.xml.namespace.QName; /** * Creates a schema definition from Json objects. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonType.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonType.java index b8dc7106ed..204134d22c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonType.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonType.java @@ -15,20 +15,17 @@ package eu.esdihumboldt.hale.io.json.internal.schema; -import java.util.LinkedHashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; - import eu.esdihumboldt.hale.common.core.report.SimpleLog; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappableFlag; import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; import eu.esdihumboldt.hale.io.json.internal.InstanceJsonConstants; +import java.util.LinkedHashMap; +import java.util.Map; +import javax.xml.namespace.QName; /** * Represents a specific type of Json object. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonTypes.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonTypes.java index 93530920a3..e56e10e56f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonTypes.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/JsonTypes.java @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.io.json.internal.schema; +import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; - import javax.xml.namespace.QName; -import eu.esdihumboldt.hale.common.core.report.SimpleLog; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; - /** * Create type definitions from information collected on different object types * encountered in Json. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/SchemaBuilderContext.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/SchemaBuilderContext.java index 09a1f68b7e..39ce5fc448 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/SchemaBuilderContext.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/schema/SchemaBuilderContext.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.io.json.internal.schema; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeIndex; @@ -30,6 +23,10 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappableFlag; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; +import java.util.HashMap; +import java.util.Map; +import javax.xml.namespace.QName; +import org.locationtech.jts.geom.Geometry; /** * Context for building a schema for Json data. Responsible for managing shared @@ -47,8 +44,8 @@ public class SchemaBuilderContext { /** * * @param defaultNamespace the namespace to use for common types - * @param sharedTypes the shared types (e.g. from other loaded schemas) for - * type reuse + * @param sharedTypes the shared types (e.g. from other loaded schemas) for type + * reuse */ public SchemaBuilderContext(String defaultNamespace, TypeIndex sharedTypes) { super(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/InstanceToJsonTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/InstanceToJsonTest.groovy index 63a1e60a6a..3a82ced8cc 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/InstanceToJsonTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/InstanceToJsonTest.groovy @@ -17,10 +17,6 @@ package eu.esdihumboldt.hale.io.json.test import static org.junit.Assert.* -import org.junit.Ignore -import org.junit.Test -import org.locationtech.jts.geom.Geometry - import eu.esdihumboldt.cst.functions.geometric.GeometryHelperFunctions import eu.esdihumboldt.hale.common.core.report.SimpleLog import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder @@ -31,6 +27,9 @@ import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.io.json.internal.InstanceToJson import groovy.json.JsonOutput import groovy.json.JsonSlurper +import org.junit.Ignore +import org.junit.Test +import org.locationtech.jts.geom.Geometry class InstanceToJsonTest { diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonInstanceCollectionTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonInstanceCollectionTest.groovy index d3dd4b4c83..cafd7a3598 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonInstanceCollectionTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonInstanceCollectionTest.groovy @@ -15,18 +15,8 @@ package eu.esdihumboldt.hale.io.json.test -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static org.assertj.core.api.Assertions.* -import java.nio.charset.Charset -import java.nio.charset.StandardCharsets -import java.util.function.Consumer - -import org.junit.Test -import org.locationtech.jts.geom.LineString -import org.locationtech.jts.geom.Polygon - import eu.esdihumboldt.hale.common.core.report.SimpleLog import eu.esdihumboldt.hale.common.instance.model.Instance import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty @@ -37,6 +27,13 @@ import eu.esdihumboldt.hale.io.json.internal.JsonInstanceCollection import eu.esdihumboldt.hale.io.json.internal.JsonReadMode import eu.esdihumboldt.hale.io.json.internal.JsonToInstance import eu.esdihumboldt.util.io.StringInputSupplier +import eu.esdihumboldt.util.test.AbstractPlatformTest +import java.nio.charset.Charset +import java.nio.charset.StandardCharsets +import java.util.function.Consumer +import org.junit.Test +import org.locationtech.jts.geom.LineString +import org.locationtech.jts.geom.Polygon /** * Tests for translating collections of Json/GeoJson objects to hale instance model. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonInstanceReaderTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonInstanceReaderTest.groovy index 3dbb8ecc96..6f2579c32b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonInstanceReaderTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonInstanceReaderTest.groovy @@ -15,17 +15,8 @@ package eu.esdihumboldt.hale.io.json.test -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static org.assertj.core.api.Assertions.* -import java.nio.charset.Charset -import java.nio.charset.StandardCharsets - -import javax.xml.namespace.QName - -import org.junit.Test - import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier import eu.esdihumboldt.hale.common.instance.model.Instance @@ -36,6 +27,11 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.io.json.JsonInstanceReader import eu.esdihumboldt.hale.io.json.internal.JsonReadMode import eu.esdihumboldt.util.io.StringInputSupplier +import eu.esdihumboldt.util.test.AbstractPlatformTest +import java.nio.charset.Charset +import java.nio.charset.StandardCharsets +import javax.xml.namespace.QName +import org.junit.Test /** * Tests for Json instance reader. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonSchemaReaderTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonSchemaReaderTest.groovy index 01080aea6c..5739b75c0b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonSchemaReaderTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonSchemaReaderTest.groovy @@ -15,20 +15,8 @@ package eu.esdihumboldt.hale.io.json.test -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static org.assertj.core.api.Assertions.* -import java.nio.charset.Charset -import java.nio.charset.StandardCharsets -import java.util.function.Consumer - -import javax.xml.namespace.QName - -import org.junit.Test -import org.locationtech.jts.geom.LineString -import org.locationtech.jts.geom.Point - import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty @@ -41,6 +29,14 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType import eu.esdihumboldt.hale.io.json.JsonSchemaReader import eu.esdihumboldt.hale.io.json.internal.schema.JsonType import eu.esdihumboldt.util.io.StringInputSupplier +import eu.esdihumboldt.util.test.AbstractPlatformTest +import java.nio.charset.Charset +import java.nio.charset.StandardCharsets +import java.util.function.Consumer +import javax.xml.namespace.QName +import org.junit.Test +import org.locationtech.jts.geom.LineString +import org.locationtech.jts.geom.Point /** * Tests for reading a schema from Json data. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonToInstanceTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonToInstanceTest.groovy index 9213918a69..5b24aca878 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonToInstanceTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.json/test/eu/esdihumboldt/hale/io/json/test/JsonToInstanceTest.groovy @@ -15,24 +15,11 @@ package eu.esdihumboldt.hale.io.json.test -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static org.assertj.core.api.Assertions.* -import java.util.function.Consumer - -import org.assertj.core.api.InstanceOfAssertFactories -import org.junit.Test -import org.locationtech.jts.geom.Coordinate -import org.locationtech.jts.geom.LineString -import org.locationtech.jts.geom.MultiPoint -import org.locationtech.jts.geom.Point -import org.locationtech.jts.geom.Polygon - import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.core.JsonToken import com.fasterxml.jackson.databind.ObjectMapper - import eu.esdihumboldt.hale.common.core.report.SimpleLog import eu.esdihumboldt.hale.common.instance.model.Instance import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty @@ -40,6 +27,15 @@ import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.schema.model.TypeDefinition import eu.esdihumboldt.hale.io.json.internal.JsonToInstance +import eu.esdihumboldt.util.test.AbstractPlatformTest +import java.util.function.Consumer +import org.assertj.core.api.InstanceOfAssertFactories +import org.junit.Test +import org.locationtech.jts.geom.Coordinate +import org.locationtech.jts.geom.LineString +import org.locationtech.jts.geom.MultiPoint +import org.locationtech.jts.geom.Point +import org.locationtech.jts.geom.Polygon /** * Tests for translating Json/GeoJson to hale instance model. diff --git a/io/plugins/eu.esdihumboldt.hale.io.pb/src/eu/esdihumboldt/hale/io/pb/ProtocolBufferInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.pb/src/eu/esdihumboldt/hale/io/pb/ProtocolBufferInstanceWriter.java index c800a4bf8f..18f43fa955 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.pb/src/eu/esdihumboldt/hale/io/pb/ProtocolBufferInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.pb/src/eu/esdihumboldt/hale/io/pb/ProtocolBufferInstanceWriter.java @@ -1,16 +1,9 @@ package eu.esdihumboldt.hale.io.pb; -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.io.Reader; -import java.nio.file.Files; - import com.google.protobuf.Struct; import com.google.protobuf.Struct.Builder; import com.google.protobuf.util.JsonFormat; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -20,6 +13,11 @@ import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; import eu.esdihumboldt.hale.io.json.JsonInstanceWriter; import eu.esdihumboldt.util.io.OutputSupplier; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.io.Reader; +import java.nio.file.Files; /** * Class to generate instances to Protocol Buffer. @@ -92,8 +90,7 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) * * @param jsonSource reader of the JSON to convert * @param target supplier for the target output stream - * @throws IOException if an error occurs reading, converting or writing - * data + * @throws IOException if an error occurs reading, converting or writing data */ public static void writeJsonToProtocolBuffer(Reader jsonSource, OutputSupplier target) throws IOException { diff --git a/io/plugins/eu.esdihumboldt.hale.io.pb/test/eu/esdihumboldt/hale/io/pb/test/ProtocolBufferInstanceWriterTest.java b/io/plugins/eu.esdihumboldt.hale.io.pb/test/eu/esdihumboldt/hale/io/pb/test/ProtocolBufferInstanceWriterTest.java index 1c918bb0d3..9bb1de14d1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.pb/test/eu/esdihumboldt/hale/io/pb/test/ProtocolBufferInstanceWriterTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.pb/test/eu/esdihumboldt/hale/io/pb/test/ProtocolBufferInstanceWriterTest.java @@ -17,20 +17,17 @@ import static org.junit.Assert.assertEquals; +import com.google.protobuf.Struct; +import com.google.protobuf.util.JsonFormat; +import eu.esdihumboldt.hale.io.pb.ProtocolBufferInstanceWriter; import java.io.ByteArrayOutputStream; import java.io.Reader; import java.io.StringReader; import java.util.HashMap; import java.util.Map; - import org.json.simple.JSONValue; import org.junit.Test; -import com.google.protobuf.Struct; -import com.google.protobuf.util.JsonFormat; - -import eu.esdihumboldt.hale.io.pb.ProtocolBufferInstanceWriter; - /** * Test class for {@link ProtocolBufferInstanceWriter} * diff --git a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/ConfigSection.java b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/ConfigSection.java index 92f94bbc10..24c4c3901c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/ConfigSection.java +++ b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/ConfigSection.java @@ -7,13 +7,12 @@ package eu.esdihumboldt.hale.io.project.jaxb.generated; -import java.util.ArrayList; -import java.util.List; - import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlType; +import java.util.ArrayList; +import java.util.List; /** *

          @@ -72,10 +71,10 @@ public void setName(String value) { * Gets the value of the data property. * *

          - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the data property. + * This accessor method returns a reference to the live list, not a snapshot. + * Therefore any modification you make to the returned list will be present + * inside the JAXB object. This is why there is not a set method + * for the data property. * *

          * For example, to add a new item, do as follows: @@ -86,8 +85,7 @@ public void setName(String value) { * * *

          - * Objects of the following type(s) are allowed in the list - * {@link ConfigData } + * Objects of the following type(s) are allowed in the list {@link ConfigData } * * */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/HaleProject.java b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/HaleProject.java index 79e12fb207..00fb1e9eaa 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/HaleProject.java +++ b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/HaleProject.java @@ -7,13 +7,12 @@ package eu.esdihumboldt.hale.io.project.jaxb.generated; -import java.util.ArrayList; -import java.util.List; - import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlType; +import java.util.ArrayList; +import java.util.List; /** *

          @@ -279,10 +278,10 @@ public void setStyles(Styles value) { * Gets the value of the configSchema property. * *

          - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the configSchema property. + * This accessor method returns a reference to the live list, not a snapshot. + * Therefore any modification you make to the returned list will be present + * inside the JAXB object. This is why there is not a set method + * for the configSchema property. * *

          * For example, to add a new item, do as follows: @@ -293,8 +292,8 @@ public void setStyles(Styles value) { * * *

          - * Objects of the following type(s) are allowed in the list - * {@link ConfigSection } + * Objects of the following type(s) are allowed in the list {@link ConfigSection + * } * * */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/ObjectFactory.java b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/ObjectFactory.java index ea8de59905..c54163f825 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/ObjectFactory.java +++ b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/ObjectFactory.java @@ -7,11 +7,10 @@ package eu.esdihumboldt.hale.io.project.jaxb.generated; -import javax.xml.namespace.QName; - import jakarta.xml.bind.JAXBElement; import jakarta.xml.bind.annotation.XmlElementDecl; import jakarta.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; /** * This object contains factory methods for each Java content interface and Java @@ -38,9 +37,8 @@ public class ObjectFactory { private final static QName _Styles_QNAME = new QName("", "Styles"); /** - * Create a new ObjectFactory that can be used to create new instances of - * schema derived classes for package: - * eu.esdihumboldt.hale.models.project.generated + * Create a new ObjectFactory that can be used to create new instances of schema + * derived classes for package: eu.esdihumboldt.hale.models.project.generated * */ public ObjectFactory() { @@ -111,8 +109,7 @@ public InstanceData createInstanceData() { } /** - * Create an instance of {@link JAXBElement }{@code <}{@link String - * }{@code >} + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * */ @XmlElementDecl(namespace = "", name = "ContextElement") @@ -170,8 +167,7 @@ public JAXBElement createHaleProject(HaleProject value) { } /** - * Create an instance of {@link JAXBElement }{@code <}{@link Styles - * }{@code >} + * Create an instance of {@link JAXBElement }{@code <}{@link Styles }{@code >} * */ @XmlElementDecl(namespace = "", name = "Styles") diff --git a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/Task.java b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/Task.java index 0ba66a5448..0ff46ae41a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/Task.java +++ b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/Task.java @@ -7,13 +7,12 @@ package eu.esdihumboldt.hale.io.project.jaxb.generated; -import java.util.ArrayList; -import java.util.List; - import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlType; +import java.util.ArrayList; +import java.util.List; /** *

          @@ -118,10 +117,10 @@ public void setTaskStatus(String value) { * Gets the value of the contextIdentifier property. * *

          - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the contextIdentifier property. + * This accessor method returns a reference to the live list, not a snapshot. + * Therefore any modification you make to the returned list will be present + * inside the JAXB object. This is why there is not a set method + * for the contextIdentifier property. * *

          * For example, to add a new item, do as follows: diff --git a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/TaskStatus.java b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/TaskStatus.java index b17924a094..7bf3b761e9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/TaskStatus.java +++ b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/generated/TaskStatus.java @@ -7,12 +7,11 @@ package eu.esdihumboldt.hale.io.project.jaxb.generated; -import java.util.ArrayList; -import java.util.List; - import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlType; +import java.util.ArrayList; +import java.util.List; /** *

          @@ -47,10 +46,10 @@ public class TaskStatus { * Gets the value of the task property. * *

          - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the task property. + * This accessor method returns a reference to the live list, not a snapshot. + * Therefore any modification you make to the returned list will be present + * inside the JAXB object. This is why there is not a set method + * for the task property. * *

          * For example, to add a new item, do as follows: diff --git a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/reader/ProjectParser.java b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/reader/ProjectParser.java index 41fa619251..b07554faab 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/reader/ProjectParser.java +++ b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/reader/ProjectParser.java @@ -16,19 +16,6 @@ package eu.esdihumboldt.hale.io.project.jaxb.reader; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.transform.stream.StreamSource; - -import org.apache.commons.io.FilenameUtils; -import org.eclipse.core.runtime.content.IContentType; -import org.osgi.framework.Version; - import eu.esdihumboldt.hale.common.align.io.AlignmentIO; import eu.esdihumboldt.hale.common.align.io.AlignmentReader; import eu.esdihumboldt.hale.common.core.io.HaleIO; @@ -62,6 +49,16 @@ import jakarta.xml.bind.JAXBException; import jakarta.xml.bind.Unmarshaller; import jakarta.xml.bind.helpers.DefaultValidationEventHandler; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.transform.stream.StreamSource; +import org.apache.commons.io.FilenameUtils; +import org.eclipse.core.runtime.content.IContentType; +import org.osgi.framework.Version; /** * The project parser reads a given project XML file and populates a diff --git a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/writer/ProjectGenerator.java b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/writer/ProjectGenerator.java index cef1e24bbe..4529445195 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/writer/ProjectGenerator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.project.jaxb/src/eu/esdihumboldt/hale/io/project/jaxb/writer/ProjectGenerator.java @@ -15,14 +15,12 @@ */ package eu.esdihumboldt.hale.io.project.jaxb.writer; +import eu.esdihumboldt.hale.io.project.jaxb.generated.HaleProject; +import jakarta.xml.bind.JAXBException; import java.io.File; import java.net.URI; - import javax.swing.GroupLayout.Alignment; -import eu.esdihumboldt.hale.io.project.jaxb.generated.HaleProject; -import jakarta.xml.bind.JAXBException; - /** * The {@link ProjectGenerator} serializes all project info to an xml file. The * {@link Alignment} is saved alongside in a goml file. diff --git a/io/plugins/eu.esdihumboldt.hale.io.schemabuilder/src/eu/esdihumboldt/hale/io/schemabuilder/SchemaBuilderReader.java b/io/plugins/eu.esdihumboldt.hale.io.schemabuilder/src/eu/esdihumboldt/hale/io/schemabuilder/SchemaBuilderReader.java index e025f99024..6b69ac3ad0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.schemabuilder/src/eu/esdihumboldt/hale/io/schemabuilder/SchemaBuilderReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.schemabuilder/src/eu/esdihumboldt/hale/io/schemabuilder/SchemaBuilderReader.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.io.schemabuilder; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -import org.codehaus.groovy.control.CompilerConfiguration; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -34,6 +28,10 @@ import groovy.lang.Binding; import groovy.lang.GroovyShell; import groovy.util.DelegatingScript; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import org.codehaus.groovy.control.CompilerConfiguration; /** * Schema reader that runs a Groovy script against a schema builder. diff --git a/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/util/SchematronReportParser.groovy b/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/util/SchematronReportParser.groovy index 3eb234ef7a..ae85f50f7c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/util/SchematronReportParser.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/util/SchematronReportParser.groovy @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.io.schematron.util -import java.text.MessageFormat - import eu.esdihumboldt.hale.common.core.io.report.IOReporter import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl import groovy.transform.CompileDynamic import groovy.util.slurpersupport.GPathResult +import java.text.MessageFormat /** * Simple parser for SRVL reports to extract failed assertion messages diff --git a/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/validator/SchematronInstanceValidator.java b/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/validator/SchematronInstanceValidator.java index e3e798a40e..79bf263fee 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/validator/SchematronInstanceValidator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/validator/SchematronInstanceValidator.java @@ -1,16 +1,5 @@ package eu.esdihumboldt.hale.io.schematron.validator; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.net.URI; - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.stream.StreamSource; - -import org.opengis.cite.validation.SchematronValidator; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; @@ -22,6 +11,14 @@ import eu.esdihumboldt.hale.io.schematron.util.SchematronReportParser; import eu.esdihumboldt.hale.io.validation.ConfigurableInstanceValidator; import eu.esdihumboldt.hale.io.validation.ValidatorConfiguration; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.net.URI; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; +import org.opengis.cite.validation.SchematronValidator; /*** * @@ -43,8 +40,7 @@ public class SchematronInstanceValidator extends AbstractInstanceValidator public static final String PROVIDER_ID = "eu.esdihumboldt.hale.io.schematron.validator"; /** - * Set the location of the schematron rules definition to use for - * validation. + * Set the location of the schematron rules definition to use for validation. * * @param location the schematron location */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/validator/SchematronUtils.java b/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/validator/SchematronUtils.java index d678447374..085bc04075 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/validator/SchematronUtils.java +++ b/io/plugins/eu.esdihumboldt.hale.io.schematron/src/eu/esdihumboldt/hale/io/schematron/validator/SchematronUtils.java @@ -17,7 +17,6 @@ import java.io.ByteArrayOutputStream; import java.io.StringWriter; - import javax.xml.transform.OutputKeys; import javax.xml.transform.Result; import javax.xml.transform.Transformer; @@ -27,7 +26,6 @@ import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; - import org.opengis.cite.validation.SchematronValidator; /** @@ -38,8 +36,7 @@ public abstract class SchematronUtils { /** - * Writes the content of the given {@link Result} into a - * {@link StringWriter} + * Writes the content of the given {@link Result} into a {@link StringWriter} * * @param result {@link Result} from {@link SchematronValidator} validation * @param writer {@link StringWriter} to write report to diff --git a/io/plugins/eu.esdihumboldt.hale.io.schematron/test/eu/esdihumboldt/hale/io/schematron/ResourceInputSupplier.java b/io/plugins/eu.esdihumboldt.hale.io.schematron/test/eu/esdihumboldt/hale/io/schematron/ResourceInputSupplier.java index 92b963b9d7..5ee71e8cc8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.schematron/test/eu/esdihumboldt/hale/io/schematron/ResourceInputSupplier.java +++ b/io/plugins/eu.esdihumboldt.hale.io.schematron/test/eu/esdihumboldt/hale/io/schematron/ResourceInputSupplier.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.schematron; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; - /** * Input supplier for a resource loaded from the classpath. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.schematron/test/eu/esdihumboldt/hale/io/schematron/SchematronInstanceValidatorTest.java b/io/plugins/eu.esdihumboldt.hale.io.schematron/test/eu/esdihumboldt/hale/io/schematron/SchematronInstanceValidatorTest.java index 52340b6bea..0896d84750 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.schematron/test/eu/esdihumboldt/hale/io/schematron/SchematronInstanceValidatorTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.schematron/test/eu/esdihumboldt/hale/io/schematron/SchematronInstanceValidatorTest.java @@ -17,11 +17,10 @@ import static org.junit.Assert.assertEquals; -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Test; - import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.io.schematron.validator.SchematronInstanceValidator; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import org.junit.Test; /** * Tests for the {@link SchematronInstanceValidator}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/ShapefileAdvisor.java b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/ShapefileAdvisor.java index 2fa9161cba..824664ece5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/ShapefileAdvisor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/ShapefileAdvisor.java @@ -15,6 +15,14 @@ package eu.esdihumboldt.hale.io.shp; +import com.google.common.io.ByteStreams; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.common.core.io.impl.DefaultResourceAdvisor; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import java.io.BufferedOutputStream; import java.io.IOException; import java.io.InputStream; @@ -25,20 +33,9 @@ import java.nio.file.Path; import java.nio.file.PathMatcher; import java.nio.file.Paths; - import org.eclipse.core.runtime.content.IContentType; import org.geotools.data.shapefile.files.ShpFileType; -import com.google.common.io.ByteStreams; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.core.io.HaleIO; -import eu.esdihumboldt.hale.common.core.io.impl.DefaultResourceAdvisor; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; - /** * Resource advisor for Shapefiles. When copying a Shapefile it also copies the * auxiliary files. diff --git a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/ShapefileConstants.java b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/ShapefileConstants.java index bffeb96ab1..9436039076 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/ShapefileConstants.java +++ b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/ShapefileConstants.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.io.shp; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.io.shp.reader.internal.ShapeInstanceReader; +import javax.xml.namespace.QName; /** * Constants for Shapefile I/O @@ -33,15 +32,15 @@ public interface ShapefileConstants { public static final String SHAPEFILE_NS = "http://www.esdi-humboldt.eu/hale/shp"; /** - * The shapefile augmentation namespace - types and properties that really - * are not part of the data, but are some kind of augmented information or - * metadata should use this namespace. + * The shapefile augmentation namespace - types and properties that really are + * not part of the data, but are some kind of augmented information or metadata + * should use this namespace. */ public static final String SHAPEFILE_AUGMENT_NS = "http://www.esdi-humboldt.eu/hale/shp/augment"; /** - * The local name of the augmented property specifying the Shapefile file - * name an instance originated from. + * The local name of the augmented property specifying the Shapefile file name + * an instance originated from. */ public static final String AUGMENTED_PROPERTY_FILENAME = "filename"; @@ -51,29 +50,29 @@ public interface ShapefileConstants { public static final String DEFAULT_TYPE_NAME = "Shapefile"; /** - * Name of the parameter for {@link ShapeInstanceReader} to select the type - * the instances should be associated to. The value is a {@link QName} - * encoded as String. + * Name of the parameter for {@link ShapeInstanceReader} to select the type the + * instances should be associated to. The value is a {@link QName} encoded as + * String. */ public static final String PARAM_TYPENAME = "typename"; /** - * Name of the parameter for {@link ShapeInstanceReader} to auto detect - * schema types when selecting instances for multiple schemas. + * Name of the parameter for {@link ShapeInstanceReader} to auto detect schema + * types when selecting instances for multiple schemas. */ public static final String PARAM_AUTO_DETECT_SCHEMA_TYPES = "autoDetectSchemaTypes"; /** - * Name of the parameter for {@link ShapeInstanceReader} to activate - * matching of Shapefile property names to schema property names by checking - * if there is exactly one schema property whose name starts with the - * Shapefile property name. + * Name of the parameter for {@link ShapeInstanceReader} to activate matching of + * Shapefile property names to schema property names by checking if there is + * exactly one schema property whose name starts with the Shapefile property + * name. */ public static final String PARAM_MATCH_SHORT_PROPERTY_NAMES = "matchShortPropertyNames"; /** - * Constant for the geometry property for the shape files. Used when - * exporting the data to the shape files. + * Constant for the geometry property for the shape files. Used when exporting + * the data to the shape files. */ public static final String THE_GEOM = "the_geom"; @@ -81,12 +80,12 @@ public interface ShapefileConstants { * Constant for the shape file extension. */ public static final String SHP_EXTENSION = ".shp"; - + /** * Constant for the CPG file extension. */ public static final String CPG_EXTENSION = ".cpg"; - + /** * Constant for underscore. */ @@ -98,8 +97,7 @@ public interface ShapefileConstants { public static final String URL_STRING = "url"; /** - * Constant used to create default transaction when writing to the shape - * file. + * Constant used to create default transaction when writing to the shape file. */ public static final String CREATE_CONSTANT = "create"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapeInstanceReader.java b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapeInstanceReader.java index 756d0ab8fc..448b55aa0d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapeInstanceReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapeInstanceReader.java @@ -15,21 +15,6 @@ */ package eu.esdihumboldt.hale.io.shp.reader.internal; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.nio.charset.Charset; -import java.text.MessageFormat; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.geotools.data.shapefile.ShapefileDataStore; -import org.geotools.data.simple.SimpleFeatureSource; -import org.opengis.feature.type.Name; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -52,6 +37,18 @@ import eu.esdihumboldt.hale.io.shp.ShapefileConstants; import eu.esdihumboldt.hale.io.shp.internal.Messages; import eu.esdihumboldt.util.Pair; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.nio.charset.Charset; +import java.text.MessageFormat; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import javax.xml.namespace.QName; +import org.geotools.data.shapefile.ShapefileDataStore; +import org.geotools.data.simple.SimpleFeatureSource; +import org.opengis.feature.type.Name; /** * Reads instances from a shapefile. @@ -222,17 +219,17 @@ protected Charset getDefaultCharset() { } /** - * Determine the type out of the the mapping relevant types in the given - * type index, that matches the given data type best. + * Determine the type out of the the mapping relevant types in the given type + * index, that matches the given data type best. * * @param types the type index * @param dataType the Shapefile data type * @param preferredName the name of the preferred type - * @param allowNonShapefileTypes if types should be considered that don't - * follow the conventions of the ShapeSchemaReader - * @return the most compatible type found together with is compatibility - * rating or null if there is no type that at least has - * one matching property + * @param allowNonShapefileTypes if types should be considered that don't follow + * the conventions of the ShapeSchemaReader + * @return the most compatible type found together with is compatibility rating + * or null if there is no type that at least has one + * matching property * * @see #checkCompatibility(TypeDefinition, TypeDefinition, boolean) */ @@ -301,11 +298,11 @@ else if (maxCompatibility > 0 && comp == maxCompatibility) { * * @param schemaType the type to test for compatibility * @param dataType the type representing the data to read - * @param allowNonShapefileProperties if properties should be considered - * that don't follow the conventions of the ShapeSchemaReader + * @param allowNonShapefileProperties if properties should be considered that + * don't follow the conventions of the ShapeSchemaReader * @return the percentage of compatibility (value from 0 to - * 100), where 100 represents an exact - * match and 0 no compatibility + * 100), where 100 represents an exact match + * and 0 no compatibility */ public static int checkCompatibility(TypeDefinition schemaType, TypeDefinition dataType, boolean allowNonShapefileProperties) { @@ -347,8 +344,8 @@ public static int checkCompatibility(TypeDefinition schemaType, TypeDefinition d * * @param schemaType the schema type. * @param propertyName the property name - * @param allowNonShapefileProperties if properties should be considered - * even if the namespace does not match + * @param allowNonShapefileProperties if properties should be considered even if + * the namespace does not match * @return the child that was found or null */ private static ChildDefinition getChild(TypeDefinition schemaType, QName propertyName, diff --git a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapeSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapeSchemaReader.java index f8f1d748ab..8a61f2c6f4 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapeSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapeSchemaReader.java @@ -15,22 +15,6 @@ */ package eu.esdihumboldt.hale.io.shp.reader.internal; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.text.MessageFormat; -import java.util.Collection; - -import javax.xml.namespace.QName; - -import org.geotools.data.shapefile.ShapefileDataStore; -import org.locationtech.jts.geom.Geometry; -import org.opengis.feature.simple.SimpleFeatureType; -import org.opengis.feature.type.AttributeDescriptor; -import org.opengis.feature.type.AttributeType; -import org.opengis.feature.type.Name; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; @@ -54,6 +38,19 @@ import eu.esdihumboldt.hale.common.schema.persist.AbstractCachedSchemaReader; import eu.esdihumboldt.hale.io.shp.ShapefileConstants; import eu.esdihumboldt.hale.io.shp.internal.Messages; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.text.MessageFormat; +import java.util.Collection; +import javax.xml.namespace.QName; +import org.geotools.data.shapefile.ShapefileDataStore; +import org.locationtech.jts.geom.Geometry; +import org.opengis.feature.simple.SimpleFeatureType; +import org.opengis.feature.type.AttributeDescriptor; +import org.opengis.feature.type.AttributeType; +import org.opengis.feature.type.Name; /** * Reads a schema from a shapefile. @@ -66,8 +63,8 @@ public class ShapeSchemaReader extends AbstractCachedSchemaReader implements Sha private static final String PARAM_ADD_FILENAME_ATTRIBUTE = "addFilenameAttribute"; /** - * Set if an attribute should be added that will be filled with the file - * name when loading data from a Shapefile. + * Set if an attribute should be added that will be filled with the file name + * when loading data from a Shapefile. * * @param addFilename if a filename attribute should be added */ @@ -239,8 +236,8 @@ protected String getDefaultTypeName() { * Get the type definition from a Shapefile. * * @param source the Shapefile source - * @return the type definition or null in case reading the type - * was not possible + * @return the type definition or null in case reading the type was + * not possible */ public static TypeDefinition readShapeType( LocatableInputSupplier source) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapesInstanceCollection.java b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapesInstanceCollection.java index 3216707525..d01bc3df82 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapesInstanceCollection.java +++ b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/reader/internal/ShapesInstanceCollection.java @@ -16,30 +16,7 @@ package eu.esdihumboldt.hale.io.shp.reader.internal; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import org.geotools.data.simple.SimpleFeatureIterator; -import org.geotools.data.simple.SimpleFeatureSource; -import org.locationtech.jts.geom.Geometry; -import org.opengis.feature.Property; -import org.opengis.feature.simple.SimpleFeature; -import org.opengis.feature.type.AttributeDescriptor; -import org.opengis.feature.type.GeometryDescriptor; -import org.opengis.referencing.crs.CoordinateReferenceSystem; - import com.google.common.collect.ImmutableMap; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.align.helper.GeometryPropertyFinder; @@ -68,6 +45,25 @@ import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.property.NillableFlag; import eu.esdihumboldt.hale.io.shp.ShapefileConstants; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.xml.namespace.QName; +import org.geotools.data.simple.SimpleFeatureIterator; +import org.geotools.data.simple.SimpleFeatureSource; +import org.locationtech.jts.geom.Geometry; +import org.opengis.feature.Property; +import org.opengis.feature.simple.SimpleFeature; +import org.opengis.feature.type.AttributeDescriptor; +import org.opengis.feature.type.GeometryDescriptor; +import org.opengis.referencing.crs.CoordinateReferenceSystem; /** * Instance collection backed by a Shapefile data store. diff --git a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/writer/ShapefileInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/writer/ShapefileInstanceWriter.java index 4193764f19..407cab2427 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/writer/ShapefileInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.shp/src/eu/esdihumboldt/hale/io/shp/writer/ShapefileInstanceWriter.java @@ -15,6 +15,30 @@ package eu.esdihumboldt.hale.io.shp.writer; +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.hale.common.core.io.supplier.MultiLocationOutputSupplier; +import eu.esdihumboldt.hale.common.instance.geometry.GeometryFinder; +import eu.esdihumboldt.hale.common.instance.groovy.InstanceAccessor; +import eu.esdihumboldt.hale.common.instance.helper.DepthFirstInstanceTraverser; +import eu.esdihumboldt.hale.common.instance.helper.InstanceTraverser; +import eu.esdihumboldt.hale.common.instance.io.impl.AbstractGeoInstanceWriter; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; +import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; +import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.AugmentedValueFlag; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import eu.esdihumboldt.hale.io.shp.ShapefileConstants; import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -32,7 +56,6 @@ import java.util.Map.Entry; import java.util.Set; import java.util.stream.Collectors; - import org.geotools.data.DefaultTransaction; import org.geotools.data.Transaction; import org.geotools.data.collection.ListFeatureCollection; @@ -48,31 +71,6 @@ import org.opengis.feature.simple.SimpleFeatureType; import org.opengis.feature.type.Name; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.common.core.io.supplier.MultiLocationOutputSupplier; -import eu.esdihumboldt.hale.common.instance.geometry.GeometryFinder; -import eu.esdihumboldt.hale.common.instance.groovy.InstanceAccessor; -import eu.esdihumboldt.hale.common.instance.helper.DepthFirstInstanceTraverser; -import eu.esdihumboldt.hale.common.instance.helper.InstanceTraverser; -import eu.esdihumboldt.hale.common.instance.io.impl.AbstractGeoInstanceWriter; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; -import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; -import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; -import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty; -import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; -import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.AugmentedValueFlag; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; -import eu.esdihumboldt.hale.io.shp.ShapefileConstants; - /** * Class to write features into Shapefiles. * @@ -184,8 +182,8 @@ protected List writeInstances(InstanceCollection instanceCollection, } /** - * Step 1. Method to create feature type for the shape file. This is the - * first step, which creates the schema for the shape file. + * Step 1. Method to create feature type for the shape file. This is the first + * step, which creates the schema for the shape file. * * shape file restrictions:
          * a single geometry column named the_geom
          @@ -199,8 +197,8 @@ protected List writeInstances(InstanceCollection instanceCollection, * @param instances the instance to write. * @param progress the progress indicator. * @param reporter the reporter. - * @return map of SimpleFeatureType type used as a template to describe the - * file contents. + * @return map of SimpleFeatureType type used as a template to describe the file + * contents. */ private Map> createFeatureType( InstanceCollection instances, ProgressIndicator progress, IOReporter reporter) { @@ -257,12 +255,11 @@ private Map> createFeatureType( * @param instance instance. * @param localPart local part of QName which tracks multiple * schemas. - * @param geometryBuilderMap SimpleFeatureType to build schema definition - * for the shape file. - * @param missingGeomsForSchemas track all the schemas with missing - * geometry, so that later they can be logged in the reporter and - * prevent throwing exception in case of more than one schema to - * export. + * @param geometryBuilderMap SimpleFeatureType to build schema definition for + * the shape file. + * @param missingGeomsForSchemas track all the schemas with missing geometry, so + * that later they can be logged in the reporter and prevent throwing + * exception in case of more than one schema to export. */ private void writeGeometrySchema(Instance instance, String localPart, Map geometryBuilderMap, @@ -294,8 +291,8 @@ else if (!geoms.isEmpty()) { * * @param instance instance to write to. * @param type type definition. - * @param geometryBuilderMap SimpleFeatureType to build schema definition - * for the shape file. + * @param geometryBuilderMap SimpleFeatureType to build schema definition for + * the shape file. */ private void writePropertiesSchema(Instance instance, TypeDefinition type, Map geometryBuilderMap) { @@ -322,8 +319,8 @@ private void writePropertiesSchema(Instance instance, TypeDefinition type, } /** - * Method to truncate the property names up to 10 characters by splitting - * them from camelCase, snake_case, or alphanumeric characters. E.g.
          + * Method to truncate the property names up to 10 characters by splitting them + * from camelCase, snake_case, or alphanumeric characters. E.g.
          * camelCase: caCa
          * snake_case: snca
          * alpha1234; al12
          @@ -332,12 +329,11 @@ private void writePropertiesSchema(Instance instance, TypeDefinition type, * population: population * * As the Shapefile DB doesn't allow more than 10 characters, the change is - * required to avoid exporting null values to the columns whose name is - * greater than 10 characters. This method intentionally truncates to 8 - * characters to leave a room for the unexpected scenario(s) where the - * truncated names might clash, then the values will be appended with the - * integers by the library and the null values will be exported (should be a - * rare scenario). + * required to avoid exporting null values to the columns whose name is greater + * than 10 characters. This method intentionally truncates to 8 characters to + * leave a room for the unexpected scenario(s) where the truncated names might + * clash, then the values will be appended with the integers by the library and + * the null values will be exported (should be a rare scenario). * * @param propName property name to be truncated. * @return unchanged property name if <= 10 chars long or truncated property @@ -405,8 +401,8 @@ private Collection getNonComplexProperties(TypeDef * * @param localPart local part of QName which tracks multiple * schemas. - * @param geometryBuilderMap simpleFeatureTypeBuilder which adds schema info - * for the shape file. + * @param geometryBuilderMap simpleFeatureTypeBuilder which adds schema info for + * the shape file. * @param geom geometry. * @param geoProp GeometryProperty. */ @@ -437,8 +433,7 @@ private void createSimpleFeatureTypeBuilderWithGeometry(String localPart, * * @param location location to store the shape files. * - * @param schemaSftMap type is used as a template to describe the file - * contents. + * @param schemaSftMap type is used as a template to describe the file contents. * @return shape file data store. * @throws IOException exception if any. */ @@ -528,16 +523,15 @@ else if (numberOfGeometries > 1) { } /** - * * Step 3. method to create features for the shape files and write them as - * per the schema definition.
          - * Always the first entry should be "the_geom" then rest of the properties - * can be written. + * * Step 3. method to create features for the shape files and write them as per + * the schema definition.
          + * Always the first entry should be "the_geom" then rest of the properties can + * be written. * * @param instances instance to write. * @param progress the progress indicator. * @param reporter the reporter. - * @param schemaFtMap type is used as a template to describe the file - * contents. + * @param schemaFtMap type is used as a template to describe the file contents. * @return list all the features to be added to the file bundled in map for * multiple schemas and multiple geometries. */ @@ -660,8 +654,8 @@ private void writePropertiesInstanceData( * schema. * @param localPart local part of QName which tracks multiple * schemas. - * @param geometryProperty geometry property to extract the CRS definition - * and the geometry. + * @param geometryProperty geometry property to extract the CRS definition and + * the geometry. */ private void addGeometryData(IOReporter reporter, Map> schemaFbMap, String localPart, @@ -680,8 +674,8 @@ private void addGeometryData(IOReporter reporter, * * @param schemaDataStoreMap data store for the shape file. * @param schemaFtMap used as a template to describe the file contents. - * @param schemaFeaturesMap for each schema, each geom list of features to - * be written to the shape file. + * @param schemaFeaturesMap for each schema, each geom list of features to be + * written to the shape file. * @return List of file names that were written (without suffixes) * @throws IOException if any. */ @@ -743,8 +737,8 @@ private List writeToFile( /** * Create the CPG file starting from the Shapefile * - * @param cpgFilePath Path of the file to be written with just one line of - * the encoding + * @param cpgFilePath Path of the file to be written with just one line of the + * encoding * @throws IOException exception in any. */ public void writeCodePageFile(String cpgFilePath) throws IOException { diff --git a/io/plugins/eu.esdihumboldt.hale.io.shp/test/eu/esdihumboldt/hale/io/shp/ShapeInstanceReaderTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.shp/test/eu/esdihumboldt/hale/io/shp/ShapeInstanceReaderTest.groovy index 611f76ed40..364423e353 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.shp/test/eu/esdihumboldt/hale/io/shp/ShapeInstanceReaderTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.shp/test/eu/esdihumboldt/hale/io/shp/ShapeInstanceReaderTest.groovy @@ -15,21 +15,11 @@ package eu.esdihumboldt.hale.io.shp -import eu.esdihumboldt.util.test.AbstractPlatformTest - -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.* import static org.junit.Assert.assertEquals import static org.junit.Assert.assertNotNull import static org.junit.Assert.assertTrue -import java.nio.charset.StandardCharsets -import java.nio.file.Files -import java.util.function.Consumer - -import org.apache.commons.io.IOUtils -import org.junit.Test -import org.locationtech.jts.geom.Geometry - import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator import eu.esdihumboldt.hale.common.core.io.report.IOReport import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier @@ -40,8 +30,15 @@ import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.test.TestUtil import eu.esdihumboldt.hale.io.shp.reader.internal.ShapeInstanceReader +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode +import java.nio.charset.StandardCharsets +import java.nio.file.Files +import java.util.function.Consumer +import org.apache.commons.io.IOUtils +import org.junit.Test +import org.locationtech.jts.geom.Geometry /** * Tests for reading Shapefiles. diff --git a/io/plugins/eu.esdihumboldt.hale.io.shp/test/eu/esdihumboldt/hale/io/shp/ShapefileInstanceWriterTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.shp/test/eu/esdihumboldt/hale/io/shp/ShapefileInstanceWriterTest.groovy index 35bf87a737..965a5b3aba 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.shp/test/eu/esdihumboldt/hale/io/shp/ShapefileInstanceWriterTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.shp/test/eu/esdihumboldt/hale/io/shp/ShapefileInstanceWriterTest.groovy @@ -15,27 +15,10 @@ package eu.esdihumboldt.hale.io.shp -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static org.junit.Assert.assertEquals import static org.junit.Assert.assertFalse import static org.junit.Assert.assertTrue -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.Paths -import java.time.Instant -import java.time.LocalDate -import java.util.function.Consumer - -import org.geotools.data.shapefile.ShapefileDataStore -import org.junit.Test -import org.locationtech.jts.geom.Coordinate -import org.locationtech.jts.geom.Geometry -import org.locationtech.jts.geom.GeometryFactory -import org.locationtech.jts.geom.MultiPolygon -import org.locationtech.jts.geom.Point - import eu.esdihumboldt.cst.functions.geometric.GeometryHelperFunctions import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator @@ -56,7 +39,21 @@ import eu.esdihumboldt.hale.io.shp.reader.internal.ShapeInstanceReader import eu.esdihumboldt.hale.io.shp.reader.internal.ShapeSchemaReader import eu.esdihumboldt.hale.io.shp.writer.ShapefileInstanceWriter import eu.esdihumboldt.util.io.IOUtils +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.transform.CompileStatic +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.Paths +import java.time.Instant +import java.time.LocalDate +import java.util.function.Consumer +import org.geotools.data.shapefile.ShapefileDataStore +import org.junit.Test +import org.locationtech.jts.geom.Coordinate +import org.locationtech.jts.geom.Geometry +import org.locationtech.jts.geom.GeometryFactory +import org.locationtech.jts.geom.MultiPolygon +import org.locationtech.jts.geom.Point class ShapefileInstanceWriterTest extends AbstractPlatformTest { diff --git a/io/plugins/eu.esdihumboldt.hale.io.topojson/src/eu/esdihumboldt/hale/io/topojson/TopoJsonInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.topojson/src/eu/esdihumboldt/hale/io/topojson/TopoJsonInstanceWriter.java index d48bd06167..7be5b58acf 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.topojson/src/eu/esdihumboldt/hale/io/topojson/TopoJsonInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.topojson/src/eu/esdihumboldt/hale/io/topojson/TopoJsonInstanceWriter.java @@ -15,28 +15,9 @@ package eu.esdihumboldt.hale.io.topojson; -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URI; -import java.nio.file.Paths; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.ZoneOffset; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.TimeZone; - -import org.opengis.referencing.crs.CoordinateReferenceSystem; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; @@ -52,9 +33,25 @@ import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; import eu.esdihumboldt.hale.io.shp.writer.ShapefileInstanceWriter; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.URI; +import java.nio.file.Paths; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.TimeZone; import json.tools.Compress; import json.tools.Toolbox; import json.topojson.api.TopojsonApi; +import org.opengis.referencing.crs.CoordinateReferenceSystem; /** * Writes instances as TopoJSON by first creating an intermediate Shapefile and @@ -96,8 +93,8 @@ public class TopoJsonInstanceWriter extends AbstractInstanceWriter { private static final String DEFAULT_TOPOLOGY_NAME = "Topology"; /** - * TopoJSON, as a descendant of GeoJSON, requires geometries to be - * represented in WGS-84 (EPSG:4326) + * TopoJSON, as a descendant of GeoJSON, requires geometries to be represented + * in WGS-84 (EPSG:4326) */ private static final String TARGET_CRS_CODE = "EPSG:4326"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.topojson/test/eu/esdihumboldt/hale/io/topojson/test/TopoJsonInstanceWriterTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.topojson/test/eu/esdihumboldt/hale/io/topojson/test/TopoJsonInstanceWriterTest.groovy index 48286e5761..474355f0ee 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.topojson/test/eu/esdihumboldt/hale/io/topojson/test/TopoJsonInstanceWriterTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.topojson/test/eu/esdihumboldt/hale/io/topojson/test/TopoJsonInstanceWriterTest.groovy @@ -15,20 +15,10 @@ package eu.esdihumboldt.hale.io.topojson.test -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static org.junit.Assert.assertEquals import static org.junit.Assert.assertNull import static org.junit.Assert.assertTrue -import java.nio.file.Files -import java.nio.file.Path -import java.time.LocalDate -import java.util.function.Consumer - -import org.junit.Test -import org.locationtech.jts.geom.Geometry - import eu.esdihumboldt.cst.functions.geometric.GeometryHelperFunctions import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator import eu.esdihumboldt.hale.common.core.io.report.IOReport @@ -40,8 +30,15 @@ import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Schema import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace import eu.esdihumboldt.hale.io.topojson.TopoJsonInstanceWriter +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.json.JsonSlurper import groovy.transform.CompileStatic +import java.nio.file.Files +import java.nio.file.Path +import java.time.LocalDate +import java.util.function.Consumer +import org.junit.Test +import org.locationtech.jts.geom.Geometry /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ProjectValidator.java b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ProjectValidator.java index 92ba4708f9..0bc9daa6a7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ProjectValidator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ProjectValidator.java @@ -15,12 +15,6 @@ package eu.esdihumboldt.hale.io.validation; -import java.io.IOException; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - import eu.esdihumboldt.hale.common.core.io.HaleIO; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -31,6 +25,11 @@ import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.instance.io.impl.AbstractInstanceValidator; import eu.esdihumboldt.hale.io.validation.service.ValidatorConfigurationService; +import java.io.IOException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; /** * Validator that executes other validators according to the validator diff --git a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfiguration.java b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfiguration.java index a7d44f1b16..e5c7f0087a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfiguration.java +++ b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfiguration.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.hale.io.validation; import java.net.URI; - import org.eclipse.core.runtime.content.IContentType; /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfigurationImportAdvisor.java b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfigurationImportAdvisor.java index 21a3b8b01d..753d8c4771 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfigurationImportAdvisor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfigurationImportAdvisor.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.io.validation; -import java.text.MessageFormat; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOAdvisor; import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.impl.DefaultIOAdvisor; import eu.esdihumboldt.hale.io.validation.service.ValidatorConfigurationService; +import java.text.MessageFormat; /** * Import advisor for validator configurations diff --git a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfigurationReaderImpl.java b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfigurationReaderImpl.java index 4aa537af25..3d2c233c3b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfigurationReaderImpl.java +++ b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/ValidatorConfigurationReaderImpl.java @@ -15,20 +15,18 @@ package eu.esdihumboldt.hale.io.validation; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.text.MessageFormat; - -import org.apache.commons.io.IOUtils; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider; import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.text.MessageFormat; +import org.apache.commons.io.IOUtils; /** * Simple validation configuration reader diff --git a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/service/ValidatorConfigurationService.java b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/service/ValidatorConfigurationService.java index 634e0afaa2..07f6be329b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/service/ValidatorConfigurationService.java +++ b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/service/ValidatorConfigurationService.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.io.validation.service; -import java.util.List; - import eu.esdihumboldt.hale.io.validation.ValidatorConfiguration; +import java.util.List; /** * Service for managing validator configuration diff --git a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/service/internal/ValidatorConfigurationServiceImpl.java b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/service/internal/ValidatorConfigurationServiceImpl.java index 0a029ec1d3..fccbd91bfb 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/service/internal/ValidatorConfigurationServiceImpl.java +++ b/io/plugins/eu.esdihumboldt.hale.io.validation/src/eu/esdihumboldt/hale/io/validation/service/internal/ValidatorConfigurationServiceImpl.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.hale.io.validation.service.internal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import com.google.common.collect.Lists; - import eu.esdihumboldt.hale.io.validation.ValidatorConfiguration; import eu.esdihumboldt.hale.io.validation.service.ValidatorConfigurationService; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * Validator configuration service diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/AbstractWFSWriter.java b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/AbstractWFSWriter.java index 07dbff8489..04f0aa107a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/AbstractWFSWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/AbstractWFSWriter.java @@ -15,6 +15,23 @@ package eu.esdihumboldt.hale.io.wfs; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.core.io.config.UserPasswordCredentials; +import eu.esdihumboldt.hale.common.core.io.impl.SubtaskProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; +import eu.esdihumboldt.hale.common.instance.io.util.GeoInstanceWriterDecorator; +import eu.esdihumboldt.hale.io.gml.writer.XmlWrapper; +import eu.esdihumboldt.hale.io.gml.writer.internal.StreamGmlWriter; +import eu.esdihumboldt.util.http.ProxyUtil; +import eu.esdihumboldt.util.http.client.ClientProxyUtil; +import eu.esdihumboldt.util.http.client.fluent.FluentProxyUtil; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -30,14 +47,12 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; - import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; - import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; @@ -51,24 +66,6 @@ import org.w3c.dom.Document; import org.xml.sax.SAXException; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.config.UserPasswordCredentials; -import eu.esdihumboldt.hale.common.core.io.impl.SubtaskProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; -import eu.esdihumboldt.hale.common.instance.io.util.GeoInstanceWriterDecorator; -import eu.esdihumboldt.hale.io.gml.writer.XmlWrapper; -import eu.esdihumboldt.hale.io.gml.writer.internal.StreamGmlWriter; -import eu.esdihumboldt.util.http.ProxyUtil; -import eu.esdihumboldt.util.http.client.ClientProxyUtil; -import eu.esdihumboldt.util.http.client.fluent.FluentProxyUtil; - /** * Base class for WFS writers that directly write to the WFS-T. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/PartitioningWFSWriter.java b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/PartitioningWFSWriter.java index 33eb72e0d2..a47ce451a1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/PartitioningWFSWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/PartitioningWFSWriter.java @@ -15,16 +15,6 @@ package eu.esdihumboldt.hale.io.wfs; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.eclipse.core.runtime.IProgressMonitor; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; @@ -38,6 +28,14 @@ import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; import eu.esdihumboldt.hale.common.instance.tools.InstanceCollectionPartitioner; import eu.esdihumboldt.hale.io.gml.writer.internal.StreamGmlWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import org.eclipse.core.runtime.IProgressMonitor; /** * WFS writer that publishes partitioned data sets @@ -92,8 +90,9 @@ protected IOReport execute(final ProgressIndicator progress, final IOReporter re InstanceCollection part = parts.next(); partitionProgress.end(); - progress.setCurrentTask("Upload part " + partCount + ((part.hasSize()) - ? (" (" + part.size() + " instances)") : (""))); + progress.setCurrentTask("Upload part " + partCount + + ((part.hasSize()) ? (" (" + part.size() + " instances)") + : (""))); IOReport report = uploadInstances(part, reporter, new SubtaskProgressIndicator(progress)); @@ -148,8 +147,9 @@ protected IOReport execute(final ProgressIndicator progress, final IOReporter re if (partCount == 1) partitionProgress.end(); - progress.setCurrentTask("Upload part " + partCount + ((part.hasSize()) - ? (" (" + part.size() + " instances)") : (""))); + progress.setCurrentTask("Upload part " + partCount + + ((part.hasSize()) ? (" (" + part.size() + " instances)") + : (""))); final int currentPart = partCount; requestThread.submit(new Runnable() { @@ -228,7 +228,7 @@ public void run() { */ protected IOReport uploadInstances(final InstanceCollection instances, final IOReporter reporter, final ProgressIndicator progress) - throws IOProviderConfigurationException, IOException { + throws IOProviderConfigurationException, IOException { SimpleWFSWriter writer = new SimpleWFSWriter() { @Override diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/SimpleWFSWriter.java b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/SimpleWFSWriter.java index 529edd923e..a83c3fb404 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/SimpleWFSWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/SimpleWFSWriter.java @@ -59,8 +59,8 @@ protected String getTaskName() { @Override protected XmlWrapper createTransaction() { String idgen = getParameter(PARAM_ID_GEN).as(String.class); - String inputFormat = getParameter(PARAM_INPUT_FORMAT) - .as(String.class, DEFAULT_INPUT_FORMAT); + String inputFormat = getParameter(PARAM_INPUT_FORMAT).as(String.class, + DEFAULT_INPUT_FORMAT); return new WFSInsert(getWFSVersion(), idgen, inputFormat); } diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/WFSConstants.java b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/WFSConstants.java index 996d29e60e..66893a16a0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/WFSConstants.java +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/WFSConstants.java @@ -28,8 +28,8 @@ public interface WFSConstants { public static final String CONTENT_TYPE_ID_WFST = "eu.esdihumboldt.hale.io.wfs-t"; /** - * Name of the parameter specifying the WFS version for I/O providers - * related to WFS. + * Name of the parameter specifying the WFS version for I/O providers related to + * WFS. */ public static final String PARAM_WFS_VERSION = "wfsVersion"; diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/WFSVersion.java b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/WFSVersion.java index 6aaa18c2a3..cd7e3695da 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/WFSVersion.java +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/WFSVersion.java @@ -23,15 +23,16 @@ * @author Simon Templer */ public enum WFSVersion { + /** WFS 1.1.0 */ - V1_1_0("1.1.0", "http://www.opengis.net/wfs", URI - .create("http://schemas.opengis.net/wfs/1.1.0/wfs.xsd")), + V1_1_0("1.1.0", "http://www.opengis.net/wfs", + URI.create("http://schemas.opengis.net/wfs/1.1.0/wfs.xsd")), /** WFS 2.0.0 */ - V2_0_0("2.0.0", "http://www.opengis.net/wfs/2.0", URI - .create("http://schemas.opengis.net/wfs/2.0/wfs.xsd")), + V2_0_0("2.0.0", "http://www.opengis.net/wfs/2.0", + URI.create("http://schemas.opengis.net/wfs/2.0/wfs.xsd")), /** WFS 2.0.2 */ - V2_0_2("2.0.2", "http://www.opengis.net/wfs/2.0", URI - .create("http://schemas.opengis.net/wfs/2.0/wfs.xsd")); + V2_0_2("2.0.2", "http://www.opengis.net/wfs/2.0", + URI.create("http://schemas.opengis.net/wfs/2.0/wfs.xsd")); /** * The version string. @@ -61,8 +62,8 @@ public String toString() { * Derive a WFS version from a version string. * * @param version the version string - * @param defVersion the default version to return if it cannot be - * determined from the given string + * @param defVersion the default version to return if it cannot be determined + * from the given string * @return the detected or default version */ public static WFSVersion fromString(String version, WFSVersion defVersion) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/capabilities/CapabilitiesHelper.groovy b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/capabilities/CapabilitiesHelper.groovy index 9da3a2aa72..1c71325c59 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/capabilities/CapabilitiesHelper.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/capabilities/CapabilitiesHelper.groovy @@ -15,16 +15,13 @@ package eu.esdihumboldt.hale.io.wfs.capabilities -import java.util.regex.Pattern - -import javax.xml.XMLConstants -import javax.xml.namespace.QName - import com.google.common.base.Splitter - import de.fhg.igd.slf4jplus.ALogger import de.fhg.igd.slf4jplus.ALoggerFactory import eu.esdihumboldt.hale.io.wfs.WFSVersion +import java.util.regex.Pattern +import javax.xml.XMLConstants +import javax.xml.namespace.QName /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/capabilities/WFSCapabilities.groovy b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/capabilities/WFSCapabilities.groovy index c0738369c9..b1fe4803e0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/capabilities/WFSCapabilities.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/capabilities/WFSCapabilities.groovy @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.io.wfs.capabilities -import javax.annotation.Nullable -import javax.xml.namespace.QName - import eu.esdihumboldt.hale.io.wfs.WFSVersion import groovy.transform.CompileStatic import groovy.transform.Immutable +import javax.annotation.Nullable +import javax.xml.namespace.QName /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/file/WFS2FCWriter.java b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/file/WFS2FCWriter.java index 8d2e603830..dcc7c5a613 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/file/WFS2FCWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/file/WFS2FCWriter.java @@ -15,16 +15,8 @@ package eu.esdihumboldt.hale.io.wfs.file; -import java.io.IOException; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.stream.XMLStreamException; - import com.google.common.collect.HashMultiset; import com.google.common.collect.Multiset; -import org.locationtech.jts.geom.Geometry; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; @@ -37,6 +29,11 @@ import eu.esdihumboldt.hale.io.gml.writer.InspireInstanceWriter; import eu.esdihumboldt.hale.io.wfs.WFSVersion; import eu.esdihumboldt.util.Pair; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; +import javax.xml.stream.XMLStreamException; +import org.locationtech.jts.geom.Geometry; /** * Concrete class for writing a WFS 2.0 FeatureCollection. Needed so HALE can @@ -71,8 +68,8 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) super.execute(progress, reporter); // run feed writer if applicable - if (getParameter(InspireInstanceWriter.PARAM_SPATIAL_DATA_SET_CREATE_FEED).as( - Boolean.class, false)) { + if (getParameter(InspireInstanceWriter.PARAM_SPATIAL_DATA_SET_CREATE_FEED).as(Boolean.class, + false)) { InspireDatasetFeedWriter feedWriter = new InspireDatasetFeedWriter(); for (String copyParam : InspireDatasetFeedWriter.getAdditionalParams()) { feedWriter.setParameter(copyParam, getParameter(copyParam)); diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/file/WFSFeatureCollectionWriter.java b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/file/WFSFeatureCollectionWriter.java index df55aa9fb4..a8182d5218 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/file/WFSFeatureCollectionWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/file/WFSFeatureCollectionWriter.java @@ -15,15 +15,6 @@ package eu.esdihumboldt.hale.io.wfs.file; -import java.util.Date; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.xmlbeans.XmlDateTime; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; @@ -41,6 +32,12 @@ import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; import eu.esdihumboldt.hale.io.xsd.reader.internal.SubstitutionGroupProperty; +import java.util.Date; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; +import org.apache.xmlbeans.XmlDateTime; /** * Write GML features as a WFS FeatureCollection. diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/transactions/AbstractWFSTransaction.java b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/transactions/AbstractWFSTransaction.java index d9c6341204..7c68dd3099 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/transactions/AbstractWFSTransaction.java +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/transactions/AbstractWFSTransaction.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.io.wfs.transactions; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.hale.io.gml.writer.XmlWrapper; +import eu.esdihumboldt.hale.io.wfs.WFSVersion; import java.util.Map; import java.util.Map.Entry; - import javax.xml.XMLConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.io.gml.writer.XmlWrapper; -import eu.esdihumboldt.hale.io.wfs.WFSVersion; - /** * Base class for WFS transactions. * @@ -57,7 +55,8 @@ public void configure(XMLStreamWriter writer, IOReporter reporter) { try { writer.setPrefix(WFS_DESIRED_PREFIX, wfsVersion.wfsNamespace); } catch (XMLStreamException e) { - reporter.warn(new IOMessageImpl("Failed to set the prefix for the WFS namespace", e)); + reporter.warn( + new IOMessageImpl("Failed to set the prefix for the WFS namespace", e)); } } } diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/transactions/WFSInsert.java b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/transactions/WFSInsert.java index 04a212fa92..7a9f0f6dd2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/transactions/WFSInsert.java +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/src/eu/esdihumboldt/hale/io/wfs/transactions/WFSInsert.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.hale.io.wfs.transactions; +import eu.esdihumboldt.hale.io.wfs.WFSVersion; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import eu.esdihumboldt.hale.io.wfs.WFSVersion; - /** * WFS Insert. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.wfs/test/eu/esdihumboldt/hale/io/wfs/test/capabilities/CapabilitiesHelperTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.wfs/test/eu/esdihumboldt/hale/io/wfs/test/capabilities/CapabilitiesHelperTest.groovy index 47d3ad84f5..8fd2ccaf0e 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.wfs/test/eu/esdihumboldt/hale/io/wfs/test/capabilities/CapabilitiesHelperTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.wfs/test/eu/esdihumboldt/hale/io/wfs/test/capabilities/CapabilitiesHelperTest.groovy @@ -1,17 +1,14 @@ package eu.esdihumboldt.hale.io.wfs.test.capabilities -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static org.junit.Assert.* -import javax.xml.namespace.QName - -import org.junit.Test - import eu.esdihumboldt.hale.io.wfs.WFSVersion import eu.esdihumboldt.hale.io.wfs.capabilities.CapabilitiesHelper import eu.esdihumboldt.hale.io.wfs.capabilities.WFSCapabilities +import eu.esdihumboldt.util.test.AbstractPlatformTest import groovy.transform.CompileStatic +import javax.xml.namespace.QName +import org.junit.Test @CompileStatic class CapabilitiesHelperTest extends AbstractPlatformTest { diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/AbstractAnalyseTable.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/AbstractAnalyseTable.java index 5e2cff8d87..faf14ab5e1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/AbstractAnalyseTable.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/AbstractAnalyseTable.java @@ -15,12 +15,12 @@ package eu.esdihumboldt.hale.io.xls; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.time.format.DateTimeFormatter; - import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; @@ -32,8 +32,6 @@ import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; - /** * Do analysis on simple Excel tables. * @@ -94,13 +92,13 @@ protected void analyse(LocatableInputSupplier source, boo * Load a workbook from a stream. * * @param input the input stream to load - * @param location an optional location that can be used to determine the - * file type + * @param location an optional location that can be used to determine the file + * type * @param isXlsx if the file should be loaded as XLSX file * @return the loaded workbook * @throws IOException if an error occurs reading the file - * @throws InvalidFormatException if file has an invalid format when - * attempting to load as OpenXML file + * @throws InvalidFormatException if file has an invalid format when attempting + * to load as OpenXML file */ public static Workbook loadWorkbook(InputStream input, URI location, boolean isXlsx) throws IOException, InvalidFormatException { @@ -147,8 +145,8 @@ protected void analyseHeader(Sheet sheet, DateTimeFormatter dateTimeFormatter) { /** * Analyse the table content if skipNlines <=0 that don't analyse first row, - * which has already been analyse into the header else analyse starting with - * the skip line + * which has already been analyse into the header else analyse starting with the + * skip line * * @param sheet the table sheet * @param skipNlines skip N lines diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/AnalyseXLSSchemaTable.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/AnalyseXLSSchemaTable.java index b424dfcf60..e2f0974cb6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/AnalyseXLSSchemaTable.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/AnalyseXLSSchemaTable.java @@ -15,18 +15,16 @@ package eu.esdihumboldt.hale.io.xls; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import java.io.InputStream; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; import java.util.List; - import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; - /** * Analyse xls/xlsx schema files * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/XLSUtil.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/XLSUtil.java index 6764499cd7..6a03cfaa24 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/XLSUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/XLSUtil.java @@ -20,7 +20,6 @@ import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; import java.util.Date; - import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.CellValue; diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/DefaultXLSLookupTableReader.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/DefaultXLSLookupTableReader.java index 9107d3ea64..04dc0f4088 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/DefaultXLSLookupTableReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/DefaultXLSLookupTableReader.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.hale.io.xls.reader; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.io.xls.XLSUtil; import java.util.LinkedHashMap; import java.util.Map; - import org.apache.poi.ss.usermodel.FormulaEvaluator; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.io.xls.XLSUtil; - /** * Default lookup table reader for xls files * @@ -42,8 +40,8 @@ public class DefaultXLSLookupTableReader { * @param skipFirst true, if first row should be skipped * @param keyColumn source column of the lookup table * @param valueColumn target column of the lookup table - * @param ignoreEmptyStrings if empty strings should be ignored and treated - * as null + * @param ignoreEmptyStrings if empty strings should be ignored and treated as + * null * @return the lookup table as map */ public Map read(Workbook workbook, boolean skipFirst, int keyColumn, diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/ReaderSettings.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/ReaderSettings.java index c92e2900a1..1220bd85f2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/ReaderSettings.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/ReaderSettings.java @@ -15,6 +15,12 @@ package eu.esdihumboldt.hale.io.xls.reader; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.core.io.ValueList; +import eu.esdihumboldt.hale.io.csv.InstanceTableIOConstants; +import eu.esdihumboldt.hale.io.csv.reader.CSVConstants; +import eu.esdihumboldt.hale.io.csv.reader.CommonSchemaConstants; +import eu.esdihumboldt.hale.io.xls.AbstractAnalyseTable; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -23,20 +29,11 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; - import javax.xml.namespace.QName; - import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.ss.usermodel.Workbook; import org.eclipse.core.runtime.content.IContentType; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.ValueList; -import eu.esdihumboldt.hale.io.csv.InstanceTableIOConstants; -import eu.esdihumboldt.hale.io.csv.reader.CSVConstants; -import eu.esdihumboldt.hale.io.csv.reader.CommonSchemaConstants; -import eu.esdihumboldt.hale.io.xls.AbstractAnalyseTable; - /** * Class collecting information and settings on reading * @@ -150,8 +147,8 @@ public Collection getSheetsToRead() { * * @param reader the Excel reader * @return the loaded settings - * @throws InvalidFormatException if the source file has a wrong format or - * is tried to be read with the wrong format + * @throws InvalidFormatException if the source file has a wrong format or is + * tried to be read with the wrong format * @throws IOException if the source file can't be read */ public static ReaderSettings load(XLSInstanceReader reader) diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/SheetSettings.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/SheetSettings.java index 6b0de82938..5cdb269c28 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/SheetSettings.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/SheetSettings.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.hale.io.xls.reader; -import java.util.Optional; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueProperties; +import java.util.Optional; +import javax.xml.namespace.QName; /** * Settings for reading a specific sheet in an Excel table. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/SheetSettingsValueDescriptor.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/SheetSettingsValueDescriptor.java index c61aed4c43..70040754c8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/SheetSettingsValueDescriptor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/SheetSettingsValueDescriptor.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.hale.io.xls.reader; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueList; import eu.esdihumboldt.hale.common.core.parameter.AbstractParameterValueDescriptor; +import javax.xml.namespace.QName; /** * Value descriptor for reader parameter with sheet settings. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSInstanceReader.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSInstanceReader.java index 0ffb357f41..e9ff53f822 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSInstanceReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSInstanceReader.java @@ -15,16 +15,6 @@ package eu.esdihumboldt.hale.io.xls.reader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.springframework.core.convert.ConversionService; - import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -46,6 +36,13 @@ import eu.esdihumboldt.hale.io.csv.reader.internal.CSVInstanceReader; import eu.esdihumboldt.hale.io.xls.AnalyseXLSSchemaTable; import eu.esdihumboldt.hale.io.xls.reader.ReaderSettings.SheetInfo; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import javax.xml.namespace.QName; +import org.springframework.core.convert.ConversionService; /** * Read source data of xls instance files (based on the @@ -119,9 +116,9 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) } /** - * Try to match the given type name to a schema type based on the name. - * Prefers a full match of the qualified name but also test for display name - * and local name matching the provided local name. + * Try to match the given type name to a schema type based on the name. Prefers + * a full match of the qualified name but also test for display name and local + * name matching the provided local name. * * @param typeName the type name to match * @param schema the schema to check diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSLookupTableReader.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSLookupTableReader.java index 873f987b92..b70da4648d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSLookupTableReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSLookupTableReader.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.io.xls.reader; -import java.io.IOException; -import java.util.Map; - -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.Value; @@ -32,6 +25,11 @@ import eu.esdihumboldt.hale.common.lookup.impl.LookupTableImpl; import eu.esdihumboldt.hale.common.lookup.impl.LookupTableInfoImpl; import eu.esdihumboldt.hale.io.csv.writer.LookupTableExportConstants; +import java.io.IOException; +import java.util.Map; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; /** * Reader for xls/xlsx lookup table files @@ -68,11 +66,11 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) int keyColumn = getParameter(LookupTableExportConstants.LOOKUP_KEY_COLUMN) .as(Integer.class); - int valueColumn = getParameter(LookupTableExportConstants.LOOKUP_VALUE_COLUMN).as( - Integer.class); + int valueColumn = getParameter(LookupTableExportConstants.LOOKUP_VALUE_COLUMN) + .as(Integer.class); - boolean skipFirst = getParameter(LookupTableExportConstants.PARAM_SKIP_FIRST_LINE).as( - Boolean.class); + boolean skipFirst = getParameter(LookupTableExportConstants.PARAM_SKIP_FIRST_LINE) + .as(Boolean.class); boolean ignoreEmptyStrings = getParameter( LookupTableExportConstants.PARAM_IGNORE_EMPTY_STRING).as(Boolean.class); @@ -96,7 +94,8 @@ else if (getContentType().getId().equals("eu.esdihumboldt.hale.io.xls.xlsx")) { Map map = reader.read(workbook, skipFirst, keyColumn, valueColumn, ignoreEmptyStrings); - lookupTable = new LookupTableInfoImpl(new LookupTableImpl(map), getName(), getDescription()); + lookupTable = new LookupTableInfoImpl(new LookupTableImpl(map), getName(), + getDescription()); reporter.setSuccess(true); return reporter; diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSSchemaReader.java index 64cdfbe52c..cc32c563de 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/reader/XLSSchemaReader.java @@ -15,13 +15,6 @@ package eu.esdihumboldt.hale.io.xls.reader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; import eu.esdihumboldt.hale.common.core.io.report.IOReporter; @@ -45,6 +38,11 @@ import eu.esdihumboldt.hale.io.csv.reader.internal.CSVConfiguration; import eu.esdihumboldt.hale.io.csv.reader.internal.CSVUtil; import eu.esdihumboldt.hale.io.xls.AnalyseXLSSchemaTable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.xml.namespace.QName; /** * Schema reader for xls/xlsx files diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSAlignmentMappingWriter.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSAlignmentMappingWriter.java index d64e347e43..158d8aa33f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSAlignmentMappingWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSAlignmentMappingWriter.java @@ -15,11 +15,20 @@ package eu.esdihumboldt.hale.io.xls.writer; +import eu.esdihumboldt.hale.common.align.model.TransformationMode; +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.hale.io.csv.writer.AbstractAlignmentMappingExport; +import eu.esdihumboldt.hale.io.csv.writer.CellInformation; +import eu.esdihumboldt.hale.io.csv.writer.CellType; +import eu.esdihumboldt.hale.io.xls.XLSCellStyles; import java.io.FileOutputStream; import java.io.IOException; import java.util.List; import java.util.Map; - import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; @@ -28,17 +37,6 @@ import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import eu.esdihumboldt.hale.common.align.model.TransformationMode; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.io.csv.writer.AbstractAlignmentMappingExport; -import eu.esdihumboldt.hale.io.csv.writer.CellInformation; -import eu.esdihumboldt.hale.io.csv.writer.CellType; -import eu.esdihumboldt.hale.io.xls.XLSCellStyles; - /** * Provider to write the alignment to a xls/xlsx file * @@ -115,11 +113,10 @@ else if (getContentType().getId().equals("eu.esdihumboldt.hale.io.xls.xlsx")) { boolean disabled = false; if (getParameter(TRANSFORMATION_AND_DISABLED_FOR).as(Boolean.class)) { - List transformationDisabled = entry.get( - CellType.TRANSFORMATION_AND_DISABLED).getText(); - disabled = !transformationDisabled.isEmpty() - && !transformationDisabled - .contains(TransformationMode.active.displayName()); + List transformationDisabled = entry + .get(CellType.TRANSFORMATION_AND_DISABLED).getText(); + disabled = !transformationDisabled.isEmpty() && !transformationDisabled + .contains(TransformationMode.active.displayName()); } // create a row diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSInstanceWriter.java index a2b5e82a35..6cec805334 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSInstanceWriter.java @@ -15,6 +15,21 @@ package eu.esdihumboldt.hale.io.xls.writer; +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import eu.esdihumboldt.hale.common.instance.model.TypeFilter; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.csv.InstanceTableIOConstants; +import eu.esdihumboldt.hale.io.csv.writer.AbstractTableInstanceWriter; +import eu.esdihumboldt.hale.io.xls.XLSCellStyles; +import eu.esdihumboldt.hale.io.xls.reader.XLSInstanceReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -25,9 +40,7 @@ import java.util.List; import java.util.Map; import java.util.NoSuchElementException; - import javax.xml.namespace.QName; - import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; @@ -37,22 +50,6 @@ import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.common.core.report.SimpleLog; -import eu.esdihumboldt.hale.common.instance.model.Instance; -import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; -import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; -import eu.esdihumboldt.hale.common.instance.model.TypeFilter; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.csv.InstanceTableIOConstants; -import eu.esdihumboldt.hale.io.csv.writer.AbstractTableInstanceWriter; -import eu.esdihumboldt.hale.io.xls.XLSCellStyles; -import eu.esdihumboldt.hale.io.xls.reader.XLSInstanceReader; - /** * Instance export provider for xls files * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSLookupTableWriter.java b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSLookupTableWriter.java index 5140642892..783e3b6d2b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSLookupTableWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/src/eu/esdihumboldt/hale/io/xls/writer/XLSLookupTableWriter.java @@ -15,10 +15,17 @@ package eu.esdihumboldt.hale.io.xls.writer; +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.hale.common.lookup.impl.AbstractLookupExport; +import eu.esdihumboldt.hale.io.csv.writer.LookupTableExportConstants; import java.io.FileOutputStream; import java.io.IOException; import java.util.Map; - import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.Cell; @@ -30,15 +37,6 @@ import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.common.lookup.impl.AbstractLookupExport; -import eu.esdihumboldt.hale.io.csv.writer.LookupTableExportConstants; - /** * Export provider for xls/xlsx lookup table files * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/XLSInstanceIOTest.java b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/XLSInstanceIOTest.java index 0916a0a91b..237c3185be 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/XLSInstanceIOTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/XLSInstanceIOTest.java @@ -1,17 +1,8 @@ package eu.esdihumboldt.hale.io.xls.test; -import java.io.File; -import java.io.IOException; -import java.util.Iterator; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.eclipse.core.runtime.content.IContentType; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import static org.junit.Assert.*; import com.google.common.io.Files; - import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.Value; @@ -28,8 +19,13 @@ import eu.esdihumboldt.hale.io.xls.reader.XLSInstanceReader; import eu.esdihumboldt.hale.io.xls.reader.XLSSchemaReader; import eu.esdihumboldt.hale.io.xls.writer.XLSInstanceWriter; - -import static org.junit.Assert.*; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.io.File; +import java.io.IOException; +import java.util.Iterator; +import org.eclipse.core.runtime.content.IContentType; +import org.junit.BeforeClass; +import org.junit.Test; /** * Tests for reading and writing instances in XLS file format @@ -47,10 +43,10 @@ public static void setUp() throws Exception { * Exports the instances created by * {@link XLSInstanceWriterTestExamples#createInstanceCollection} into a * temporary XLS file by executing {@link XLSInstanceWriter#execute}. - * Afterwards, the schema is read by {@link XLSSchemaReader} and the - * instances are loaded by {@link XLSInstanceReader}. Each of the imported - * instances are compared with the original instances. In addtion, a - * different set of instances is compared with the imported instances. + * Afterwards, the schema is read by {@link XLSSchemaReader} and the instances + * are loaded by {@link XLSInstanceReader}. Each of the imported instances are + * compared with the original instances. In addtion, a different set of + * instances is compared with the imported instances. */ @Test public void test() { diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/XLSInstanceWriterTestExamples.groovy b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/XLSInstanceWriterTestExamples.groovy index bd315f722c..835c81d2fe 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/XLSInstanceWriterTestExamples.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/XLSInstanceWriterTestExamples.groovy @@ -15,13 +15,12 @@ package eu.esdihumboldt.hale.io.xls.test -import java.text.SimpleDateFormat -import java.time.LocalDate - import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder import eu.esdihumboldt.hale.common.instance.model.InstanceCollection import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Schema +import java.text.SimpleDateFormat +import java.time.LocalDate class XLSInstanceWriterTestExamples { diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/reader/XLSReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/reader/XLSReaderTest.java index e62a509e26..dbaefca9f8 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/reader/XLSReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/reader/XLSReaderTest.java @@ -21,20 +21,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.function.Consumer; - -import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.BeforeClass; -import org.junit.Test; - import eu.esdihumboldt.hale.common.core.io.Value; import eu.esdihumboldt.hale.common.core.io.ValueList; import eu.esdihumboldt.hale.common.core.io.report.IOReport; @@ -56,6 +42,17 @@ import eu.esdihumboldt.hale.io.xls.reader.SheetSettings; import eu.esdihumboldt.hale.io.xls.reader.XLSInstanceReader; import eu.esdihumboldt.hale.io.xls.reader.XLSSchemaReader; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.function.Consumer; +import javax.xml.namespace.QName; +import org.junit.BeforeClass; +import org.junit.Test; /** * Test class for {@link XLSSchemaReader} and {@link XLSInstanceReader} @@ -78,8 +75,8 @@ public static void waitForServices() { } /** - * Test - read a sample xls schema and data from same file and sheet (simple - * io test). Check the type, check the properties, check the values of the + * Test - read a sample xls schema and data from same file and sheet (simple io + * test). Check the type, check the properties, check the values of the * properties, check the datatype of the properties * * @throws Exception , if an error occurs @@ -139,8 +136,8 @@ public void testReadSimple() throws Exception { /** * Test - read a sample xls schema and data where skip is a boolean. It - * simulates the previous version where the first line was either skipped - * (true) or not (false) + * simulates the previous version where the first line was either skipped (true) + * or not (false) * * @throws Exception , if an error occurs */ @@ -206,8 +203,8 @@ public void testReadEmptySheet() throws Exception { } /** - * Test - read a sample xls schema and data from same file and different - * sheets. Check skip first + * Test - read a sample xls schema and data from same file and different sheets. + * Check skip first * * @throws Exception , if an error occurs */ @@ -287,8 +284,8 @@ public void testReadBlankCells() throws Exception { } /** - * Test - read xls file and data. Check multiple values of one instance. - * Check formula cells + * Test - read xls file and data. Check multiple values of one instance. Check + * formula cells * * @throws Exception , if an error occurs */ @@ -355,8 +352,8 @@ public void testPropertyType() throws Exception { } /** - * Read an Excel file with multiple sheets detecting the associated types - * based on the sheet name. + * Read an Excel file with multiple sheets detecting the associated types based + * on the sheet name. * * @throws Exception if an error occurs */ @@ -399,8 +396,8 @@ public void testReadMultiSheetTypeNames() throws Exception { } /** - * Read an Excel file with multiple sheets specifying types explicitly via - * sheet settings identified by sheet name. + * Read an Excel file with multiple sheets specifying types explicitly via sheet + * settings identified by sheet name. * * @throws Exception if an error occurs */ @@ -434,9 +431,9 @@ public void testReadMultiSheetTypeSettingsNamed() throws Exception { } /** - * Read an Excel file with multiple sheets specifying types explicitly via - * sheet settings identified by sheet name. How many lines are to be skipped - * is configured individually per sheet. + * Read an Excel file with multiple sheets specifying types explicitly via sheet + * settings identified by sheet name. How many lines are to be skipped is + * configured individually per sheet. * * @throws Exception if an error occurs */ @@ -470,8 +467,8 @@ public void testReadMultiSheetTypeSettingsNamedNoGeneralSkip() throws Exception } /** - * Read an Excel file with multiple sheets specifying types explicitly via - * sheet settings identified by sheet index. + * Read an Excel file with multiple sheets specifying types explicitly via sheet + * settings identified by sheet index. * * @throws Exception if an error occurs */ @@ -505,8 +502,8 @@ public void testReadMultiSheetTypeSettingsIndex() throws Exception { } /** - * Read an Excel file with multiple sheets specifying types explicitly via - * sheet settings identified by sheet index. + * Read an Excel file with multiple sheets specifying types explicitly via sheet + * settings identified by sheet index. * * @throws Exception if an error occurs */ @@ -622,8 +619,8 @@ private InstanceCollection readXLSInstances(String sourceLocation, Schema source } /** - * Test - read a sample xls schema and data from same file and sheet (simple - * io test). Check the type, check the properties, check the values of the + * Test - read a sample xls schema and data from same file and sheet (simple io + * test). Check the type, check the properties, check the values of the * properties, check the datatype of the properties * * @throws Exception , if an error occurs diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/reader/XLSReaderTestUtil.groovy b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/reader/XLSReaderTestUtil.groovy index 34076c0d49..8bb637c16a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/reader/XLSReaderTestUtil.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/reader/XLSReaderTestUtil.groovy @@ -15,14 +15,13 @@ package eu.esdihumboldt.hale.io.xls.test.reader -import static org.assertj.core.api.Assertions.*; - -import java.util.function.Consumer +import static org.assertj.core.api.Assertions.* import eu.esdihumboldt.hale.common.instance.model.Instance import eu.esdihumboldt.hale.common.instance.model.InstanceCollection import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Schema +import java.util.function.Consumer /** * Utilities for XLSReaderTest. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/writer/XLSInstanceWriterTest.java b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/writer/XLSInstanceWriterTest.java index 79ea6265e2..804f9b6a48 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/writer/XLSInstanceWriterTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xls/test/eu/esdihumboldt/hale/io/xls/test/writer/XLSInstanceWriterTest.java @@ -19,12 +19,25 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import eu.esdihumboldt.cst.test.TransformationExample; +import eu.esdihumboldt.cst.test.TransformationExamples; +import eu.esdihumboldt.hale.common.core.HalePlatform; +import eu.esdihumboldt.hale.common.core.io.Value; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; +import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstanceCollection; +import eu.esdihumboldt.hale.common.instance.model.impl.MultiInstanceCollection; +import eu.esdihumboldt.hale.common.schema.model.Schema; +import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace; +import eu.esdihumboldt.hale.common.test.TestUtil; +import eu.esdihumboldt.hale.io.csv.InstanceTableIOConstants; +import eu.esdihumboldt.hale.io.xls.writer.XLSInstanceWriter; +import eu.esdihumboldt.util.test.AbstractPlatformTest; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.List; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.ss.usermodel.Cell; @@ -37,21 +50,6 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; -import eu.esdihumboldt.cst.test.TransformationExample; -import eu.esdihumboldt.cst.test.TransformationExamples; -import eu.esdihumboldt.hale.common.core.HalePlatform; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; -import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; -import eu.esdihumboldt.hale.common.instance.model.impl.DefaultInstanceCollection; -import eu.esdihumboldt.hale.common.instance.model.impl.MultiInstanceCollection; -import eu.esdihumboldt.hale.common.schema.model.Schema; -import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace; -import eu.esdihumboldt.hale.common.test.TestUtil; -import eu.esdihumboldt.hale.io.csv.InstanceTableIOConstants; -import eu.esdihumboldt.hale.io.xls.writer.XLSInstanceWriter; - /** * Test class for {@link XLSInstanceWriter} * @@ -75,9 +73,9 @@ public static void waitForServices() { } /** - * Test - write simple data, without nested properties and useSchema=true - - * test if order/number of column persisted from original schema when in the - * instance an attribute has no values + * Test - write simple data, without nested properties and useSchema=true - test + * if order/number of column persisted from original schema when in the instance + * an attribute has no values * * @throws Exception , if an error occurs */ @@ -181,9 +179,8 @@ public void testWriteComplexSchema() throws Exception { } /** - * Test - write data of complex schema and analyze result The - * implementation, this test based on, does not work correctly at the - * moment. + * Test - write data of complex schema and analyze result The implementation, + * this test based on, does not work correctly at the moment. * * @throws Exception , if an error occurs */ @@ -341,9 +338,9 @@ private void checkFirstDataRow(Sheet sheet, List firstDataRow) { } /** - * test - if a complex schema with data is present and this schema contains - * more than one type, the exporter should export all types (one sheet per - * type) or the selected one XXX not supported under current circumstances + * test - if a complex schema with data is present and this schema contains more + * than one type, the exporter should export all types (one sheet per type) or + * the selected one XXX not supported under current circumstances */ public void testExportChoosenType() { // TODO @@ -351,8 +348,8 @@ public void testExportChoosenType() { /** * test - if a complex schema has a type containing an object attribute with - * maxOccures > 1, one type can contain more than one instance of that - * object. If this is the case than... TODO Export special case. + * maxOccures > 1, one type can contain more than one instance of that object. + * If this is the case than... TODO Export special case. */ public void testMultipleInstances() { // TransformationExample example = diff --git a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/Report.java b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/Report.java index d5c9136a14..ecf471f759 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/Report.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/Report.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.xml.validator; import java.util.List; - import org.xml.sax.SAXParseException; /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/ValidatorFactory.java b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/ValidatorFactory.java index dc4dece280..65f985e2a7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/ValidatorFactory.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/ValidatorFactory.java @@ -16,10 +16,9 @@ package eu.esdihumboldt.hale.io.xml.validator; -import java.net.URI; - import eu.esdihumboldt.hale.io.xml.validator.internal.XMLApiValidator; import eu.esdihumboldt.hale.io.xml.validator.internal.XercesValidator; +import java.net.URI; /** * Factory for {@link Validator}s @@ -51,8 +50,7 @@ private ValidatorFactory() { } /** - * Create a validator that relies on the schema locations specified in the - * file. + * Create a validator that relies on the schema locations specified in the file. * * @return the validator */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/XmlInstanceValidator.java b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/XmlInstanceValidator.java index d24dbeac0d..47bdc1c686 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/XmlInstanceValidator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/XmlInstanceValidator.java @@ -16,14 +16,6 @@ package eu.esdihumboldt.hale.io.xml.validator; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.ArrayList; -import java.util.List; - -import org.xml.sax.SAXParseException; - import eu.esdihumboldt.hale.common.core.io.IOProvider; import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; @@ -33,6 +25,12 @@ import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; import eu.esdihumboldt.hale.common.core.io.supplier.Locatable; import eu.esdihumboldt.hale.common.instance.io.impl.AbstractInstanceValidator; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import org.xml.sax.SAXParseException; /** * Validates XML diff --git a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/LSInputImpl.java b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/LSInputImpl.java index c4e156a276..753cc82705 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/LSInputImpl.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/LSInputImpl.java @@ -18,7 +18,6 @@ import java.io.InputStream; import java.io.Reader; - import org.w3c.dom.ls.LSInput; /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/ReportErrorHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/ReportErrorHandler.java index 72e2a66cf6..ddcc18e0df 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/ReportErrorHandler.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/ReportErrorHandler.java @@ -16,15 +16,13 @@ package eu.esdihumboldt.hale.io.xml.validator.internal; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import java.text.MessageFormat; - import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; - /** * Error handler populating a {@link ReportImpl} * @@ -50,7 +48,8 @@ public ReportErrorHandler(ReportImpl report) { @Override public void warning(SAXParseException e) throws SAXException { - log.warn(MessageFormat.format("Line {0} - {1}", e.getLineNumber(), e.getLocalizedMessage())); + log.warn( + MessageFormat.format("Line {0} - {1}", e.getLineNumber(), e.getLocalizedMessage())); report.addWarning(e); } @@ -61,7 +60,8 @@ public void fatalError(SAXParseException e) throws SAXException { @Override public void error(SAXParseException e) throws SAXException { - log.error(MessageFormat.format("Line {0} - {1}", e.getLineNumber(), e.getLocalizedMessage())); + log.error( + MessageFormat.format("Line {0} - {1}", e.getLineNumber(), e.getLocalizedMessage())); report.addError(e); } diff --git a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/ReportImpl.java b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/ReportImpl.java index 860be59f1f..4628f61bd5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/ReportImpl.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/ReportImpl.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.io.xml.validator.internal; +import eu.esdihumboldt.hale.io.xml.validator.Report; import java.util.ArrayList; import java.util.Collections; import java.util.List; - import org.xml.sax.SAXParseException; -import eu.esdihumboldt.hale.io.xml.validator.Report; - /** * {@link Report} implementation * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/SchemaResolver.java b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/SchemaResolver.java index 19737188c4..e0d2021252 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/SchemaResolver.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/SchemaResolver.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.hale.io.xml.validator.internal; +import eu.esdihumboldt.hale.common.cache.Request; +import eu.esdihumboldt.util.io.InputSupplier; +import eu.esdihumboldt.util.resource.Resources; import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; - import org.w3c.dom.ls.LSInput; import org.w3c.dom.ls.LSResourceResolver; -import eu.esdihumboldt.hale.common.cache.Request; -import eu.esdihumboldt.util.io.InputSupplier; -import eu.esdihumboldt.util.resource.Resources; - /** * Resolve imported/included schemas * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/XMLApiValidator.java b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/XMLApiValidator.java index 473b9a9186..01714d00d1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/XMLApiValidator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/XMLApiValidator.java @@ -16,18 +16,16 @@ package eu.esdihumboldt.hale.io.xml.validator.internal; +import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; +import eu.esdihumboldt.hale.io.xml.validator.Report; +import eu.esdihumboldt.hale.io.xml.validator.Validator; import java.io.InputStream; import java.net.URI; - import javax.xml.XMLConstants; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.SchemaFactory; -import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; -import eu.esdihumboldt.hale.io.xml.validator.Report; -import eu.esdihumboldt.hale.io.xml.validator.Validator; - /** * Validate using the XML API. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/XercesValidator.java b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/XercesValidator.java index 20e386b36e..16d71f008f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/XercesValidator.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xml/src/eu/esdihumboldt/hale/io/xml/validator/internal/XercesValidator.java @@ -16,9 +16,13 @@ package eu.esdihumboldt.hale.io.xml.validator.internal; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import de.fhg.igd.slf4jplus.ATransaction; +import eu.esdihumboldt.hale.io.xml.validator.Report; +import eu.esdihumboldt.hale.io.xml.validator.Validator; import java.io.IOException; import java.io.InputStream; - import org.apache.xerces.parsers.SAXParser; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -26,12 +30,6 @@ import org.xml.sax.SAXNotSupportedException; import org.xml.sax.SAXParseException; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import de.fhg.igd.slf4jplus.ATransaction; -import eu.esdihumboldt.hale.io.xml.validator.Report; -import eu.esdihumboldt.hale.io.xml.validator.Validator; - /** * Validate using Xerces directly. * @@ -73,8 +71,8 @@ public Report validate(InputStream xml) { @Override public void error(SAXParseException e) throws SAXException { // XXX this error occurs even if the element is present - if (e.getMessage() - .equals("cvc-elt.1: Cannot find the declaration of element 'gml:FeatureCollection'.")) { //$NON-NLS-1$ + if (e.getMessage().equals( + "cvc-elt.1: Cannot find the declaration of element 'gml:FeatureCollection'.")) { //$NON-NLS-1$ return; } diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/XMLSchemaIO.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/XMLSchemaIO.java index 106bf21874..1f95eb65f3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/XMLSchemaIO.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/XMLSchemaIO.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.List; - import org.apache.ws.commons.schema.XmlSchemaAnnotated; import org.apache.ws.commons.schema.XmlSchemaAppInfo; import org.apache.ws.commons.schema.XmlSchemaDocumentation; diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/XMLSchemaResourceAdvisor.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/XMLSchemaResourceAdvisor.java index 91aa8d3693..6354d5a9af 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/XMLSchemaResourceAdvisor.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/XMLSchemaResourceAdvisor.java @@ -15,19 +15,17 @@ package eu.esdihumboldt.hale.io.xsd; +import eu.esdihumboldt.hale.common.core.io.impl.DefaultResourceAdvisor; +import eu.esdihumboldt.hale.common.core.io.project.util.XMLSchemaUpdater; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.nio.file.Path; - import org.eclipse.core.runtime.content.IContentType; -import eu.esdihumboldt.hale.common.core.io.impl.DefaultResourceAdvisor; -import eu.esdihumboldt.hale.common.core.io.project.util.XMLSchemaUpdater; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; - /** * Resource advisor for XML Schemas. Additionally to the main schema file it * copies also referenced schema files if applicable. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContent.groovy b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContent.groovy index 138bcc9725..2e499bb2e0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContent.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContent.groovy @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.xsd.anytype import groovy.transform.CompileStatic import groovy.transform.Immutable - import javax.xml.namespace.QName diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContentAssociation.groovy b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContentAssociation.groovy index db392a43b8..9a3b3d597d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContentAssociation.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContentAssociation.groovy @@ -17,7 +17,6 @@ package eu.esdihumboldt.hale.io.xsd.anytype import groovy.transform.CompileStatic import groovy.transform.Immutable - import javax.xml.namespace.QName diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContentHelper.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContentHelper.java index 0bd56363ad..d75b7ce950 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContentHelper.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/CustomTypeContentHelper.java @@ -15,11 +15,6 @@ package eu.esdihumboldt.hale.io.xsd.anytype; -import java.util.LinkedList; -import java.util.List; - -import javax.xml.namespace.QName; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; @@ -39,6 +34,9 @@ import eu.esdihumboldt.hale.common.schema.model.impl.PropertyTypeOverrideProperty; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import java.util.LinkedList; +import java.util.List; +import javax.xml.namespace.QName; /** * Helper methods for custom type content. @@ -65,8 +63,7 @@ public static void applyConfigurations(XmlIndex index, CustomTypeContentConfigur * Apply a custom type configuration to the given schema. * * @param index the XML schema - * @param association the custom type configuration for an individual - * property + * @param association the custom type configuration for an individual property */ public static void applyConfiguration(XmlIndex index, CustomTypeContentAssociation association) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentAssociationType.groovy b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentAssociationType.groovy index ef6e70eae6..ffd9bd6ba3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentAssociationType.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentAssociationType.groovy @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.io.xsd.anytype.valuetypes; -import javax.xml.namespace.QName - -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.core.io.ComplexValueType import eu.esdihumboldt.hale.common.core.io.DOMValueUtil import eu.esdihumboldt.hale.common.core.io.Value @@ -30,6 +26,8 @@ import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentMode import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import eu.esdihumboldt.util.groovy.xml.NSDOMCategory import groovy.transform.CompileStatic +import javax.xml.namespace.QName +import org.w3c.dom.Element /** * Complex value definition for {@link CustomTypeContentAssociation}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentConfigurationType.groovy b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentConfigurationType.groovy index 3302291569..cf3ea8d303 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentConfigurationType.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentConfigurationType.groovy @@ -15,17 +15,16 @@ package eu.esdihumboldt.hale.io.xsd.anytype.valuetypes; -import org.w3c.dom.Element; - -import eu.esdihumboldt.hale.common.core.io.ComplexValueType; -import eu.esdihumboldt.hale.common.core.io.DOMValueUtil; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.ValueList; -import eu.esdihumboldt.hale.io.xsd.XMLSchemaIO; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentAssociation; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentConfiguration; -import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder; +import eu.esdihumboldt.hale.common.core.io.ComplexValueType +import eu.esdihumboldt.hale.common.core.io.DOMValueUtil +import eu.esdihumboldt.hale.common.core.io.Value +import eu.esdihumboldt.hale.common.core.io.ValueList +import eu.esdihumboldt.hale.io.xsd.XMLSchemaIO +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentAssociation +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentConfiguration +import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import groovy.transform.CompileStatic +import org.w3c.dom.Element /** * Complex value definition for {@link CustomTypeContentConfiguration}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentType.groovy b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentType.groovy index 9a040923ec..08238081e0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentType.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentType.groovy @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.io.xsd.anytype.valuetypes; -import javax.xml.namespace.QName - -import org.w3c.dom.Element - import eu.esdihumboldt.hale.common.core.io.ComplexValueType import eu.esdihumboldt.hale.common.core.io.DOMValueUtil import eu.esdihumboldt.hale.common.core.io.Value @@ -29,6 +25,8 @@ import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentMode import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder import eu.esdihumboldt.util.groovy.xml.NSDOMCategory import groovy.transform.CompileStatic +import javax.xml.namespace.QName +import org.w3c.dom.Element /** * Complex value definition for {@link CustomTypeContent}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/RestrictionFlag.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/RestrictionFlag.java index d156219eeb..74a8983d16 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/RestrictionFlag.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/RestrictionFlag.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.io.xsd.constraint; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if a type's super type relation is a restriction, disabled by default @@ -41,9 +41,8 @@ public final class RestrictionFlag extends AbstractFlagConstraint implements Typ public static final RestrictionFlag DISABLED = new RestrictionFlag(false); /** - * Creates a default restriction flag, which is disabled. If possible, - * instead of creating an instance, use {@link #ENABLED} or - * {@link #DISABLED}. + * Creates a default restriction flag, which is disabled. If possible, instead + * of creating an instance, use {@link #ENABLED} or {@link #DISABLED}. * * @see Constraint */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlAppInfo.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlAppInfo.java index 809f6977a0..b884ff3057 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlAppInfo.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlAppInfo.java @@ -16,15 +16,13 @@ package eu.esdihumboldt.hale.io.xsd.constraint; -import java.util.Collections; -import java.util.List; - -import org.apache.ws.commons.schema.XmlSchemaAppInfo; - import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.GroupPropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import java.util.Collections; +import java.util.List; +import org.apache.ws.commons.schema.XmlSchemaAppInfo; /** * Constraint that holds an {@link XmlSchemaAppInfo}s for a schema element. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlAttributeFlag.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlAttributeFlag.java index 2c7cab3ff8..3333eebf40 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlAttributeFlag.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlAttributeFlag.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.io.xsd.constraint; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if a property is represented by a XML attribute, disabled by default @@ -51,9 +51,9 @@ public static XmlAttributeFlag get(boolean isAttribute) { } /** - * Creates a default XML attribute flag, which is disabled. If possible, - * instead of creating an instance, use {@link #get(boolean)}, - * {@link #ENABLED} or {@link #DISABLED}. + * Creates a default XML attribute flag, which is disabled. If possible, instead + * of creating an instance, use {@link #get(boolean)}, {@link #ENABLED} or + * {@link #DISABLED}. * * @see Constraint */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlElements.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlElements.java index 9668ad4e06..9c5be7da3c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlElements.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlElements.java @@ -16,15 +16,14 @@ package eu.esdihumboldt.hale.io.xsd.constraint; +import eu.esdihumboldt.hale.common.schema.model.Constraint; +import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; -import eu.esdihumboldt.hale.common.schema.model.Constraint; -import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; -import eu.esdihumboldt.hale.io.xsd.model.XmlElement; - /** * Constraint that states the {@link XmlElement}s associated with a type * definition, by default no elements are contained. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlIdUnique.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlIdUnique.java index 127c695bb4..0365166ece 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlIdUnique.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlIdUnique.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.io.xsd.constraint; -import org.apache.ws.commons.schema.constants.Constants; - import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.property.Unique; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import org.apache.ws.commons.schema.constants.Constants; /** * Unique constraint for XS:ID types. Needed because while loading the property diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlMixedFlag.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlMixedFlag.java index d4cb3653ab..f82ce30dd3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlMixedFlag.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/XmlMixedFlag.java @@ -16,10 +16,10 @@ package eu.esdihumboldt.hale.io.xsd.constraint; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.Constraint; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint; +import net.jcip.annotations.Immutable; /** * Flags if a type is a mixed XML type and therefore can contain text, elements @@ -53,8 +53,8 @@ public static XmlMixedFlag get(boolean isMixed) { /** * Creates a default XML mixed type flag, which is disabled. If possible, - * instead of creating an instance, use {@link #get(boolean)}, - * {@link #ENABLED} or {@link #DISABLED}. + * instead of creating an instance, use {@link #get(boolean)}, {@link #ENABLED} + * or {@link #DISABLED}. * * @see Constraint */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/factory/XmlElementsFactory.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/factory/XmlElementsFactory.java index 02c4773adb..87ea99eef7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/factory/XmlElementsFactory.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/constraint/factory/XmlElementsFactory.java @@ -15,10 +15,6 @@ package eu.esdihumboldt.hale.io.xsd.constraint.factory; -import java.util.Collection; - -import javax.xml.namespace.QName; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.Value; @@ -32,6 +28,8 @@ import eu.esdihumboldt.hale.common.schema.model.constraint.factory.ValueConstraintFactory; import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; +import java.util.Collection; +import javax.xml.namespace.QName; /** * Value constraint factory for {@link XmlElements}. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/HasNotInheritableValue.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/HasNotInheritableValue.java index 383ee84714..b56a344103 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/HasNotInheritableValue.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/HasNotInheritableValue.java @@ -15,8 +15,8 @@ package eu.esdihumboldt.hale.io.xsd.model; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import net.jcip.annotations.Immutable; /** * {@link HasValueFlag} that marks a type as having a value, but doesn't inherit diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlAttribute.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlAttribute.java index f59501e150..1694935cbc 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlAttribute.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlAttribute.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.io.xsd.model; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition; +import javax.xml.namespace.QName; /** * Represents a XML schema attribute diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlElement.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlElement.java index 73b462c9f4..b6651a6cca 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlElement.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlElement.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.io.xsd.model; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.Definition; import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition; +import javax.xml.namespace.QName; /** * Represents a XML schema element diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlIndex.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlIndex.java index 26c9f6e179..e9e0423e98 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlIndex.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/model/XmlIndex.java @@ -16,16 +16,9 @@ package eu.esdihumboldt.hale.io.xsd.model; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - import com.google.common.base.Preconditions; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; - import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.AbstractFlag; import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappableFlag; @@ -33,6 +26,10 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeIndex; import eu.esdihumboldt.hale.io.xsd.reader.internal.XmlTypeDefinition; import eu.esdihumboldt.hale.io.xsd.reader.internal.XmlTypeUtil; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import javax.xml.namespace.QName; /** * XML schema used during schema parsing, manages {@link XmlTypeDefinition}s @@ -74,8 +71,8 @@ public XmlIndex(String namespace, URI location) { } /** - * Get the type definition with the given name. If the type doesn't exist a - * new type definition will be created. + * Get the type definition with the given name. If the type doesn't exist a new + * type definition will be created. * * @param name the type name * @return the type definition diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReader.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReader.java index dcd5f43bfe..d24fa45a8d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReader.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReader.java @@ -15,61 +15,8 @@ */ package eu.esdihumboldt.hale.io.xsd.reader; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.MessageFormat; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; -import javax.xml.transform.stream.StreamSource; - -import org.apache.ws.commons.schema.XmlSchema; -import org.apache.ws.commons.schema.XmlSchemaAll; -import org.apache.ws.commons.schema.XmlSchemaAnnotated; -import org.apache.ws.commons.schema.XmlSchemaAny; -import org.apache.ws.commons.schema.XmlSchemaAppInfo; -import org.apache.ws.commons.schema.XmlSchemaAttribute; -import org.apache.ws.commons.schema.XmlSchemaAttributeGroup; -import org.apache.ws.commons.schema.XmlSchemaAttributeGroupRef; -import org.apache.ws.commons.schema.XmlSchemaChoice; -import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.apache.ws.commons.schema.XmlSchemaComplexContentExtension; -import org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction; -import org.apache.ws.commons.schema.XmlSchemaComplexType; -import org.apache.ws.commons.schema.XmlSchemaContent; -import org.apache.ws.commons.schema.XmlSchemaContentModel; -import org.apache.ws.commons.schema.XmlSchemaElement; -import org.apache.ws.commons.schema.XmlSchemaExternal; -import org.apache.ws.commons.schema.XmlSchemaForm; -import org.apache.ws.commons.schema.XmlSchemaGroup; -import org.apache.ws.commons.schema.XmlSchemaGroupRef; -import org.apache.ws.commons.schema.XmlSchemaImport; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaNotation; -import org.apache.ws.commons.schema.XmlSchemaObject; -import org.apache.ws.commons.schema.XmlSchemaObjectCollection; -import org.apache.ws.commons.schema.XmlSchemaParticle; -import org.apache.ws.commons.schema.XmlSchemaSequence; -import org.apache.ws.commons.schema.XmlSchemaSimpleContentExtension; -import org.apache.ws.commons.schema.XmlSchemaSimpleContentRestriction; -import org.apache.ws.commons.schema.XmlSchemaSimpleType; -import org.apache.ws.commons.schema.XmlSchemaType; -import org.apache.ws.commons.schema.constants.Constants; -import org.apache.ws.commons.schema.utils.NamespacePrefixList; -import org.w3c.dom.Node; - import com.google.common.base.Objects; import com.google.common.collect.ImmutableSet; - import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.common.core.io.IOProvider; @@ -138,6 +85,55 @@ import eu.esdihumboldt.util.io.InputSupplier; import eu.esdihumboldt.util.resource.Resources; import gnu.trove.TObjectIntHashMap; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.MessageFormat; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; +import javax.xml.transform.stream.StreamSource; +import org.apache.ws.commons.schema.XmlSchema; +import org.apache.ws.commons.schema.XmlSchemaAll; +import org.apache.ws.commons.schema.XmlSchemaAnnotated; +import org.apache.ws.commons.schema.XmlSchemaAny; +import org.apache.ws.commons.schema.XmlSchemaAppInfo; +import org.apache.ws.commons.schema.XmlSchemaAttribute; +import org.apache.ws.commons.schema.XmlSchemaAttributeGroup; +import org.apache.ws.commons.schema.XmlSchemaAttributeGroupRef; +import org.apache.ws.commons.schema.XmlSchemaChoice; +import org.apache.ws.commons.schema.XmlSchemaCollection; +import org.apache.ws.commons.schema.XmlSchemaComplexContentExtension; +import org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction; +import org.apache.ws.commons.schema.XmlSchemaComplexType; +import org.apache.ws.commons.schema.XmlSchemaContent; +import org.apache.ws.commons.schema.XmlSchemaContentModel; +import org.apache.ws.commons.schema.XmlSchemaElement; +import org.apache.ws.commons.schema.XmlSchemaExternal; +import org.apache.ws.commons.schema.XmlSchemaForm; +import org.apache.ws.commons.schema.XmlSchemaGroup; +import org.apache.ws.commons.schema.XmlSchemaGroupRef; +import org.apache.ws.commons.schema.XmlSchemaImport; +import org.apache.ws.commons.schema.XmlSchemaInclude; +import org.apache.ws.commons.schema.XmlSchemaNotation; +import org.apache.ws.commons.schema.XmlSchemaObject; +import org.apache.ws.commons.schema.XmlSchemaObjectCollection; +import org.apache.ws.commons.schema.XmlSchemaParticle; +import org.apache.ws.commons.schema.XmlSchemaSequence; +import org.apache.ws.commons.schema.XmlSchemaSimpleContentExtension; +import org.apache.ws.commons.schema.XmlSchemaSimpleContentRestriction; +import org.apache.ws.commons.schema.XmlSchemaSimpleType; +import org.apache.ws.commons.schema.XmlSchemaType; +import org.apache.ws.commons.schema.constants.Constants; +import org.apache.ws.commons.schema.utils.NamespacePrefixList; +import org.w3c.dom.Node; /** * The main functionality of this class is to load an XML schema file (XSD) and @@ -169,8 +165,8 @@ private NamespaceIdentifiers(String prefix, boolean useEquals, int startCounter) /** * Add existing identifiers (to avoid conflicts). * - * @param objectsAndIdentifiers objects (namespaces) mapped to - * identifiers (prefixes) + * @param objectsAndIdentifiers objects (namespaces) mapped to identifiers + * (prefixes) */ public void addIdentifiers(Map objectsAndIdentifiers) { for (Entry entry : objectsAndIdentifiers.entrySet()) { @@ -180,8 +176,8 @@ public void addIdentifiers(Map objectsAndIdentifiers) { } /** - * Name of the parameter specifying the elements that represent mapping - * relevant types. + * Name of the parameter specifying the elements that represent mapping relevant + * types. */ public static final String PARAM_RELEVANT_ELEMENTS = "relevantElements"; @@ -192,17 +188,16 @@ public void addIdentifiers(Map objectsAndIdentifiers) { public static final String PARAM_ONLY_ELEMENTS_MAPPABLE = "onlyElementsMappable"; /** - * Name of the parameter specifying which mode to use to determine the - * default mapping relevant types. + * Name of the parameter specifying which mode to use to determine the default + * mapping relevant types. * - * Valid values currently are {@value #MAPPING_RELEVANT_MODE_MAIN_SCHEMA} - * and {@value #MAPPING_RELEVANT_MODE_FEATURE_TYPES}. + * Valid values currently are {@value #MAPPING_RELEVANT_MODE_MAIN_SCHEMA} and + * {@value #MAPPING_RELEVANT_MODE_FEATURE_TYPES}. */ public static final String PARAM_MAPPING_RELEVANT_MODE = "relevantMode"; /** - * Mapping relevant type mode that marks types from the main schema as - * relevant. + * Mapping relevant type mode that marks types from the main schema as relevant. */ public static final String MAPPING_RELEVANT_MODE_MAIN_SCHEMA = "mainSchema"; @@ -497,8 +492,8 @@ public String getMappingRelevantMode() { } /** - * Set if only elements should be mappable. Otherwise all types with a - * global type definition are mappable. + * Set if only elements should be mappable. Otherwise all types with a global + * type definition are mappable. * * @param onlyElements if only elements should be mappable */ @@ -507,8 +502,8 @@ public void setOnlyElementsMappable(boolean onlyElements) { } /** - * @return states if only types with associated global elements are - * classified as mappable types + * @return states if only types with associated global elements are classified + * as mappable types */ public boolean isOnlyElementsMappable() { return getParameter(PARAM_ONLY_ELEMENTS_MAPPABLE).as(Boolean.class, true); @@ -519,8 +514,8 @@ public boolean isOnlyElementsMappable() { * * @param schemaLocation the schema location * @param xmlSchema the schema - * @param imports the imports/includes that were already loaded or where - * loading has been started + * @param imports the imports/includes that were already loaded or where loading + * has been started * @param progress the progress indicator * @param mainSchema states if this is a main schema and therefore elements * declared here should be flagged mappable @@ -827,13 +822,12 @@ private void addPrefixes(NamespacePrefixList namespaces, String defaultNamespace } /** - * Create a type definition from the given schema type and add it to the - * index or enhance an existing type definition if it is already in the - * index. + * Create a type definition from the given schema type and add it to the index + * or enhance an existing type definition if it is already in the index. * * @param schemaType the schema type - * @param typeName the type name to use for the type, null if - * the name of the schema type shall be used + * @param typeName the type name to use for the type, null if the + * name of the schema type shall be used * @param schemaLocation the schema location * @param schemaNamespace the schema namespace * @param mainSchema if the type definition is a global definition in a main @@ -1097,8 +1091,7 @@ else if (particle instanceof XmlSchemaGroupRef) { long min = groupRef.getMinOccurs(); /* - * Only allow flatten if group is not forced and appears exactly - * once + * Only allow flatten if group is not forced and appears exactly once */ XmlGroupReferenceProperty property = new XmlGroupReferenceProperty(groupName, declaringGroup, index, groupName, !forceGroup && min == 1 && max == 1); @@ -1385,14 +1378,14 @@ else if (element.getSchemaType() instanceof XmlSchemaSimpleType) { } /** - * Get a type identifier from the given group. If the group is a type - * definition its identifier will be returned, if it is a child definition - * the identifier of the parent type will be returned. + * Get a type identifier from the given group. If the group is a type definition + * its identifier will be returned, if it is a child definition the identifier + * of the parent type will be returned. * * @param group the group * @return the type identifier - * @throws IllegalArgumentException if the group is neither a type nor a - * child definition + * @throws IllegalArgumentException if the group is neither a type nor a child + * definition */ private static String getTypeIdentifier(DefinitionGroup group) throws IllegalArgumentException { if (group instanceof TypeDefinition) { @@ -1417,8 +1410,8 @@ private void setMetadataAndConstraints(XmlTypeDefinition type, XmlSchemaComplexT type.setConstraint(AbstractFlag.get(complexType.isAbstract())); /* - * HasValue and Binding and all other inheritable constraints from super - * type, override constraints for special types + * HasValue and Binding and all other inheritable constraints from super type, + * override constraints for special types */ // special bindings (geometries) @@ -1437,14 +1430,12 @@ private void setMetadataAndConstraints(XmlTypeDefinition type, XmlSchemaComplexT // XXX how to treat mixed type? // XXX for now represent as a string value /* - * Types inheriting from a mixed don't necessarily are mixed - * themselves. + * Types inheriting from a mixed don't necessarily are mixed themselves. */ type.setConstraint(HasNotInheritableValue.INSTANCE); } /* - * XXX String binding is a problem as it is inherited to non-mixed - * types + * XXX String binding is a problem as it is inherited to non-mixed types */ // type.setConstraint(Binding.get(String.class)); // mark as mixed type @@ -1912,9 +1903,8 @@ private QName determineAttributeName(XmlSchemaAttribute attribute, String schema && (attribute.getQName().getNamespaceURI() == null || attribute.getQName() .getNamespaceURI().equals(XMLConstants.NULL_NS_URI))) { /* - * It seems in this case the namespace is not included in - * attribute.getQName(). Is this a bug in the schema parser? As a - * workaround we provide the namespace. + * It seems in this case the namespace is not included in attribute.getQName(). + * Is this a bug in the schema parser? As a workaround we provide the namespace. */ return new QName(schemaNamespace, attribute.getQName().getLocalPart()); } diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/AnonymousXmlType.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/AnonymousXmlType.java index a30efc0550..31d6709379 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/AnonymousXmlType.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/AnonymousXmlType.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition; +import javax.xml.namespace.QName; /** * An anonymous XML type diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/HumboldtURIResolver.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/HumboldtURIResolver.java index 71807819b6..b1c96fa408 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/HumboldtURIResolver.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/HumboldtURIResolver.java @@ -15,19 +15,17 @@ */ package eu.esdihumboldt.hale.io.xsd.reader.internal; +import eu.esdihumboldt.hale.common.cache.Request; +import eu.esdihumboldt.util.io.InputSupplier; +import eu.esdihumboldt.util.resource.Resources; import java.io.File; import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; - import org.apache.ws.commons.schema.resolver.CollectionURIResolver; import org.apache.ws.commons.schema.resolver.URIResolver; import org.xml.sax.InputSource; -import eu.esdihumboldt.hale.common.cache.Request; -import eu.esdihumboldt.util.io.InputSupplier; -import eu.esdihumboldt.util.resource.Resources; - /** * This resolver provides the means of resolving the imports and includes of a * given schema document. The system will call this default resolver if there is diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/LazyGroupPropertyDefinition.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/LazyGroupPropertyDefinition.java index ff042d7f01..e79560cc37 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/LazyGroupPropertyDefinition.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/LazyGroupPropertyDefinition.java @@ -16,14 +16,12 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; -import java.util.Collection; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultGroupPropertyDefinition; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import java.util.Collection; +import javax.xml.namespace.QName; /** * Lazy property group definition @@ -68,8 +66,8 @@ private void init() { } /** - * Initialize the children. {@link #addChild(ChildDefinition)} can be used - * to add them. + * Initialize the children. {@link #addChild(ChildDefinition)} can be used to + * add them. */ protected abstract void initChildren(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/LazyPropertyDefinition.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/LazyPropertyDefinition.java index d85c38be64..7578ba21a0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/LazyPropertyDefinition.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/LazyPropertyDefinition.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import javax.xml.namespace.QName; /** * XML property definition that doesn't know its property type on construction diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/ProgressURIResolver.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/ProgressURIResolver.java index d70b75dab0..fbe85c5103 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/ProgressURIResolver.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/ProgressURIResolver.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.io.xsd.internal.Messages; import org.apache.ws.commons.schema.resolver.CollectionURIResolver; import org.apache.ws.commons.schema.resolver.URIResolver; import org.xml.sax.InputSource; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.io.xsd.internal.Messages; - /** * Decorator for URI resolvers that supports a {@link ProgressIndicator} * @@ -79,11 +78,13 @@ public void setCollectionBaseURI(String uri) { * @see URIResolver#resolveEntity(String, String, String) */ @Override - public InputSource resolveEntity(String targetNamespace, String schemaLocation, String baseUri) { + public InputSource resolveEntity(String targetNamespace, String schemaLocation, + String baseUri) { InputSource is = decoratee.resolveEntity(targetNamespace, schemaLocation, baseUri); String url = is.getSystemId(); - progress.setCurrentTask(Messages.getString("ProgressURIResolver.0") + ((url == null) ? (schemaLocation) : (url))); //$NON-NLS-1$ + progress.setCurrentTask(Messages.getString("ProgressURIResolver.0") //$NON-NLS-1$ + + ((url == null) ? (schemaLocation) : (url))); return is; } diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/SubstitutionGroupProperty.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/SubstitutionGroupProperty.java index ec50854c99..a99d55e380 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/SubstitutionGroupProperty.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/SubstitutionGroupProperty.java @@ -16,19 +16,7 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import java.util.Set; - -import javax.xml.namespace.QName; - import com.google.common.base.Preconditions; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; @@ -41,6 +29,15 @@ import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition; import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import java.util.Set; +import javax.xml.namespace.QName; /** * Group property that resolves all possible substitutions for a property and @@ -67,8 +64,8 @@ public SubstitutionGroupProperty(QName name, DefinitionGroup parentGroup) { /** * Set the property represented by the group. The property must have been - * created with this group as parent and the {@link Cardinality} constraint - * must have been already set. + * created with this group as parent and the {@link Cardinality} constraint must + * have been already set. * * @param property the property to set */ @@ -131,8 +128,8 @@ protected void initChildren() { } /** - * Collect all sub-types from the given type that may substitute it on - * condition of the given element name. + * Collect all sub-types from the given type that may substitute it on condition + * of the given element name. * * @param elementName the element name * @param type the type to be substituted @@ -144,13 +141,12 @@ public static List collectSubstitutions(QName elementName, TypeDefin Queue subTypes = new LinkedList(); /* - * Add type itself also to list of types to be checked for - * substitutions. (this is needed e.g. in CityGML 0.4.0 schema - * cityObjectMember substituting featureMember) This essentially then is - * only a substitution in name and not in type. XXX if other elements, - * that are in no relation to the type, should also be possible for - * substitution, we would need some kond of substitution index in - * XmlIndex + * Add type itself also to list of types to be checked for substitutions. (this + * is needed e.g. in CityGML 0.4.0 schema cityObjectMember substituting + * featureMember) This essentially then is only a substitution in name and not + * in type. XXX if other elements, that are in no relation to the type, should + * also be possible for substitution, we would need some kond of substitution + * index in XmlIndex */ subTypes.add(type); diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/SubstitutionProperty.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/SubstitutionProperty.java index 3a6642f3b6..9380a40fd2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/SubstitutionProperty.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/SubstitutionProperty.java @@ -41,7 +41,8 @@ public class SubstitutionProperty extends DefaultPropertyDefinition { * @param substitutionGroup the parent group */ public SubstitutionProperty(XmlElement substitution, - DefaultPropertyDefinition originialProperty, SubstitutionGroupProperty substitutionGroup) { + DefaultPropertyDefinition originialProperty, + SubstitutionGroupProperty substitutionGroup) { super(substitution.getName(), substitutionGroup, substitution.getType()); this.originialProperty = originialProperty; diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlAttributeGroupReferenceProperty.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlAttributeGroupReferenceProperty.java index 71557109f8..423dd27ebf 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlAttributeGroupReferenceProperty.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlAttributeGroupReferenceProperty.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; import eu.esdihumboldt.hale.io.xsd.model.XmlAttributeGroup; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import javax.xml.namespace.QName; /** * Group property referencing a XML attribute group @@ -59,8 +58,8 @@ protected void initChildren() { XmlAttributeGroup group = resolveAttributeGroup(); if (group == null) { - throw new IllegalStateException("Referenced attribute group could not be found: " - + groupName.toString()); + throw new IllegalStateException( + "Referenced attribute group could not be found: " + groupName.toString()); } // redeclare children diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlAttributeReferenceProperty.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlAttributeReferenceProperty.java index 3cd4361072..4f3159b79a 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlAttributeReferenceProperty.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlAttributeReferenceProperty.java @@ -16,14 +16,13 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition; import eu.esdihumboldt.hale.io.xsd.model.XmlAttribute; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import javax.xml.namespace.QName; /** * Property referencing a XML attribute @@ -59,8 +58,8 @@ protected TypeDefinition resolvePropertyType(XmlIndex index) { XmlAttribute attribute = resolveAttribute(); if (attribute == null) { - throw new IllegalStateException("Referenced attribute could not be found: " - + attributeName.toString()); + throw new IllegalStateException( + "Referenced attribute could not be found: " + attributeName.toString()); } return attribute.getType(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlElementReferenceProperty.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlElementReferenceProperty.java index 311638cb23..5db6f0cba5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlElementReferenceProperty.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlElementReferenceProperty.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import javax.xml.namespace.QName; /** * Property referencing a XML element diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlGroupReferenceProperty.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlGroupReferenceProperty.java index 22febf6601..bbd6399640 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlGroupReferenceProperty.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlGroupReferenceProperty.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup; import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil; import eu.esdihumboldt.hale.io.xsd.model.XmlGroup; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import javax.xml.namespace.QName; /** * Group property referencing a XML group @@ -59,8 +58,8 @@ protected void initChildren() { XmlGroup group = resolveGroup(); if (group == null) { - throw new IllegalStateException("Referenced group could not be found: " - + groupName.toString()); + throw new IllegalStateException( + "Referenced group could not be found: " + groupName.toString()); } // redeclare children diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlTypeDefinition.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlTypeDefinition.java index 775f2e919a..e6b5f2c4b3 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlTypeDefinition.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlTypeDefinition.java @@ -16,15 +16,6 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; @@ -32,6 +23,13 @@ import eu.esdihumboldt.hale.io.xsd.constraint.XmlAttributeFlag; import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Map.Entry; +import javax.xml.namespace.QName; /** * XML type definition @@ -70,18 +68,16 @@ public Collection> getChildren() { while (it.hasNext()) { Entry> entry = it.next(); - boolean isAttribute = entry.getValue().asProperty() != null - && entry.getValue().asProperty().getConstraint(XmlAttributeFlag.class) - .isEnabled(); + boolean isAttribute = entry.getValue().asProperty() != null && entry.getValue() + .asProperty().getConstraint(XmlAttributeFlag.class).isEnabled(); if (!isAttribute) { /* - * XXX For restrictions (on complex types) assume that - * all elements are redefined if needed. + * XXX For restrictions (on complex types) assume that all elements are + * redefined if needed. * - * For attributes though, it seems that they don't have - * to be redefined. (Or is this only for mandatory - * attributes?) + * For attributes though, it seems that they don't have to be redefined. (Or + * is this only for mandatory attributes?) */ // remove element it.remove(); diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlTypeUtil.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlTypeUtil.java index 9198760315..65d9f58f02 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlTypeUtil.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/XmlTypeUtil.java @@ -16,6 +16,36 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; +import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.AbstractFlag; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.AugmentedValueFlag; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.Enumeration; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappableFlag; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.ValidationConstraint; +import eu.esdihumboldt.hale.io.gml.geometry.Geometries; +import eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException; +import eu.esdihumboldt.hale.io.xsd.constraint.RestrictionFlag; +import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader; +import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.SkipGeometryValidation; +import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.UnionBinding; +import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.UnionEnumeration; +import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.UnionValidationConstraint; +import eu.esdihumboldt.util.validator.AndValidator; +import eu.esdihumboldt.util.validator.DigitCountValidator; +import eu.esdihumboldt.util.validator.EnumerationValidator; +import eu.esdihumboldt.util.validator.LengthValidator; +import eu.esdihumboldt.util.validator.NumberValidator; +import eu.esdihumboldt.util.validator.OrValidator; +import eu.esdihumboldt.util.validator.PatternValidator; +import eu.esdihumboldt.util.validator.Validator; import java.math.BigDecimal; import java.net.URI; import java.text.MessageFormat; @@ -24,10 +54,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; - import javax.xml.XMLConstants; import javax.xml.namespace.QName; - import org.apache.ws.commons.schema.XmlSchemaEnumerationFacet; import org.apache.ws.commons.schema.XmlSchemaFacet; import org.apache.ws.commons.schema.XmlSchemaFractionDigitsFacet; @@ -54,37 +82,6 @@ import org.opengis.feature.type.AttributeType; import org.opengis.feature.type.Name; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.AbstractFlag; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.AugmentedValueFlag; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.ElementType; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.Enumeration; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappableFlag; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.ValidationConstraint; -import eu.esdihumboldt.hale.io.gml.geometry.Geometries; -import eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException; -import eu.esdihumboldt.hale.io.xsd.constraint.RestrictionFlag; -import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; -import eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader; -import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.SkipGeometryValidation; -import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.UnionBinding; -import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.UnionEnumeration; -import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.UnionValidationConstraint; -import eu.esdihumboldt.util.validator.AndValidator; -import eu.esdihumboldt.util.validator.DigitCountValidator; -import eu.esdihumboldt.util.validator.EnumerationValidator; -import eu.esdihumboldt.util.validator.LengthValidator; -import eu.esdihumboldt.util.validator.NumberValidator; -import eu.esdihumboldt.util.validator.OrValidator; -import eu.esdihumboldt.util.validator.PatternValidator; -import eu.esdihumboldt.util.validator.Validator; - /** * Utility methods regarding type resolving * @@ -119,8 +116,8 @@ public abstract class XmlTypeUtil { "anyType"); /** - * Set of XML schema types that should get a String binding but don't get - * one through the Geotools bindings + * Set of XML schema types that should get a String binding but don't get one + * through the Geotools bindings * * @see "http://www.w3schools.com/Schema/schema_dtypes_string.asp" */ @@ -458,8 +455,7 @@ private static boolean isDecimal(String s) { } /** - * Configure a type definition for a simple type based on a simple type - * list. + * Configure a type definition for a simple type based on a simple type list. * * @param type the type definition * @param list the simple type list @@ -506,8 +502,7 @@ else if (list.getItemTypeName() != null) { } /** - * Configure a type definition for a simple type based on a simple type - * union. + * Configure a type definition for a simple type based on a simple type union. * * @param type the type definition * @param union the simple type union diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/ElementName.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/ElementName.java index 12ec4dbb00..dff1058d8f 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/ElementName.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/ElementName.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal.constraint; -import java.util.Collection; - import eu.esdihumboldt.hale.common.schema.model.constraint.DisplayName; import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; +import java.util.Collection; /** * Custom display name based on XML elements @@ -50,8 +49,8 @@ public String getCustomName() { // only use the element name if it is unique return elements.iterator().next().getDisplayName(); /* - * FIXME do something else if there are multiple elements? prefer - * ones that are flagged Mappable? (not done currently) + * FIXME do something else if there are multiple elements? prefer ones that are + * flagged Mappable? (not done currently) */ } diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/ElementReferenceProperty.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/ElementReferenceProperty.java index d97f3466c3..795ef96292 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/ElementReferenceProperty.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/ElementReferenceProperty.java @@ -15,15 +15,13 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal.constraint; -import java.util.Collection; -import java.util.List; - -import javax.xml.namespace.QName; - import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.property.ReferenceProperty; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import java.util.Collection; +import java.util.List; +import javax.xml.namespace.QName; /** * Reference property constraints that references XML elements and is only diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/MappableUsingXsiType.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/MappableUsingXsiType.java index 94b7c7cceb..4dbe278dc9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/MappableUsingXsiType.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/MappableUsingXsiType.java @@ -33,8 +33,7 @@ public class MappableUsingXsiType extends MappableFlag { private final XmlTypeDefinition type; /** - * Create a mapping constraint that checks if a type is mappable using - * xsi:type. + * Create a mapping constraint that checks if a type is mappable using xsi:type. * * @param type the type defintion */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/SkipGeometryValidation.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/SkipGeometryValidation.java index 6729596f32..c19a76605d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/SkipGeometryValidation.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/SkipGeometryValidation.java @@ -15,9 +15,9 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal.constraint; -import net.jcip.annotations.Immutable; import eu.esdihumboldt.hale.common.instance.model.Instance; import eu.esdihumboldt.hale.common.schema.model.constraint.type.SkipValidation; +import net.jcip.annotations.Immutable; /** * Controls validation being skipped for geometry properties with an augmented diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionBinding.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionBinding.java index 2efa8dc206..049df0adea 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionBinding.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionBinding.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal.constraint; -import java.util.Collection; -import java.util.Iterator; - import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.Binding; +import java.util.Collection; +import java.util.Iterator; /** * Binding constraint for type unions @@ -52,8 +51,8 @@ public Class getBinding() { Class binding = it.next().getConstraint(Binding.class).getBinding(); while (it.hasNext()) { - binding = findCompatibleClass(binding, it.next().getConstraint(Binding.class) - .getBinding()); + binding = findCompatibleClass(binding, + it.next().getConstraint(Binding.class).getBinding()); } return binding; @@ -78,7 +77,8 @@ else if (binding2.isAssignableFrom(binding)) { } // special treatment for string - if any binding is compatible to // String, it is returned - else if (String.class.isAssignableFrom(binding) || String.class.isAssignableFrom(binding2)) { + else if (String.class.isAssignableFrom(binding) + || String.class.isAssignableFrom(binding2)) { return String.class; } else { diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionEnumeration.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionEnumeration.java index 4ed76c85ab..ef5cf4cdc9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionEnumeration.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionEnumeration.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal.constraint; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.Enumeration; import java.util.Collection; import java.util.LinkedHashSet; import java.util.Set; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.Enumeration; - /** * Enumeration constraint for type unions * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionValidationConstraint.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionValidationConstraint.java index 9bbe4dbec3..86c792b905 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionValidationConstraint.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/UnionValidationConstraint.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal.constraint; -import java.util.ArrayList; -import java.util.Collection; - import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.ValidationConstraint; import eu.esdihumboldt.util.validator.OrValidator; import eu.esdihumboldt.util.validator.Validator; +import java.util.ArrayList; +import java.util.Collection; /** * Validation constraint for type unions. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/XLinkReference.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/XLinkReference.java index 2577eb5335..85775ea588 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/XLinkReference.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/XLinkReference.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal.constraint; -import org.apache.commons.lang.StringUtils; - import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; +import org.apache.commons.lang.StringUtils; /** * Reference constraint that should be associated with a XLink href attribute. diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/validator/XLinkReferenceContext.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/validator/XLinkReferenceContext.java index 105da5868f..eecb58c8e2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/validator/XLinkReferenceContext.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/src/eu/esdihumboldt/hale/io/xsd/reader/internal/constraint/validator/XLinkReferenceContext.java @@ -15,6 +15,10 @@ package eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.validator; +import eu.esdihumboldt.hale.common.instance.extension.validation.ValidationLocation; +import eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationReporter; +import eu.esdihumboldt.hale.common.instance.extension.validation.report.impl.DefaultInstanceValidationMessage; +import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.XLinkReference; import java.text.MessageFormat; import java.util.HashMap; import java.util.HashSet; @@ -22,11 +26,6 @@ import java.util.Map.Entry; import java.util.Set; -import eu.esdihumboldt.hale.common.instance.extension.validation.ValidationLocation; -import eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationReporter; -import eu.esdihumboldt.hale.common.instance.extension.validation.report.impl.DefaultInstanceValidationMessage; -import eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.XLinkReference; - /** * Context for {@link XLinkReference} validation. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentAssociationTypeTest.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentAssociationTypeTest.java index 0bfb348ef0..94743b3069 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentAssociationTypeTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentAssociationTypeTest.java @@ -18,20 +18,17 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContent; +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentAssociation; +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentMode; +import eu.esdihumboldt.util.test.AbstractPlatformTest; import java.util.ArrayList; import java.util.List; - import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; import org.junit.Test; import org.w3c.dom.Element; -import eu.esdihumboldt.hale.common.core.io.HaleIO; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContent; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentAssociation; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentMode; - /** * Test {@link CustomTypeContentAssociation} serialization. * @@ -76,8 +73,8 @@ public void testBothWays() { assertEquals(name2, conv.getProperty().get(1)); assertEquals(name3, conv.getProperty().get(2)); - assertEquals("Mode does not match", CustomTypeContentMode.elements, conv.getConfig() - .getMode()); + assertEquals("Mode does not match", CustomTypeContentMode.elements, + conv.getConfig().getMode()); assertEquals(2, conv.getConfig().getElements().size()); assertEquals(elem1, conv.getConfig().getElements().get(0)); assertEquals(elem2, conv.getConfig().getElements().get(1)); diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentConfigurationTypeTest.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentConfigurationTypeTest.java index 09965fb78d..10ec1b4e79 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentConfigurationTypeTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentConfigurationTypeTest.java @@ -18,24 +18,21 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContent; +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentAssociation; +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentConfiguration; +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentMode; +import eu.esdihumboldt.util.test.AbstractPlatformTest; import java.io.InputStream; import java.util.ArrayList; import java.util.List; - import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; import org.junit.Test; import org.w3c.dom.Element; -import eu.esdihumboldt.hale.common.core.io.HaleIO; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContent; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentAssociation; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentConfiguration; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentMode; - /** * Test {@link CustomTypeContentConfiguration} serialization. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentTypeTest.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentTypeTest.java index d8c0b40b48..0ea5bbc2d1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentTypeTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/anytype/valuetypes/CustomTypeContentTypeTest.java @@ -17,19 +17,16 @@ import static org.junit.Assert.assertEquals; +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContent; +import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentMode; +import eu.esdihumboldt.util.test.AbstractPlatformTest; import java.util.ArrayList; import java.util.List; - import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; import org.junit.Test; import org.w3c.dom.Element; -import eu.esdihumboldt.hale.common.core.io.HaleIO; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContent; -import eu.esdihumboldt.hale.io.xsd.anytype.CustomTypeContentMode; - /** * Test {@link CustomTypeContent} serialization. * diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/HumboldtURIResolverTest.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/HumboldtURIResolverTest.java index 2d4bb1e4aa..5cbfef8c74 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/HumboldtURIResolverTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/HumboldtURIResolverTest.java @@ -17,11 +17,10 @@ import static org.junit.Assert.assertEquals; +import eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver; import org.junit.Test; import org.xml.sax.InputSource; -import eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver; - /** * Tests for schema URI resolver. */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReaderMoreTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReaderMoreTest.groovy index 96fe4a5306..d2793a2200 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReaderMoreTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReaderMoreTest.groovy @@ -15,19 +15,16 @@ package eu.esdihumboldt.hale.io.xsd.reader -import eu.esdihumboldt.util.test.AbstractPlatformTest - import static eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReaderTest.readSchema import static org.junit.Assert.* -import javax.xml.namespace.QName - -import org.junit.Test - import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier import eu.esdihumboldt.hale.common.schema.model.constraint.property.ReferenceProperty import eu.esdihumboldt.hale.io.xsd.constraint.XmlAppInfo import eu.esdihumboldt.hale.io.xsd.model.XmlIndex +import eu.esdihumboldt.util.test.AbstractPlatformTest +import javax.xml.namespace.QName +import org.junit.Test /** * More XmlSchemaReader tests (using Groovy). diff --git a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReaderTest.java b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReaderTest.java index df7a998c23..953d955ed0 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReaderTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.xsd/test/eu/esdihumboldt/hale/io/xsd/reader/XmlSchemaReaderTest.java @@ -21,23 +21,9 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; - -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; - -import eu.esdihumboldt.util.test.AbstractPlatformTest; -import org.junit.Test; - import com.google.common.base.Objects; import com.google.common.base.Predicate; import com.google.common.collect.Collections2; - import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier; @@ -59,6 +45,16 @@ import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; import eu.esdihumboldt.hale.io.xsd.model.XmlElement; import eu.esdihumboldt.hale.io.xsd.model.XmlIndex; +import eu.esdihumboldt.util.test.AbstractPlatformTest; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import javax.xml.XMLConstants; +import javax.xml.namespace.QName; +import org.junit.Test; /** * Tests for XML schema reading @@ -68,8 +64,8 @@ public class XmlSchemaReaderTest extends AbstractPlatformTest { /** - * Test reading a simple XML schema that contains one big element. Focuses - * on structure, simple type bindings and cardinalities. + * Test reading a simple XML schema that contains one big element. Focuses on + * structure, simple type bindings and cardinalities. * * @throws Exception if reading the schema fails */ @@ -92,8 +88,8 @@ public void testRead_shiporder_one() throws Exception { /** * Test reading a simple XML schema that contains one big element and where - * elementFormDefault/attributeFromDefault is set to unqualified and no - * target namespace is set. Focuses on structure, simple type bindings and + * elementFormDefault/attributeFromDefault is set to unqualified and no target + * namespace is set. Focuses on structure, simple type bindings and * cardinalities. * * @throws Exception if reading the schema fails @@ -165,8 +161,8 @@ public void testRead_shiporder_types() throws Exception { } /** - * Test reading a simple XML schema that uses several custom named types and - * has a cycle. + * Test reading a simple XML schema that uses several custom named types and has + * a cycle. * * @throws Exception if reading the schema fails */ @@ -196,8 +192,8 @@ public void testRead_shiporder_types_cycle() throws Exception { } /** - * Test reading a simple XML schema that uses several custom named types. - * The types are referenced before they are declared. + * Test reading a simple XML schema that uses several custom named types. The + * types are referenced before they are declared. * * @throws Exception if reading the schema fails */ @@ -268,8 +264,8 @@ public void testRead_definitive_attributegroup() throws Exception { } /** - * Test reading a simple XML schema that is split into several files. Tests - * also the {@link XmlElements} and {@link MappingRelevantFlag} constraints + * Test reading a simple XML schema that is split into several files. Tests also + * the {@link XmlElements} and {@link MappingRelevantFlag} constraints * * @throws Exception if reading the schema fails */ @@ -624,8 +620,8 @@ public boolean apply(XmlElement input) { * * @param input the input supplier * @return the schema - * @throws IOProviderConfigurationException if the configuration of the - * reader is invalid + * @throws IOProviderConfigurationException if the configuration of the reader + * is invalid * @throws IOException if reading the schema fails */ public static Schema readSchema(LocatableInputSupplier input) diff --git a/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/IterableDelegate.java b/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/IterableDelegate.java index 5a47d45f59..3a04dbb0aa 100644 --- a/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/IterableDelegate.java +++ b/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/IterableDelegate.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.util.blueprints.entities; -import java.lang.reflect.Constructor; -import java.util.Iterator; - import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.Vertex; +import java.lang.reflect.Constructor; +import java.util.Iterator; /** * Wraps a vertex iterable and wraps vertices with entities. diff --git a/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntity.java b/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntity.java index e9d2241ce6..bd3eac845a 100644 --- a/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntity.java +++ b/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntity.java @@ -19,7 +19,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - import org.codehaus.groovy.transform.GroovyASTTransformationClass; /** @@ -30,7 +29,8 @@ */ @Retention(RetentionPolicy.SOURCE) @Target({ ElementType.TYPE }) -@GroovyASTTransformationClass({ "eu.esdihumboldt.util.blueprints.entities.VertexEntityTransformation" }) +@GroovyASTTransformationClass({ + "eu.esdihumboldt.util.blueprints.entities.VertexEntityTransformation" }) public @interface VertexEntity { /** @@ -39,8 +39,8 @@ String value(); /** - * @return the name of the vertex property the entity class name is stored - * in (not applicable for OrientGraph) + * @return the name of the vertex property the entity class name is stored in + * (not applicable for OrientGraph) */ String typeProperty() default "_type"; } diff --git a/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntityDelegates.java b/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntityDelegates.java index f17ba37a73..b06969e679 100644 --- a/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntityDelegates.java +++ b/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntityDelegates.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.util.blueprints.entities; -import java.util.NoSuchElementException; - import com.google.common.collect.Iterables; import com.orientechnologies.orient.core.metadata.schema.OClass; import com.orientechnologies.orient.core.sql.OCommandSQL; import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.impls.orient.OrientGraph; +import java.util.NoSuchElementException; /** * Utility methods that {@link VertexEntityTransformation} delegates to for some @@ -117,8 +116,8 @@ public static Iterable findByDelegate(Graph graph, String className, * @param propertyName the name of the property to check for the given value * @param value the value that vertices should have for the given property * @return the found vertex or null if it does not exist - * @throws NonUniqueResultException if there are multiple vertices matching - * the criteria + * @throws NonUniqueResultException if there are multiple vertices matching the + * criteria */ public static Vertex getByDelegate(Graph graph, String className, String typeProperty, String propertyName, Object value) throws NonUniqueResultException { diff --git a/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntityTransformation.java b/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntityTransformation.java index c1141bc6e3..f90ff7ae11 100644 --- a/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntityTransformation.java +++ b/util/plugins/eu.esdihumboldt.util.blueprints.entities/src/eu/esdihumboldt/util/blueprints/entities/VertexEntityTransformation.java @@ -15,13 +15,15 @@ package eu.esdihumboldt.util.blueprints.entities; +import com.tinkerpop.blueprints.Graph; +import com.tinkerpop.blueprints.Vertex; +import com.tinkerpop.blueprints.impls.orient.OrientGraph; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; - import org.codehaus.groovy.ast.ASTNode; import org.codehaus.groovy.ast.AnnotationNode; import org.codehaus.groovy.ast.ClassHelper; @@ -57,10 +59,6 @@ import org.codehaus.groovy.transform.ASTTransformation; import org.codehaus.groovy.transform.GroovyASTTransformation; -import com.tinkerpop.blueprints.Graph; -import com.tinkerpop.blueprints.Vertex; -import com.tinkerpop.blueprints.impls.orient.OrientGraph; - /** * Groovy AST transformation that converts POGOs to vertex entities. * @@ -223,8 +221,8 @@ private void processClass(ClassNode clazz) { } /** - * Create a static method that initializes a graph. For an - * {@link OrientGraph} it registers the entity class as a schema type. + * Create a static method that initializes a graph. For an {@link OrientGraph} + * it registers the entity class as a schema type. * * @param entityName the entity name * @param superEntityName the super entity name, may be null @@ -286,8 +284,8 @@ private MethodNode buildDeleteMethod(FieldNode vertexField, FieldNode graphField } /** - * Create a static method that allows creating a new vertex and adding it to - * a graph. + * Create a static method that allows creating a new vertex and adding it to a + * graph. * * @param clazz the entity class * @param entityName the entity name @@ -365,8 +363,8 @@ private MethodNode buildFindAllMethod(ClassNode clazz, Expression entityName, code.addStatement(callInitGraph(clazz, new VariableExpression("graph"))); /* - * def vertices = VertexEntityDelegates.findAllDelegate(graph, - * entityName, typeProperty) + * def vertices = VertexEntityDelegates.findAllDelegate(graph, entityName, + * typeProperty) */ VariableExpression vertices = new VariableExpression("vertices"); @@ -420,8 +418,8 @@ private MethodNode buildFindByMethod(ClassNode clazz, Expression entityName, code.addStatement(callInitGraph(clazz, new VariableExpression("graph"))); /* - * def vertices = VertexEntityDelegates.findByDelegate(graph, - * entityName, typeProperty, propertyName, value) + * def vertices = VertexEntityDelegates.findByDelegate(graph, entityName, + * typeProperty, propertyName, value) */ VariableExpression vertices = new VariableExpression("vertices"); @@ -512,8 +510,8 @@ private MethodNode buildGetByMethod(ClassNode clazz, Expression entityName, code.addStatement(callInitGraph(clazz, new VariableExpression("graph"))); /* - * def vertex = VertexEntityDelegates.findUniqueByDelegate(graph, - * entityName, typeProperty, propertyName, value) + * def vertex = VertexEntityDelegates.findUniqueByDelegate(graph, entityName, + * typeProperty, propertyName, value) */ VariableExpression vertex = new VariableExpression("vertex"); @@ -545,14 +543,13 @@ private MethodNode buildGetByMethod(ClassNode clazz, Expression entityName, } /** - * Create a constructor taking a Vertex and a Graph as an argument, - * assigning them to the vertex and graph fields. + * Create a constructor taking a Vertex and a Graph as an argument, assigning + * them to the vertex and graph fields. * * @param vertexField the vertex field * @param graphField the graph field * @param superClass the vertex entity super class or null - * @param typeProperty the expression specifying the name of the type - * property + * @param typeProperty the expression specifying the name of the type property * @param entityName the expression specifying the entity name * @return a constructor taking a Vertex as an argument */ diff --git a/util/plugins/eu.esdihumboldt.util.blueprints.entities/test/eu/esdihumboldt/util/blueprints/entities/test/VertexEntityTransformationTest.groovy b/util/plugins/eu.esdihumboldt.util.blueprints.entities/test/eu/esdihumboldt/util/blueprints/entities/test/VertexEntityTransformationTest.groovy index 8d06e5244d..9d7e9077cc 100644 --- a/util/plugins/eu.esdihumboldt.util.blueprints.entities/test/eu/esdihumboldt/util/blueprints/entities/test/VertexEntityTransformationTest.groovy +++ b/util/plugins/eu.esdihumboldt.util.blueprints.entities/test/eu/esdihumboldt/util/blueprints/entities/test/VertexEntityTransformationTest.groovy @@ -15,16 +15,14 @@ package eu.esdihumboldt.util.blueprints.entities.test; -import org.codehaus.groovy.ast.builder.AstBuilder - import com.google.common.collect.Iterables import com.tinkerpop.blueprints.Graph import com.tinkerpop.blueprints.Vertex import com.tinkerpop.blueprints.impls.orient.OrientGraph import com.tinkerpop.blueprints.impls.tg.TinkerGraph import com.tinkerpop.blueprints.impls.tg.TinkerGraphFactory - import eu.esdihumboldt.util.blueprints.entities.NonUniqueResultException +import org.codehaus.groovy.ast.builder.AstBuilder import org.junit.Ignore import org.junit.Test diff --git a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/Command.java b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/Command.java index 0e43c4d104..d6436e7290 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/Command.java +++ b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/Command.java @@ -15,12 +15,10 @@ package eu.esdihumboldt.util.cli; +import eu.esdihumboldt.util.cli.bash.BashCompletion; import java.util.List; - import javax.annotation.Nullable; -import eu.esdihumboldt.util.cli.bash.BashCompletion; - /** * Interface for CLI commands. * @@ -58,8 +56,8 @@ default BashCompletion bashCompletion(List args, int current) { } /** - * States if this is an experimental command. Experimental commands cannot - * be expected to be backwards compatible. + * States if this is an experimental command. Experimental commands cannot be + * expected to be backwards compatible. * * @return if the command is experimental */ diff --git a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/bash/BashCompletion.java b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/bash/BashCompletion.java index b496bd559a..7b54455f06 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/bash/BashCompletion.java +++ b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/bash/BashCompletion.java @@ -49,8 +49,8 @@ static BashCompletion file() { } /** - * Return a Unix command to use to generate bash completions. Alternatively - * a reserved keyword can be used to use a pre-configured completion. + * Return a Unix command to use to generate bash completions. Alternatively a + * reserved keyword can be used to use a pre-configured completion. * * @return the Unix command or null */ diff --git a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/GroupCommand.java b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/GroupCommand.java index b4266176ef..986650c2e5 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/GroupCommand.java +++ b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/GroupCommand.java @@ -15,19 +15,17 @@ package eu.esdihumboldt.util.cli.extension; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import eu.esdihumboldt.util.cli.Command; import eu.esdihumboldt.util.cli.extension.command.CommandExtension; import eu.esdihumboldt.util.cli.extension.command.CommandFactory; import eu.esdihumboldt.util.cli.extension.group.Group; import eu.esdihumboldt.util.cli.extension.group.GroupExtension; import eu.esdihumboldt.util.cli.impl.DelegatingCommand; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Delegating command based on a registered command group. diff --git a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/CommandExtension.java b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/CommandExtension.java index 42f3e603c8..fd219c6ec6 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/CommandExtension.java +++ b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/CommandExtension.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.util.cli.extension.command; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractExtension; import eu.esdihumboldt.util.cli.Command; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension for CLI commands. diff --git a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/CommandFactory.java b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/CommandFactory.java index faedab850b..cd3590c41f 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/CommandFactory.java +++ b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/CommandFactory.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.util.cli.extension.command; -import javax.annotation.Nullable; - import de.fhg.igd.eclipse.util.extension.ExtensionObjectFactory; import eu.esdihumboldt.util.cli.Command; +import javax.annotation.Nullable; /** * Command factory. diff --git a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/ConfigurationCommandFactory.java b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/ConfigurationCommandFactory.java index e94f64c4e5..d89d24848e 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/ConfigurationCommandFactory.java +++ b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/command/ConfigurationCommandFactory.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.util.cli.extension.command; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import eu.esdihumboldt.util.cli.Command; +import org.eclipse.core.runtime.IConfigurationElement; /** * Command factory based on a configuration element. diff --git a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/group/Group.java b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/group/Group.java index 66996c4139..9855f99b8b 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/group/Group.java +++ b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/group/Group.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.util.cli.extension.group; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; - /** * Represents a CLI command group. Usually provided through the corresponding * extension point. diff --git a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/group/GroupExtension.java b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/group/GroupExtension.java index 679fc5cb45..10a7c040b6 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/group/GroupExtension.java +++ b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/extension/group/GroupExtension.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.util.cli.extension.group; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; import eu.esdihumboldt.util.cli.extension.command.CommandExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * CLI command group extension. diff --git a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/impl/DelegatingCommand.groovy b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/impl/DelegatingCommand.groovy index 80399e7c1f..78a7a63096 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/impl/DelegatingCommand.groovy +++ b/util/plugins/eu.esdihumboldt.util.cli/src/eu/esdihumboldt/util/cli/impl/DelegatingCommand.groovy @@ -91,5 +91,4 @@ abstract class DelegatingCommand implements Command { BashCompletion.command('compgen -W "help ' + subCommands.keySet().join(' ') + '" -- ' + args[current]) } } - } diff --git a/util/plugins/eu.esdihumboldt.util.config/src/eu/esdihumboldt/util/config/ConfigYaml.groovy b/util/plugins/eu.esdihumboldt.util.config/src/eu/esdihumboldt/util/config/ConfigYaml.groovy index 20fa272d44..453e9c4ed9 100644 --- a/util/plugins/eu.esdihumboldt.util.config/src/eu/esdihumboldt/util/config/ConfigYaml.groovy +++ b/util/plugins/eu.esdihumboldt.util.config/src/eu/esdihumboldt/util/config/ConfigYaml.groovy @@ -15,15 +15,13 @@ package eu.esdihumboldt.util.config +import groovy.transform.CompileStatic import java.nio.charset.StandardCharsets - import org.yaml.snakeyaml.DumperOptions import org.yaml.snakeyaml.LoaderOptions import org.yaml.snakeyaml.Yaml import org.yaml.snakeyaml.constructor.SafeConstructor -import groovy.transform.CompileStatic - /** * Helper for converting a Config from and to YAML. * diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/CurveHelper.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/CurveHelper.java index 76c886807c..8a331372e6 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/CurveHelper.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/CurveHelper.java @@ -15,6 +15,7 @@ package eu.esdihumboldt.util.geometry; +import eu.esdihumboldt.util.DependencyOrderedList; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -22,16 +23,12 @@ import java.util.Map; import java.util.Set; import java.util.function.Function; - import javax.annotation.Nullable; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.MultiLineString; -import eu.esdihumboldt.util.DependencyOrderedList; - /** * Helper methods for curves. * @@ -60,8 +57,7 @@ public static MultiLineString combineCurve(MultiLineString lineStrings, Geometry } /** - * Combine the given {@link LineString}s to a curve / - * {@link MultiLineString}. + * Combine the given {@link LineString}s to a curve / {@link MultiLineString}. * * @param lineStrings the line strings * @param fact a geometry factory @@ -84,8 +80,8 @@ public static MultiLineString combineCurve(List lineString * @param lineStrings the line strings * @param strict if it should be checked if the geometry fulfills the strict * requirements of a curve - * @param builder the builder function creating a combination of the - * individual {@link LineString}s + * @param builder the builder function creating a combination of the individual + * {@link LineString}s * @return the combined {@link MultiLineString} or null if the * geometry did not meet the requirements of the strict mode */ @@ -136,13 +132,13 @@ public static T combineCurve(List lineStrings, boolean } /** - * Combine the given {@link MultiLineString} to a single {@link LineString} - * if possible. + * Combine the given {@link MultiLineString} to a single {@link LineString} if + * possible. * * @param lineStrings the multi line string * @param fact a geometry factory - * @return the combined {@link LineString} or null if the - * geometry did not meet the requirements of the strict mode + * @return the combined {@link LineString} or null if the geometry + * did not meet the requirements of the strict mode */ @Nullable public static LineString combineCurve(MultiLineString lineStrings, GeometryFactory fact) { @@ -159,8 +155,8 @@ public static LineString combineCurve(MultiLineString lineStrings, GeometryFacto * * @param lineStrings the line strings * @param fact a geometry factory - * @return the combined {@link LineString} or null if the - * geometry did not meet the requirements of the strict mode + * @return the combined {@link LineString} or null if the geometry + * did not meet the requirements of the strict mode */ @Nullable public static LineString combineCurve(List lineStrings, diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/WindingOrder.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/WindingOrder.java index fef97b7c94..4c0eafff22 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/WindingOrder.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/WindingOrder.java @@ -15,9 +15,6 @@ package eu.esdihumboldt.util.geometry; -import org.opengis.referencing.crs.CoordinateReferenceSystem; -import org.opengis.referencing.cs.AxisDirection; - import org.locationtech.jts.algorithm.CGAlgorithms; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; @@ -26,6 +23,8 @@ import org.locationtech.jts.geom.LinearRing; import org.locationtech.jts.geom.MultiPolygon; import org.locationtech.jts.geom.Polygon; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.cs.AxisDirection; /** * Winding order changer for Geometry objects. @@ -104,8 +103,7 @@ public static boolean isCounterClockwise(Geometry geometry) { * LinearRing) as CounterClockwise or Clockwise. * * @param geometry Geometry object for unifying. - * @param counterClockWise true, if unify geometry counterClockwise else - * false. + * @param counterClockWise true, if unify geometry counterClockwise else false. * @param crs Coordinate Reference System * @return Geometry unified object. */ @@ -198,9 +196,8 @@ public static Polygon unifyWindingOrderForPolyGon(Polygon poly, boolean counterC * Unify order of the Multipolygon including all polygons and holes in it. * * @param multiPoly Multipolygon object for unifying it. - * @param counterClockWise boolean value. true, if want shell of - * multipolygon as counter clock wise and holes as clockwise, - * else false. + * @param counterClockWise boolean value. true, if want shell of multipolygon as + * counter clock wise and holes as clockwise, else false. * @return Multipolygon unified Object */ public static MultiPolygon unifyWindingOrderForMultiPolygon(MultiPolygon multiPoly, @@ -223,8 +220,8 @@ public static MultiPolygon unifyWindingOrderForMultiPolygon(MultiPolygon multiPo * Unify order of the GeometryCollection including all Geometries in it. * * @param geoCollection GeometryCollection object for unifying. - * @param counterClockWise boolean value. true, if want all geometry object - * * as counter clock wise, else false. + * @param counterClockWise boolean value. true, if want all geometry object * as + * counter clock wise, else false. * @return GeometryCollection unified Object */ public static GeometryCollection unifyWindingOrderForGeometryCollection( diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/AbstractInterpolationAlgorithm.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/AbstractInterpolationAlgorithm.java index 5c11768c7c..a50a35e8b9 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/AbstractInterpolationAlgorithm.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/AbstractInterpolationAlgorithm.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.util.geometry.interpolation; +import eu.esdihumboldt.util.geometry.interpolation.model.ComplexGeometry; import java.util.Map; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; -import eu.esdihumboldt.util.geometry.interpolation.model.ComplexGeometry; - /** * Base class for interpolation algorithms. * diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/ArcSegment.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/ArcSegment.java index a946c2dd4c..7ad983da84 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/ArcSegment.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/ArcSegment.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.util.geometry.interpolation; import javax.annotation.Nullable; - import org.locationtech.jts.geom.Coordinate; /** diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolatedLineString.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolatedLineString.java index bc4f783d8a..f19abe3f08 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolatedLineString.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolatedLineString.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.util.geometry.interpolation; +import eu.esdihumboldt.util.geometry.interpolation.model.ComplexGeometry; import org.locationtech.jts.geom.CoordinateSequence; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; -import eu.esdihumboldt.util.geometry.interpolation.model.ComplexGeometry; - /** * Line string that was interpolated and holds the information on the original * geometry. diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolationAlgorithm.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolationAlgorithm.java index 40893eddd3..111723e6e3 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolationAlgorithm.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolationAlgorithm.java @@ -15,17 +15,15 @@ package eu.esdihumboldt.util.geometry.interpolation; +import eu.esdihumboldt.util.geometry.interpolation.model.Arc; +import eu.esdihumboldt.util.geometry.interpolation.model.ArcString; import java.util.ArrayList; import java.util.List; import java.util.Map; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; -import eu.esdihumboldt.util.geometry.interpolation.model.Arc; -import eu.esdihumboldt.util.geometry.interpolation.model.ArcString; - /** * Interface for interpolations algorithms. * diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolationUtil.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolationUtil.java index 992a21c380..faa0e4b926 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolationUtil.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/InterpolationUtil.java @@ -15,14 +15,12 @@ package eu.esdihumboldt.util.geometry.interpolation; -import java.math.BigDecimal; -import java.util.List; - -import org.locationtech.jts.geom.Coordinate; - import eu.esdihumboldt.util.geometry.interpolation.model.Arc; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; +import java.math.BigDecimal; +import java.util.List; +import org.locationtech.jts.geom.Coordinate; /** * Utility functions related to interpolation. diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/NoInterpolation.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/NoInterpolation.java index b2b037396d..635bf4eae3 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/NoInterpolation.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/NoInterpolation.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.util.geometry.interpolation; -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LineString; - import eu.esdihumboldt.util.geometry.interpolation.model.Arc; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LineString; /** * Interpolation algorithm that always represents arcs by three points. diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/extension/InterpolationExtension.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/extension/InterpolationExtension.java index f4437fc581..277ab1e902 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/extension/InterpolationExtension.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/extension/InterpolationExtension.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.util.geometry.interpolation.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.AbstractConfigurationFactory; import de.fhg.igd.eclipse.util.extension.AbstractExtension; import eu.esdihumboldt.util.geometry.interpolation.InterpolationAlgorithm; +import org.eclipse.core.runtime.IConfigurationElement; /** * Interpolation algorithm extension point. diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/ArcGridSegment.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/ArcGridSegment.java index 36d50ce068..09dcaa18e6 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/ArcGridSegment.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/ArcGridSegment.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.util.geometry.interpolation.grid; -import org.locationtech.jts.geom.Coordinate; - import eu.esdihumboldt.util.geometry.interpolation.ArcSegment; import eu.esdihumboldt.util.geometry.interpolation.model.Angle; import eu.esdihumboldt.util.geometry.interpolation.model.Arc; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl; +import org.locationtech.jts.geom.Coordinate; /** * Segment of an arc for gridded interpolation. diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/FixedStartEndGridSegment.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/FixedStartEndGridSegment.java index 6260dabb8f..3216c6b705 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/FixedStartEndGridSegment.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/FixedStartEndGridSegment.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.util.geometry.interpolation.grid; -import org.locationtech.jts.geom.Coordinate; - import eu.esdihumboldt.util.geometry.interpolation.model.Arc; +import org.locationtech.jts.geom.Coordinate; /** * Segment of an arc for gridded interpolation with provided fixed start and end diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/GridInterpolation.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/GridInterpolation.java index b445bf47a1..fb387dd83a 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/GridInterpolation.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/GridInterpolation.java @@ -17,22 +17,20 @@ import static eu.esdihumboldt.util.geometry.interpolation.grid.GridUtil.movePointToGrid; +import eu.esdihumboldt.util.geometry.interpolation.AbstractInterpolationAlgorithm; +import eu.esdihumboldt.util.geometry.interpolation.ArcSegment; +import eu.esdihumboldt.util.geometry.interpolation.InterpolationUtil; +import eu.esdihumboldt.util.geometry.interpolation.model.Arc; +import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; import java.util.ArrayList; import java.util.Deque; import java.util.LinkedList; import java.util.List; import java.util.Map; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; -import eu.esdihumboldt.util.geometry.interpolation.AbstractInterpolationAlgorithm; -import eu.esdihumboldt.util.geometry.interpolation.ArcSegment; -import eu.esdihumboldt.util.geometry.interpolation.InterpolationUtil; -import eu.esdihumboldt.util.geometry.interpolation.model.Arc; -import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; - /** * Grid based interpolation algorithm. * diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/GridUtil.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/GridUtil.java index 9421037ed7..586a13ca94 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/GridUtil.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/grid/GridUtil.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.util.geometry.interpolation.grid; import java.math.BigDecimal; - import org.locationtech.jts.geom.Coordinate; /** diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/ArcByCenterPoint.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/ArcByCenterPoint.java index a012299203..e05f657d4d 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/ArcByCenterPoint.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/ArcByCenterPoint.java @@ -50,9 +50,8 @@ public interface ArcByCenterPoint extends Arc { Angle getEndAngle(); /** - * Get the angle between start and end of the arc. This is a positive value - * if the arc is counter-clockwise, a negative value if the arc is - * clockwise. + * Get the angle between start and end of the arc. This is a positive value if + * the arc is counter-clockwise, a negative value if the arc is clockwise. * * @return the angle between start and end angle (a positive value is * counter-clockwise) diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByCenterPointImpl.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByCenterPointImpl.java index e33f34dcf9..50bab0e548 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByCenterPointImpl.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByCenterPointImpl.java @@ -15,13 +15,11 @@ package eu.esdihumboldt.util.geometry.interpolation.model.impl; -import java.text.MessageFormat; - -import org.locationtech.jts.geom.Coordinate; - import eu.esdihumboldt.util.geometry.interpolation.model.Angle; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; +import java.text.MessageFormat; +import org.locationtech.jts.geom.Coordinate; /** * An arc represented by center point and radius. diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByPointsImpl.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByPointsImpl.java index 8e9371c608..dd0ce63567 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByPointsImpl.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByPointsImpl.java @@ -17,13 +17,11 @@ import static eu.esdihumboldt.util.geometry.interpolation.InterpolationUtil.round; -import java.text.MessageFormat; - -import org.locationtech.jts.geom.Coordinate; - import eu.esdihumboldt.util.geometry.interpolation.model.Angle; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; +import java.text.MessageFormat; +import org.locationtech.jts.geom.Coordinate; /** * An arc represented by three points. diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcStringImpl.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcStringImpl.java index de735844f5..8dc7a0a19f 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcStringImpl.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcStringImpl.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.util.geometry.interpolation.model.impl; +import eu.esdihumboldt.util.geometry.interpolation.model.Arc; +import eu.esdihumboldt.util.geometry.interpolation.model.ArcString; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; -import eu.esdihumboldt.util.geometry.interpolation.model.Arc; -import eu.esdihumboldt.util.geometry.interpolation.model.ArcString; - /** * Represents a string of arcs. * diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/ArcSplitSegment.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/ArcSplitSegment.java index f053d674e1..f2684f719e 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/ArcSplitSegment.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/ArcSplitSegment.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.util.geometry.interpolation.split; -import org.locationtech.jts.geom.Coordinate; - import eu.esdihumboldt.util.geometry.interpolation.ArcSegment; import eu.esdihumboldt.util.geometry.interpolation.model.Angle; import eu.esdihumboldt.util.geometry.interpolation.model.Arc; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl; +import org.locationtech.jts.geom.Coordinate; /** * Segment of an arc for split interpolation. diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/FixedStartEndSplitSegment.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/FixedStartEndSplitSegment.java index 40e9fabde4..22de3d104a 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/FixedStartEndSplitSegment.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/FixedStartEndSplitSegment.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.util.geometry.interpolation.split; -import org.locationtech.jts.geom.Coordinate; - import eu.esdihumboldt.util.geometry.interpolation.model.Arc; +import org.locationtech.jts.geom.Coordinate; /** * Segment of an arc for gridded interpolation with provided fixed start and end diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/SplitInterpolation.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/SplitInterpolation.java index f282cfba29..952fd62813 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/SplitInterpolation.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/interpolation/split/SplitInterpolation.java @@ -15,20 +15,18 @@ package eu.esdihumboldt.util.geometry.interpolation.split; +import eu.esdihumboldt.util.geometry.interpolation.AbstractInterpolationAlgorithm; +import eu.esdihumboldt.util.geometry.interpolation.ArcSegment; +import eu.esdihumboldt.util.geometry.interpolation.InterpolationUtil; +import eu.esdihumboldt.util.geometry.interpolation.model.Arc; +import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; import java.util.ArrayList; import java.util.Deque; import java.util.LinkedList; import java.util.List; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; -import eu.esdihumboldt.util.geometry.interpolation.AbstractInterpolationAlgorithm; -import eu.esdihumboldt.util.geometry.interpolation.ArcSegment; -import eu.esdihumboldt.util.geometry.interpolation.InterpolationUtil; -import eu.esdihumboldt.util.geometry.interpolation.model.Arc; -import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; - /** * Grid based interpolation algorithm. * diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/FixedBoundaryQuadtree.groovy b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/FixedBoundaryQuadtree.groovy index 728ab2787e..ec76437e39 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/FixedBoundaryQuadtree.groovy +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/FixedBoundaryQuadtree.groovy @@ -15,11 +15,10 @@ package eu.esdihumboldt.util.geometry.quadtree +import groovy.transform.CompileStatic import org.locationtech.jts.geom.Envelope import org.locationtech.jts.geom.Point -import groovy.transform.CompileStatic - /** * Quadtree implementation where contained Point geometries all lie within a * pre-determined envelope. diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/Quadtree.java b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/Quadtree.java index 9d7906de30..2e2ecb769d 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/Quadtree.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/Quadtree.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.util.geometry.quadtree; import java.util.Collection; - import org.locationtech.jts.geom.Geometry; /** diff --git a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/QuadtreeBuilder.groovy b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/QuadtreeBuilder.groovy index 2f3efb8047..764fc6def2 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/QuadtreeBuilder.groovy +++ b/util/plugins/eu.esdihumboldt.util.geometry/src/eu/esdihumboldt/util/geometry/quadtree/QuadtreeBuilder.groovy @@ -15,12 +15,11 @@ package eu.esdihumboldt.util.geometry.quadtree +import groovy.transform.CompileStatic import org.locationtech.jts.geom.Envelope import org.locationtech.jts.geom.Geometry import org.locationtech.jts.geom.GeometryFactory -import groovy.transform.CompileStatic - /** * Helper class to build Quadtrees * diff --git a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/DecimalFormatUtilTest.java b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/DecimalFormatUtilTest.java index cfa911b2a3..2e79e42d59 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/DecimalFormatUtilTest.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/DecimalFormatUtilTest.java @@ -18,18 +18,16 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import eu.esdihumboldt.util.format.DecimalFormatUtil; import java.math.BigDecimal; import java.text.DecimalFormat; import java.util.Arrays; import java.util.Collection; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import eu.esdihumboldt.util.format.DecimalFormatUtil; - /** * Test for {@link DecimalFormatUtil} * diff --git a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/WindingOrderTest.java b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/WindingOrderTest.java index 3741f7a040..f0337cfd68 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/WindingOrderTest.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/WindingOrderTest.java @@ -18,16 +18,13 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; import java.util.concurrent.TimeUnit; - import org.geotools.referencing.CRS; import org.junit.BeforeClass; import org.junit.Test; -import org.opengis.referencing.crs.CoordinateReferenceSystem; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryCollection; @@ -35,6 +32,7 @@ import org.locationtech.jts.geom.LinearRing; import org.locationtech.jts.geom.MultiPolygon; import org.locationtech.jts.geom.Polygon; +import org.opengis.referencing.crs.CoordinateReferenceSystem; /** * TODO Type description diff --git a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/AbstractArcTest.java b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/AbstractArcTest.java index 63f6fbd98d..3f9450b5b7 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/AbstractArcTest.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/AbstractArcTest.java @@ -17,15 +17,6 @@ import static org.junit.Assert.assertEquals; -import java.awt.Color; -import java.awt.geom.Arc2D; -import java.io.IOException; -import java.util.function.Consumer; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.Envelope; -import org.locationtech.jts.geom.LineString; - import eu.esdihumboldt.util.geometry.interpolation.model.Arc; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; @@ -33,6 +24,13 @@ import eu.esdihumboldt.util.svg.test.AbstractSVGPainterTest; import eu.esdihumboldt.util.svg.test.PaintSettings; import eu.esdihumboldt.util.svg.test.SVGPainter; +import java.awt.Color; +import java.awt.geom.Arc2D; +import java.io.IOException; +import java.util.function.Consumer; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.LineString; /** * Base class for Arc based tests. @@ -42,8 +40,8 @@ public abstract class AbstractArcTest extends AbstractSVGPainterTest { /** - * Prepare a canvas to draw an arc, perform the given draw operation and - * save the drawing. + * Prepare a canvas to draw an arc, perform the given draw operation and save + * the drawing. * * @param arc the arc to draw * @param draw function that draws on the canvas @@ -67,8 +65,8 @@ private Envelope getArcEnvelope(Arc arc) { } /** - * Prepare a canvas to draw an arc, perform the given draw operation and - * save the drawing. + * Prepare a canvas to draw an arc, perform the given draw operation and save + * the drawing. * * @param arcs the arc string to draw * @param draw function that draws on the canvas @@ -104,14 +102,14 @@ protected void drawName(SVGPainter svg, String name) { svg.setColor(Color.DARK_GRAY); // LineMetrics fontMetrics = svg.getGraphics2D().getFontMetrics().getLineMetrics(name, svg.getGraphics2D()); - svg.getGraphics2D().setFont(svg.getGraphics2D().getFont() - .deriveFont(40.0f)/* .deriveFont(Font.BOLD) */); + svg.getGraphics2D().setFont( + svg.getGraphics2D().getFont().deriveFont(40.0f)/* .deriveFont(Font.BOLD) */); svg.getGraphics2D().drawString(name, 30, 70); } /** - * Draw an arc with markers for the points defining the arc. Saves the - * resulting drawing. + * Draw an arc with markers for the points defining the arc. Saves the resulting + * drawing. * * @param arc the arc to draw * @throws IOException if saving the drawing fails @@ -121,8 +119,8 @@ protected void drawArcWithMarkers(Arc arc) throws IOException { } /** - * Draw an arc with markers for the points defining the arc. Saves the - * resulting drawing. + * Draw an arc with markers for the points defining the arc. Saves the resulting + * drawing. * * @param arc the arc to draw * @param name an optional name for the drawing @@ -147,8 +145,7 @@ protected void drawArcWithMarkers(Arc arc, String name) throws IOException { } /** - * Draw an interpolated arc with debug information. Saves the resulting - * drawing. + * Draw an interpolated arc with debug information. Saves the resulting drawing. * * @param arc the arc to draw * @param gridSize the grid size @@ -173,8 +170,7 @@ protected void drawGridInterpolatedArc(Arc arc, double gridSize, LineString inte } /** - * Draw an interpolated arc with debug information. Saves the resulting - * drawing. + * Draw an interpolated arc with debug information. Saves the resulting drawing. * * @param arc the arc to draw * @param interpolated the interpolated geometry @@ -202,8 +198,8 @@ protected void drawInterpolatedArc(Arc arc, LineString interpolated) throws IOEx } /** - * Draw an interpolated arc string with debug information. Saves the - * resulting drawing. + * Draw an interpolated arc string with debug information. Saves the resulting + * drawing. * * @param arcs the arc string to draw * @param gridSize the grid size @@ -228,8 +224,8 @@ protected void drawGridInterpolatedArcString(ArcString arcs, double gridSize, } /** - * Draw an interpolated arc string with debug information. Saves the - * resulting drawing. + * Draw an interpolated arc string with debug information. Saves the resulting + * drawing. * * @param arcs the arc string to draw * @param interpolated the interpolated geometry diff --git a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/grid/GridInterpolationTest.java b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/grid/GridInterpolationTest.java index 64f02e8758..2871b4cb40 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/grid/GridInterpolationTest.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/grid/GridInterpolationTest.java @@ -18,27 +18,24 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; +import eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest; +import eu.esdihumboldt.util.geometry.interpolation.model.Angle; +import eu.esdihumboldt.util.geometry.interpolation.model.Arc; +import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; +import eu.esdihumboldt.util.geometry.interpolation.model.ArcString; +import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl; +import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByPointsImpl; +import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcStringImpl; import java.io.IOException; import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - import org.junit.Test; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; - -import eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest; -import eu.esdihumboldt.util.geometry.interpolation.model.Angle; -import eu.esdihumboldt.util.geometry.interpolation.model.Arc; -import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; -import eu.esdihumboldt.util.geometry.interpolation.model.ArcString; -import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl; -import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByPointsImpl; -import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcStringImpl; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/grid/GridUtilTest.java b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/grid/GridUtilTest.java index edac108392..03f9a8f8dc 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/grid/GridUtilTest.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/grid/GridUtilTest.java @@ -19,11 +19,8 @@ import static org.junit.Assert.assertTrue; import java.text.MessageFormat; - import org.junit.Test; - import org.locationtech.jts.geom.Coordinate; - import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByCenterPointImplTest.java b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByCenterPointImplTest.java index 0fcf15ea23..007f1e3fa7 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByCenterPointImplTest.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByCenterPointImplTest.java @@ -19,17 +19,14 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import java.io.IOException; - -import org.junit.Test; - -import org.locationtech.jts.geom.Coordinate; - import eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest; import eu.esdihumboldt.util.geometry.interpolation.InterpolationUtil; import eu.esdihumboldt.util.geometry.interpolation.model.Angle; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; +import java.io.IOException; +import org.junit.Test; +import org.locationtech.jts.geom.Coordinate; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByPointsImplTest.java b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByPointsImplTest.java index 05121d0e61..e225109d22 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByPointsImplTest.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/model/impl/ArcByPointsImplTest.java @@ -19,17 +19,14 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import java.io.IOException; - -import org.junit.Test; - -import org.locationtech.jts.geom.Coordinate; - import eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest; import eu.esdihumboldt.util.geometry.interpolation.InterpolationUtil; import eu.esdihumboldt.util.geometry.interpolation.model.Angle; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint; import eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints; +import java.io.IOException; +import org.junit.Test; +import org.locationtech.jts.geom.Coordinate; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/split/SplitInterpolationTest.java b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/split/SplitInterpolationTest.java index c5562ed630..cdbfade6bc 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/split/SplitInterpolationTest.java +++ b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/interpolation/split/SplitInterpolationTest.java @@ -19,19 +19,6 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; -import java.io.IOException; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.junit.Test; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.geom.LineString; - import eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest; import eu.esdihumboldt.util.geometry.interpolation.grid.GridInterpolation; import eu.esdihumboldt.util.geometry.interpolation.model.Angle; @@ -42,6 +29,16 @@ import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByPointsImpl; import eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcStringImpl; +import java.io.IOException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Test; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.LineString; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; diff --git a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/quadtree/QuadtreeTest.groovy b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/quadtree/QuadtreeTest.groovy index 6a202314b2..de57ac01ee 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/quadtree/QuadtreeTest.groovy +++ b/util/plugins/eu.esdihumboldt.util.geometry/test/eu/esdihumboldt/util/geometry/quadtree/QuadtreeTest.groovy @@ -17,6 +17,7 @@ package eu.esdihumboldt.util.geometry.quadtree import static org.junit.Assert.* +import groovy.transform.CompileStatic import org.junit.Test import org.locationtech.jts.geom.Coordinate import org.locationtech.jts.geom.Envelope @@ -24,8 +25,6 @@ import org.locationtech.jts.geom.Geometry import org.locationtech.jts.geom.GeometryFactory import org.locationtech.jts.geom.Point -import groovy.transform.CompileStatic - /** * Tests for quadtree implementations * diff --git a/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/src/eu/esdihumboldt/util/groovy/meta/extension/MetaClassDescriptor.java b/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/src/eu/esdihumboldt/util/groovy/meta/extension/MetaClassDescriptor.java index c4b4e3ef33..564a994320 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/src/eu/esdihumboldt/util/groovy/meta/extension/MetaClassDescriptor.java +++ b/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/src/eu/esdihumboldt/util/groovy/meta/extension/MetaClassDescriptor.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.util.groovy.meta.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.ExtensionUtil; import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; +import org.eclipse.core.runtime.IConfigurationElement; /** * Meta class extension descriptor. diff --git a/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/src/eu/esdihumboldt/util/groovy/meta/extension/MetaClassExtension.java b/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/src/eu/esdihumboldt/util/groovy/meta/extension/MetaClassExtension.java index 3a6b08d778..e9f058a2c7 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/src/eu/esdihumboldt/util/groovy/meta/extension/MetaClassExtension.java +++ b/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/src/eu/esdihumboldt/util/groovy/meta/extension/MetaClassExtension.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.util.groovy.meta.extension; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Extension point for Groovy delegating meta classes. diff --git a/util/plugins/eu.esdihumboldt.util.groovy.meta.fragment/src/groovy/runtime/metaclass/CustomMetaClassCreationHandle.java b/util/plugins/eu.esdihumboldt.util.groovy.meta.fragment/src/groovy/runtime/metaclass/CustomMetaClassCreationHandle.java index 560cf72996..241679c18c 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.meta.fragment/src/groovy/runtime/metaclass/CustomMetaClassCreationHandle.java +++ b/util/plugins/eu.esdihumboldt.util.groovy.meta.fragment/src/groovy/runtime/metaclass/CustomMetaClassCreationHandle.java @@ -15,13 +15,12 @@ package groovy.runtime.metaclass; -import java.lang.reflect.Constructor; - import eu.esdihumboldt.util.groovy.meta.extension.MetaClassDescriptor; import eu.esdihumboldt.util.groovy.meta.extension.MetaClassExtension; import groovy.lang.MetaClass; import groovy.lang.MetaClassRegistry; import groovy.lang.MetaClassRegistry.MetaClassCreationHandle; +import java.lang.reflect.Constructor; /** * Adapts created meta classes with delegating meta classes registered in the @@ -63,8 +62,8 @@ protected MetaClass createNormalMetaClass(@SuppressWarnings("rawtypes") Class th * Check if a meta class descriptor applies to a given class. * * @param descriptor the meta class descriptor - * @param theClass the class for which should be determined if the - * descriptor applies + * @param theClass the class for which should be determined if the descriptor + * applies * @return true if the descriptor applies to the class, * false otherwise */ diff --git a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/DefaultGroovyService.java b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/DefaultGroovyService.java index 1e3f2bf783..988661e6cd 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/DefaultGroovyService.java +++ b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/DefaultGroovyService.java @@ -1,28 +1,25 @@ package eu.esdihumboldt.util.groovy.sandbox; +import de.fhg.igd.eclipse.util.extension.ExtensionUtil; +import eu.esdihumboldt.util.groovy.sandbox.internal.RestrictiveGroovyInterceptor; +import eu.esdihumboldt.util.groovy.sandbox.internal.RestrictiveGroovyInterceptor.AllowedPrefix; +import eu.esdihumboldt.util.groovy.sandbox.internal.SecureScript; +import groovy.lang.Binding; +import groovy.lang.GroovyShell; +import groovy.lang.Script; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.regex.Pattern; - import javax.annotation.Nullable; - import org.codehaus.groovy.control.CompilerConfiguration; import org.codehaus.groovy.control.customizers.ImportCustomizer; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; import org.kohsuke.groovy.sandbox.SandboxTransformer; -import de.fhg.igd.eclipse.util.extension.ExtensionUtil; -import eu.esdihumboldt.util.groovy.sandbox.internal.RestrictiveGroovyInterceptor; -import eu.esdihumboldt.util.groovy.sandbox.internal.RestrictiveGroovyInterceptor.AllowedPrefix; -import eu.esdihumboldt.util.groovy.sandbox.internal.SecureScript; -import groovy.lang.Binding; -import groovy.lang.GroovyShell; -import groovy.lang.Script; - /** * Default implementation of the {@link GroovyService} interface. * @@ -53,8 +50,8 @@ public DefaultGroovyService() { } /** - * @return the Groovy interceptor configured with the allowed classes from - * the extension point. + * @return the Groovy interceptor configured with the allowed classes from the + * extension point. */ public static RestrictiveGroovyInterceptor createInterceptorFromExtensions() { Set> additionalAllowedClasses = new HashSet<>(); @@ -100,12 +97,12 @@ public GroovyShell createShell(Binding binding) { /* * Disable handling Groovy Grape annotations. * - * This mainly serves the purpose to allow external Groovy snippets to - * use Grapes, but have them disabled when imported into hale. + * This mainly serves the purpose to allow external Groovy snippets to use + * Grapes, but have them disabled when imported into hale. * - * If at some point we support Grapes within hale studio, we will want - * to change this behavior. Then we will need to think about how we can - * deal with conflicts on the classpath. + * If at some point we support Grapes within hale studio, we will want to change + * this behavior. Then we will need to think about how we can deal with + * conflicts on the classpath. */ if (cc.getDisabledGlobalASTTransformations() == null) { cc.setDisabledGlobalASTTransformations(new HashSet()); diff --git a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/GroovyRestrictionException.java b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/GroovyRestrictionException.java index d6e39356b2..4acb2df7ea 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/GroovyRestrictionException.java +++ b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/GroovyRestrictionException.java @@ -11,8 +11,8 @@ public class GroovyRestrictionException extends RuntimeException { private static final long serialVersionUID = 1L; /** - * Constructs a new exception with the specified detail message. The cause - * is not initialized, and may subsequently be initialized by a call to + * Constructs a new exception with the specified detail message. The cause is + * not initialized, and may subsequently be initialized by a call to * {@link #initCause}. * * @param message the detail message. The detail message is saved for later diff --git a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/GroovyService.java b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/GroovyService.java index 1b38b4028a..461d7b10cf 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/GroovyService.java +++ b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/GroovyService.java @@ -1,10 +1,9 @@ package eu.esdihumboldt.util.groovy.sandbox; -import javax.annotation.Nullable; - import groovy.lang.Binding; import groovy.lang.GroovyShell; import groovy.lang.Script; +import javax.annotation.Nullable; /** * Groovy sandbox service interface. @@ -21,8 +20,8 @@ public interface GroovyService { public interface ResultProcessor { /** - * Process the script result. It is important that any closures created - * in the script are executed within the processor. + * Process the script result. It is important that any closures created in the + * script are executed within the processor. * * @param script the script * @param returnValue the script return value diff --git a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/internal/RestrictiveGroovyInterceptor.java b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/internal/RestrictiveGroovyInterceptor.java index 3aa23e30b1..4ab57127c5 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/internal/RestrictiveGroovyInterceptor.java +++ b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/internal/RestrictiveGroovyInterceptor.java @@ -15,6 +15,12 @@ package eu.esdihumboldt.util.groovy.sandbox.internal; +import eu.esdihumboldt.util.groovy.sandbox.GroovyRestrictionException; +import groovy.lang.Closure; +import groovy.lang.GString; +import groovy.lang.MissingPropertyException; +import groovy.lang.Range; +import groovy.lang.Script; import java.math.BigDecimal; import java.math.BigInteger; import java.sql.Timestamp; @@ -50,18 +56,10 @@ import java.util.TreeMap; import java.util.UUID; import java.util.regex.Pattern; - import org.codehaus.groovy.runtime.GStringImpl; import org.codehaus.groovy.runtime.InvokerHelper; import org.kohsuke.groovy.sandbox.GroovyInterceptor; -import eu.esdihumboldt.util.groovy.sandbox.GroovyRestrictionException; -import groovy.lang.Closure; -import groovy.lang.GString; -import groovy.lang.MissingPropertyException; -import groovy.lang.Range; -import groovy.lang.Script; - /** * {@link GroovyInterceptor} which allows some basic classes but is pretty * restrictive. Constructor offers parameters to allow more classes. @@ -207,8 +205,8 @@ public class RestrictiveGroovyInterceptor extends GroovyInterceptor { } /** - * AllowedPackage saves information to allow the use of all classes with a - * given prefix. + * AllowedPackage saves information to allow the use of all classes with a given + * prefix. */ public static class AllowedPrefix { @@ -229,8 +227,8 @@ public AllowedPrefix(String prefix, boolean allowChildren) { } /** - * Checks whether the given class is allowed to be used because of this - * allowed package. + * Checks whether the given class is allowed to be used because of this allowed + * package. * * @param clazz the class to test * @return true, if the class may be used, false otherwise @@ -254,13 +252,12 @@ public boolean checkAllowed(Class clazz) { /** * Constructor using additional allowed classes. * - * @param additionalAllowedClasses classes, which may be initialized, and - * all their declared methods may be used - * @param additionalAllAllowedClasses classes, which may be initialized, and - * any call on them is allowed (has to implement methodMissing or - * equal) - * @param additionalAllowedPackages packages whose classes and their - * declared methods may be used + * @param additionalAllowedClasses classes, which may be initialized, and all + * their declared methods may be used + * @param additionalAllAllowedClasses classes, which may be initialized, and any + * call on them is allowed (has to implement methodMissing or equal) + * @param additionalAllowedPackages packages whose classes and their declared + * methods may be used */ public RestrictiveGroovyInterceptor(Set> additionalAllowedClasses, Set> additionalAllAllowedClasses, diff --git a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/test/eu/esdihumboldt/util/groovy/sandbox/test/internal/GroovySandboxTest.java b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/test/eu/esdihumboldt/util/groovy/sandbox/test/internal/GroovySandboxTest.java index a2acd60af4..9c432865da 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/test/eu/esdihumboldt/util/groovy/sandbox/test/internal/GroovySandboxTest.java +++ b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/test/eu/esdihumboldt/util/groovy/sandbox/test/internal/GroovySandboxTest.java @@ -2,17 +2,15 @@ import static org.junit.Assert.fail; +import eu.esdihumboldt.util.groovy.sandbox.internal.RestrictiveGroovyInterceptor; +import eu.esdihumboldt.util.groovy.sandbox.internal.RestrictiveGroovyInterceptor.AllowedPrefix; +import groovy.lang.GroovyShell; import java.util.Collections; - import org.codehaus.groovy.control.CompilerConfiguration; import org.junit.Before; import org.junit.Test; import org.kohsuke.groovy.sandbox.SandboxTransformer; -import eu.esdihumboldt.util.groovy.sandbox.internal.RestrictiveGroovyInterceptor; -import eu.esdihumboldt.util.groovy.sandbox.internal.RestrictiveGroovyInterceptor.AllowedPrefix; -import groovy.lang.GroovyShell; - /** * Test for Groovy sandboxing. * diff --git a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/builder/BuilderBase.groovy b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/builder/BuilderBase.groovy index 551dfb97a5..24f7da10f0 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/builder/BuilderBase.groovy +++ b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/builder/BuilderBase.groovy @@ -18,7 +18,6 @@ package eu.esdihumboldt.util.groovy.builder import groovy.transform.CompileStatic import groovy.transform.TypeChecked import groovy.transform.TypeCheckingMode - import org.codehaus.groovy.runtime.InvokerHelper diff --git a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/collector/GenericCollector.java b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/collector/GenericCollector.java index 3f0d453cbd..1ae5e222e0 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/collector/GenericCollector.java +++ b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/collector/GenericCollector.java @@ -15,14 +15,13 @@ package eu.esdihumboldt.util.groovy.collector; +import groovy.lang.Closure; +import groovy.lang.GroovyObjectSupport; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import groovy.lang.Closure; -import groovy.lang.GroovyObjectSupport; - /** * Thread-safe helper for collecting values. * @@ -193,8 +192,8 @@ public void each(Closure closure) { /** * Iterate over the child collectors. * - * @param closure the closure called for each collector key and collector - * (two arguments) or only the collector (one argument) + * @param closure the closure called for each collector key and collector (two + * arguments) or only the collector (one argument) */ public void eachCollector(Closure closure) { // iterate map diff --git a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/collector/PropertyCollector.java b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/collector/PropertyCollector.java index 26fb40f7c4..e6835b65df 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/collector/PropertyCollector.java +++ b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/collector/PropertyCollector.java @@ -15,15 +15,14 @@ package eu.esdihumboldt.util.groovy.collector; +import groovy.json.JsonOutput; +import groovy.json.JsonSlurper; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import groovy.json.JsonOutput; -import groovy.json.JsonSlurper; - /** * Collector that supports Groovy property access. Values may be any object. * @@ -100,8 +99,8 @@ public C at(String property) { // serialization /** - * Get the collector as map/list structure. This method is not thread safe - * and should not be used while the collector is modified. + * Get the collector as map/list structure. This method is not thread safe and + * should not be used while the collector is modified. * * @param compact if a compact representation should be used * @@ -160,8 +159,8 @@ else if (values.size() == 1) { } /** - * Get the collector as Json string. This method is not thread safe and - * should not be used while the collector is modified. + * Get the collector as Json string. This method is not thread safe and should + * not be used while the collector is modified. * * @param compact if a compact representation should be used * @@ -172,8 +171,8 @@ public String saveToJson(boolean compact) { } /** - * Load the collector from a map/list structure. This method is not thread - * safe and should not be used while the collector is modified. + * Load the collector from a map/list structure. This method is not thread safe + * and should not be used while the collector is modified. * * @param from the list or map to load the collector from */ diff --git a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/json/JsonStreamBuilder.groovy b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/json/JsonStreamBuilder.groovy index 7b13ab3e04..43ef22b313 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/json/JsonStreamBuilder.groovy +++ b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/json/JsonStreamBuilder.groovy @@ -427,5 +427,4 @@ class JsonStreamBuilder extends BuilderBase { // return null instead null } - } diff --git a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/AbstractAccessor.java b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/AbstractAccessor.java index b80969de26..8332964226 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/AbstractAccessor.java +++ b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/AbstractAccessor.java @@ -15,17 +15,14 @@ package eu.esdihumboldt.util.groovy.paths; +import com.google.common.collect.ImmutableList; import groovy.lang.GroovyObjectSupport; import groovy.lang.MissingMethodException; import groovy.lang.MissingPropertyException; - import java.util.Collections; import java.util.List; - import org.codehaus.groovy.runtime.InvokerHelper; -import com.google.common.collect.ImmutableList; - /** * Base class for path accessors. * @@ -44,8 +41,8 @@ public abstract class AbstractAccessor extends GroovyObjectSupport { /** * Creates a new accessor. * - * @param parentPath the root path, usually containing only one path with - * the parent element + * @param parentPath the root path, usually containing only one path with the + * parent element */ public AbstractAccessor(Path parentPath) { this(ImmutableList.of(parentPath)); @@ -54,8 +51,8 @@ public AbstractAccessor(Path parentPath) { /** * Creates a new accessor. * - * @param initialPaths the initial paths, usually containing only one path - * with the parent element + * @param initialPaths the initial paths, usually containing only one path with + * the parent element */ public AbstractAccessor(List> initialPaths) { this.accessorPaths = initialPaths; @@ -138,8 +135,8 @@ public Path eval() { * * @param unique if the path must be unique * @return a child path or null if none was found - * @throws IllegalStateException if there are multiple paths but a unique - * path was requested + * @throws IllegalStateException if there are multiple paths but a unique path + * was requested */ public Path eval(boolean unique) { if (accessorPaths == null || accessorPaths.isEmpty()) { diff --git a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/PathImpl.java b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/PathImpl.java index 4984ad516d..24464eddb4 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/PathImpl.java +++ b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/PathImpl.java @@ -15,9 +15,8 @@ package eu.esdihumboldt.util.groovy.paths; -import java.util.List; - import com.google.common.collect.ImmutableList; +import java.util.List; /** * Path base implementation. This path implementation does not allow diff --git a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/PathWithNulls.java b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/PathWithNulls.java index 6430e0682b..2aeafa9797 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/PathWithNulls.java +++ b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/paths/PathWithNulls.java @@ -15,12 +15,11 @@ package eu.esdihumboldt.util.groovy.paths; +import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import com.google.common.collect.ImmutableList; - /** * Path implementation that supports . * diff --git a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/xml/NSDOMBuilder.groovy b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/xml/NSDOMBuilder.groovy index 20405e2eca..810a6139bf 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/xml/NSDOMBuilder.groovy +++ b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/xml/NSDOMBuilder.groovy @@ -17,19 +17,16 @@ package eu.esdihumboldt.util.groovy.xml -import javax.xml.parsers.DocumentBuilder -import javax.xml.parsers.DocumentBuilderFactory -import javax.xml.parsers.ParserConfigurationException - -import org.w3c.dom.Document -import org.w3c.dom.Element - import com.google.common.collect.ImmutableMap - import groovy.transform.CompileStatic import groovy.xml.DOMBuilder import groovy.xml.FactorySupport import groovy.xml.QName +import javax.xml.parsers.DocumentBuilder +import javax.xml.parsers.DocumentBuilderFactory +import javax.xml.parsers.ParserConfigurationException +import org.w3c.dom.Document +import org.w3c.dom.Element /** diff --git a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/xml/NSDOMCategory.groovy b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/xml/NSDOMCategory.groovy index 9de211e56b..54a184df3d 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/xml/NSDOMCategory.groovy +++ b/util/plugins/eu.esdihumboldt.util.groovy/src/eu/esdihumboldt/util/groovy/xml/NSDOMCategory.groovy @@ -17,7 +17,6 @@ package eu.esdihumboldt.util.groovy.xml; import groovy.transform.CompileStatic import groovy.xml.dom.DOMCategory - import org.w3c.dom.Element import org.w3c.dom.Node import org.w3c.dom.NodeList @@ -68,7 +67,7 @@ public class NSDOMCategory extends DOMCategory { for (int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if (node instanceof Element && (localName == null || node.getLocalName().equals(localName)) - && (ns == null || ns.equals(node.getNamespaceURI()))) { + && (ns == null || ns.equals(node.getNamespaceURI()))) { return (Element) node; } } @@ -90,7 +89,7 @@ public class NSDOMCategory extends DOMCategory { for (int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if (node instanceof Element && node.getLocalName().equals(localName) - && (ns == null || ns.equals(node.getNamespaceURI()))) { + && (ns == null || ns.equals(node.getNamespaceURI()))) { result.add((Element) node); } } diff --git a/util/plugins/eu.esdihumboldt.util.groovy/test/eu/esdihumboldt/util/groovy/collector/StatsCollectorTest.groovy b/util/plugins/eu.esdihumboldt.util.groovy/test/eu/esdihumboldt/util/groovy/collector/StatsCollectorTest.groovy index c18ae146d9..316690b592 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/test/eu/esdihumboldt/util/groovy/collector/StatsCollectorTest.groovy +++ b/util/plugins/eu.esdihumboldt.util.groovy/test/eu/esdihumboldt/util/groovy/collector/StatsCollectorTest.groovy @@ -16,8 +16,8 @@ package eu.esdihumboldt.util.groovy.collector import static org.junit.Assert.* -import groovy.json.JsonOutput +import groovy.json.JsonOutput import org.junit.Test /** diff --git a/util/plugins/eu.esdihumboldt.util.groovy/test/eu/esdihumboldt/util/groovy/xml/NSDOMBuilderTest.groovy b/util/plugins/eu.esdihumboldt.util.groovy/test/eu/esdihumboldt/util/groovy/xml/NSDOMBuilderTest.groovy index dce3c863fe..b359bca4af 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/test/eu/esdihumboldt/util/groovy/xml/NSDOMBuilderTest.groovy +++ b/util/plugins/eu.esdihumboldt.util.groovy/test/eu/esdihumboldt/util/groovy/xml/NSDOMBuilderTest.groovy @@ -15,25 +15,22 @@ package eu.esdihumboldt.util.groovy.xml -import org.junit.Test +import static org.junit.Assert.assertEquals +import static org.junit.Assert.assertTrue +import groovy.transform.CompileStatic +import groovy.xml.DOMBuilder +import groovy.xml.QName +import groovy.xml.dom.DOMCategory import javax.xml.transform.OutputKeys import javax.xml.transform.Transformer import javax.xml.transform.TransformerFactory import javax.xml.transform.dom.DOMSource import javax.xml.transform.stream.StreamResult - +import org.junit.Test import org.w3c.dom.Element import org.w3c.dom.Node -import groovy.transform.CompileStatic -import groovy.xml.DOMBuilder -import groovy.xml.QName -import groovy.xml.dom.DOMCategory - -import static org.junit.Assert.assertEquals -import static org.junit.Assert.assertTrue - /** * Tests for {@link NSDOMBuilder}. diff --git a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/ProxyUtil.java b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/ProxyUtil.java index 089dd4ce3c..8290b5e8ed 100644 --- a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/ProxyUtil.java +++ b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/ProxyUtil.java @@ -16,6 +16,8 @@ package eu.esdihumboldt.util.http; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import java.net.Proxy; import java.net.ProxySelector; import java.net.URI; @@ -23,9 +25,6 @@ import java.util.List; import java.util.Set; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; - /** * Proxy utility methods * @@ -65,26 +64,24 @@ public static Proxy findProxy(URI uri) { return Proxy.NO_PROXY; /* - * The following code is obsolete System properties are handled - * correctly by proxy selector The only thing that the code supports - * additionally is setting using a proxy for the host that is the proxy - * host + * The following code is obsolete System properties are handled correctly by + * proxy selector The only thing that the code supports additionally is setting + * using a proxy for the host that is the proxy host */ /* * String strProxyHost = System.getProperty("http.proxyHost"); String - * strProxyPort = System.getProperty("http.proxyPort"); String - * strNonProxyHosts = System.getProperty("http.nonProxyHosts"); String[] - * nonProxyHosts; if (strNonProxyHosts != null) { nonProxyHosts = - * strNonProxyHosts.split("\\|"); } else { nonProxyHosts = new - * String[0]; } + * strProxyPort = System.getProperty("http.proxyPort"); String strNonProxyHosts + * = System.getProperty("http.nonProxyHosts"); String[] nonProxyHosts; if + * (strNonProxyHosts != null) { nonProxyHosts = strNonProxyHosts.split("\\|"); } + * else { nonProxyHosts = new String[0]; } * - * if (strProxyHost != null && strProxyPort != null) { boolean noProxy = - * false; for (int i = 0; i < nonProxyHosts.length; ++i) { if - * (nonProxyHosts[i].equalsIgnoreCase(uri.getHost())) { noProxy = true; - * break; } } + * if (strProxyHost != null && strProxyPort != null) { boolean noProxy = false; + * for (int i = 0; i < nonProxyHosts.length; ++i) { if + * (nonProxyHosts[i].equalsIgnoreCase(uri.getHost())) { noProxy = true; break; } + * } * - * if (!noProxy) { int proxyPort = Integer.parseInt(strProxyPort); - * return new InetSocketAddress(strProxyHost, proxyPort); } } + * if (!noProxy) { int proxyPort = Integer.parseInt(strProxyPort); return new + * InetSocketAddress(strProxyHost, proxyPort); } } * * return null; */ diff --git a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/ClientProxyUtil.java b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/ClientProxyUtil.java index 4dd3c1b7a1..f4a16e948f 100644 --- a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/ClientProxyUtil.java +++ b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/ClientProxyUtil.java @@ -16,10 +16,12 @@ package eu.esdihumboldt.util.http.client; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.util.http.ProxyUtil; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.Proxy.Type; - import org.apache.http.HttpHost; import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; @@ -30,10 +32,6 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.ProxyAuthenticationStrategy; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.util.http.ProxyUtil; - /** * Proxy utility methods related to the Apache HTTP client API. * diff --git a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/ClientUtil.java b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/ClientUtil.java index 4af1071aa0..3e749d0138 100644 --- a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/ClientUtil.java +++ b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/ClientUtil.java @@ -16,13 +16,12 @@ package eu.esdihumboldt.util.http.client; +import eu.esdihumboldt.util.http.client.metrics.PoolingHttpClientConnectionManagerMetrics; +import eu.esdihumboldt.util.metrics.CollectorRegistryService; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import eu.esdihumboldt.util.http.client.metrics.PoolingHttpClientConnectionManagerMetrics; -import eu.esdihumboldt.util.metrics.CollectorRegistryService; - /** * HTTP client utilities * @@ -61,9 +60,9 @@ public static HttpClientBuilder threadSafeHttpClientBuilder(String clientName) { * null to use the default (20) * @param maxConnPerRoute the maximum number of connections per route or * null to use the default (2) - * @param enablePerHostMetrics if metrics that include information on routes - * per individual host should be collected (if metric collection - * is enabled) + * @param enablePerHostMetrics if metrics that include information on routes per + * individual host should be collected (if metric collection is + * enabled) * * @return the created HTTP client */ diff --git a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/fluent/FluentProxyUtil.java b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/fluent/FluentProxyUtil.java index 5789a13218..aee263bf68 100644 --- a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/fluent/FluentProxyUtil.java +++ b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/fluent/FluentProxyUtil.java @@ -16,19 +16,17 @@ package eu.esdihumboldt.util.http.client.fluent; +import eu.esdihumboldt.util.http.ProxyUtil; +import eu.esdihumboldt.util.http.client.ClientProxyUtil; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.Proxy.Type; - import org.apache.http.HttpHost; import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; import org.apache.http.client.fluent.Executor; import org.apache.http.client.fluent.Request; -import eu.esdihumboldt.util.http.ProxyUtil; -import eu.esdihumboldt.util.http.client.ClientProxyUtil; - /** * Proxy utility methods related to the Apache HTTP fluent client API. * diff --git a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/metrics/PoolingHttpClientConnectionManagerMetrics.java b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/metrics/PoolingHttpClientConnectionManagerMetrics.java index 1ea1ee64eb..6935531990 100644 --- a/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/metrics/PoolingHttpClientConnectionManagerMetrics.java +++ b/util/plugins/eu.esdihumboldt.util.http/src/eu/esdihumboldt/util/http/client/metrics/PoolingHttpClientConnectionManagerMetrics.java @@ -15,23 +15,20 @@ package eu.esdihumboldt.util.http.client.metrics; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.apache.http.conn.routing.HttpRoute; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.apache.http.pool.PoolStats; - import com.google.common.collect.ImmutableList; - import eu.esdihumboldt.util.Pair; import eu.esdihumboldt.util.metrics.CollectorRegistryService; import eu.esdihumboldt.util.metrics.MetricsProvider; import io.prometheus.client.Collector; import io.prometheus.client.CollectorRegistry; import io.prometheus.client.GaugeMetricFamily; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.apache.http.conn.routing.HttpRoute; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.pool.PoolStats; /** * Metrics collector for {@link PoolingHttpClientConnectionManager}. @@ -53,15 +50,13 @@ public class PoolingHttpClientConnectionManagerMetrics extends Collector */ /** - * Install a metric collector for a - * {@link PoolingHttpClientConnectionManager}. + * Install a metric collector for a {@link PoolingHttpClientConnectionManager}. * * @param connectionManager the connection manager * @param clientName the client name the metrics should be labeled with - * @param enablePerHostMetrics if metrics that include information on routes - * per individual host should be collected - * @param service the service for registering with the - * {@link CollectorRegistry} + * @param enablePerHostMetrics if metrics that include information on routes per + * individual host should be collected + * @param service the service for registering with the {@link CollectorRegistry} */ public static void install(PoolingHttpClientConnectionManager connectionManager, String clientName, boolean enablePerHostMetrics, CollectorRegistryService service) { @@ -120,13 +115,12 @@ public static void install(PoolingHttpClientConnectionManager connectionManager, private final List clientNameAndLeased; /** - * Create a metric collector for a - * {@link PoolingHttpClientConnectionManager}. + * Create a metric collector for a {@link PoolingHttpClientConnectionManager}. * * @param connectionManager the connection manager * @param clientName the client name the metrics should be labeled with - * @param enablePerHostMetrics if metrics that include information on routes - * per individual host should be collected + * @param enablePerHostMetrics if metrics that include information on routes per + * individual host should be collected */ public PoolingHttpClientConnectionManagerMetrics( PoolingHttpClientConnectionManager connectionManager, String clientName, diff --git a/util/plugins/eu.esdihumboldt.util.metrics/src/eu/esdihumboldt/util/metrics/CollectorRegistryService.java b/util/plugins/eu.esdihumboldt.util.metrics/src/eu/esdihumboldt/util/metrics/CollectorRegistryService.java index 2309891564..ebaca3eba3 100644 --- a/util/plugins/eu.esdihumboldt.util.metrics/src/eu/esdihumboldt/util/metrics/CollectorRegistryService.java +++ b/util/plugins/eu.esdihumboldt.util.metrics/src/eu/esdihumboldt/util/metrics/CollectorRegistryService.java @@ -15,10 +15,9 @@ package eu.esdihumboldt.util.metrics; -import java.util.function.Supplier; - import eu.esdihumboldt.util.metrics.impl.HaleCollectorRegistryService; import io.prometheus.client.CollectorRegistry; +import java.util.function.Supplier; /** * Service interface for providing access to the platform @@ -31,9 +30,8 @@ public interface CollectorRegistryService { /** * Default registry service * - * Note: Originally wanted to provide this via hale service provider - * mechanism, but this lead to not easily resolvable bundle dependency - * cycles. + * Note: Originally wanted to provide this via hale service provider mechanism, + * but this lead to not easily resolvable bundle dependency cycles. */ CollectorRegistryService DEFAULT = new HaleCollectorRegistryService( CollectorRegistry.defaultRegistry); @@ -41,8 +39,8 @@ public interface CollectorRegistryService { /** * Register a metric provider. * - * @param metricsProvider supplier for metrics provider that is called only - * if metric collection is enabled + * @param metricsProvider supplier for metrics provider that is called only if + * metric collection is enabled */ void register(Supplier metricsProvider); diff --git a/util/plugins/eu.esdihumboldt.util.metrics/src/eu/esdihumboldt/util/metrics/impl/HaleCollectorRegistryService.java b/util/plugins/eu.esdihumboldt.util.metrics/src/eu/esdihumboldt/util/metrics/impl/HaleCollectorRegistryService.java index f9abd54ec9..0bb5391399 100644 --- a/util/plugins/eu.esdihumboldt.util.metrics/src/eu/esdihumboldt/util/metrics/impl/HaleCollectorRegistryService.java +++ b/util/plugins/eu.esdihumboldt.util.metrics/src/eu/esdihumboldt/util/metrics/impl/HaleCollectorRegistryService.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.util.metrics.impl; -import java.util.function.Supplier; - import eu.esdihumboldt.util.metrics.CollectorRegistryService; import eu.esdihumboldt.util.metrics.MetricsProvider; import io.prometheus.client.CollectorRegistry; +import java.util.function.Supplier; /** * Default implementation of {@link CollectorRegistryService}. diff --git a/util/plugins/eu.esdihumboldt.util.nonosgi/src/main/java/eu/esdihumboldt/util/nonosgi/CustomMetaClassCreationHandle.java b/util/plugins/eu.esdihumboldt.util.nonosgi/src/main/java/eu/esdihumboldt/util/nonosgi/CustomMetaClassCreationHandle.java index 0afeaeb33c..11c4c48411 100644 --- a/util/plugins/eu.esdihumboldt.util.nonosgi/src/main/java/eu/esdihumboldt/util/nonosgi/CustomMetaClassCreationHandle.java +++ b/util/plugins/eu.esdihumboldt.util.nonosgi/src/main/java/eu/esdihumboldt/util/nonosgi/CustomMetaClassCreationHandle.java @@ -1,15 +1,13 @@ package eu.esdihumboldt.util.nonosgi; -import java.lang.reflect.Constructor; -import java.util.stream.Collectors; - -import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper; - import eu.esdihumboldt.util.groovy.meta.extension.MetaClassDescriptor; import eu.esdihumboldt.util.groovy.meta.extension.MetaClassExtension; import groovy.lang.MetaClass; import groovy.lang.MetaClassRegistry; import groovy.lang.MetaClassRegistry.MetaClassCreationHandle; +import java.lang.reflect.Constructor; +import java.util.stream.Collectors; +import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,83 +19,85 @@ */ public class CustomMetaClassCreationHandle extends MetaClassCreationHandle { - private static final Logger log = LoggerFactory.getLogger(CustomMetaClassCreationHandle.class); + private static final Logger log = LoggerFactory.getLogger(CustomMetaClassCreationHandle.class); - private final MetaClassExtension ext; + private final MetaClassExtension ext; - public CustomMetaClassCreationHandle() { - // initialize registry - RegistryFactoryHelper.getRegistry(); + public CustomMetaClassCreationHandle() { + // initialize registry + RegistryFactoryHelper.getRegistry(); - ext = new MetaClassExtension(); + ext = new MetaClassExtension(); - if (log.isDebugEnabled()) { + if (log.isDebugEnabled()) { - var elements = ext.getElements(); - if (elements.isEmpty()) { - log.debug("No registered meta class descriptors"); - } - else { - var list = elements.stream().map(d -> d.getMetaClass() + " applied to " + d.getForClass()).collect(Collectors.joining("\n ")); - log.debug("Registered meta class descriptors:\n " + list); - } - } - } + var elements = ext.getElements(); + if (elements.isEmpty()) { + log.debug("No registered meta class descriptors"); + } + else { + var list = elements.stream() + .map(d -> d.getMetaClass() + " applied to " + d.getForClass()) + .collect(Collectors.joining("\n ")); + log.debug("Registered meta class descriptors:\n " + list); + } + } + } - @Override - protected MetaClass createNormalMetaClass(@SuppressWarnings("rawtypes") Class theClass, - MetaClassRegistry registry) { - MetaClass metaClass = super.createNormalMetaClass(theClass, registry); + @Override + protected MetaClass createNormalMetaClass(@SuppressWarnings("rawtypes") Class theClass, + MetaClassRegistry registry) { + MetaClass metaClass = super.createNormalMetaClass(theClass, registry); - for (MetaClassDescriptor descriptor : ext.getElements()) { - if (descriptorApplies(descriptor, theClass)) { - // create meta class - Class delegatingMetaClass = descriptor.getMetaClass(); - try { - Constructor constructor = delegatingMetaClass - .getConstructor(MetaClass.class); - metaClass = (MetaClass) constructor.newInstance(metaClass); - } catch (Exception e) { - e.printStackTrace(); - } - } - } + for (MetaClassDescriptor descriptor : ext.getElements()) { + if (descriptorApplies(descriptor, theClass)) { + // create meta class + Class delegatingMetaClass = descriptor.getMetaClass(); + try { + Constructor constructor = delegatingMetaClass + .getConstructor(MetaClass.class); + metaClass = (MetaClass) constructor.newInstance(metaClass); + } catch (Exception e) { + e.printStackTrace(); + } + } + } - return metaClass; - } + return metaClass; + } - /** - * Check if a meta class descriptor applies to a given class. - * - * @param descriptor the meta class descriptor - * @param theClass the class for which should be determined if the - * descriptor applies - * @return true if the descriptor applies to the class, - * false otherwise - */ - private boolean descriptorApplies(MetaClassDescriptor descriptor, - @SuppressWarnings("rawtypes") Class theClass) { - Class forClass = descriptor.getForClass(); - if (descriptor.isForArray()) { - if (theClass.isArray()) { - Class componentClass = theClass.getComponentType(); - if (componentClass != null) { - return forClass.equals(componentClass) - || forClass.isAssignableFrom(componentClass); - } - else { - // should actually not happen - return false; - } - } - else { - // no array - return false; - } - } - else { - return forClass.equals(theClass) || forClass.isAssignableFrom(theClass); - } - } + /** + * Check if a meta class descriptor applies to a given class. + * + * @param descriptor the meta class descriptor + * @param theClass the class for which should be determined if the descriptor + * applies + * @return true if the descriptor applies to the class, + * false otherwise + */ + private boolean descriptorApplies(MetaClassDescriptor descriptor, + @SuppressWarnings("rawtypes") Class theClass) { + Class forClass = descriptor.getForClass(); + if (descriptor.isForArray()) { + if (theClass.isArray()) { + Class componentClass = theClass.getComponentType(); + if (componentClass != null) { + return forClass.equals(componentClass) + || forClass.isAssignableFrom(componentClass); + } + else { + // should actually not happen + return false; + } + } + else { + // no array + return false; + } + } + else { + return forClass.equals(theClass) || forClass.isAssignableFrom(theClass); + } + } } diff --git a/util/plugins/eu.esdihumboldt.util.nonosgi/src/main/java/eu/esdihumboldt/util/nonosgi/Init.java b/util/plugins/eu.esdihumboldt.util.nonosgi/src/main/java/eu/esdihumboldt/util/nonosgi/Init.java index ccb526e4dd..496e210e88 100644 --- a/util/plugins/eu.esdihumboldt.util.nonosgi/src/main/java/eu/esdihumboldt/util/nonosgi/Init.java +++ b/util/plugins/eu.esdihumboldt.util.nonosgi/src/main/java/eu/esdihumboldt/util/nonosgi/Init.java @@ -1,12 +1,10 @@ package eu.esdihumboldt.util.nonosgi; +import groovy.lang.GroovySystem; import java.util.concurrent.atomic.AtomicBoolean; - import org.eclipse.equinox.nonosgi.registry.RegistryFactoryHelper; import org.slf4j.bridge.SLF4JBridgeHandler; -import groovy.lang.GroovySystem; - /** * Initializes hale functionality in a non-OSGi environment. * @@ -14,18 +12,19 @@ */ public class Init { - private static AtomicBoolean initialized = new AtomicBoolean(false); + private static AtomicBoolean initialized = new AtomicBoolean(false); - public static void init() { - if (initialized.compareAndSet(false, true)) { - SLF4JBridgeHandler.install(); + public static void init() { + if (initialized.compareAndSet(false, true)) { + SLF4JBridgeHandler.install(); - // initialize registry - RegistryFactoryHelper.getRegistry(); + // initialize registry + RegistryFactoryHelper.getRegistry(); - // initialize meta extensions - GroovySystem.getMetaClassRegistry().setMetaClassCreationHandle(new CustomMetaClassCreationHandle()); - } - } + // initialize meta extensions + GroovySystem.getMetaClassRegistry() + .setMetaClassCreationHandle(new CustomMetaClassCreationHandle()); + } + } } diff --git a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/AbstractDocumentTest.java b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/AbstractDocumentTest.java index 137a99955e..e74f872026 100644 --- a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/AbstractDocumentTest.java +++ b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/AbstractDocumentTest.java @@ -18,22 +18,20 @@ import static org.junit.Assert.assertEquals; +import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; +import com.orientechnologies.orient.core.query.nativ.ONativeSynchQuery; +import com.orientechnologies.orient.core.query.nativ.OQueryContextNative; +import com.orientechnologies.orient.core.record.impl.ODocument; +import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; -import com.orientechnologies.orient.core.query.nativ.ONativeSynchQuery; -import com.orientechnologies.orient.core.query.nativ.OQueryContextNative; -import com.orientechnologies.orient.core.record.impl.ODocument; -import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; - /** * Basic tests on the document based DB * diff --git a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/BrowseClassIterateTest.java b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/BrowseClassIterateTest.java index 2255317910..f3a7c13eb3 100644 --- a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/BrowseClassIterateTest.java +++ b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/BrowseClassIterateTest.java @@ -21,19 +21,17 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; +import com.orientechnologies.orient.core.iterator.ORecordIteratorClass; +import com.orientechnologies.orient.core.record.impl.ODocument; import java.io.File; import java.util.UUID; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; -import com.orientechnologies.orient.core.iterator.ORecordIteratorClass; -import com.orientechnologies.orient.core.record.impl.ODocument; - /** * Test the iterator provided through browseClass. * diff --git a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/LocalDocumentTest.java b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/LocalDocumentTest.java index 00552fe6e8..c65b116848 100644 --- a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/LocalDocumentTest.java +++ b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/LocalDocumentTest.java @@ -18,17 +18,15 @@ import static org.junit.Assert.assertEquals; +import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import java.io.File; import java.util.UUID; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; - import org.junit.Test; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; - /** * Tests basic functions in the document based DB in the file system * diff --git a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/MemoryDocumentTest.java b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/MemoryDocumentTest.java index 0bf9cc2bb6..a55d55da37 100644 --- a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/MemoryDocumentTest.java +++ b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/test/eu/esdihumboldt/util/orient/embedded/MemoryDocumentTest.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.util.orient.embedded; -import java.util.UUID; - import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; +import java.util.UUID; /** * Tests basic functions in the document based DB in memory diff --git a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/ResourceResolver.java b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/ResourceResolver.java index 8a37398919..5e7b79d91f 100644 --- a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/ResourceResolver.java +++ b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/ResourceResolver.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.util.resource; +import eu.esdihumboldt.util.io.InputSupplier; import java.io.InputStream; import java.net.URI; -import eu.esdihumboldt.util.io.InputSupplier; - /** * Resolve URIs to an input supplier. * diff --git a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/Resources.java b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/Resources.java index 33586891f1..0678e5f022 100644 --- a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/Resources.java +++ b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/Resources.java @@ -16,17 +16,15 @@ package eu.esdihumboldt.util.resource; -import java.io.InputStream; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; - import eu.esdihumboldt.util.io.InputSupplier; import eu.esdihumboldt.util.resource.internal.ResolverConfiguration; import eu.esdihumboldt.util.resource.internal.ResolverExtension; +import java.io.InputStream; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; /** * Utility methods for the resource extensions. @@ -46,8 +44,8 @@ public abstract class Resources implements ResourcesConstants { * @param uri the URI to the resource * @param resourceType the resource type, null for any resource * type - * @return an input supplier for the resource or null if it was - * not found through resource resolvers + * @return an input supplier for the resource or null if it was not + * found through resource resolvers */ public static final InputSupplier tryResolve(URI uri, String resourceType) { diff --git a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/BundleResolver.java b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/BundleResolver.java index 2763992710..3dc0fa7e32 100644 --- a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/BundleResolver.java +++ b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/BundleResolver.java @@ -16,22 +16,20 @@ package eu.esdihumboldt.util.resource.internal; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.util.io.InputSupplier; +import eu.esdihumboldt.util.resource.ResourceNotFoundException; +import eu.esdihumboldt.util.resource.ResourceResolver; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.net.URL; import java.util.Enumeration; - import org.eclipse.core.runtime.IConfigurationElement; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.util.io.InputSupplier; -import eu.esdihumboldt.util.resource.ResourceNotFoundException; -import eu.esdihumboldt.util.resource.ResourceResolver; - /** * Resource resolver that attempts to find a resource at the URI path in the * bundle that registered the resolver as extension. @@ -103,7 +101,8 @@ public InputStream getInput() throws IOException { final ClassLoader loader = getClass().getClassLoader(); // ClassLoader.getSystemClassLoader(); String pathCandidate = uri.getPath(); final String path = (pathCandidate != null && pathCandidate.startsWith("/")) - ? (pathCandidate.substring(1)) : (pathCandidate); + ? (pathCandidate.substring(1)) + : (pathCandidate); Enumeration resources; try { resources = loader.getResources(path); diff --git a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResolverConfiguration.java b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResolverConfiguration.java index d3e337e5cb..f39c4029a6 100644 --- a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResolverConfiguration.java +++ b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResolverConfiguration.java @@ -16,15 +16,13 @@ package eu.esdihumboldt.util.resource.internal; +import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; +import eu.esdihumboldt.util.resource.ResourceResolver; import java.util.Collections; import java.util.HashSet; import java.util.Set; - import org.eclipse.core.runtime.IConfigurationElement; -import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension.Identifiable; -import eu.esdihumboldt.util.resource.ResourceResolver; - /** * A resolver and its configuration. * diff --git a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResolverExtension.java b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResolverExtension.java index 93f83ff1e1..e766f7d410 100644 --- a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResolverExtension.java +++ b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResolverExtension.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.util.resource.internal; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Resource resolver extension. diff --git a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResourceType.java b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResourceType.java index 810d9bbd8a..f3f446c131 100644 --- a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResourceType.java +++ b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResourceType.java @@ -48,8 +48,8 @@ public String getId() { } /** - * Get the resource type name. If no name was explicitly specified the name - * is equal to the resource type ID. + * Get the resource type name. If no name was explicitly specified the name is + * equal to the resource type ID. * * @return the resource type name */ diff --git a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResourceTypeExtension.java b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResourceTypeExtension.java index 4079b9020a..eda22133b1 100644 --- a/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResourceTypeExtension.java +++ b/util/plugins/eu.esdihumboldt.util.resource/src/eu/esdihumboldt/util/resource/internal/ResourceTypeExtension.java @@ -16,9 +16,8 @@ package eu.esdihumboldt.util.resource.internal; -import org.eclipse.core.runtime.IConfigurationElement; - import de.fhg.igd.eclipse.util.extension.simple.IdentifiableExtension; +import org.eclipse.core.runtime.IConfigurationElement; /** * Resource type extension diff --git a/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/AbstractSVGPainterTest.java b/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/AbstractSVGPainterTest.java index 174574b334..0d1ebd8d47 100644 --- a/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/AbstractSVGPainterTest.java +++ b/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/AbstractSVGPainterTest.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; - import ru.yandex.qatools.allure.annotations.Attachment; /** diff --git a/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/PaintSettings.java b/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/PaintSettings.java index d6f0d5f4e8..4ab31d90b9 100644 --- a/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/PaintSettings.java +++ b/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/PaintSettings.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.util.svg.test; import java.awt.Dimension; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Envelope; @@ -41,10 +40,8 @@ public class PaintSettings { * Create a new settings object based on the given values. * * @param scaleFactor the scale factor - * @param minX the offset on the X axis (which is subtracted from X - * ordinates) - * @param maxY the offset on the Y axis (which Y ordinates are substracted - * from) + * @param minX the offset on the X axis (which is subtracted from X ordinates) + * @param maxY the offset on the Y axis (which Y ordinates are substracted from) * @param pointSize the size of individual drawn points * @param canvasSize the canvas size or null */ diff --git a/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/SVGPainter.java b/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/SVGPainter.java index ced8f9f18b..d6f29192b3 100644 --- a/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/SVGPainter.java +++ b/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/SVGPainter.java @@ -25,17 +25,15 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; - import org.apache.batik.dom.GenericDOMImplementation; import org.apache.batik.svggen.SVGGraphics2D; -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; - import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.Point; import org.locationtech.jts.geom.Polygon; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; /** * Helper for painting (geometries) to an SVG image. diff --git a/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/SVGPainterTest.java b/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/SVGPainterTest.java index c3aa7b45bc..359e64c82d 100644 --- a/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/SVGPainterTest.java +++ b/util/plugins/eu.esdihumboldt.util.svg.test/src/eu/esdihumboldt/util/svg/test/SVGPainterTest.java @@ -17,9 +17,7 @@ import java.awt.Color; import java.io.IOException; - import org.junit.Test; - import org.locationtech.jts.geom.Coordinate; /** diff --git a/util/plugins/eu.esdihumboldt.util.test/src/main/java/eu/esdihumboldt/util/test/AbstractPlatformTest.java b/util/plugins/eu.esdihumboldt.util.test/src/main/java/eu/esdihumboldt/util/test/AbstractPlatformTest.java index fa6d3e5b6d..2e716728ad 100644 --- a/util/plugins/eu.esdihumboldt.util.test/src/main/java/eu/esdihumboldt/util/test/AbstractPlatformTest.java +++ b/util/plugins/eu.esdihumboldt.util.test/src/main/java/eu/esdihumboldt/util/test/AbstractPlatformTest.java @@ -8,9 +8,9 @@ */ public abstract class AbstractPlatformTest { - @BeforeClass - public static void init() { - Init.init(); - } + @BeforeClass + public static void init() { + Init.init(); + } } diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/CustomIdentifiers.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/CustomIdentifiers.java index 4dadcee517..441dd845c5 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/CustomIdentifiers.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/CustomIdentifiers.java @@ -52,8 +52,8 @@ public CustomIdentifiers(String prefix, boolean useEquals) { * * @param object the object to identify * @param desiredId the desired identifier - * @return the object identifier, if the identifier was newly assigned this - * is either the desiredId or the desiredId with a suffix + * @return the object identifier, if the identifier was newly assigned this is + * either the desiredId or the desiredId with a suffix */ public String getId(T object, final String desiredId) { String currentId = fetchId(object); diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/DependencyOrderedList.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/DependencyOrderedList.java index a1872227ff..045b9803d4 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/DependencyOrderedList.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/DependencyOrderedList.java @@ -103,8 +103,8 @@ private void insert(T object, Map> dependencies, Set alreadyInserte * Find an object in the list * * @param object the object to find - * @return the object's index or -1 if there is no such object - * in the list + * @return the object's index or -1 if there is no such object in + * the list */ private int find(T object) { return list.indexOf(object); diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/Identifiers.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/Identifiers.java index 3ed1cfb225..d2cf443737 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/Identifiers.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/Identifiers.java @@ -31,8 +31,8 @@ public class Identifiers extends IdentifiersBase { * Creates Identifiers with type name prefix * * @param clazz the object type - * @param useEquals if the objects shall be compared using equals instead of - * the == operator + * @param useEquals if the objects shall be compared using equals instead of the + * == operator */ public Identifiers(Class clazz, boolean useEquals) { this(clazz.getSimpleName() + "_", useEquals); @@ -42,8 +42,8 @@ public Identifiers(Class clazz, boolean useEquals) { * Creates Identifiers with the given prefix * * @param prefix the identifier prefix - * @param useEquals if the objects shall be compared using equals instead of - * the == operator + * @param useEquals if the objects shall be compared using equals instead of the + * == operator */ public Identifiers(String prefix, boolean useEquals) { this(prefix, useEquals, 0); @@ -53,8 +53,8 @@ public Identifiers(String prefix, boolean useEquals) { * Creates Identifiers with the given prefix * * @param prefix the identifier prefix - * @param useEquals if the objects shall be compared using equals instead of - * the == operator + * @param useEquals if the objects shall be compared using equals instead of the + * == operator * @param startCounter number given to first identifier */ public Identifiers(String prefix, boolean useEquals, int startCounter) { diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/IdentityWrapper.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/IdentityWrapper.java index 0d09fd0b0b..bc88b0aa06 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/IdentityWrapper.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/IdentityWrapper.java @@ -33,9 +33,8 @@ public class IdentityWrapper { /** * Create a wrapper for the given value. * - * @param value the value to wrap, if the value is an - * {@link IdentityWrapper}, its value will be extracted and used - * as the value to wrap + * @param value the value to wrap, if the value is an {@link IdentityWrapper}, + * its value will be extracted and used as the value to wrap */ @SuppressWarnings("unchecked") public IdentityWrapper(T value) { diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/Pair.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/Pair.java index 8519059fde..ee5bb3b986 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/Pair.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/Pair.java @@ -61,9 +61,10 @@ public F getFirst() { public S getSecond() { return second; } - + /** * Pair creation helper. + * * @param the type of the first element in the pair * @param the type of the second element * @param first the first object diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/PlatformUtil.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/PlatformUtil.java index 70a7a420d5..d0b2646924 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/PlatformUtil.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/PlatformUtil.java @@ -17,7 +17,6 @@ import java.io.File; import java.net.URI; - import org.eclipse.core.runtime.Platform; import org.eclipse.osgi.service.datalocation.Location; diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/PropertiesFile.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/PropertiesFile.java index b60b6f4e4c..f82e9a89c6 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/PropertiesFile.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/PropertiesFile.java @@ -109,8 +109,8 @@ public void save() throws IOException { } /** - * Sync the properties with the file. For duplicate properties you can - * either prefer the runtime property values or the file property values. + * Sync the properties with the file. For duplicate properties you can either + * prefer the runtime property values or the file property values. * * @param preferRuntime if the runtime properties should be preferred * @throws IOException if loading or saving the file fails diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/StructuredEquals.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/StructuredEquals.java index 0ba69efc1e..7cc214c12e 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/StructuredEquals.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/StructuredEquals.java @@ -16,6 +16,8 @@ package eu.esdihumboldt.util; +import com.google.common.base.Objects; +import com.google.common.collect.Iterables; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -23,9 +25,6 @@ import java.util.Iterator; import java.util.NoSuchElementException; -import com.google.common.base.Objects; -import com.google.common.collect.Iterables; - /** * StructuredEquals provides methods for equals and hashCode implementations for * complex structures. @@ -89,8 +88,8 @@ public int deepIterableHashCode(Object object) { } /** - * Collect all objects contained in an {@link Iterable} or array and in - * their elements. + * Collect all objects contained in an {@link Iterable} or array and in their + * elements. * * @param object the object to collect objects on * @return the collected objects @@ -110,8 +109,8 @@ public Collection collectObjects(Object object) { } /** - * Returns an iterable for the given objects contents, or null if it does - * not contain anything that needs to be compared. + * Returns an iterable for the given objects contents, or null if it does not + * contain anything that needs to be compared. * * @param object the object in question * @return an iterable for the given object diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/SyncedPropertiesFile.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/SyncedPropertiesFile.java index 4261e2d7db..4091abd8c8 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/SyncedPropertiesFile.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/SyncedPropertiesFile.java @@ -15,13 +15,12 @@ package eu.esdihumboldt.util; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import java.io.File; import java.io.IOException; import java.util.Properties; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; - /** * Properties file that is in sync with its physical counterpart. * diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/definition/AbstractObjectFactory.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/definition/AbstractObjectFactory.java index 9929cf7fae..a8e7c9bb68 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/definition/AbstractObjectFactory.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/definition/AbstractObjectFactory.java @@ -16,12 +16,11 @@ package eu.esdihumboldt.util.definition; +import eu.esdihumboldt.util.Pair; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import eu.esdihumboldt.util.Pair; - /** * Provides support for converting certain objects to a definition string and * vice versa based on the {@link ObjectDefinition}ies available for the @@ -54,14 +53,14 @@ public AbstractObjectFactory() { protected abstract List getDefinitions(); /** - * Represent the given object as a definition string, so that it can be used - * to again create an object instance using {@link #parse(String)}. + * Represent the given object as a definition string, so that it can be used to + * again create an object instance using {@link #parse(String)}. * - * @param the object type, an {@link ObjectDefinition} supporting this - * type must be available + * @param the object type, an {@link ObjectDefinition} supporting this type + * must be available * @param object the object to create a string representation for - * @return the string representation of the object or null if - * no corresponding {@link ObjectDefinition} is available + * @return the string representation of the object or null if no + * corresponding {@link ObjectDefinition} is available * * @see #getDefinitions() */ @@ -76,16 +75,16 @@ public String asString(X object) { } /** - * Get the object type identifier and the string representation of the - * object. Please note that the string representation is not the same as the - * definition string retrieved through {@link #asString(Object)}. + * Get the object type identifier and the string representation of the object. + * Please note that the string representation is not the same as the definition + * string retrieved through {@link #asString(Object)}. * - * @param the object type, an {@link ObjectDefinition} supporting this - * type must be available + * @param the object type, an {@link ObjectDefinition} supporting this type + * must be available * @param object the object to create a string representation for - * @return the object type identifier and string representation of the - * object, null if no corresponding - * {@link ObjectDefinition} is available + * @return the object type identifier and string representation of the object, + * null if no corresponding {@link ObjectDefinition} is + * available * * @see #getDefinitions() */ @@ -165,8 +164,7 @@ private Iterable getSortedDefinitions() { } /* - * if it's not a super class/interface add it to result and - * remove it from list + * if it's not a super class/interface add it to result and remove it from list */ if (!isSuper) { result.add(def); diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/definition/ObjectDefinition.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/definition/ObjectDefinition.java index dfb7dde255..18b66e0fe3 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/definition/ObjectDefinition.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/definition/ObjectDefinition.java @@ -52,8 +52,8 @@ public interface ObjectDefinition { public T parse(String value); /** - * Represent the given object as a definition string, so that it can be used - * to again create an object instance using {@link #parse(String)}. + * Represent the given object as a definition string, so that it can be used to + * again create an object instance using {@link #parse(String)}. * * @param object the object to create a string representation for * @return the string representation of the object diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/format/DecimalFormatUtil.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/format/DecimalFormatUtil.java index ae9283fd73..a2a6048b06 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/format/DecimalFormatUtil.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/format/DecimalFormatUtil.java @@ -31,8 +31,8 @@ private DecimalFormatUtil() { } /** - * Create a {@link DecimalFormat} instance for the given pattern that uses - * '.' as the decimal separator. + * Create a {@link DecimalFormat} instance for the given pattern that uses '.' + * as the decimal separator. * * @param pattern the pattern string * @return A {@link DecimalFormat} for the given pattern diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/internal/Activator.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/internal/Activator.java index dc9f71b770..7a39098413 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/internal/Activator.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/internal/Activator.java @@ -16,11 +16,10 @@ package eu.esdihumboldt.util.internal; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - import eu.esdihumboldt.util.reflection.OSGIPackageResolver; import eu.esdihumboldt.util.reflection.ReflectionHelper; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; /** * Bundle activator diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/IOUtils.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/IOUtils.java index 0a31ee0353..f76624716c 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/IOUtils.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/IOUtils.java @@ -16,6 +16,10 @@ package eu.esdihumboldt.util.io; +import com.google.common.io.ByteStreams; +import com.google.common.io.Files; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; @@ -35,12 +39,6 @@ import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; -import com.google.common.io.ByteStreams; -import com.google.common.io.Files; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; - /** * Helper class for IO * @@ -100,8 +98,7 @@ public static Collection extract(File baseDir, InputStream in) throws IOEx * * @param zipDir the directory to ZIP * @param zos the ZIP output stream - * @throws IOException if reading the directory or writing the ZIP stream - * fails + * @throws IOException if reading the directory or writing the ZIP stream fails */ public static void zipDirectory(File zipDir, ZipOutputStream zos) throws IOException { zipDirectory(zipDir, zos, ""); @@ -145,8 +142,8 @@ private static void zipDirectory(File zipDir, ZipOutputStream zos, String parent * * @param targetURI the target path * @param baseURI the base path - * @return a relative path from basePath to targetPath or the targetPath if - * a relative path is not possible + * @return a relative path from basePath to targetPath or the targetPath if a + * relative path is not possible */ public static URI getRelativePath(URI targetURI, URI baseURI) { // nothing to do if one path is opaque or not absolute @@ -221,8 +218,8 @@ public static URI getRelativePath(URI targetURI, URI baseURI) { /** * Returns a URI for the given file. * - * In contrast to {@link File#toURI()} it does not resolve a relative file, - * but instead returns a relative URI. + * In contrast to {@link File#toURI()} it does not resolve a relative file, but + * instead returns a relative URI. * * @param file the file to transform * @return a (relative) URI for the given file @@ -261,8 +258,8 @@ public static String humanReadableByteCount(long bytes, boolean si) { * * @param resourcePath The path to the ZIP resource. * @param processorClass The class containing the processor method. - * @param processFolder The function that performs an action on the contents - * of the temporary extraction directory. + * @param processFolder The function that performs an action on the contents of + * the temporary extraction directory. * @throws IOException If an I/O error occurs. */ public static void withTemporaryExtractedZipResource(String resourcePath, diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/InputSupplier.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/InputSupplier.java index 1ff91c76d6..2c05da4b2b 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/InputSupplier.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/InputSupplier.java @@ -28,8 +28,8 @@ public interface InputSupplier { /** * Returns an object that encapsulates a readable resource. * - * This method may be called repeatedly to get independent channels to the - * same underlying resource. + * This method may be called repeatedly to get independent channels to the same + * underlying resource. * * @return a new input source, the caller is responsible for cleanup * @throws IOException if a new input source cannot be opened diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/OutputSupplier.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/OutputSupplier.java index 93d536c541..cb9059e227 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/OutputSupplier.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/OutputSupplier.java @@ -29,8 +29,8 @@ public interface OutputSupplier { /** * Returns an object that encapsulates a writable resource. * - * This method may be called repeatedly to get independent channels to the - * same underlying resource. + * This method may be called repeatedly to get independent channels to the same + * underlying resource. * * @return a new output sink, the caller is responsible for cleanup * @throws IOException if a new output sink cannot be opened diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/reflection/OSGIPackageResolver.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/reflection/OSGIPackageResolver.java index 42b5e64dcb..a3a851c53b 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/reflection/OSGIPackageResolver.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/reflection/OSGIPackageResolver.java @@ -15,16 +15,14 @@ */ package eu.esdihumboldt.util.reflection; +import eu.esdihumboldt.util.internal.Activator; import java.io.IOException; import java.net.URL; - import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Path; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; -import eu.esdihumboldt.util.internal.Activator; - /** *

          * Title: OSGIPackageResolver diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/reflection/ReflectionHelper.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/reflection/ReflectionHelper.java index accfd555d4..005e71b38e 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/reflection/ReflectionHelper.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/reflection/ReflectionHelper.java @@ -87,8 +87,8 @@ public static Method findSetter(Class c, String property, Class propertyTy /** * Returns a setter method for a given property, no matter if the method is - * visible or hidden or if it is declared in the given class or in a - * superclass or implemented interface. + * visible or hidden or if it is declared in the given class or in a superclass + * or implemented interface. * * @param c the class which would contain the setter method * @param property the property @@ -161,8 +161,8 @@ public static Method findGetter(Class c, String property, Class propertyTy /** * Returns a getter method for a given property, no matter if the method is - * visible or hidden or if it is declared in the given class or in a - * superclass or implemented interface. + * visible or hidden or if it is declared in the given class or in a superclass + * or implemented interface. * * @param c the class which would contain the getter method * @param property the property @@ -235,8 +235,8 @@ public static Field findField(Class c, String property, Class propertyType } /** - * Returns a field for a given property, no matter if the field is visible - * or hidden or if it is declared in the given class or in a superclass. + * Returns a field for a given property, no matter if the field is visible or + * hidden or if it is declared in the given class or in a superclass. * * @param c the class which would contain the field * @param property the property @@ -317,9 +317,9 @@ public static void setProperty(Object bean, String propertyName, Object value) } /** - * Invokes a setter for a property, no matter if the setter is visible or - * hidden or if it is declared in the given class or in a superclass or - * implemented interface. + * Invokes a setter for a property, no matter if the setter is visible or hidden + * or if it is declared in the given class or in a superclass or implemented + * interface. * * @param bean the object to invoke the public setter on * @param propertyName the name of the property that shall be updated @@ -392,9 +392,9 @@ public static T getProperty(Object bean, String propertyName) } /** - * Invokes a getter for a property, no matter if the getter is visible or - * hidden or if it is declared in the given class or in a superclass or - * implemented interface. + * Invokes a getter for a property, no matter if the getter is visible or hidden + * or if it is declared in the given class or in a superclass or implemented + * interface. * * @param the result type * @param bean the object to invoke the getter on @@ -418,8 +418,7 @@ public static T getDeepProperty(Object bean, String propertyName) } /** - * Invokes a getter for a property, or gets the matching field, no matter - * what. + * Invokes a getter for a property, or gets the matching field, no matter what. * * @param bean the object to invoke the getter on * @param propertyName the name of the property to retrieve @@ -459,8 +458,7 @@ public static T getDeepPropertyOrField(Object bean, String propertyName, /** * @return the URL to the JAR file this class is in or null - * @throws MalformedURLException if the URL to the jar file could not be - * created + * @throws MalformedURLException if the URL to the jar file could not be created */ public static URL getCurrentJarURL() throws MalformedURLException { String name = ReflectionHelper.class.getCanonicalName(); @@ -707,22 +705,21 @@ else if (name.toLowerCase().endsWith(".class")) { //$NON-NLS-1$ /** *

          - * Find the most specialised class from group compatible with clazz. A - * direct superclass match is searched and returned if found. + * Find the most specialised class from group compatible with clazz. A direct + * superclass match is searched and returned if found. *

          *

          - * If not and checkAssignability is true, the most derived assignable class - * is being searched. + * If not and checkAssignability is true, the most derived assignable class is + * being searched. *

          *

          - * See The Java Language Specification, sections 5.1.1 and 5.1.4 , for - * details. + * See The Java Language Specification, sections 5.1.1 and 5.1.4 , for details. *

          * * @param clazz a class * @param group a collection of classes to match against - * @param checkAssignability whether to use assignability when no direct - * match is found + * @param checkAssignability whether to use assignability when no direct match + * is found * @return null or the most specialised match from group */ public static Class findMostSpecificMatch(Class clazz, Collection> group, diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/scavenger/AbstractResourceScavenger.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/scavenger/AbstractResourceScavenger.java index 40fcd5031e..0d71a1ffbf 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/scavenger/AbstractResourceScavenger.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/scavenger/AbstractResourceScavenger.java @@ -15,6 +15,10 @@ package eu.esdihumboldt.util.scavenger; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.util.Pair; +import eu.esdihumboldt.util.PlatformUtil; import java.io.File; import java.io.FileFilter; import java.io.IOException; @@ -23,14 +27,8 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; - import org.apache.commons.io.FileUtils; -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.util.Pair; -import eu.esdihumboldt.util.PlatformUtil; - /** * Scans for folder resources in a specific location or references a single * resource. @@ -57,13 +55,13 @@ public abstract class AbstractResourceScavenger implements ResourceScavenger< * Create a scavenger instance. Subclass constructors should call * {@link #triggerScan()} after to initialize the scavenger. * - * @param scavengeLocation the location to scan, if the location does not - * exist or is not accessible, a default location inside the - * platform instance location is used + * @param scavengeLocation the location to scan, if the location does not exist + * or is not accessible, a default location inside the platform + * instance location is used * @param instanceLocPath the instance location sub-path to use if the * scavengeLocation is invalid or null, may be - * null if the platform instance location should not - * be used as fall-back + * null if the platform instance location should not be + * used as fall-back */ public AbstractResourceScavenger(File scavengeLocation, String instanceLocPath) { if (scavengeLocation == null || !scavengeLocation.exists() && instanceLocPath != null) { @@ -174,8 +172,8 @@ public boolean accept(File pathname) { } /** - * Called when a resource has been added, either when adding the resource on - * the first scan or if it was added afterwards. + * Called when a resource has been added, either when adding the resource on the + * first scan or if it was added afterwards. * * @param reference the resource reference * @param resourceId the resource identifier @@ -202,8 +200,8 @@ public boolean accept(File pathname) { * Load a resource reference. * * @param resourceFolder the resource folder - * @param resourceFileName the name of the resource file in that folder, may - * be null if unknown + * @param resourceFileName the name of the resource file in that folder, may be + * null if unknown * @param resourceId the resource identifier * @return the resource reference * @throws IOException if the resource cannot be accessed or loaded diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/scavenger/ResourceScavenger.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/scavenger/ResourceScavenger.java index 93887deef0..518b9d7e1b 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/scavenger/ResourceScavenger.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/scavenger/ResourceScavenger.java @@ -15,11 +15,10 @@ package eu.esdihumboldt.util.scavenger; +import eu.esdihumboldt.util.Pair; import java.io.File; import java.util.Set; -import eu.esdihumboldt.util.Pair; - /** * Service that scans for specific resources in a location and keeps references * to them. Each resource has a unique identifier and usually occupies its own @@ -54,8 +53,8 @@ public interface ResourceScavenger { public File reserveResourceId(String resourceId) throws ScavengerException; /** - * Reserve a resource identifier, if the desired identifier is already - * taken, an identifier will be generated. + * Reserve a resource identifier, if the desired identifier is already taken, an + * identifier will be generated. * * @param desiredId the desired identifier, may be null * @return a pair of identifier and resource directory @@ -64,8 +63,8 @@ public interface ResourceScavenger { public Pair reserveResource(String desiredId) throws ScavengerException; /** - * Release a previously reserved resource identifier. Also removes the - * resource folder. + * Release a previously reserved resource identifier. Also removes the resource + * folder. * * @param resourceId the resource identifier */ diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/AbstractValidator.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/AbstractValidator.java index 40121c59fc..ddb0bba2f5 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/AbstractValidator.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/AbstractValidator.java @@ -33,8 +33,8 @@ public abstract class AbstractValidator implements Validator { * @param o the object to convert * @param type the target type * @return the converted object - * @throws ConversionException if the object couldn't be converted to the - * target type + * @throws ConversionException if the object couldn't be converted to the target + * type */ @SuppressWarnings("unchecked") public T getObjectAs(Object o, Class type) throws ConversionException { diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/AndValidator.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/AndValidator.java index 167d5ace4d..5521d49d13 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/AndValidator.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/AndValidator.java @@ -43,8 +43,7 @@ public AndValidator(Collection validators) { /** * Adds the given Validator to this Validator.
          - * Validators which are always true are ignored and AndValidators get - * flattened. + * Validators which are always true are ignored and AndValidators get flattened. * * @param validator the validator to add */ diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/DigitCountValidator.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/DigitCountValidator.java index a4e67dfde1..051d03b79f 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/DigitCountValidator.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/DigitCountValidator.java @@ -17,7 +17,6 @@ package eu.esdihumboldt.util.validator; import java.math.BigDecimal; - import org.springframework.core.convert.ConversionException; /** @@ -33,8 +32,8 @@ public class DigitCountValidator extends AbstractValidator { private final int length; /** - * Construct a validator that checks the digit count of the input to match - * the given type and value. + * Construct a validator that checks the digit count of the input to match the + * given type and value. * * @param type the digits to check for * @param length the length to check for @@ -72,8 +71,7 @@ public String validate(Object value) { if (decimal.scale() > length) { // throws exception if scaling is not possible /* - * FIXME this does not change the original value, so what - * does this achieve? + * FIXME this does not change the original value, so what does this achieve? */ decimal = decimal.setScale(length); } diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/LengthValidator.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/LengthValidator.java index 2ca2fabf21..15190d1070 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/LengthValidator.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/LengthValidator.java @@ -29,8 +29,8 @@ public class LengthValidator extends AbstractValidator { private final int length; /** - * Construct a validator that checks the length of the input to match the - * given type and value. + * Construct a validator that checks the length of the input to match the given + * type and value. * * @param type the length attribute to check for * @param length the length to check for diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/NumberValidator.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/NumberValidator.java index 60b0d5670a..4707bfb357 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/NumberValidator.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/NumberValidator.java @@ -18,7 +18,6 @@ import java.math.BigDecimal; import java.util.Collection; - import org.springframework.core.convert.ConversionException; /** @@ -32,8 +31,8 @@ public class NumberValidator extends AbstractValidator { private final BigDecimal value; /** - * Construct a validator that checks the value of the input to match the - * given type and value. + * Construct a validator that checks the value of the input to match the given + * type and value. * * @param type the condition to check for * @param value the value to check for diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/Validator.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/Validator.java index e3b0abd434..a22fa72c29 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/Validator.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/validator/Validator.java @@ -27,8 +27,7 @@ public interface Validator { * Checks whether the given value is valid. * * @param value the value to check - * @return null, if the value is valid, otherwise the reason why it's - * invalid + * @return null, if the value is valid, otherwise the reason why it's invalid */ public String validate(Object value); @@ -41,11 +40,11 @@ public interface Validator { /** * Returns true, if this Validator validates all values to true.
          - * The result must not necessarily be correct. If the validator does not - * know its result for sure it must return false. + * The result must not necessarily be correct. If the validator does not know + * its result for sure it must return false. * - * @return true, iff the validator knows for sure, that it validates all - * values to true + * @return true, iff the validator knows for sure, that it validates all values + * to true */ public boolean isAlwaysTrue(); } diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/xml/XmlUtil.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/xml/XmlUtil.java index a7105fe2ed..4ea1028372 100644 --- a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/xml/XmlUtil.java +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/xml/XmlUtil.java @@ -16,7 +16,6 @@ package eu.esdihumboldt.util.xml; import java.io.StringWriter; - import javax.xml.transform.OutputKeys; import javax.xml.transform.Result; import javax.xml.transform.Source; @@ -26,7 +25,6 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; - import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -99,8 +97,8 @@ public static void serialize(Source source, StreamResult target, boolean indent, else { transformer = factory.newTransformer(); } - transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXmlDeclaration ? "yes" - : "no"); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, + omitXmlDeclaration ? "yes" : "no"); // transformer.setOutputProperty(OutputKeys.INDENT, indent ? "yes" : // "no"); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); @@ -113,8 +111,8 @@ public static void serialize(Source source, StreamResult target, boolean indent, * * @param source the source, e.g. {@link DOMSource} * @param target the target, e.g. {@link StreamResult} - * @throws TransformerException if the XSLT transformation for pretty - * printing cannot be loaded + * @throws TransformerException if the XSLT transformation for pretty printing + * cannot be loaded */ public static void prettyPrint(Source source, Result target) throws TransformerException { diff --git a/util/plugins/eu.esdihumboldt.util/test/eu/esdihumboldt/util/DependencyOrderedListTest.java b/util/plugins/eu.esdihumboldt.util/test/eu/esdihumboldt/util/DependencyOrderedListTest.java index e22501b1eb..f91aec0341 100644 --- a/util/plugins/eu.esdihumboldt.util/test/eu/esdihumboldt/util/DependencyOrderedListTest.java +++ b/util/plugins/eu.esdihumboldt.util/test/eu/esdihumboldt/util/DependencyOrderedListTest.java @@ -21,7 +21,6 @@ import java.util.List; import java.util.Map; import java.util.Set; - import org.junit.Assert; import org.junit.Test;