You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/04/06 11:21:37 UTC
[isis] branch master updated: ISIS-2599: purge legacy modules
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/master by this push:
new c584c04 ISIS-2599: purge legacy modules
c584c04 is described below
commit c584c04e204297a432b4c4219be16dbdc50462c0
Author: ahuber@apache.org <ah...@luna>
AuthorDate: Tue Apr 6 13:21:25 2021 +0200
ISIS-2599: purge legacy modules
---
.../modules/ROOT/pages/building-apache-isis.adoc | 5 +-
legacy/adoc/antora.yml | 23 -
legacy/adoc/modules/ROOT/nav.adoc | 4 -
legacy/adoc/modules/ROOT/pages/about.adoc | 7 -
.../adoc/modules/ROOT/partials/component-nav.adoc | 6 -
legacy/adoc/modules/ROOT/partials/module-nav.adoc | 9 -
legacy/extensions/core/applib/.gitignore | 1 -
legacy/extensions/core/applib/pom.xml | 93 --
.../core/applib/src/main/adoc/antora.yml | 19 -
.../applib/src/main/adoc/modules/applib/nav.adoc | 4 -
.../src/main/adoc/modules/applib/pages/about.adoc | 6 -
.../adoc/modules/applib/partials/module-nav.adoc | 4 -
.../isis/legacy/applib/DomainObjectContainer.java | 724 -----------
.../apache/isis/legacy/applib/filter/Filter.java | 50 -
.../apache/isis/legacy/applib/filter/Filters.java | 108 --
.../services/eventbus/ActionDomainEvent.java | 205 ---
.../services/eventbus/CollectionDomainEvent.java | 144 ---
.../services/eventbus/PropertyDomainEvent.java | 121 --
.../org/apache/isis/legacy/applib/value/Color.java | 110 --
.../org/apache/isis/legacy/applib/value/Image.java | 127 --
.../apache/isis/legacy/applib/value/Magnitude.java | 64 -
.../org/apache/isis/legacy/applib/value/Money.java | 188 ---
.../isis/legacy/applib/value/Percentage.java | 131 --
.../apache/isis/legacy/applib/value/ColorTest.java | 39 -
.../apache/isis/legacy/applib/value/MoneyTest.java | 232 ----
.../isis/legacy/applib/value/PercentageTest.java | 73 --
legacy/extensions/core/commons/.gitignore | 1 -
legacy/extensions/core/commons/pom.xml | 93 --
.../core/commons/src/main/adoc/antora.yml | 19 -
.../commons/src/main/adoc/modules/commons/nav.adoc | 4 -
.../src/main/adoc/modules/commons/pages/about.adoc | 5 -
.../adoc/modules/commons/partials/module-nav.adoc | 4 -
.../internal/encoding/DataInputExtended.java | 58 -
.../encoding/DataInputExtendedDecorator.java | 203 ---
.../internal/encoding/DataInputStreamExtended.java | 206 ---
.../internal/encoding/DataOutputExtended.java | 68 -
.../encoding/DataOutputExtendedDecorator.java | 206 ---
.../encoding/DataOutputStreamExtended.java | 227 ----
.../internal/encoding/DebugDataInputExtended.java | 103 --
.../internal/encoding/DebugDataOutputExtended.java | 100 --
.../commons/internal/encoding/Encodable.java | 40 -
.../internal/encoding/EncodingConstants.java | 29 -
.../internal/encoding/FailedToDecodeException.java | 36 -
.../encoding/FailedToDeserializeException.java | 36 -
.../commons/internal/encoding/FieldType.java | 1350 --------------------
.../FutureWithIndexIntoFutureOfList.java | 63 -
.../threadpool/ThreadPoolExecutionMode.java | 66 -
.../internal/threadpool/ThreadPoolSizeAdvisor.java | 55 -
.../internal/threadpool/ThreadPoolSupport.java | 328 -----
.../encoding/ByteEncoderDecoderRoundtripTest.java | 182 ---
.../internal/threadpool/ThreadPoolSupportTest.java | 134 --
legacy/extensions/core/metamodel/.gitignore | 1 -
legacy/extensions/core/metamodel/pom.xml | 99 --
.../core/metamodel/src/main/adoc/antora.yml | 19 -
.../src/main/adoc/modules/metamodel/nav.adoc | 4 -
.../main/adoc/modules/metamodel/pages/about.adoc | 6 -
.../modules/metamodel/partials/module-nav.adoc | 7 -
.../facets/value/color/ColorValueFacet.java | 30 -
...lorValueFacetUsingSemanticsProviderFactory.java | 43 -
.../value/color/ColorValueSemanticsProvider.java | 126 --
...ageValueFacetUsingSemanticsProviderFactory.java | 43 -
.../value/image/ImageValueSemanticsProvider.java | 106 --
.../facets/value/money/MoneyValueFacet.java | 33 -
...neyValueFacetUsingSemanticsProviderFactory.java | 43 -
.../value/money/MoneyValueSemanticsProvider.java | 230 ----
...ageValueFacetUsingSemanticsProviderFactory.java | 44 -
.../PercentageValueSemanticsProvider.java | 151 ---
.../value/ColorValueSemanticsProviderTest.java | 90 --
.../value/ImageValueSemanticsProviderTest.java | 83 --
.../value/MoneyValueSemanticsProviderTest.java | 163 ---
.../PercentageValueSemanticsProviderTest.java | 91 --
.../PolishMoneyValueSemanticsProviderTest.java | 164 ---
.../ValueSemanticsProviderAbstractTestCase.java | 163 ---
legacy/extensions/core/runtime/.gitignore | 1 -
legacy/extensions/core/runtime/pom.xml | 111 --
.../core/runtime/src/main/adoc/antora.yml | 19 -
.../runtime/src/main/adoc/modules/runtime/nav.adoc | 4 -
.../src/main/adoc/modules/runtime/pages/about.adoc | 5 -
.../adoc/modules/runtime/partials/module-nav.adoc | 4 -
.../datanucleus/valuetypes/IsisMoneyMapping.java | 133 --
.../legacy/runtime/snapshot/DomSerializer.java | 33 -
.../legacy/runtime/snapshot/DomSerializerJaxp.java | 71 -
.../isis/legacy/runtime/sysout/SystemPrinter.java | 44 -
.../system/persistence/LoggingLocation.java | 27 -
.../runtime/system/persistence/ObjectFactory.java | 57 -
.../system/persistence/SuspendableListener.java | 27 -
.../viewer/web/AbstractServletOrFilterMapping.java | 56 -
.../runtime/viewer/web/FilterSpecification.java | 46 -
.../runtime/viewer/web/ServletSpecification.java | 46 -
.../runtime/viewer/web/WebAppSpecification.java | 135 --
.../scalars/isisapplib/IsisColorPanel.java | 43 -
.../scalars/isisapplib/IsisColorPanelFactory.java | 45 -
.../scalars/isisapplib/IsisMoneyPanel.java | 43 -
.../scalars/isisapplib/IsisMoneyPanelFactory.java | 45 -
.../scalars/isisapplib/IsisPercentagePanel.java | 44 -
.../isisapplib/IsisPercentagePanelFactory.java | 45 -
legacy/mappings/restclient/pom.xml | 63 -
.../mappings/restclient/src/main/adoc/antora.yml | 19 -
.../src/main/adoc/modules/restclient/nav.adoc | 4 -
.../main/adoc/modules/restclient/pages/about.adoc | 5 -
.../modules/restclient/partials/module-nav.adoc | 4 -
.../legacy/restclient/ClientRequestFactory.java | 52 -
.../legacy/restclient/RepresentationWalker.java | 183 ---
.../isis/legacy/restclient/RestEasyLegacy.java | 55 -
.../isis/legacy/restclient/RestfulClient.java | 189 ---
.../legacy/restclient/RestfulClientException.java | 40 -
.../isis/legacy/restclient/lib/ClientExecutor.java | 118 --
.../isis/legacy/restclient/lib/ClientRequest.java | 43 -
.../restclient/lib/ClientRequestConfigurer.java | 175 ---
.../restclient/lib/RestfulHttpMethodHelper.java | 83 --
.../lib/RestfulHttpMethodTest_setUp.java | 95 --
legacy/pom.xml | 112 --
legacy/subdomains/servletapi/impl/pom.xml | 37 -
.../servletapi/dom/IsisModuleSubServletApi.java | 28 -
.../subdomains/servletapi/src/main/adoc/antora.yml | 19 -
.../src/main/adoc/modules/servletapi/nav.adoc | 5 -
.../main/adoc/modules/servletapi/pages/about.adoc | 5 -
.../modules/servletapi/partials/module-nav.adoc | 3 -
pom.xml | 13 -
starters/pom.xml | 6 -
120 files changed, 1 insertion(+), 10291 deletions(-)
diff --git a/antora/components/conguide/modules/ROOT/pages/building-apache-isis.adoc b/antora/components/conguide/modules/ROOT/pages/building-apache-isis.adoc
index efe6a03..5c6cab3 100644
--- a/antora/components/conguide/modules/ROOT/pages/building-apache-isis.adoc
+++ b/antora/components/conguide/modules/ROOT/pages/building-apache-isis.adoc
@@ -9,7 +9,7 @@
From the root project root run:
[source,bash]
-----
+----gacyy
mvn clean install
----
@@ -255,9 +255,6 @@ where `module-xxx` and `module-yyy` correspond to profile names, as provided wit
| module-incubator-vaadin
| The Vaadin Viewer
-| module-legacy
-| Legacy Packages (to ease migration)
-
| module-regressiontests
| Regression Tests (for the CI pipelines)
diff --git a/legacy/adoc/antora.yml b/legacy/adoc/antora.yml
deleted file mode 100644
index 61f1510..0000000
--- a/legacy/adoc/antora.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name: legacy
-title: "Legacy Catalog"
-version: latest
-start_page: ROOT:about.adoc
-nav:
-- modules/ROOT/nav.adoc
diff --git a/legacy/adoc/modules/ROOT/nav.adoc b/legacy/adoc/modules/ROOT/nav.adoc
deleted file mode 100644
index 6485415..0000000
--- a/legacy/adoc/modules/ROOT/nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-include::legacy:ROOT:partial$component-nav.adoc[]
diff --git a/legacy/adoc/modules/ROOT/pages/about.adoc b/legacy/adoc/modules/ROOT/pages/about.adoc
deleted file mode 100644
index ee0f699..0000000
--- a/legacy/adoc/modules/ROOT/pages/about.adoc
+++ /dev/null
@@ -1,7 +0,0 @@
-= Legacy Catalog
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-:page-partial:
-
-This catalog contains deprecated functionality that has been extracted from the core framework, prior to it being removed permanently.
-
diff --git a/legacy/adoc/modules/ROOT/partials/component-nav.adoc b/legacy/adoc/modules/ROOT/partials/component-nav.adoc
deleted file mode 100644
index 1eff803..0000000
--- a/legacy/adoc/modules/ROOT/partials/component-nav.adoc
+++ /dev/null
@@ -1,6 +0,0 @@
-include::legacy:applib:partial$module-nav.adoc[]
-include::legacy:commons:partial$module-nav.adoc[]
-include::legacy:runtime:partial$module-nav.adoc[]
-include::legacy:restclient:partial$module-nav.adoc[]
-include::legacy:servletapi:partial$module-nav.adoc[]
-
diff --git a/legacy/adoc/modules/ROOT/partials/module-nav.adoc b/legacy/adoc/modules/ROOT/partials/module-nav.adoc
deleted file mode 100644
index 5045585..0000000
--- a/legacy/adoc/modules/ROOT/partials/module-nav.adoc
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-* xref:legacy:ROOT:about.adoc[About the Legacy Catalog]
-
-
-
-
-
diff --git a/legacy/extensions/core/applib/.gitignore b/legacy/extensions/core/applib/.gitignore
deleted file mode 100644
index a48e45b..0000000
--- a/legacy/extensions/core/applib/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/target-ide
diff --git a/legacy/extensions/core/applib/pom.xml b/legacy/extensions/core/applib/pom.xml
deleted file mode 100644
index b0e05d2..0000000
--- a/legacy/extensions/core/applib/pom.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.isis.legacy</groupId>
- <artifactId>isis-legacy</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../../pom.xml</relativePath>
- </parent>
-
- <artifactId>isis-legacy-applib</artifactId>
- <name>Apache Isis Legacy - Applib</name>
- <description>
- To ease migration from Apache Isis versions 1.16+ to 2.0.0.
- </description>
-
- <properties>
- <jar-plugin.automaticModuleName>org.apache.isis.legacy.applib</jar-plugin.automaticModuleName>
- <git-plugin.propertiesDir>org/apache/isis/legacy/applib</git-plugin.propertiesDir>
- </properties>
-
- <dependencies>
-
- <!-- JDO API (non transient, provided by plugin) -->
- <dependency>
- <!-- v3.2 not available yet, use datanucleus staging for now -->
- <!-- <groupId>javax.jdo</groupId> -->
- <!-- <artifactId>jdo-api</artifactId> -->
- <groupId>org.datanucleus</groupId>
- <artifactId>javax.jdo</artifactId>
- <!-- provided by plugins -->
- <scope>provided</scope>
- </dependency>
-
- <!-- LEGACY DEPENDENCY -->
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
-
- <!-- CORE -->
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-applib</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.persistence</groupId>
- <artifactId>isis-persistence-jdo-applib</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-runtime</artifactId>
- <scope>compile</scope>
- </dependency>
-
-
- <!-- TEST DEPENDENCY -->
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-internaltestsupport</artifactId>
- <scope>test</scope>
- <exclusions>
- <!-- whatever unittestsupport is dependent on, it should not be transitive -->
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/legacy/extensions/core/applib/src/main/adoc/antora.yml b/legacy/extensions/core/applib/src/main/adoc/antora.yml
deleted file mode 100644
index 3938f85..0000000
--- a/legacy/extensions/core/applib/src/main/adoc/antora.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name: legacy
-version: latest
diff --git a/legacy/extensions/core/applib/src/main/adoc/modules/applib/nav.adoc b/legacy/extensions/core/applib/src/main/adoc/modules/applib/nav.adoc
deleted file mode 100644
index 6485415..0000000
--- a/legacy/extensions/core/applib/src/main/adoc/modules/applib/nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-include::legacy:ROOT:partial$component-nav.adoc[]
diff --git a/legacy/extensions/core/applib/src/main/adoc/modules/applib/pages/about.adoc b/legacy/extensions/core/applib/src/main/adoc/modules/applib/pages/about.adoc
deleted file mode 100644
index 7f60221..0000000
--- a/legacy/extensions/core/applib/src/main/adoc/modules/applib/pages/about.adoc
+++ /dev/null
@@ -1,6 +0,0 @@
-= Applib (Legacy)
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-WARNING: TODO
-
diff --git a/legacy/extensions/core/applib/src/main/adoc/modules/applib/partials/module-nav.adoc b/legacy/extensions/core/applib/src/main/adoc/modules/applib/partials/module-nav.adoc
deleted file mode 100644
index 99c1753..0000000
--- a/legacy/extensions/core/applib/src/main/adoc/modules/applib/partials/module-nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-* xref:legacy:applib:about.adoc[Applib]
-
-
-
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/DomainObjectContainer.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/DomainObjectContainer.java
deleted file mode 100644
index a579faf..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/DomainObjectContainer.java
+++ /dev/null
@@ -1,724 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.legacy.applib;
-
-import java.util.Iterator;
-import java.util.List;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import com.google.common.base.Predicate;
-
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Primary;
-import org.springframework.core.annotation.Order;
-import org.springframework.objenesis.instantiator.util.ClassUtils;
-import org.springframework.stereotype.Service;
-
-import org.apache.isis.applib.ViewModel;
-import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.Nature;
-import org.apache.isis.applib.annotation.OrderPrecedence;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.query.Query;
-import org.apache.isis.applib.services.factory.FactoryService;
-import org.apache.isis.applib.services.i18n.TranslatableString;
-import org.apache.isis.applib.services.inject.ServiceInjector;
-import org.apache.isis.applib.services.message.MessageService;
-import org.apache.isis.applib.services.metamodel.MetaModelService;
-import org.apache.isis.applib.services.registry.ServiceRegistry;
-import org.apache.isis.applib.services.repository.RepositoryService;
-import org.apache.isis.applib.services.title.TitleService;
-import org.apache.isis.applib.services.user.UserMemento;
-import org.apache.isis.applib.services.user.UserService;
-import org.apache.isis.applib.services.xactn.TransactionService;
-import org.apache.isis.commons.internal.exceptions._Exceptions;
-import org.apache.isis.core.config.IsisConfiguration;
-import org.apache.isis.legacy.applib.filter.Filter;
-import org.apache.isis.persistence.jdo.applib.services.JdoSupportService;
-
-import lombok.NonNull;
-import lombok.SneakyThrows;
-
-/**
- * @deprecated
- */
-@Service
-@Named("isis.legacy.applib.DomainObjectContainer")
-@Order(OrderPrecedence.MIDPOINT)
-@Primary
-@Qualifier("Default")
-@Deprecated
-public class DomainObjectContainer {
-
- @Inject private RepositoryService repositoryService;
- @Inject private MetaModelService metaModelService;
- @Inject private JdoSupportService jdoSupport;
- @Inject private FactoryService factoryService;
- @Inject private TitleService titleService;
- @Inject private TransactionService transactionService;
- @Inject private ServiceInjector serviceInjector;
- @Inject private ServiceRegistry serviceRegistry;
- @Inject private MessageService messageService;
- @Inject private UserService userService;
-
- /**
- * Return the title of the object, as rendered in the UI by the
- * Isis viewers.
- *
- * @deprecated - use {@link TitleService#titleOf(Object)} instead.
- */
- @Deprecated
- @Programmatic
- public String titleOf(Object domainObject) {
- return titleService.titleOf(domainObject);
- }
-
- /**
- * Return the icon name of the object, as rendered in the UI by the
- * Isis viewers.
- *
- * @deprecated - use {@link TitleService#iconNameOf(Object)} instead.
- */
- @Deprecated
- @Programmatic
- public String iconNameOf(Object domainObject) {
- return titleService.iconNameOf(domainObject);
- }
-
- /**
- * Re-initialises the fields of an object, using the
- * JDO {@link javax.jdo.PersistenceManager#refresh(Object) refresh} API.
- *
- * <p>
- * Previously this method was provided for manual control of lazy loading; with the JDO/DataNucleus objectstore
- * that original functionality is performed automatically by the framework.
- * </p>
- *
- * @deprecated - equivalent to {@link JdoSupportService#refresh(Object)}.
- */
- @Programmatic
- @Deprecated
- public void resolve(Object domainObject) {
- jdoSupport.refresh(domainObject);
- }
-
- /**
- * Provided that the <tt>field</tt> parameter is <tt>null</tt>, re-initialises the fields of an object, using the
- * JDO {@link javax.jdo.PersistenceManager#refresh(Object) refresh} API.
- *
- * <p>
- * Previously this method was provided for manual control of lazy loading; with the JDO/DataNucleus objectstore
- * that original functionality is performed automatically by the framework.
- * </p>
- *
- * @deprecated - equivalent to {@link JdoSupportService#refresh(Object)}.
- */
- @Programmatic
- @Deprecated
- public void resolve(Object domainObject, Object field) {
- resolve(domainObject);
- }
-
- /**
- * This method does nothing (is a no-op).
- *
- * <p>
- * Previous this method was provided for manual control of object dirtyng; with the JDO/DataNucleus objectstore
- * that original functionality is performed automatically by the framework.
- * </p>
- *
- * @deprecated - is a no-op
- */
- @Programmatic
- @Deprecated
- public void objectChanged(Object domainObject) {
- // do nothing
- }
-
-
- /**
- * Flush all changes to the object store.
- *
- * <p>
- * Occasionally useful to ensure that newly persisted domain objects
- * are flushed to the database prior to a subsequent repository query.
- *
- * @return - is never used, always returns <tt>false</tt>.
- *
- * @deprecated - use {@link TransactionService#flushTransaction()}.
- */
- @Programmatic
- @Deprecated
- public boolean flush() {
- transactionService.flushTransaction();
- return false;
- }
-
- /**
- * Commit all changes to the object store.
- *
- * <p>
- * This has been deprecated because the demarcation of transaction
- * boundaries is a framework responsibility rather than being a
- * responsibility of the domain object model.
- *
- * @deprecated
- */
- @Programmatic
- @Deprecated
- public void commit() {
- // do nothing
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.factory.FactoryService#instantiate(Class)} instead.
- */
- @Deprecated
- @Programmatic
- @SneakyThrows
- public <T> T newTransientInstance(final @NonNull Class<T> ofType) {
- return factoryService.detachedEntity(ofType.newInstance());
- }
-
- /**
- * Create a new {@link ViewModel} instance of the specified type, initializing with the specified memento.
- *
- * <p>
- * Rather than use this constructor it is generally preferable to simply instantiate a
- * class annotated with {@link DomainObject} using nature {@link Nature#VIEW_MODEL}.
- * If services need injecting into it, use {@link #injectServicesInto(Object)}.
- * </p>
- */
- @Programmatic
- public <T> T newViewModelInstance(final Class<T> ofType, final String memento) {
- if(memento!=null) {
- throw new IllegalArgumentException("parameter 'memento' is no longer supported");
- }
- T obj = factoryService.viewModel(ClassUtils.newInstance(ofType));
- serviceInjector.injectServicesInto(obj);
- return obj;
- }
-
- /**
- * @deprecated - not supported, will throw a RuntimeException
- */
- @Deprecated
- @Programmatic
- public <T> T newAggregatedInstance(Object parent, Class<T> ofType) {
- throw new RuntimeException("method no longer supported");
- }
-
- /**
- * (Deprecated) returns a new instance of the specified class that will have been
- * persisted.
- *
- * @deprecated - in almost all cases the workflow is to {@link #newTransientInstance(Class)}, populate the object
- * (eg with the arguments to an action) and then to
- * {@link #persist(Object) persist} the object. It is exceptionally rare for
- * an object to be created, and with no further data required - be in a state
- * to be persisted immediately.
- */
- @Programmatic
- @Deprecated
- public <T> T newPersistentInstance(final Class<T> ofType) {
- throw new RuntimeException("method no longer supported");
- }
-
- /**
- * Returns a new instance of the specified class that has the same persisted
- * state (either transient or persisted) as the provided object.
- *
- * <p>
- * This method has been deprecated because it is a rare use case, causing
- * unnecessary interface bloat for very little gain.
- * <p></p>
- *
- * @deprecated
- */
- @Programmatic
- @Deprecated
- public <T> T newInstance(final Class<T> ofType, final Object object) {
- throw new RuntimeException("method no longer supported");
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.factory.FactoryService#mixin(Class, Object)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T mixin( Class<T> mixinClass, Object mixedIn) {
- return factoryService.mixin(mixinClass, mixedIn);
- }
-
-
- /**
- * @deprecated - use {@link ServiceInjector#injectServicesInto(Object)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T injectServicesInto(final T domainObject) {
- return serviceInjector.injectServicesInto(domainObject);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.registry.ServiceRegistry#lookupService(Class)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T lookupService(Class<T> service) {
- return serviceRegistry.lookupService(service).orElse(null);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.registry.ServiceRegistry#lookupService(Class)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> Iterable<T> lookupServices(Class<T> service){
- return serviceRegistry.select(service);
- }
-
- /**
- * Whether the object is in a valid state, that is that none of the
- * validation of properties, collections and object-level is vetoing.
- *
- * @see #validate(Object)
- */
- @Programmatic
- public boolean isValid(Object domainObject) {
- throw new RuntimeException("method no longer supported");
- }
-
- /**
- * The reason, if any why the object is in a invalid state
- *
- * <p>
- * Checks the validation of all of the properties, collections and
- * object-level.
- * </p>
- *
- * @see #isValid(Object)
- */
- public @Programmatic
- String validate(Object domainObject) {
- throw new RuntimeException("method no longer supported");
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.metamodel.MetaModelService#sortOf(Class, MetaModelService.Mode)} instead.
- */
- @Deprecated
- @Programmatic
- public boolean isViewModel(Object domainObject) {
- return metaModelService.sortOf(domainObject.getClass(), MetaModelService.Mode.RELAXED).isViewModel();
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#isPersistent(Object)} instead.
- */
- @Deprecated
- @Programmatic
- public boolean isPersistent(Object domainObject) {
- return repositoryService.isPersistent(domainObject);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#persist(Object)} instead. Please note that {@link org.apache.isis.applib.services.repository.RepositoryService#persist(Object)} will not throw an exception if the Domain Object is already persistent, so the implementation will be the same as that of {@link org.apache.isis.applib.services.repository.RepositoryService#persist(Object)}instead.
- */
- @Deprecated
- @Programmatic
- public void persist(Object domainObject) {
- repositoryService.persist(domainObject);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#persist(Object)} instead.
- */
- @Deprecated
- @Programmatic
- public void persistIfNotAlready(Object domainObject) {
- repositoryService.persist(domainObject);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#remove(Object)} instead.
- */
- @Deprecated
- @Programmatic
- public void remove(Object persistentDomainObject) {
- repositoryService.remove(persistentDomainObject);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#remove(Object)} instead.
- */
- @Deprecated
- @Programmatic
- public void removeIfNotAlready(Object domainObject) {
- repositoryService.remove(domainObject);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#informUser(String)} instead.
- */
- @Deprecated
- @Programmatic
- public void informUser(String message) {
- messageService.informUser(message);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#informUser(TranslatableString, Class, String)} instead.
- */
- @Deprecated
- @Programmatic
- public String informUser(TranslatableString message, final Class<?> contextClass, final String contextMethod) {
- return messageService.informUser(message, contextClass, contextMethod);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#warnUser(String)} instead.
- */
- @Deprecated
- @Programmatic
- public void warnUser(String message) {
- messageService.warnUser(message);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#warnUser(TranslatableString, Class, String)} instead.
- */
- @Deprecated
- @Programmatic
- public String warnUser(TranslatableString message, final Class<?> contextClass, final String contextMethod) {
- return messageService.warnUser(message, contextClass, contextMethod);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#raiseError(String)} instead.
- */
- @Deprecated
- @Programmatic
- public void raiseError(String message) {
- messageService.raiseError(message);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#raiseError(TranslatableString, Class, String)} instead.
- */
- @Deprecated
- @Programmatic
- public String raiseError(TranslatableString message, final Class<?> contextClass, final String contextMethod) {
- return messageService.raiseError(message, contextClass, contextMethod);
- }
-
-
- /**
- * @deprecated - use {@link IsisConfiguration} instead.
- */
- @Deprecated
- @Programmatic
- public String getProperty(String name) {
- return serviceRegistry.lookupServiceElseFail(IsisConfiguration.class)
- .getEnvironment()
- .getProperty(name);
- }
-
- /**
- * @deprecated - use {@link IsisConfiguration} instead.
- */
- @Deprecated
- @Programmatic
- public String getProperty(String name, String defaultValue) {
- return serviceRegistry.lookupServiceElseFail(IsisConfiguration.class)
- .getEnvironment().getProperty(name, defaultValue);
- }
-
- /**
- * @deprecated - use {@link IsisConfiguration} instead.
- */
- @Deprecated
- @Programmatic
- public List<String> getPropertyNames() {
- throw _Exceptions.notImplemented();
- }
-
- /**
- * @deprecated - use {@link UserService#currentUser()} instead
- */
- @Deprecated
- @Programmatic
- public UserMemento getUser() {
- return userService.currentUser().orElse(null);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#allInstances(Class, long, long)} instead
- */
- @Deprecated
- @Programmatic
- public <T> List<T> allInstances(Class<T> ofType, long... range){
- return
- range.length >= 2
- ? repositoryService.allInstances(ofType, range[0], range[1])
- : repositoryService.allInstances(ofType);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#allMatches(Class, java.util.function.Predicate)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> List<T> allMatches(final Class<T> ofType, final Predicate<? super T> predicate, long... range){
- return
- range.length >= 2
- ? repositoryService.allMatches(ofType, predicate::apply, range[0], range[1])
- : repositoryService.allMatches(ofType, predicate::apply);
- }
-
- /**
- * @deprecated - use {@link #allMatches(Class, Predicate, long...)} or (better) {@link #allMatches(Query)} instead
- */
- @Deprecated
- @Programmatic
- public <T> List<T> allMatches(final Class<T> ofType, final Filter<? super T> filter, long... range) {
- return
- range.length >= 2
- ? repositoryService.allMatches(ofType, filter::accept, range[0], range[1])
- : repositoryService.allMatches(ofType, filter::accept);
- }
-
- /**
- * Returns all the instances of the specified type (including subtypes) that
- * have the given title.
- * If the optional range parameters are used, the dataset returned starts
- * from (0 based) index, and consists of only up to count items.
- *
- * <p>
- * If there are no instances the list will be empty. This method creates a
- * new {@link List} object each time it is called so the caller is free to
- * use or modify the returned {@link List}, but the changes will not be
- * reflected back to the repository.
- * </p>
- *
- * <p>
- * This method is useful during prototyping, but - because the filtering is performed client-side -
- * this method is only really suitable for initial development/prototyping, or for classes with very few
- * instances. Use {@link #allMatches(Query)} for production code.
- * </p>
- *
- * @param range 2 longs, specifying 0-based start and count.
- *
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#allMatches(Class, java.util.function.Predicate, long, long)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> List<T> allMatches(Class<T> ofType, String title, long... range) {
- return
- range.length >= 2
- ? repositoryService.allMatches(ofType, obj->title.equals(titleService.titleOf(obj)), range[0], range[1])
- : repositoryService.allMatches(ofType, obj->title.equals(titleService.titleOf(obj)));
-
- }
-
- /**
- * Returns all the instances of the specified type (including subtypes) that
- * match the given object: where any property that is set will be tested and
- * properties that are not set will be ignored.
- * If the optional range parameters are used, the dataset returned starts
- * from (0 based) index, and consists of only up to count items.
- *
- * <p>
- * If there are no instances the list will be empty. This method creates a
- * new {@link List} object each time it is called so the caller is free to
- * use or modify the returned {@link List}, but the changes will not be
- * reflected back to the repository.
- * </p>
- *
- * <p>
- * This method is useful during prototyping, but - because the filtering is performed client-side -
- * this method is only really suitable for initial development/prototyping, or for classes with very few
- * instances. Use {@link #allMatches(Query)} for production code.
- * </p>
- *
- * @param range 2 longs, specifying 0-based start and count.
- *
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#allMatches(Class, java.util.function.Predicate, long, long)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> List<T> allMatches(Class<T> ofType, T pattern, long... range) {
- throw new RuntimeException("method no longer supported");
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#allMatches(Query)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> List<T> allMatches(Query<T> query) {
- return repositoryService.allMatches(query);
- }
-
- // //////////////////////////////////////
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#firstMatch(Class, java.util.function.Predicate)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T firstMatch(final Class<T> ofType, final Predicate<T> predicate) {
- return repositoryService.firstMatch(ofType, predicate::apply).orElse(null);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#firstMatch(Class, java.util.function.Predicate)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T firstMatch(final Class<T> ofType, final Filter<T> filter) {
- return repositoryService.firstMatch(ofType, filter::accept).orElse(null);
- }
-
- /**
- * Returns the first instance of the specified type (including subtypes)
- * that matches the supplied title, or <tt>null</tt> if none.
- *
- * <p>
- * This method is useful during prototyping, but - because the filtering is performed client-side -
- * this method is only really suitable for initial development/prototyping, or for classes with very few
- * instances. Use {@link #firstMatch(Query)} for production code.
- * </p>
- *
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#firstMatch(Class, java.util.function.Predicate)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T firstMatch(Class<T> ofType, String title) {
- return repositoryService.firstMatch(ofType, obj->title.equals(titleService.titleOf(obj))).orElse(null);
- }
-
- /**
- * Returns the first instance of the specified type (including subtypes)
- * that matches the supplied object as a pattern, or <tt>null</tt> if none.
- *
- * <p>
- * This method is useful during prototyping, but - because the filtering is performed client-side -
- * this method is only really suitable for initial development/prototyping, or for classes with very few
- * instances. Use {@link #firstMatch(Query)} for production code.
- * </p>
- *
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#firstMatch(Class, java.util.function.Predicate)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T firstMatch(Class<T> ofType, T pattern) {
- throw new RuntimeException("method no longer supported");
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#firstMatch(Query)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T firstMatch(Query<T> query) {
- Iterator<T> it = repositoryService.allMatches(query).iterator();
- return it.hasNext() ? it.next() : null;
- }
-
- // //////////////////////////////////////
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#uniqueMatch(Class, java.util.function.Predicate)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T uniqueMatch(final Class<T> ofType, final Predicate<T> predicate) {
- return repositoryService.uniqueMatch(ofType, predicate::apply).orElse(null);
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#uniqueMatch(Class, java.util.function.Predicate)} instead.
- */
- @Programmatic
- @Deprecated
- public <T> T uniqueMatch(final Class<T> ofType, final Filter<T> filter) {
- return repositoryService.uniqueMatch(ofType, filter::accept).orElse(null);
- }
-
- /**
- * Find the only instance of the specified type (including subtypes) that
- * has the specified title.
- *
- * <p>
- * If no instance is found then <tt>null</tt> will be returned, while if
- * there is more that one instances a run-time exception will be thrown.
- *
- * <p>
- * This method is useful during prototyping, but - because the filtering is performed client-side -
- * this method is only really suitable for initial development/prototyping, or for classes with very few
- * instances. Use {@link #uniqueMatch(Query)} for production code.
- * </p>
- *
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#uniqueMatch(Class, java.util.function.Predicate)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T uniqueMatch(Class<T> ofType, String title) {
- return repositoryService.uniqueMatch(ofType, obj->title.equals(titleService.titleOf(obj))).orElse(null);
- }
-
- /**
- * Find the only instance of the patterned object type (including subtypes)
- * that matches the set fields in the pattern object: where any property
- * that is set will be tested and properties that are not set will be
- * ignored.
- *
- * <p>
- * If no instance is found then null will be return, while if there is more
- * that one instances a run-time exception will be thrown.
- * </p>
- *
- * <p>
- * This method is useful during prototyping, but - because the filtering is performed client-side -
- * this method is only really suitable for initial development/prototyping, or for classes with very few
- * instances. Use {@link #uniqueMatch(Query)} for production code.
- * </p>
- *
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#uniqueMatch(Class, java.util.function.Predicate)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T uniqueMatch(Class<T> ofType, T pattern) {
- throw new RuntimeException("method no longer supported");
- }
-
- /**
- * @deprecated - use {@link org.apache.isis.applib.services.repository.RepositoryService#uniqueMatch(Query)} instead.
- */
- @Deprecated
- @Programmatic
- public <T> T uniqueMatch(Query<T> query) {
- return repositoryService.uniqueMatch(query).orElse(null);
- }
-
-
-}
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/filter/Filter.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/filter/Filter.java
deleted file mode 100644
index fb55d48..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/filter/Filter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.filter;
-
-import java.util.function.Predicate;
-
-/**
- * For use by repository implementations to allow a set of objects returned by a
- * back-end objectstore to be filtered before being returned to the caller.
- *
- * <p>
- * Note that this is different from the pattern or criteria object accepted by
- * some repositories' <tt>findXxx</tt> methods. Such criteria objects are
- * implementation-specific to the configured objectstore and allow it to return
- * an already-filtered set of rows. (For example, a Hibernate-based ObjectStore
- * would accept a representation of a HQL query; an XML-based objectstore might
- * accept an XPath query, etc.)
- *
- * @deprecated - use java's {@link Predicate} instead.
- */
-@Deprecated
-public interface Filter<T> {
-
- /**
- * Whether or not the supplied pojo meets this criteria.
- *
- * @param pojo
- * @return <tt>true</tt> if this pojo is acceptable, <tt>false</tt>
- * otherwise.
- */
- public boolean accept(T pojo);
-
-}
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/filter/Filters.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/filter/Filters.java
deleted file mode 100644
index 9d7c1fb..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/filter/Filters.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.filter;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-
-/**
- * @deprecated - use {@link Predicate} and {@link Predicates} instead.
- */
-@Deprecated
-public final class Filters {
-
- private Filters() {
- }
-
- @SafeVarargs
- public static <T> Filter<T> and(final Filter<T>... filters) {
- return new Filter<T>() {
- @Override
- public boolean accept(final T f) {
- for(final Filter<T> filter: filters) {
- if(!filter.accept(f)) {
- return false;
- }
- }
- return true;
- }
- };
- }
-
- @SafeVarargs
- public static <T> Filter<T> or(final Filter<T>... filters) {
- return new Filter<T>() {
- @Override
- public boolean accept(final T f) {
- for(final Filter<T> filter: filters) {
- if(filter.accept(f)) {
- return true;
- }
- }
- return false;
- }
- };
- }
-
- public static <T> Filter<T> not(final Filter<T> f1) {
- return new Filter<T>() {
- @Override
- public boolean accept(final T f) {
- return !f1.accept(f);
- }
- };
- }
-
- public static <T> Filter<T> any() {
- return new Filter<T>() {
- @Override
- public boolean accept(final T t) {
- return true;
- }
- };
- }
-
- public static final <T> Filter<T> anyOfType(final Class<T> clazz) {
- return any();
- }
-
- public static <T> Filter<T> none() {
- return new Filter<T>() {
- @Override
- public boolean accept(final T f) {
- return false;
- }
- };
- }
-
- public static <T> Filter<T> noneOfType(final Class<T> clazz) {
- return none();
- }
-
- public static <T> Predicate<T> asPredicate(final Filter<T> filter) {
- return new Predicate<T>() {
- @Override
- public boolean apply(T candidate) {
- return filter.accept(candidate);
- }
- };
- }
-
-}
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/services/eventbus/ActionDomainEvent.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/services/eventbus/ActionDomainEvent.java
deleted file mode 100644
index aa72e3f..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/services/eventbus/ActionDomainEvent.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.services.eventbus;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.events.domain.AbstractDomainEvent;
-import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.applib.services.iactn.Interaction;
-import org.apache.isis.applib.util.ObjectContracts;
-import org.apache.isis.applib.util.ToString;
-
-/**
- * @deprecated
- */
-@Deprecated
-public abstract class ActionDomainEvent<S> extends AbstractDomainEvent<S> {
-
- // -- Default class
- /**
- * This class is the default for the
- * {@link org.apache.isis.applib.annotation.Action#domainEvent()} annotation attribute. Whether this
- * raises an event or not depends upon the <tt>isis.core.meta-model.annotation.action.domain-event.post-for-default</tt>
- * configuration property.
- */
- public static class Default extends ActionDomainEvent<Object> { }
-
-
- // -- Noop class
-
- /**
- * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
- * property setting for the {@link Default} event.
- */
- public static class Noop extends ActionDomainEvent<Object> { }
-
-
- // -- Doop class
-
- /**
- * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
- * property setting for the {@link Default} event..
- */
- public static class Doop extends ActionDomainEvent<Object> { }
-
-
-
- /**
- * If used then the framework will set state via (non-API) setters.
- *
- * <p>
- * Recommended because it reduces the amount of boilerplate in the domain object classes.
- * </p>
- */
- public ActionDomainEvent() {
- }
-
- // -- command
- private Command command;
-
- /**
- * @deprecated - use {@link Interaction#getCommand()} to obtain the current {@link Command}.
- */
- @Deprecated
- public Command getCommand() {
- return command;
- }
-
- /**
- * Not API - set by the framework.
- *
- * @deprecated - the corresponding {@link #getCommand()} should not be called, instead use {@link Interaction#getCommand()} to obtain the current {@link Command}.
- */
- @Deprecated
- public void setCommand(Command command) {
- this.command = command;
- }
-
-
- // -- actionSemantics
- public SemanticsOf getSemantics() {
- return actionSemantics;
- }
-
- private SemanticsOf actionSemantics;
-
- /**
- * @deprecated - use {@link #getSemantics()} instead.
- */
- @Deprecated
- public SemanticsOf getActionSemantics() {
- return actionSemantics;
- }
-
- /**
- * Not API - set by the framework.
- */
- public void setActionSemantics(SemanticsOf actionSemantics) {
- this.actionSemantics = actionSemantics;
- }
-
-
-
- // -- parameterNames
- private List<String> parameterNames;
- public List<String> getParameterNames() {
- return parameterNames;
- }
- public void setParameterNames(final List<String> parameterNames) {
- this.parameterNames = parameterNames;
- }
-
-
- // -- parameterTypes
- private List<Class<?>> parameterTypes;
- public List<Class<?>> getParameterTypes() {
- return parameterTypes;
- }
-
- public void setParameterTypes(final List<Class<?>> parameterTypes) {
- this.parameterTypes = parameterTypes;
- }
-
-
-
-
- // -- arguments
- private List<Object> arguments;
- /**
- * The arguments being used to invoke the action;
- * populated at {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#VALIDATE} and subsequent phases
- * (but null for {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#HIDE hidden}
- * and {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#DISABLE disable} phases).
- */
- public List<Object> getArguments() {
- return arguments;
- }
-
- /**
- * Not API - set by the framework.
- */
- public void setArguments(List<Object> arguments) {
- this.arguments = arguments;
- }
-
-
- // -- returnValue
- /**
- *
- */
- private Object returnValue;
-
- /**
- * The value returned by the action.
- *
- * <p>
- * Only available for the
- * {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#EXECUTED}
- * {@link #getEventPhase() phase}.
- * </p>
- */
- public Object getReturnValue() {
- return returnValue;
- }
-
- /**
- * Not API - set by the framework
- */
- public void setReturnValue(final Object returnValue) {
- this.returnValue = returnValue;
- }
-
-
-
- private static final ToString<ActionDomainEvent<?>> toString = ObjectContracts.<ActionDomainEvent<?>>
- toString("source", ActionDomainEvent::getSource)
- .thenToString("identifier", ActionDomainEvent::getIdentifier)
- .thenToString("eventPhase", ActionDomainEvent::getEventPhase)
- ;
-
- @Override
- public String toString() {
- return toString.toString(this);
- }
-
-
-}
\ No newline at end of file
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/services/eventbus/CollectionDomainEvent.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/services/eventbus/CollectionDomainEvent.java
deleted file mode 100644
index ee4a655..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/services/eventbus/CollectionDomainEvent.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.legacy.applib.services.eventbus;
-
-import org.apache.isis.applib.events.domain.AbstractDomainEvent;
-import org.apache.isis.applib.util.ObjectContracts;
-import org.apache.isis.applib.util.ToString;
-
-/**
- * @deprecated
- */
-@Deprecated
-public abstract class CollectionDomainEvent<S, T> extends AbstractDomainEvent<S> {
-
- // -- Default class
- /**
- * This class is the default for the
- * {@link org.apache.isis.applib.annotation.Collection#domainEvent()} annotation attribute. Whether this
- * raises an event or not depends upon the <tt>isis.core.meta-model.annotation.collection.domain-event.post-for-default</tt>
- * configuration property.
- */
- public static class Default extends CollectionDomainEvent<Object, Object> {}
-
-
- // -- Noop class
-
- /**
- * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
- * property setting for the {@link Default} event.
- */
- public static class Noop extends CollectionDomainEvent<Object, Object> {}
-
-
- // -- Doop class
-
- /**
- * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
- * property setting for the {@link Default} event..
- */
- public static class Doop extends CollectionDomainEvent<Object, Object> {}
-
-
-
- // -- constructor
-
- /**
- * If used then the framework will set state via (non-API) setters.
- *
- * <p>
- * Recommended because it reduces the amount of boilerplate in the domain object classes.
- * </p>
- */
- public CollectionDomainEvent() {
- }
-
-
-
- // -- value
- private T value;
-
- /**
- * The proposed reference to either add or remove (per {@link #getOf()}), populated at {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#VALIDATE}
- * and subsequent phases (is null for {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#HIDE hidden} and {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#DISABLE disable} phases).
- */
- public T getValue() {
- return value;
- }
- /**
- * Not API, set by the framework.
- */
- public void setValue(T value) {
- this.value = value;
- }
-
-
- // -- Of
- public static enum Of {
- /**
- * The collection is being accessed
- * ({@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#HIDE hide} and
- * {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#DISABLE disable}) checks.
- */
- ACCESS,
- /**
- * The collection is being added to
- * ({@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#VALIDATE validity} check and
- * {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#EXECUTED execution}).
- */
- ADD_TO,
- /**
- * The collection is being removed from
- * ({@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#VALIDATE validity} check and
- * {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#EXECUTED execution}).
- */
- REMOVE_FROM
- }
-
- private Of of;
-
- public Of getOf() {
- return of;
- }
-
- /**
- * Not API; updates from {@link Of#ACCESS} to either {@link Of#ADD_TO} or {@link Of#REMOVE_FROM} when hits the
- * {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#VALIDATE validation phase}.
- */
- public void setOf(Of of) {
- this.of = of;
- }
-
-
-
- private static final ToString<CollectionDomainEvent<?,?>> toString =
- ObjectContracts.<CollectionDomainEvent<?,?>>
- toString("source", CollectionDomainEvent::getSource)
- .thenToString("identifier", CollectionDomainEvent::getIdentifier)
- .thenToString("eventPhase", CollectionDomainEvent::getEventPhase)
- .thenToString("of", CollectionDomainEvent::getOf)
- .thenToString("value", CollectionDomainEvent::getValue)
- ;
-
- @Override
- public String toString() {
- return toString.toString(this);
- }
-
-}
\ No newline at end of file
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/services/eventbus/PropertyDomainEvent.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/services/eventbus/PropertyDomainEvent.java
deleted file mode 100644
index 185bbb6..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/services/eventbus/PropertyDomainEvent.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.legacy.applib.services.eventbus;
-
-import org.apache.isis.applib.events.domain.AbstractDomainEvent;
-import org.apache.isis.applib.util.ObjectContracts;
-import org.apache.isis.applib.util.ToString;
-
-/**
- * @deprecated
- */
-@Deprecated
-public abstract class PropertyDomainEvent<S,T> extends AbstractDomainEvent<S> {
-
- // -- Default class
- /**
- * This class is the default for the
- * {@link org.apache.isis.applib.annotation.Property#domainEvent()} annotation attribute. Whether this
- * raises an event or not depends upon the <tt>isis.core.meta-model.annotation.property.domain-event.post-for-default</tt>
- * configuration property.
- */
- public static class Default extends PropertyDomainEvent<Object, Object> {}
-
-
- // -- Noop class
-
- /**
- * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
- * property setting for the {@link Default} event.
- */
- public static class Noop extends PropertyDomainEvent<Object, Object> {}
-
-
- // -- Doop class
-
- /**
- * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
- * property setting for the {@link Default} event..
- */
- public static class Doop extends PropertyDomainEvent<Object, Object> {}
-
-
- // -- constructors
-
- /**
- * If used then the framework will set state via (non-API) setters.
- *
- * <p>
- * Recommended because it reduces the amount of boilerplate in the domain object classes.
- * </p>
- */
- public PropertyDomainEvent() {
- }
-
-
- // -- oldValue
- private T oldValue;
-
- /**
- * The current (pre-modification) value of the property; populated at {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#VALIDATE} and subsequent phases
- * (but null for {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#HIDE hidden} and {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#DISABLE disable} phases).
- */
- public T getOldValue() {
- return oldValue;
- }
- /**
- * Not API; for framework use only.
- */
- public void setOldValue(T oldValue) {
- this.oldValue = oldValue;
- }
-
-
- // -- newValue
- private T newValue;
- /**
- * The proposed (post-modification) value of the property; populated at {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#VALIDATE} and subsequent phases
- * (but null for {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#HIDE hidden} and {@link org.apache.isis.applib.events.domain.AbstractDomainEvent.Phase#DISABLE disable} phases).
- */
- public T getNewValue() {
- return newValue;
- }
- /**
- * Not API; for framework use only.
- */
- public void setNewValue(T newValue) {
- this.newValue = newValue;
- }
-
-
- private static final ToString<PropertyDomainEvent<?,?>> toString =
- ObjectContracts.<PropertyDomainEvent<?,?>>
- toString("source", PropertyDomainEvent::getSource)
- .thenToString("identifier", PropertyDomainEvent::getIdentifier)
- .thenToString("eventPhase", PropertyDomainEvent::getEventPhase)
- .thenToString("oldValue", PropertyDomainEvent::getOldValue)
- .thenToString("newValue", PropertyDomainEvent::getNewValue)
- ;
-
- @Override
- public String toString() {
- return toString.toString(this);
- }
-
-}
\ No newline at end of file
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Color.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Color.java
deleted file mode 100644
index 102e8f6..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Color.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.value;
-
-import org.apache.isis.applib.annotation.Value;
-
-/**
- * Color is simple numerical representation of a color using the brightness of
- * red, green and blue (RGB) components.
- *
- * <p>
- * Where there is no basic colors (RGB all equal 0) then you get black; where
- * each color is at maximum (RGB all equal 255) you get white.
- *
- * @deprecated
- */
-@Deprecated
-@Value(semanticsProviderName = "org.apache.isis.core.metamodel.facets.value.color.ColorValueSemanticsProvider")
-public class Color extends Magnitude<Color> {
-
- private static final long serialVersionUID = 1L;
-
- public static final Color WHITE = new Color(0xffffff);
- public static final Color BLACK = new Color(0);
-
- private final int color;
-
- public Color(final int color) {
- this.color = color;
- }
-
- public int intValue() {
- return color;
- }
-
- /**
- * returns true if the number of this object has the same value as the
- * specified number
- */
- @Override
- public boolean isEqualTo(final Color number) {
- return (number).color == color;
- }
-
- /**
- * Returns true if this value is less than the specified value.
- */
- @Override
- public boolean isLessThan(final Color value) {
- return color < (value).color;
- }
-
- public String title() {
- if (color == 0) {
- return "Black";
- } else if (color == 0xffffff) {
- return "White";
- } else {
- return "#" + Integer.toHexString(color).toUpperCase();
- }
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final Color other = (Color) obj;
- if (color != other.color) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + color;
- return result;
- }
-
- @Override
- public String toString() {
- return "Color: #" + Integer.toHexString(color).toUpperCase();
- }
-}
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Image.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Image.java
deleted file mode 100644
index 890f326..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Image.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.value;
-
-import java.io.Serializable;
-
-import javax.annotation.Nullable;
-
-import org.apache.isis.applib.annotation.Value;
-import org.apache.isis.commons.internal.base._NullSafe;
-
-import lombok.val;
-
-/**
- * Represents an image.
- */
-@Value(semanticsProviderName = "org.apache.isis.core.metamodel.facets.value.image.ImageValueSemanticsProvider")
-public class Image implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private final int[][] pixels;
-
- private final int width;
- private final int height;
-
-
- /**
- * @param pixels - 2 dim array of pixels defining this image,
- * where each pixel is a 32 bit ARGB color value,
- * with {@code A} the alpha value as highest significant 8 bits
- * followed by {@code R} the red value and so on
- */
- public Image(final @Nullable int[][] pixels) {
-
- final int height = _NullSafe.size(pixels);
- final int width = height>0
- ? _NullSafe.size(pixels[0])
- : 0;
- final int pixelCount = width * height;
-
- if(pixelCount>0) {
- this.width = width;
- this.height = height;
- // make a clone
- this.pixels = clone(pixels, height);
- } else {
- this.width = 0;
- this.height = 0;
- this.pixels = null;
- }
-
- }
-
- /**
- * @return 2 dim array of pixels defining this image,
- * where each pixel is a 32 bit ARGB color value,
- * with {@code A} the alpha value as highest significant 8 bits
- * followed by {@code R} the red value and so on
- */
- @Nullable
- public int[][] getPixels() {
- // make a clone, don't expose the internal array
- return clone(pixels, height);
- }
-
- /**
- * @return height of this image or 0 if empty
- */
- public int getHeight() {
- return height;
- }
-
- /**
- * @return width of this image or 0 if empty
- */
- public int getWidth() {
- return width;
- }
-
- /**
- *
- * @return whether this image has any pixels
- */
- public boolean isEmpty() {
- return pixels==null;
- }
-
- @Override
- public String toString() {
- return isEmpty()
- ? "Image [empty]"
- : String.format("Image [size=%dx%d]", width, height);
- }
-
- // -- HELPER
-
- @Nullable
- private static int[][] clone(final @Nullable int[][] array, final int height) {
- if(array==null) {
- return null;
- }
- val result = new int[height][];
- for(int i=0; i<height; ++i) {
- result[i] = array[i].clone();
- }
- return result;
- }
-
-}
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Magnitude.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Magnitude.java
deleted file mode 100644
index cac9b3a..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Magnitude.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.value;
-
-import java.io.Serializable;
-
-/**
- * @deprecated
- */
-@Deprecated
-public abstract class Magnitude<T extends Magnitude<T>> implements Serializable {
- private static final long serialVersionUID = 1L;
-
- public boolean isBetween(final T minMagnitude, final T maxMagnitude) {
- return isGreaterThanOrEqualTo(minMagnitude) && isLessThanOrEqualTo(maxMagnitude);
- }
-
- public abstract boolean isEqualTo(final T magnitude);
-
- public boolean isGreaterThan(final T magnitude) {
- return magnitude.isLessThan(thisAsT());
- }
-
- public boolean isGreaterThanOrEqualTo(final T magnitude) {
- return !isLessThan(magnitude);
- }
-
- public abstract boolean isLessThan(final T magnitude);
-
- public boolean isLessThanOrEqualTo(final T magnitude) {
- return !isGreaterThan(magnitude);
- }
-
- public T max(final T magnitude) {
- return isGreaterThan(magnitude) ? thisAsT() : magnitude;
- }
-
- public T min(final T magnitude) {
- return isLessThan(magnitude) ? thisAsT() : magnitude;
- }
-
- @SuppressWarnings("unchecked")
- private T thisAsT() {
- return (T) this;
- }
-
-}
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Money.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Money.java
deleted file mode 100644
index 648510b..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Money.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.value;
-
-import java.math.BigDecimal;
-
-import org.apache.isis.applib.annotation.Value;
-
-/**
- * @deprecated
- */
-@Value(semanticsProviderName = "org.apache.isis.core.metamodel.facets.value.money.MoneyValueSemanticsProvider")
-@Deprecated
-public class Money extends Magnitude<Money> {
-
- private static final long serialVersionUID = 1L;
- private static final int[] cents = new int[] { 1, 10, 100, 100 };
- private final long amount;
- private final String currency;
-
- public Money(final double amount, final String currency) {
- assertCurrencySet(currency);
- this.currency = currency.toUpperCase();
- this.amount = Math.round(amount * centFactor());
- }
-
- public Money(final long amount, final String currency) {
- assertCurrencySet(currency);
- this.currency = currency.toUpperCase();
- this.amount = amount * centFactor();
- }
-
- private void assertCurrencySet(final String currency) {
- if (currency == null || currency.equals("")) {
- throw new IllegalArgumentException("Currency must be specified");
- }
- if (currency.length() != 3) {
- throw new IllegalArgumentException("Invalid currency code '" + currency + "'");
- }
- }
-
- /**
- * Add the specified money to this money.
- */
- public Money add(final Money money) {
- assertSameCurrency(money);
- return newMoney(amount + money.amount);
- }
-
- private void assertSameCurrency(final Money money) {
- if (!money.getCurrency().equals(getCurrency())) {
- throw new IllegalArgumentException("Not the same currency: " + getCurrency() + " & " + money.getCurrency());
- }
- }
-
- private int centFactor() {
- return cents[getFractionalDigits()];
- }
-
- /**
- * Returns this value as a double.
- */
- public double doubleValue() {
- return amount / (double) centFactor();
- }
-
- /**
- * Returns this value as a float.
- */
- public float floatValue() {
- return amount;
- }
-
- public BigDecimal getAmount() {
- return BigDecimal.valueOf(amount, getFractionalDigits());
- }
-
- public String getCurrency() {
- return currency;
- }
-
- private int getFractionalDigits() {
- return 2;
- }
-
- public boolean hasSameCurrency(final Money money) {
- return currency.equals(money.currency);
- }
-
- /**
- * Returns this value as an int.
- */
- public int intValue() {
- return (int) amount;
- }
-
- @Override
- public boolean isEqualTo(final Money magnitude) {
- if (!hasSameCurrency(magnitude)) {
- throw new IllegalArgumentException("Parameter must be of type Money and have the same currency");
- }
- return (magnitude).amount == amount;
- }
-
- public boolean isGreaterThanZero() {
- return amount > 0;
- }
-
- @Override
- public boolean isLessThan(final Money magnitude) {
- if (!hasSameCurrency(magnitude)) {
- throw new IllegalArgumentException("Parameter must be of type Money and have the same currency");
- }
- return amount < (magnitude).amount;
- }
-
- /**
- * Returns true if this value is less than zero.
- */
- public boolean isLessThanZero() {
- return amount < 0;
- }
-
- public boolean isZero() {
- return amount == 0;
- }
-
- /**
- * Returns this value as an long.
- */
- public long longValue() {
- return amount;
- }
-
- private Money newMoney(final long amount) {
- return new Money(amount / (centFactor() * 1.0), this.currency);
- }
-
- /**
- * Subtract the specified amount from this value.
- */
- public Money subtract(final Money money) {
- assertSameCurrency(money);
- return newMoney(amount - money.amount);
- }
-
- @Override
- public boolean equals(final Object other) {
- if (this == other) {
- return true;
- }
- if (other == null) {
- return false;
- }
- return other.getClass() == this.getClass() && equals((Money) other);
- }
-
- public boolean equals(final Money other) {
- return other.currency.equals(currency) && other.amount == amount;
- }
-
- @Override
- public int hashCode() {
- return (int) amount;
- }
-
- @Override
- public String toString() {
- return amount / (centFactor() * 1.0) + " " + currency;
- }
-}
diff --git a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Percentage.java b/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Percentage.java
deleted file mode 100644
index c23a457..0000000
--- a/legacy/extensions/core/applib/src/main/java/org/apache/isis/legacy/applib/value/Percentage.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.value;
-
-import org.apache.isis.applib.annotation.Value;
-
-/**
- * @deprecated
- */
-@Value(semanticsProviderName = "org.apache.isis.core.metamodel.facets.value.percentage.PercentageValueSemanticsProvider")
-@Deprecated
-public class Percentage extends Magnitude<Percentage> {
-
- private static final long serialVersionUID = 1L;
- private final float value;
-
- public Percentage(final float value) {
- this.value = value;
- }
-
- public Percentage add(final float value) {
- return new Percentage((floatValue() + value));
- }
-
- public Percentage add(final Percentage value) {
- return add(value.floatValue());
- }
-
- /**
- * Returns this value as an double.
- */
- public double doubleValue() {
- return value;
- }
-
- /**
- * Returns this value as an float.
- */
- public float floatValue() {
- return value;
- }
-
- /**
- * Returns this value as an int.
- */
- public int intValue() {
- return (int) value;
- }
-
- /**
- */
- @Override
- public boolean isEqualTo(final Percentage magnitude) {
- return (magnitude).value == value;
- }
-
- @Override
- public boolean isLessThan(final Percentage magnitude) {
- return value < (magnitude).value;
- }
-
- /**
- * Returns this value as an long.
- */
- public long longValue() {
- return (long) value;
- }
-
- public Percentage multiply(final float value) {
- return new Percentage((floatValue() * value));
- }
-
- /**
- * Returns this value as an short.
- */
- public short shortValue() {
- return (short) value;
- }
-
- public Percentage subtract(final float value) {
- return add(-value);
- }
-
- public Percentage subtract(final Percentage value) {
- return add(-value.floatValue());
- }
-
- @Override
- public boolean equals(final Object other) {
- if (this == other) {
- return true;
- }
- if (other == null) {
- return false;
- }
- return other.getClass() == this.getClass() && equals((Percentage) other);
- }
-
- public boolean equals(final Percentage other) {
- return value == other.value;
- }
-
- @Override
- public int hashCode() {
- // multiply by 100 just in case the percentage is being stored as 0.0 to
- // 1.0
- return (int) (floatValue() * 100);
- }
-
- @Override
- public String toString() {
- return "" + value;
- }
-}
diff --git a/legacy/extensions/core/applib/src/test/java/org/apache/isis/legacy/applib/value/ColorTest.java b/legacy/extensions/core/applib/src/test/java/org/apache/isis/legacy/applib/value/ColorTest.java
deleted file mode 100644
index 51ba5ae..0000000
--- a/legacy/extensions/core/applib/src/test/java/org/apache/isis/legacy/applib/value/ColorTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.value;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-public class ColorTest {
- @Test
- public void testToTitle() throws Exception {
- assertEquals("Black", Color.BLACK.title());
- assertEquals("White", Color.WHITE.title());
- assertEquals("#FE231D", new Color(0xfe231D).title());
- }
-
- @Test
- public void testIsLessThan() throws Exception {
- assertTrue(Color.BLACK.isLessThan(Color.WHITE));
- }
-}
diff --git a/legacy/extensions/core/applib/src/test/java/org/apache/isis/legacy/applib/value/MoneyTest.java b/legacy/extensions/core/applib/src/test/java/org/apache/isis/legacy/applib/value/MoneyTest.java
deleted file mode 100644
index 0066e0b..0000000
--- a/legacy/extensions/core/applib/src/test/java/org/apache/isis/legacy/applib/value/MoneyTest.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.value;
-
-import java.math.BigDecimal;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-public class MoneyTest {
-
- @Test
- public void testAdd() {
- final Money m1 = new Money(110, "pds");
- final Money m2 = new Money(220, "pds");
- final Money m3 = m1.add(m2);
- assertEquals(330.0, m3.doubleValue(), 0.0);
- }
-
- @Test
- public void testAddWithCents() {
- final Money m1 = new Money(110.10, "pds");
- final Money m2 = new Money(220.50, "pds");
- final Money m3 = m1.add(m2);
- assertEquals(330.60, m3.doubleValue(), 0.0);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testAddThrowsExceptionForDifferentCurrencies() {
- final Money m1 = new Money(100, "pds");
- final Money m2 = new Money(200, "uds");
-
- m1.add(m2);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testDoubleConstructorExpectsCurrencyToBeSpecified() {
- new Money(100.50, null);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testLongConstructorExpectsCurrencyToBeSpecified() {
- new Money(100L, null);
- }
-
- @Test
- public void testCreateFromDouble() {
- final Money m1 = new Money(100.50, "pds");
- assertEquals("100.50", m1.getAmount().toString());
- assertEquals(100.50, m1.doubleValue(), 0.0);
- }
-
- @Test
- public void testDouble() {
- final Money m1 = new Money(100, "pds");
- assertEquals(100.0, m1.doubleValue(), 0.0);
- }
-
- @Test
- public void testDoubleConstructor() {
- final Money m1 = new Money(100.15, "pds");
- assertEquals(100.15, m1.doubleValue(), 0.0);
- }
-
- @Test
- public void testDoubleRoundingDown() {
- final Money m1 = new Money(100.154, "pds");
- assertEquals(100.15, m1.doubleValue(), 0.0);
- }
-
- @Test
- public void testDoubleRoundingUp() {
- final Money m1 = new Money(100.156, "pds");
- assertEquals(100.16, m1.doubleValue(), 0.0);
- }
-
- @Test
- public void testEqualsObject() {
- final Money m1 = new Money(100.25, "pds");
- final Money m2 = new Money(100.25, "pds");
- assertTrue(m1.equals(m2));
- }
-
- @Test
- public void testEqualsObjectFailsWithDifferentAmounts() {
- final Money m1 = new Money(100, "pds");
- final Money m2 = new Money(101, "pds");
- assertFalse(m1.equals(m2));
- }
-
- @Test
- public void testEqualsObjectFailsWithDifferentCurrencies() {
- final Money m1 = new Money(100, "pds");
- final Money m2 = new Money(100, "usd");
- assertFalse(m1.equals(m2));
- }
-
- @Test
- public void testGetAmount() {
- final Money m1 = new Money(100, "pds");
- assertEquals(BigDecimal.valueOf(10000, 2), m1.getAmount());
- }
-
- @Test
- public void testHasSameCurrency() {
- final Money m1 = new Money(100, "pds");
- final Money m2 = new Money(200, "pds");
- final Money m3 = new Money(200, "usd");
- assertTrue(m1.hasSameCurrency(m2));
- assertFalse(m1.hasSameCurrency(m3));
- }
-
- @Test
- public void testIsEqualTo() {
- final Money m1 = new Money(100, "pds");
- final Money m2 = new Money(100, "pds");
- assertTrue(m1.isEqualTo(m2));
- }
-
- @Test
- public void testIsEqualToFailsWithDifferentAmount() {
- final Money m1 = new Money(100, "pds");
- final Money m2 = new Money(101, "pds");
- assertFalse(m1.isEqualTo(m2));
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testIsEqualToThrowsExceptionWithDifferentCurrencies() {
- final Money m1 = new Money(100, "pds");
- final Money m2 = new Money(100, "usd");
-
- m1.isEqualTo(m2);
- }
-
- @Test
- public void testIsGreaterThanZero() {
- final Money m1 = new Money(1, "usd");
- assertTrue(m1.isGreaterThanZero());
- }
-
- @Test
- public void testIsGreaterThanZeroFailsWhenZero() {
- final Money m1 = new Money(0, "usd");
- assertFalse(m1.isGreaterThanZero());
- }
-
- @Test
- public void testIsLessThan() {
- final Money m1 = new Money(98, "pds");
- final Money m2 = new Money(100, "pds");
- assertTrue(m1.isLessThan(m2));
- }
-
- @Test
- public void testIsLessThanFails() {
- final Money m1 = new Money(98, "pds");
- final Money m2 = new Money(100, "pds");
- assertFalse(m2.isLessThan(m1));
- }
-
- @Test
- public void testIsLessThanZero() {
- final Money m1 = new Money(-1, "usd");
- assertTrue(m1.isLessThanZero());
- }
-
- @Test
- public void testIsLessThanZeroFailsWhenZero() {
- final Money m1 = new Money(0, "usd");
- assertFalse(m1.isLessThanZero());
- }
-
- public void testIsLessThrowsExceptionWithDifferentCurrencies() {
- final Money m1 = new Money(98, "pds");
- final Money m2 = new Money(100, "usd");
- try {
- m2.isLessThan(m1);
- fail();
- } catch (final IllegalArgumentException expected) {
- }
- }
-
- @Test
- public void testIsZero() {
- final Money m1 = new Money(0, "usd");
- assertTrue(m1.isZero());
- }
-
- @Test
- public void testIsZeroFailsWhenPositive() {
- final Money m1 = new Money(1, "usd");
- assertFalse(m1.isZero());
- }
-
- @Test
- public void testSubtract() {
- final Money m1 = new Money(300, "pds");
- final Money m2 = new Money(100, "pds");
- final Money m3 = m1.subtract(m2);
- assertEquals(200.0, m3.doubleValue(), 0.0);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testSubtractThrowsExceptionForDifferentCurrencies() {
- final Money m1 = new Money(100, "pds");
- final Money m2 = new Money(200, "uds");
-
- m1.subtract(m2);
- }
-
-}
diff --git a/legacy/extensions/core/applib/src/test/java/org/apache/isis/legacy/applib/value/PercentageTest.java b/legacy/extensions/core/applib/src/test/java/org/apache/isis/legacy/applib/value/PercentageTest.java
deleted file mode 100644
index 78b9904..0000000
--- a/legacy/extensions/core/applib/src/test/java/org/apache/isis/legacy/applib/value/PercentageTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.applib.value;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-
-public class PercentageTest {
- Percentage p1;
- Percentage p2;
- Percentage p3;
-
- @Before
- public void setUp() throws Exception {
- p1 = new Percentage(10.5f);
- p2 = new Percentage(10.5f);
- p3 = new Percentage(12.0f);
- }
-
- @Test
- public void testEquals() {
- assertEquals(p1, p2);
- assertNotSame(p1, p2);
- assertFalse(p1.equals(p3));
- }
-
- @Test
- public void testAddFloat() {
- final Percentage p4 = p1.add(10.0f);
- assertEquals(20.5f, p4.floatValue(), 0.0f);
- }
-
- @Test
- public void testAddPercentage() {
- final Percentage p4 = p1.add(p3);
- assertEquals(22.5f, p4.floatValue(), 0.0f);
- }
-
- @Test
- public void testIsEqualTo() {
- assertTrue(p1.isEqualTo(p2));
- assertFalse(p1.isEqualTo(p3));
- }
-
- @Test
- public void testIsLessThan() {
- assertTrue(p1.isLessThan(p3));
- assertFalse(p3.isLessThan(p1));
- assertFalse(p1.isLessThan(p1));
- }
-}
diff --git a/legacy/extensions/core/commons/.gitignore b/legacy/extensions/core/commons/.gitignore
deleted file mode 100644
index a48e45b..0000000
--- a/legacy/extensions/core/commons/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/target-ide
diff --git a/legacy/extensions/core/commons/pom.xml b/legacy/extensions/core/commons/pom.xml
deleted file mode 100644
index 22ff6ea..0000000
--- a/legacy/extensions/core/commons/pom.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.isis.legacy</groupId>
- <artifactId>isis-legacy</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../../pom.xml</relativePath>
- </parent>
-
- <artifactId>isis-legacy-commons</artifactId>
- <name>Apache Isis Legacy - Commons</name>
- <description>
- To ease migration from Apache Isis versions 1.16+ to 2.0.0.
- </description>
-
- <properties>
- <jar-plugin.automaticModuleName>org.apache.isis.legacy.commons</jar-plugin.automaticModuleName>
- <git-plugin.propertiesDir>org/apache/isis/legacy/commons</git-plugin.propertiesDir>
- </properties>
-
- <dependencies>
-
- <!-- JDO API (non transient, provided by plugin) -->
- <dependency>
- <!-- v3.2 not available yet, use datanucleus staging for now -->
- <!-- <groupId>javax.jdo</groupId> -->
- <!-- <artifactId>jdo-api</artifactId> -->
- <groupId>org.datanucleus</groupId>
- <artifactId>javax.jdo</artifactId>
- <!-- provided by plugins -->
- <scope>provided</scope>
- </dependency>
-
- <!-- LEGACY DEPENDENCY -->
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
-
- <!-- CORE -->
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-applib</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.persistence</groupId>
- <artifactId>isis-persistence-jdo-applib</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-runtime</artifactId>
- <scope>compile</scope>
- </dependency>
-
-
- <!-- TEST DEPENDENCY -->
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-internaltestsupport</artifactId>
- <scope>test</scope>
- <exclusions>
- <!-- whatever unittestsupport is dependent on, it should not be transitive -->
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/legacy/extensions/core/commons/src/main/adoc/antora.yml b/legacy/extensions/core/commons/src/main/adoc/antora.yml
deleted file mode 100644
index 3938f85..0000000
--- a/legacy/extensions/core/commons/src/main/adoc/antora.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name: legacy
-version: latest
diff --git a/legacy/extensions/core/commons/src/main/adoc/modules/commons/nav.adoc b/legacy/extensions/core/commons/src/main/adoc/modules/commons/nav.adoc
deleted file mode 100644
index 6485415..0000000
--- a/legacy/extensions/core/commons/src/main/adoc/modules/commons/nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-include::legacy:ROOT:partial$component-nav.adoc[]
diff --git a/legacy/extensions/core/commons/src/main/adoc/modules/commons/pages/about.adoc b/legacy/extensions/core/commons/src/main/adoc/modules/commons/pages/about.adoc
deleted file mode 100644
index 4cc95c2..0000000
--- a/legacy/extensions/core/commons/src/main/adoc/modules/commons/pages/about.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= Commons
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-WARNING: TODO
diff --git a/legacy/extensions/core/commons/src/main/adoc/modules/commons/partials/module-nav.adoc b/legacy/extensions/core/commons/src/main/adoc/modules/commons/partials/module-nav.adoc
deleted file mode 100644
index 2cc4bbe..0000000
--- a/legacy/extensions/core/commons/src/main/adoc/modules/commons/partials/module-nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-* xref:legacy:commons:about.adoc[Commons]
-
-
-
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataInputExtended.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataInputExtended.java
deleted file mode 100644
index 9e5a287..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataInputExtended.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.DataInput;
-import java.io.DataInputStream;
-import java.io.IOException;
-
-public interface DataInputExtended extends DataInput {
-
- public boolean[] readBooleans() throws IOException;
-
- public char[] readChars() throws IOException;
-
- public byte[] readBytes() throws IOException;
-
- public short[] readShorts() throws IOException;
-
- public int[] readInts() throws IOException;
-
- public long[] readLongs() throws IOException;
-
- public float[] readFloats() throws IOException;
-
- public double[] readDoubles() throws IOException;
-
- public String[] readUTFs() throws IOException;
-
- public <T> T readEncodable(Class<T> encodableType) throws IOException;
-
- public <T> T[] readEncodables(Class<T> elementType) throws IOException;
-
- public <T> T readSerializable(Class<T> serializableType) throws IOException;
-
- public <T> T[] readSerializables(Class<T> elementType) throws IOException;
-
- /**
- * Underlying {@link DataInputStream} to read in primitives.
- */
- DataInputStream getDataInputStream();
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataInputExtendedDecorator.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataInputExtendedDecorator.java
deleted file mode 100644
index 739e96c..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataInputExtendedDecorator.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-
-public class DataInputExtendedDecorator implements DataInputExtended {
-
- private final DataInputExtended underlying;
-
- public DataInputExtendedDecorator(final DataInputExtended underlying) {
- this.underlying = underlying;
- }
-
- @Override
- public DataInputStream getDataInputStream() {
- return underlying.getDataInputStream();
- }
-
- // ////////////////////////////////////////
- // Boolean, Char
- // ////////////////////////////////////////
-
- @Override
- public boolean readBoolean() throws IOException {
- return underlying.readBoolean();
- }
-
- @Override
- public boolean[] readBooleans() throws IOException {
- return underlying.readBooleans();
- }
-
- @Override
- public char readChar() throws IOException {
- return underlying.readChar();
- }
-
- @Override
- public char[] readChars() throws IOException {
- return underlying.readChars();
- }
-
- // ////////////////////////////////////////
- // Integral Numbers
- // ////////////////////////////////////////
-
- @Override
- public byte readByte() throws IOException {
- return underlying.readByte();
- }
-
- @Override
- public int readUnsignedByte() throws IOException {
- return underlying.readUnsignedByte();
- }
-
- @Override
- public byte[] readBytes() throws IOException {
- return underlying.readBytes();
- }
-
- @Override
- public short readShort() throws IOException {
- return underlying.readShort();
- }
-
- @Override
- public int readUnsignedShort() throws IOException {
- return underlying.readUnsignedShort();
- }
-
- @Override
- public short[] readShorts() throws IOException {
- return underlying.readShorts();
- }
-
- @Override
- public int readInt() throws IOException {
- return underlying.readInt();
- }
-
- @Override
- public int[] readInts() throws IOException {
- return underlying.readInts();
- }
-
- @Override
- public long[] readLongs() throws IOException {
- return underlying.readLongs();
- }
-
- @Override
- public long readLong() throws IOException {
- return underlying.readLong();
- }
-
- // ////////////////////////////////////////
- // Floating Point Numbers
- // ////////////////////////////////////////
-
- @Override
- public float readFloat() throws IOException {
- return underlying.readFloat();
- }
-
- @Override
- public float[] readFloats() throws IOException {
- return underlying.readFloats();
- }
-
- @Override
- public double readDouble() throws IOException {
- return underlying.readDouble();
- }
-
- @Override
- public double[] readDoubles() throws IOException {
- return underlying.readDoubles();
- }
-
- // ////////////////////////////////////////
- // Strings
- // ////////////////////////////////////////
-
- @Override
- public String readUTF() throws IOException {
- return underlying.readUTF();
- }
-
- @Override
- public String[] readUTFs() throws IOException {
- return underlying.readUTFs();
- }
-
- // ////////////////////////////////////////
- // Encodable and Serializable
- // ////////////////////////////////////////
-
- @Override
- public <T> T readEncodable(final Class<T> encodableType) throws IOException {
- return underlying.readEncodable(encodableType);
- }
-
- @Override
- public <T> T[] readEncodables(final Class<T> encodableType) throws IOException {
- return underlying.readEncodables(encodableType);
- }
-
- @Override
- public <T> T readSerializable(final Class<T> serializableType) throws IOException {
- return underlying.readSerializable(serializableType);
- }
-
- @Override
- public <T> T[] readSerializables(final Class<T> serializableType) throws IOException {
- return underlying.readSerializables(serializableType);
- }
-
- // ////////////////////////////////////////
- // Other
- // ////////////////////////////////////////
-
- @Override
- public void readFully(final byte[] b) throws IOException {
- underlying.readFully(b);
- }
-
- @Override
- public void readFully(final byte[] b, final int off, final int len) throws IOException {
- underlying.readFully(b, off, len);
- }
-
- @Override
- public String readLine() throws IOException {
- return underlying.readLine();
- }
-
- @Override
- public int skipBytes(final int n) throws IOException {
- return underlying.skipBytes(n);
- }
-
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataInputStreamExtended.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataInputStreamExtended.java
deleted file mode 100644
index ec75b45..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataInputStreamExtended.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class DataInputStreamExtended implements DataInputExtended {
-
- private final DataInputStream dataInputStream;
-
- public DataInputStreamExtended(final InputStream inputStream) {
- this.dataInputStream = new DataInputStream(inputStream);
- }
-
- @Override
- public DataInputStream getDataInputStream() {
- return dataInputStream;
- }
-
- // ////////////////////////////////////////
- // Boolean, Char
- // ////////////////////////////////////////
-
- @Override
- public boolean readBoolean() throws IOException {
- return FieldType.BOOLEAN.read(this);
- }
-
- @Override
- public boolean[] readBooleans() throws IOException {
- return FieldType.BOOLEAN_ARRAY.read(this);
- }
-
- @Override
- public char readChar() throws IOException {
- return FieldType.CHAR.read(this);
- }
-
- @Override
- public char[] readChars() throws IOException {
- return FieldType.CHAR_ARRAY.read(this);
- }
-
- // ////////////////////////////////////////
- // Integral Numbers
- // ////////////////////////////////////////
-
- @Override
- public byte readByte() throws IOException {
- return FieldType.BYTE.read(this);
- }
-
- @Override
- public byte[] readBytes() throws IOException {
- return FieldType.BYTE_ARRAY.read(this);
- }
-
- @Override
- public short readShort() throws IOException {
- return FieldType.SHORT.read(this);
- }
-
- @Override
- public short[] readShorts() throws IOException {
- return FieldType.SHORT_ARRAY.read(this);
- }
-
- @Override
- public int readInt() throws IOException {
- return FieldType.INTEGER.read(this);
- }
-
- @Override
- public int readUnsignedByte() throws IOException {
- return FieldType.UNSIGNED_BYTE.read(this);
- }
-
- @Override
- public int readUnsignedShort() throws IOException {
- return FieldType.UNSIGNED_SHORT.read(this);
- }
-
- @Override
- public int[] readInts() throws IOException {
- return FieldType.INTEGER_ARRAY.read(this);
- }
-
- @Override
- public long readLong() throws IOException {
- return FieldType.LONG.read(this);
- }
-
- @Override
- public long[] readLongs() throws IOException {
- return FieldType.LONG_ARRAY.read(this);
- }
-
- // ////////////////////////////////////////
- // Floating Point Numbers
- // ////////////////////////////////////////
-
- @Override
- public float readFloat() throws IOException {
- return FieldType.FLOAT.read(this);
- }
-
- @Override
- public float[] readFloats() throws IOException {
- return FieldType.FLOAT_ARRAY.read(this);
- }
-
- @Override
- public double readDouble() throws IOException {
- return FieldType.DOUBLE.read(this);
- }
-
- @Override
- public double[] readDoubles() throws IOException {
- return FieldType.DOUBLE_ARRAY.read(this);
- }
-
- // ////////////////////////////////////////
- // Strings
- // ////////////////////////////////////////
-
- @Override
- public String readUTF() throws IOException {
- return FieldType.STRING.read(this);
- }
-
- @Override
- public String[] readUTFs() throws IOException {
- return FieldType.STRING_ARRAY.read(this);
- }
-
- // ////////////////////////////////////////
- // Encodable and Serializable
- // ////////////////////////////////////////
-
- @Override
- @SuppressWarnings("unchecked")
- public <T> T readEncodable(final Class<T> encodableType) throws IOException {
- return (T) FieldType.ENCODABLE.read(this);
- }
-
- @Override
- public <T> T[] readEncodables(final Class<T> elementType) throws IOException {
- return FieldType.ENCODABLE_ARRAY.readArray(this, elementType);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T> T readSerializable(final Class<T> serializableType) throws IOException {
- return (T) FieldType.SERIALIZABLE.read(this);
- }
-
- @Override
- public <T> T[] readSerializables(final Class<T> elementType) throws IOException {
- return FieldType.SERIALIZABLE_ARRAY.readArray(this, elementType);
- }
-
- // ////////////////////////////////////////
- // Other
- // ////////////////////////////////////////
-
- @Override
- public void readFully(final byte[] b) throws IOException {
- dataInputStream.readFully(b);
- }
-
- @Override
- public void readFully(final byte[] b, final int off, final int len) throws IOException {
- dataInputStream.readFully(b, off, len);
- }
-
- @Override
- @SuppressWarnings("deprecation")
- public String readLine() throws IOException {
- return dataInputStream.readLine();
- }
-
- @Override
- public int skipBytes(final int n) throws IOException {
- return dataInputStream.skipBytes(n);
- }
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataOutputExtended.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataOutputExtended.java
deleted file mode 100644
index 28a180b..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataOutputExtended.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.DataOutput;
-import java.io.DataOutputStream;
-import java.io.Flushable;
-import java.io.IOException;
-
-public interface DataOutputExtended extends DataOutput, Flushable {
-
- public void writeBooleans(boolean[] booleans) throws IOException;
-
- public void writeChars(char[] chars) throws IOException;
-
- /**
- * NB: only writes out <tt>byte</tt>.
- */
- @Override
- public void write(int b) throws IOException;
-
- /**
- * Same as {@link #write(int)}.
- */
- @Override
- public void writeByte(int v) throws IOException;
-
- public void writeBytes(byte[] bytes) throws IOException;
-
- public void writeShorts(short[] shorts) throws IOException;
-
- public void writeInts(int[] ints) throws IOException;
-
- public void writeLongs(long[] longs) throws IOException;
-
- public void writeDoubles(double[] doubles) throws IOException;
-
- public void writeFloats(float[] floats) throws IOException;
-
- public void writeUTFs(String[] strings) throws IOException;
-
- public void writeEncodable(Object encodable) throws IOException;
-
- public void writeEncodables(Object[] encodables) throws IOException;
-
- public void writeSerializable(Object serializable) throws IOException;
-
- public void writeSerializables(Object[] serializables) throws IOException;
-
- DataOutputStream getDataOutputStream();
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataOutputExtendedDecorator.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataOutputExtendedDecorator.java
deleted file mode 100644
index bb418d0..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataOutputExtendedDecorator.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-public class DataOutputExtendedDecorator implements DataOutputExtended {
-
- private final DataOutputExtended underlying;
-
- public DataOutputExtendedDecorator(final DataOutputExtended underlying) {
- this.underlying = underlying;
- }
-
- @Override
- public DataOutputStream getDataOutputStream() {
- return underlying.getDataOutputStream();
- }
-
- // ////////////////////////////////////////
- // Boolean, Char
- // ////////////////////////////////////////
-
- @Override
- public void writeBoolean(final boolean v) throws IOException {
- underlying.writeBoolean(v);
- }
-
- @Override
- public void writeBooleans(final boolean[] booleans) throws IOException {
- underlying.writeBooleans(booleans);
- }
-
- @Override
- public void writeChar(final int v) throws IOException {
- underlying.writeChar(v);
- }
-
- @Override
- public void writeChars(final char[] chars) throws IOException {
- underlying.writeChars(chars);
- }
-
- // ////////////////////////////////////////
- // Integral Numbers
- // ////////////////////////////////////////
-
- @Override
- public void write(final int b) throws IOException {
- underlying.write(b);
- }
-
- @Override
- public void writeByte(final int v) throws IOException {
- underlying.writeByte(v);
- }
-
- @Override
- public void write(final byte[] b) throws IOException {
- underlying.write(b);
- }
-
- @Override
- public void writeBytes(final byte[] bytes) throws IOException {
- underlying.writeBytes(bytes);
- }
-
- @Override
- public void writeShort(final int v) throws IOException {
- underlying.writeShort(v);
- }
-
- @Override
- public void writeShorts(final short[] shorts) throws IOException {
- underlying.writeShorts(shorts);
- }
-
- @Override
- public void writeInt(final int v) throws IOException {
- underlying.writeInt(v);
- }
-
- @Override
- public void writeInts(final int[] ints) throws IOException {
- underlying.writeInts(ints);
- }
-
- @Override
- public void writeLong(final long v) throws IOException {
- underlying.writeLong(v);
- }
-
- @Override
- public void writeLongs(final long[] longs) throws IOException {
- underlying.writeLongs(longs);
- }
-
- // ////////////////////////////////////////
- // Floating Point Numbers
- // ////////////////////////////////////////
-
- @Override
- public void writeFloat(final float v) throws IOException {
- underlying.writeFloat(v);
- }
-
- @Override
- public void writeFloats(final float[] floats) throws IOException {
- underlying.writeFloats(floats);
- }
-
- @Override
- public void writeDouble(final double v) throws IOException {
- underlying.writeDouble(v);
- }
-
- @Override
- public void writeDoubles(final double[] doubles) throws IOException {
- underlying.writeDoubles(doubles);
- }
-
- // ////////////////////////////////////////
- // Strings
- // ////////////////////////////////////////
-
- @Override
- public void writeUTF(final String str) throws IOException {
- underlying.writeUTF(str);
- }
-
- @Override
- public void writeUTFs(final String[] strings) throws IOException {
- underlying.writeUTFs(strings);
- }
-
- // ////////////////////////////////////////
- // Encodable and Serializable
- // ////////////////////////////////////////
-
- @Override
- public void writeEncodable(final Object encodable) throws IOException {
- underlying.writeEncodable(encodable);
- }
-
- @Override
- public void writeEncodables(final Object[] encodables) throws IOException {
- underlying.writeEncodables(encodables);
- }
-
- @Override
- public void writeSerializable(final Object serializable) throws IOException {
- underlying.writeSerializable(serializable);
- }
-
- @Override
- public void writeSerializables(final Object[] serializables) throws IOException {
- underlying.writeSerializables(serializables);
- }
-
- // ////////////////////////////////////////
- // Other
- // ////////////////////////////////////////
-
- @Override
- public void write(final byte[] b, final int off, final int len) throws IOException {
- underlying.write(b, off, len);
- }
-
- @Override
- public void writeBytes(final String s) throws IOException {
- underlying.writeBytes(s);
- }
-
- @Override
- public void writeChars(final String s) throws IOException {
- underlying.writeChars(s);
- }
-
- // ////////////////////////////////////////
- // Flush
- // ////////////////////////////////////////
-
- @Override
- public void flush() throws IOException {
- underlying.flush();
- }
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataOutputStreamExtended.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataOutputStreamExtended.java
deleted file mode 100644
index 366fb7d..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DataOutputStreamExtended.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Serializable;
-
-public class DataOutputStreamExtended implements DataOutputExtended {
-
- private final DataOutputStream dataOutputStream;
-
- public DataOutputStreamExtended(final OutputStream output) {
- dataOutputStream = new DataOutputStream(output);
- }
-
- @Override
- public DataOutputStream getDataOutputStream() {
- return dataOutputStream;
- }
-
- // ////////////////////////////////////////
- // Boolean, Char
- // ////////////////////////////////////////
-
- @Override
- public void writeBoolean(final boolean value) throws IOException {
- FieldType.BOOLEAN.write(this, value);
- }
-
- @Override
- public void writeBooleans(final boolean[] value) throws IOException {
- FieldType.BOOLEAN_ARRAY.write(this, value);
- }
-
- @Override
- public void writeChar(final int value) throws IOException {
- FieldType.CHAR.write(this, (char) value);
- }
-
- @Override
- public void writeChars(final char[] value) throws IOException {
- FieldType.CHAR_ARRAY.write(this, value);
- }
-
-
- // ////////////////////////////////////////
- // Integral Numbers
- // ////////////////////////////////////////
-
- @Override
- public void write(final int value) throws IOException {
- writeByte((byte) value);
- }
-
- @Override
- public void writeByte(final int value) throws IOException {
- FieldType.BYTE.write(this, (byte) value);
- }
-
- @Override
- public void write(final byte[] value) throws IOException {
- writeBytes(value);
- }
-
- @Override
- public void writeBytes(final byte[] value) throws IOException {
- FieldType.BYTE_ARRAY.write(this, value);
- }
-
- @Override
- public void writeShort(final int value) throws IOException {
- FieldType.SHORT.write(this, (short) value);
- }
-
- @Override
- public void writeShorts(final short[] value) throws IOException {
- FieldType.SHORT_ARRAY.write(this, value);
- }
-
- @Override
- public void writeInt(final int value) throws IOException {
- FieldType.INTEGER.write(this, value);
- }
-
- @Override
- public void writeInts(final int[] value) throws IOException {
- FieldType.INTEGER_ARRAY.write(this, value);
- }
-
- @Override
- public void writeLong(final long value) throws IOException {
- FieldType.LONG.write(this, value);
- }
-
- @Override
- public void writeLongs(final long[] value) throws IOException {
- FieldType.LONG_ARRAY.write(this, value);
- }
-
- // ////////////////////////////////////////
- // Floating Point Numbers
- // ////////////////////////////////////////
-
- @Override
- public void writeFloat(final float value) throws IOException {
- FieldType.FLOAT.write(this, value);
- }
-
- @Override
- public void writeFloats(final float[] value) throws IOException {
- FieldType.FLOAT_ARRAY.write(this, value);
- }
-
- @Override
- public void writeDouble(final double value) throws IOException {
- FieldType.DOUBLE.write(this, value);
- }
-
- @Override
- public void writeDoubles(final double[] value) throws IOException {
- FieldType.DOUBLE_ARRAY.write(this, value);
- }
-
- // ////////////////////////////////////////
- // Strings
- // ////////////////////////////////////////
-
- @Override
- public void writeUTF(final String value) throws IOException {
- FieldType.STRING.write(this, value);
- }
-
- @Override
- public void writeUTFs(final String[] value) throws IOException {
- FieldType.STRING_ARRAY.write(this, value);
- }
-
- // ////////////////////////////////////////
- // Encodable and Serializable
- // ////////////////////////////////////////
-
- @Override
- public void writeEncodable(final Object encodable) throws IOException {
- FieldType.ENCODABLE.write(this, (Encodable) encodable);
- }
-
- @Override
- public void writeEncodables(final Object[] objects) throws IOException {
- Encodable[] encodables;
- if (objects == null) {
- encodables = null;
- } else {
- encodables = new Encodable[objects.length];
- for (int i = 0; i < encodables.length; i++) {
- encodables[i] = (Encodable) objects[i];
- }
- }
- FieldType.ENCODABLE_ARRAY.write(this, encodables);
- }
-
- @Override
- public void writeSerializable(final Object serializable) throws IOException {
- FieldType.SERIALIZABLE.write(this, (Serializable) serializable);
- }
-
- @Override
- public void writeSerializables(final Object[] objects) throws IOException {
- Serializable[] serializeables;
- if (objects == null) {
- serializeables = null;
- } else {
- serializeables = new Serializable[objects.length];
- for (int i = 0; i < serializeables.length; i++) {
- serializeables[i] = (Serializable) objects[i];
- }
- }
- FieldType.SERIALIZABLE_ARRAY.write(this, serializeables);
- }
-
- // ////////////////////////////////////////
- // Other
- // ////////////////////////////////////////
-
- @Override
- public void write(final byte[] b, final int off, final int len) throws IOException {
- dataOutputStream.write(b, off, len);
- }
-
- @Override
- public void writeBytes(final String str) throws IOException {
- dataOutputStream.writeBytes(str);
- }
-
- @Override
- public void writeChars(final String str) throws IOException {
- dataOutputStream.writeChars(str);
- }
-
- // ////////////////////////////////////////
- // Flushable
- // ////////////////////////////////////////
-
- @Override
- public void flush() throws IOException {
- dataOutputStream.flush();
- }
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DebugDataInputExtended.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DebugDataInputExtended.java
deleted file mode 100644
index 75e86fe..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DebugDataInputExtended.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.IOException;
-import java.util.Arrays;
-
-import lombok.extern.log4j.Log4j2;
-
-@Log4j2
-public class DebugDataInputExtended extends DataInputExtendedDecorator {
-
- public DebugDataInputExtended(final DataInputExtended input) {
- super(input);
- }
-
- @Override
- public boolean readBoolean() throws IOException {
- final boolean b = super.readBoolean();
- log.debug("boolean: {}", b);
- return b;
- }
-
- @Override
- public byte readByte() throws IOException {
- final byte b = super.readByte();
- log.debug("byte: {}", b);
- return b;
- }
-
- @Override
- public byte[] readBytes() throws IOException {
- final byte[] bs = super.readBytes();
- if (log.isDebugEnabled()) {
- log.debug("bytes: {}", new String(bs));
- }
- return bs;
- }
-
- @Override
- public int readInt() throws IOException {
- final int i = super.readInt();
- log.debug("int: {}", i);
- return i;
- }
-
- @Override
- public long readLong() throws IOException {
- final long l = super.readLong();
- log.debug("long: {}", l);
- return l;
- }
-
- @Override
- public String readUTF() throws IOException {
- final String string = super.readUTF();
- log.debug("string: {}", string);
- return string;
- }
-
- @Override
- public String[] readUTFs() throws IOException {
- final String[] strings = super.readUTFs();
- if (log.isDebugEnabled()) {
- log.debug("list: {}", Arrays.toString(strings));
- }
- return strings;
- }
-
- @Override
- public <T> T readEncodable(final Class<T> encodableType) throws IOException {
- final T object = super.readEncodable(encodableType);
- if (log.isDebugEnabled()) {
- log.debug(">>> object");
- }
- return object;
- }
-
- @Override
- public <T> T[] readEncodables(final Class<T> encodableType) throws IOException {
- final T[] objects = super.readEncodables(encodableType);
- log.debug(">>> objects x{}", objects.length);
- return objects;
- }
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DebugDataOutputExtended.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DebugDataOutputExtended.java
deleted file mode 100644
index c11b1e9..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/DebugDataOutputExtended.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.IOException;
-
-import lombok.extern.log4j.Log4j2;
-
-@Log4j2
-public class DebugDataOutputExtended extends DataOutputExtendedDecorator {
-
- public DebugDataOutputExtended(final DataOutputExtended underlying) {
- super(underlying);
- }
-
- @Override
- public void writeBoolean(final boolean flag) throws IOException {
- log.debug("boolean: {}", flag);
- super.writeBoolean(flag);
- }
-
- @Override
- public void writeBytes(final byte[] value) throws IOException {
- if (log.isDebugEnabled()) {
- log.debug("bytes: ({}) {}", value.length, new String(value));
- }
- super.writeBytes(value);
- }
-
- @Override
- public void writeByte(final int value) throws IOException {
- log.debug("byte: {}", value);
- super.writeByte(value);
- }
-
- @Override
- public void writeInt(final int value) throws IOException {
- log.debug("int: {}", value);
- super.writeInt(value);
- }
-
- @Override
- public void writeLong(final long value) throws IOException {
- log.debug("long: {}", value);
- super.writeLong(value);
- }
-
- @Override
- public void writeEncodable(final Object object) throws IOException {
- log.debug(">>> object: ({})", object);
- super.writeEncodable(object);
- }
-
- @Override
- public void writeEncodables(final Object[] objects) throws IOException {
- if (log.isDebugEnabled()) {
- log.debug(">>> objects x{}", objects.length);
- }
- super.writeEncodables(objects);
- }
-
- @Override
- public void writeUTF(final String str) throws IOException {
- log.debug("string: {}", str);
- super.writeUTF(str);
- }
-
- @Override
- public void writeUTFs(final String[] strings) throws IOException {
- if (log.isDebugEnabled()) {
- final StringBuffer l = new StringBuffer();
- for (int i = 0; i < strings.length; i++) {
- if (i > 0) {
- l.append(", ");
- }
- l.append(strings[i]);
- }
- log.debug("list: {}", l);
- }
- super.writeUTFs(strings);
- }
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/Encodable.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/Encodable.java
deleted file mode 100644
index af5fb6d..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/Encodable.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.IOException;
-
-/**
- * This interface indicates that an object can be encoded into into a byte array
- * so it can be streamed.
- *
- * <p>
- * By implementing this interface you are agreeing to provide a constructor with
- * a single argument of type {@link DataInputExtended}, which create an instance
- * from the stream.
- */
-public interface Encodable {
-
- /**
- * Returns the domain object's value as an encoded byte array via the
- * encoder.
- */
- void encode(DataOutputExtended outputStream) throws IOException;
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/EncodingConstants.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/EncodingConstants.java
deleted file mode 100644
index 8562986..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/EncodingConstants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-public class EncodingConstants {
-
- static final String ENCODED_NULL_ARRAY = "$$.$null-array$.$$";
- static final String ENCODED_BOOLEAN_FALSE = "$$.$false$.$$";
- static final String ENCODED_BOOLEAN_TRUE = "$$.$true$.$$";
- static final String ENCODED_NULL_OBJECT = "$$.$null$.$$";
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/FailedToDecodeException.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/FailedToDecodeException.java
deleted file mode 100644
index 1870d3b..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/FailedToDecodeException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- *
- */
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.IOException;
-
-public class FailedToDecodeException extends IOException {
-
- private static final long serialVersionUID = 1L;
-
- public FailedToDecodeException(final Throwable cause) {
- super(cause);
- }
-
-
-}
\ No newline at end of file
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/FailedToDeserializeException.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/FailedToDeserializeException.java
deleted file mode 100644
index 707cbfd..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/FailedToDeserializeException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- *
- */
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.IOException;
-
-public class FailedToDeserializeException extends IOException {
-
- private static final long serialVersionUID = 1L;
-
- public FailedToDeserializeException(final ClassNotFoundException cause) {
- super(cause);
- }
-
-
-}
\ No newline at end of file
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/FieldType.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/FieldType.java
deleted file mode 100644
index c36f230..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/encoding/FieldType.java
+++ /dev/null
@@ -1,1350 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.isis.commons.internal.context._Context;
-
-import lombok.extern.log4j.Log4j2;
-
-/**
- * Typesafe writing and reading of fields, providing some level of integrity
- * checking of encoded messages.
- *
- * <p>
- * The {@link #write(DataOutputExtended, Object)} writes out field type and then
- * the data for that field type. The field type is represented by this
- * enumeration, with the {@link FieldType#getIdx() index} being what is written
- * to the stream (hence of type <tt>byte</tt> to keep small).
- *
- * <p>
- * Conversely, the {@link #read(DataInputExtended)} reads the field type and
- * then the data for that field type.
- */
-@Log4j2
-public abstract class FieldType<T> {
-
- private static String LOG_INDENT = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";
- private static final int NULL_BIT = 64; // 2 to the 6
-
- private static Map<Byte, FieldType<?>> cache = new HashMap<Byte, FieldType<?>>();
- private static int next = 0;
-
- static enum Indenting {
- INDENT_ONLY, INDENT_AND_OUTDENT;
- }
-
- public static FieldType<Boolean> BOOLEAN = new FieldType<Boolean>((byte) next++, Boolean.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Boolean value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeBoolean(value);
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Boolean doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final boolean value = inputStream.readBoolean();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<boolean[]> BOOLEAN_ARRAY = new FieldType<boolean[]>((byte) next++, boolean[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final boolean[] values) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(values.length);
- }
- for (int i = 0; i < values.length; i++) {
- outputStream.writeBoolean(values[i]);
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected boolean[] doRead(final DataInputExtended input) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(length);
- }
- final boolean[] values = new boolean[length];
- for (int i = 0; i < values.length; i++) {
- values[i] = inputStream.readBoolean();
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<Byte> BYTE = new FieldType<Byte>((byte) next++, Byte.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Byte value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeByte(value.byteValue());
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Byte doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final byte value = inputStream.readByte();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<byte[]> BYTE_ARRAY = new FieldType<byte[]>((byte) next++, byte[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final byte[] values) throws IOException {
- try {
- final DataOutputStream outputStream = output.getDataOutputStream();
- final int length = values.length;
- outputStream.writeInt(length);
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append("length:").append(length).append(" [BYTE ARRAY]"));
- }
-
- // rather than looping through the array,
- // we take advantage of optimization built into DataOutputStream
- outputStream.write(values);
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected byte[] doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- final StringBuilder msg = new StringBuilder().append("length:").append(length).append(" [BYTE ARRAY]");
- log(this, msg);
- }
-
- final byte[] bytes = new byte[length];
- readBytes(inputStream, bytes);
- return bytes;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- // rather than looping through the array,
- // we take advantage of optimization built into DataInputStream
- private void readBytes(final DataInputStream inputStream, final byte[] bytes) throws IOException {
- inputStream.readFully(bytes);
- }
- };
-
- public static FieldType<Short> SHORT = new FieldType<Short>((byte) next++, Short.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Short value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeShort(value.shortValue());
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Short doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final short value = inputStream.readShort();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<short[]> SHORT_ARRAY = new FieldType<short[]>((byte) next++, short[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final short[] values) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(values.length);
- }
-
- for (int i = 0; i < values.length; i++) {
- outputStream.writeShort(values[i]);
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected short[] doRead(final DataInputExtended input) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(length);
- }
-
- final short[] values = new short[length];
- for (int i = 0; i < values.length; i++) {
- values[i] = inputStream.readShort();
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<Integer> INTEGER = new FieldType<Integer>((byte) next++, Integer.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Integer value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(value.intValue());
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Integer doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final int value = inputStream.readInt();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<Integer> UNSIGNED_BYTE = new FieldType<Integer>((byte) next++, Integer.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Integer value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeByte(value);
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Integer doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final int value = inputStream.readUnsignedByte();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<Integer> UNSIGNED_SHORT = new FieldType<Integer>((byte) next++, Integer.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Integer value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeShort(value);
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Integer doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final int value = inputStream.readUnsignedShort();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<int[]> INTEGER_ARRAY = new FieldType<int[]>((byte) next++, int[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final int[] values) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(values.length);
- }
-
- for (int i = 0; i < values.length; i++) {
- outputStream.writeInt(values[i]);
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected int[] doRead(final DataInputExtended input) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(length);
- }
-
- final int[] values = new int[length];
- for (int i = 0; i < values.length; i++) {
- values[i] = inputStream.readInt();
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<Long> LONG = new FieldType<Long>((byte) next++, Long.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Long value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeLong(value.intValue());
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Long doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final long value = inputStream.readLong();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
- public static FieldType<long[]> LONG_ARRAY = new FieldType<long[]>((byte) next++, long[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final long[] values) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(values.length);
- }
-
- for (int i = 0; i < values.length; i++) {
- outputStream.writeLong(values[i]);
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected long[] doRead(final DataInputExtended input) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
-
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(length);
- }
-
- final long[] values = new long[length];
- for (int i = 0; i < values.length; i++) {
- values[i] = inputStream.readLong();
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<Character> CHAR = new FieldType<Character>((byte) next++, Character.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Character value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeLong(value.charValue());
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Character doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final char value = inputStream.readChar();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<char[]> CHAR_ARRAY = new FieldType<char[]>((byte) next++, char[].class, Indenting.INDENT_AND_OUTDENT) {
- // TODO: could perhaps optimize by writing out as a string
- @Override
- protected void doWrite(final DataOutputExtended output, final char[] values) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(values.length);
- }
-
- for (int i = 0; i < values.length; i++) {
- outputStream.writeChar(values[i]);
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected char[] doRead(final DataInputExtended input) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(length);
- }
-
- final char[] values = new char[length];
- for (int i = 0; i < values.length; i++) {
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- values[i] = inputStream.readChar();
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<Float> FLOAT = new FieldType<Float>((byte) next++, Float.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Float value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeFloat(value);
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Float doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final float value = inputStream.readFloat();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<float[]> FLOAT_ARRAY = new FieldType<float[]>((byte) next++, float[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final float[] values) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(values.length);
- }
-
- for (int i = 0; i < values.length; i++) {
- outputStream.writeFloat(values[i]);
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected float[] doRead(final DataInputExtended input) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(length);
- }
-
- final float[] values = new float[length];
- for (int i = 0; i < values.length; i++) {
- values[i] = inputStream.readFloat();
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<Double> DOUBLE = new FieldType<Double>((byte) next++, Double.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Double value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeDouble(value);
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Double doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final double value = inputStream.readDouble();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<double[]> DOUBLE_ARRAY = new FieldType<double[]>((byte) next++, double[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final double[] values) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(values.length);
- }
-
- for (int i = 0; i < values.length; i++) {
- outputStream.writeDouble(values[i]);
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected double[] doRead(final DataInputExtended input) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(length);
- }
-
- final double[] values = new double[length];
- for (int i = 0; i < values.length; i++) {
- values[i] = inputStream.readDouble();
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<String> STRING = new FieldType<String>((byte) next++, String.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final String value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeUTF(value);
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected String doRead(final DataInputExtended input) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final String value = inputStream.readUTF();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(value));
- }
- return value;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
- public static FieldType<String[]> STRING_ARRAY = new FieldType<String[]>((byte) next++, String[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final String[] values) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(values.length);
- }
-
- for (int i = 0; i < values.length; i++) {
- // using FieldType to write out takes care of null handling
- FieldType.STRING.write(output, values[i]);
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected String[] doRead(final DataInputExtended input) throws IOException {
- try {
- final StringBuilder buf = new StringBuilder();
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- buf.append("length: ").append(length);
- }
-
- final String[] values = new String[length];
- for (int i = 0; i < values.length; i++) {
- // using FieldType to read in takes care of null handling
- values[i] = FieldType.STRING.read(input);
- if (log.isDebugEnabled()) {
- buf.append(i == 0 ? ": " : ", ");
- buf.append(values[i]);
- }
- }
- if (log.isDebugEnabled()) {
- log(this, buf);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
- };
-
- public static FieldType<Encodable> ENCODABLE = new FieldType<Encodable>((byte) next++, Encodable.class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Encodable encodable) throws IOException {
- try {
- // write out class
- final String className = encodable.getClass().getName();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(className));
- }
- output.writeUTF(className);
-
- // recursively encode
- encodable.encode(output);
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Encodable doRead(final DataInputExtended input) throws IOException {
- try {
- // read in class name ...
- final String className = input.readUTF();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append(className));
- }
-
- Class<?> cls;
- try {
- // ...obtain constructor
- cls = _Context.loadClass(className);
-
- final Constructor<?> constructor = cls.getConstructor(new Class[] { DataInputExtended.class });
-
- // recursively decode
- return (Encodable) constructor.newInstance(new Object[] { input });
- } catch (final ClassNotFoundException ex) {
- throw new FailedToDecodeException(ex);
- } catch (final IllegalArgumentException ex) {
- throw new FailedToDecodeException(ex);
- } catch (final InstantiationException ex) {
- throw new FailedToDecodeException(ex);
- } catch (final IllegalAccessException ex) {
- throw new FailedToDecodeException(ex);
- } catch (final InvocationTargetException ex) {
- throw new FailedToDecodeException(ex);
- } catch (final SecurityException ex) {
- throw new FailedToDecodeException(ex);
- } catch (final NoSuchMethodException ex) {
- throw new FailedToDecodeException(ex);
- }
-
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected boolean checksStream() {
- return false;
- }
- };
-
- public static FieldType<Encodable[]> ENCODABLE_ARRAY = new FieldType<Encodable[]>((byte) next++, Encodable[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Encodable[] values) throws IOException {
- try {
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append("length: ").append(values.length));
- }
- for (final Encodable encodable : values) {
- // using FieldType to write out takes care of null handling
- FieldType.ENCODABLE.write(output, encodable);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected <Q> Q[] doReadArray(final DataInputExtended input, final Class<Q> elementType) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append("length: ").append(length));
- }
-
- final Q[] values = (Q[]) Array.newInstance(elementType, length);
- for (int i = 0; i < values.length; i++) {
- // using FieldType to read in takes care of null handling
- values[i] = (Q) FieldType.ENCODABLE.read(input);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected boolean checksStream() {
- return false;
- }
- };
-
- public static FieldType<Serializable> SERIALIZABLE = new FieldType<Serializable>((byte) next++, Serializable.class, Indenting.INDENT_ONLY) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Serializable value) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append("[SERIALIZABLE]"));
- }
-
- // write out as blob of bytes
- final ObjectOutputStream oos = new ObjectOutputStream(output.getDataOutputStream());
- oos.writeObject(value);
- oos.flush();
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected Serializable doRead(final DataInputExtended input) throws IOException {
- try {
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append("[SERIALIZABLE]"));
- }
-
- // read in a blob of bytes
- final ObjectInputStream ois = new ObjectInputStream(input.getDataInputStream());
- try {
- return (Serializable) ois.readObject();
- } catch (final ClassNotFoundException ex) {
- throw new FailedToDeserializeException(ex);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected boolean checksStream() {
- return false;
- }
- };
-
- public static FieldType<Serializable[]> SERIALIZABLE_ARRAY = new FieldType<Serializable[]>((byte) next++, Serializable[].class, Indenting.INDENT_AND_OUTDENT) {
- @Override
- protected void doWrite(final DataOutputExtended output, final Serializable[] values) throws IOException {
- try {
- final DataOutputStream outputStream = output.getDataOutputStream();
- outputStream.writeInt(values.length);
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append("length: ").append(values.length));
- }
-
- for (final Serializable value : values) {
- // using FieldType to write out takes care of null handling
- FieldType.SERIALIZABLE.write(output, value);
- }
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected <Q> Q[] doReadArray(final DataInputExtended input, final Class<Q> elementType) throws IOException {
- try {
- final DataInputStream inputStream = input.getDataInputStream();
- final int length = inputStream.readInt();
- if (log.isDebugEnabled()) {
- log(this, new StringBuilder().append("length: ").append(length));
- }
-
- final Q[] values = (Q[]) Array.newInstance(elementType, length);
- for (int i = 0; i < values.length; i++) {
- // using FieldType to read in takes care of null handling
- values[i] = (Q) FieldType.SERIALIZABLE.read(input);
- }
- return values;
- } finally {
- if (log.isDebugEnabled()) {
- unlog(this);
- }
- }
- }
-
- @Override
- protected boolean checksStream() {
- return false;
- }
- };
-
- public static FieldType<?> get(final byte idx) {
- return cache.get(idx);
- }
-
- private final byte idx;
- private final Class<T> cls;
- private final Indenting indenting;
-
- private FieldType(final byte idx, final Class<T> cls, final Indenting indenting) {
- this.idx = idx;
- this.cls = cls;
- this.indenting = indenting;
- cache.put(idx, this);
- }
-
- public byte getIdx() {
- return idx;
- }
-
- public Class<T> getCls() {
- return cls;
- }
-
- /**
- * Whether this implementation checks ordering in the stream.
- *
- * <p>
- * Broadly, the type safe ones do, the {@link Encodable} and
- * {@link Serializable} ones do not.
- */
- protected boolean checksStream() {
- return true;
- }
-
- public final T read(final DataInputExtended input) throws IOException {
- final DataInputStream inputStream = input.getDataInputStream();
- final byte fieldTypeIdxAndNullability = inputStream.readByte();
-
- final boolean isNull = fieldTypeIdxAndNullability >= NULL_BIT;
- final byte fieldTypeIdx = (byte) (fieldTypeIdxAndNullability - (isNull ? NULL_BIT : 0));
- try {
- final FieldType<?> fieldType = FieldType.get(fieldTypeIdx);
- if (fieldType == null || (fieldType.checksStream() && fieldType != this)) {
- throw new IllegalStateException("Mismatch in stream: expected " + this + " but got " + fieldType + " (" + fieldTypeIdx + ")");
- }
-
- if (isNull && log.isDebugEnabled()) {
- // only log if reading a null; otherwise actual value read
- // logged later
- log(this, new StringBuilder().append("(null)"));
- }
-
- if (isNull) {
- return null;
- } else {
- return doRead(input);
- }
- } finally {
- if (isNull && log.isDebugEnabled()) {
- // only unlog if reading a null
- unlog(this);
- }
- }
- }
-
- public final <Q> Q[] readArray(final DataInputExtended input, final Class<Q> elementType) throws IOException {
- final DataInputStream inputStream = input.getDataInputStream();
- final byte fieldTypeIdxAndNullability = inputStream.readByte();
-
- final boolean isNull = fieldTypeIdxAndNullability >= NULL_BIT;
- final byte fieldTypeIdx = (byte) (fieldTypeIdxAndNullability - (isNull ? NULL_BIT : 0));
- try {
- final FieldType<?> fieldType = FieldType.get(fieldTypeIdx);
- if (fieldType.checksStream() && fieldType != this) {
- throw new IllegalStateException("Mismatch in stream: expected " + this + " but got " + fieldType);
- }
-
- if (isNull && log.isDebugEnabled()) {
- // only log if reading a null; otherwise actual value read
- // logged later
- log(this, new StringBuilder().append("(null)"));
- }
-
- if (isNull) {
- return null;
- } else {
- return doReadArray(input, elementType);
- }
-
- } finally {
- if (isNull && log.isDebugEnabled()) {
- // only unlog if reading a null
- unlog(this);
- }
- }
-
- }
-
- public final void write(final DataOutputExtended output, final T value) throws IOException {
- byte fieldTypeIdxAndNullability = getIdx();
- final boolean isNull = value == null;
- if (isNull) {
- // set high order bit
- fieldTypeIdxAndNullability += NULL_BIT;
- }
- try {
-
- final DataOutputStream outputStream = output.getDataOutputStream();
-
- outputStream.write(fieldTypeIdxAndNullability);
- if (isNull && log.isDebugEnabled()) {
- // only log if writing a null; otherwise actual value logged
- // later
- log(this, new StringBuilder().append("(null)"));
- }
-
- if (!isNull) {
- doWrite(output, value);
- }
- } finally {
- if (isNull && log.isDebugEnabled()) {
- // only unlog if writing a null
- unlog(this);
- }
- }
- }
-
- protected T doRead(final DataInputExtended input) throws IOException {
- throw new UnsupportedOperationException("not supported for this field type");
- }
-
- protected <Q> Q[] doReadArray(final DataInputExtended input, final Class<Q> elementType) throws IOException {
- throw new UnsupportedOperationException("not supported for this field type");
- }
-
- protected abstract void doWrite(DataOutputExtended output, T value) throws IOException;
-
- private boolean isIndentingAndOutdenting() {
- return indenting == Indenting.INDENT_AND_OUTDENT;
- }
-
- // ///////////////////////////////////////////////////////
- // debugging
- // ///////////////////////////////////////////////////////
-
- //resource leak
- //private static ThreadLocal<int[]> debugIndent = ThreadLocal.<int[]>withInitial(()->new int[1]);
-
- private static void log(final FieldType<?> fieldType, final StringBuilder buf) {
- buf.insert(0, ": ");
- buf.insert(0, fieldType);
- if (fieldType.isIndentingAndOutdenting()) {
- buf.insert(0, "> ");
- }
- buf.insert(0, spaces(currentDebugLevel()));
- incrementDebugLevel();
- log.debug(buf.toString());
- }
-
- private static void unlog(final FieldType<?> fieldType) {
- final StringBuilder buf = new StringBuilder();
- if (fieldType.isIndentingAndOutdenting()) {
- buf.insert(0, "< ");
- }
- decrementDebugLevel();
- if (fieldType.isIndentingAndOutdenting()) {
- buf.insert(0, spaces(currentDebugLevel()));
- log.debug(buf.toString());
- }
- }
-
- private static String spaces(final int num) {
- return LOG_INDENT.substring(0, num);
- }
-
- private static int currentDebugLevel() {
- return 0; //debugIndent.get()[0];
- }
-
- private static void incrementDebugLevel() {
-// final int[] indentLevel = debugIndent.get();
-// indentLevel[0] += 2;
- }
-
- private static void decrementDebugLevel() {
-// final int[] indentLevel = debugIndent.get();
-// indentLevel[0] -= 2;
- }
-
- // ///////////////////////////////////////////////////////
- // toString
- // ///////////////////////////////////////////////////////
-
- @Override
- public String toString() {
- return getCls().getSimpleName();
- }
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/FutureWithIndexIntoFutureOfList.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/FutureWithIndexIntoFutureOfList.java
deleted file mode 100644
index 8196eec..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/FutureWithIndexIntoFutureOfList.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.threadpool;
-
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-@Deprecated
-final class FutureWithIndexIntoFutureOfList<T> implements Future<T> {
- final Future<List<T>> commonFuture;
- final int index;
-
- FutureWithIndexIntoFutureOfList(Future<List<T>> commonFuture, int index) {
- this.commonFuture = commonFuture;
- this.index = index;
- }
-
- @Override
- public boolean cancel(boolean mayInterruptIfRunning) {
- return commonFuture.cancel(mayInterruptIfRunning);
- }
-
- @Override
- public boolean isCancelled() {
- return commonFuture.isCancelled();
- }
-
- @Override
- public boolean isDone() {
- return commonFuture.isDone();
- }
-
- @Override
- public T get() throws InterruptedException, ExecutionException {
- return commonFuture.get().get(index);
- }
-
- @Override
- public T get(long timeout, TimeUnit unit)
- throws InterruptedException, ExecutionException, TimeoutException {
- return commonFuture.get(timeout, unit).get(index);
- }
-}
\ No newline at end of file
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolExecutionMode.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolExecutionMode.java
deleted file mode 100644
index 00c6aa1..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolExecutionMode.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.legacy.commons.internal.threadpool;
-
-/**
- * ThreadPollSupport's executions mode where the enum's ordinal corresponds to the level of concurrency.
- */
-@Deprecated
-enum ThreadPoolExecutionMode {
-
- /**
- * Wraps submitted tasks into a single task, which is then executed within the context
- * of the calling thread. Basically to allow for switching off background execution to
- * run submitted tasks in sequence (legacy behavior) for debugging purposes.
- * (expected lowest concurrency)
- */
- SEQUENTIAL_WITHIN_CALLING_THREAD,
-
- /**
- * Wraps submitted tasks into a single task, which is then executed on the default executor.
- * (expected medium concurrency)
- */
- SEQUENTIAL,
-
- /**
- * Executes submitted tasks on the default executor.
- * (expected highest concurrency)
- */
- PARALLEL,
-
- ;
-
- /**
- * {@link ThreadPoolSupport#HIGHEST_CONCURRENCY_EXECUTION_MODE_ALLOWED} acts as an upper bound for the
- * concurrency level supported.
- * @param proposedExecutionMode
- * @return proposedExecutionMode or the highest possible concurrent execution mode allowed, if
- * the proposedExecutionMode exceeds the highest allowed
- */
- public static ThreadPoolExecutionMode honorHighestConcurrencyAllowed(
- ThreadPoolExecutionMode proposedExecutionMode) {
-
- final int upper = ThreadPoolSupport.HIGHEST_CONCURRENCY_EXECUTION_MODE_ALLOWED.ordinal();
- final int proposed = proposedExecutionMode.ordinal();
- final int bounded = proposed>upper ? upper : proposed;
-
- return ThreadPoolExecutionMode.values()[bounded];
- }
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolSizeAdvisor.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolSizeAdvisor.java
deleted file mode 100644
index e76b934..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolSizeAdvisor.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.threadpool;
-
-@Deprecated
-final class ThreadPoolSizeAdvisor {
-
- /*
- * For the thread-pool let there be at least 4 concurrent threads,
- * limited by the number of available (logical) processor cores,
- * but with a maximum of 16.
- *
- * Note: Future improvements might make these values configurable,
- * but for now lets try to be reasonable.
- *
- */
- private final int minThreadCount = 4; // allows for a maximum concurrent task nesting depth of 3
- private final int maxThreadCount = 16; // reasonable upper limit
-
- // if we are running in a container, eg docker, its up to the JVM to report correct values
- private final int logicalCoreCount =
- Runtime.getRuntime().availableProcessors(); // reasonable upper limit
-
- int corePoolSize() {
- return minThreadCount;
- }
-
- int maximumPoolSize() {
- final int upperLimit = Math.min(maxThreadCount, logicalCoreCount);
- return Math.max(minThreadCount, upperLimit);
- }
-
- public static ThreadPoolSizeAdvisor get() {
- return new ThreadPoolSizeAdvisor();
- }
-
-
-}
diff --git a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolSupport.java b/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolSupport.java
deleted file mode 100644
index 8cc3a60..0000000
--- a/legacy/extensions/core/commons/src/main/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolSupport.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.threadpool;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Future;
-import java.util.concurrent.FutureTask;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-import static java.util.Collections.emptyList;
-import static java.util.Collections.singletonList;
-import static java.util.stream.Collectors.toList;
-
-import javax.annotation.Nullable;
-
-import org.apache.isis.commons.internal.collections._Lists;
-import org.apache.isis.commons.internal.context._Context;
-import org.apache.isis.commons.internal.exceptions._Exceptions;
-
-import static org.apache.isis.commons.internal.base._Casts.uncheckedCast;
-import static org.apache.isis.commons.internal.base._With.requires;
-
-import lombok.extern.log4j.Log4j2;
-
-/**
- * ThreadPoolSupport is application-scoped, meaning ThreadPoolSupport is closed on
- * application's end of life-cycle.
- * <br/><br/>
- * Implementation Note: ThreadPoolSupport::close is triggered by _Context.clear()
- * when application shuts down.
- *
- * @deprecated in favor of the {@code org.apache.isis.commons.internal.concurrent} API
- */
-@Deprecated
-@Log4j2
-final class ThreadPoolSupport implements AutoCloseable {
-
- public static ThreadPoolExecutionMode HIGHEST_CONCURRENCY_EXECUTION_MODE_ALLOWED =
- ThreadPoolExecutionMode.PARALLEL;
-
- private static final int KEEP_ALIVE_TIME_SECS = 5;
- private static final int QUEUE_CAPACITY = Integer.MAX_VALUE;
-
- private final ThreadGroup group;
- private final ThreadPoolExecutor concurrentExecutor;
-
- /**
- * @return the application-scoped singleton ThreadPoolSupport instance
- */
- public static ThreadPoolSupport getInstance() {
- return _Context.computeIfAbsent(ThreadPoolSupport.class, ThreadPoolSupport::new);
- }
-
- ThreadPoolSupport() {
-
- group = new ThreadGroup(ThreadPoolSupport.class.getName());
-
- final ThreadPoolSizeAdvisor advisor = ThreadPoolSizeAdvisor.get();
-
- final ThreadFactory threadFactory = (Runnable r) -> new Thread(group, r);
-
- final Supplier<BlockingQueue<Runnable>> workQueueFactory =
- ()->new LinkedBlockingQueue<>(QUEUE_CAPACITY);
-
- concurrentExecutor = new ThreadPoolExecutor(
- advisor.corePoolSize(),
- advisor.maximumPoolSize(),
- KEEP_ALIVE_TIME_SECS,
- TimeUnit.SECONDS,
- workQueueFactory.get(),
- threadFactory);
- }
-
- /*
- * Implementation Note: triggered by _Context.clear() when application shuts down.
- */
- @Override
- public void close() throws Exception {
- concurrentExecutor.shutdown();
- }
-
- /**
- * @return this thread-pool's underlying concurrent executor
- */
- public Executor getExecutor() {
- return concurrentExecutor;
- }
-
- /**
- * Non-blocking call.
- * <p>
- * If the computation requires an open IsisInteraction use {@code IsisContext.compute(Supplier)} instead,
- * which utilizes a ForkJoinPool instead.
- *
- * @param computation - async task
- * @return new CompletableFuture utilizing this thread-pool's underlying concurrent executor
- */
- public <T> CompletableFuture<T> newCompletableFuture(Supplier<T> computation) {
- requires(computation, "computation");
- return CompletableFuture.supplyAsync(computation, getExecutor());
- }
-
- /**
- * Executes specified {@code callables} on the default executor.
- * See {@link ThreadPoolExecutor#invokeAll(java.util.Collection)}
- * @param proposedExecutionMode - if 'higher concurrency than allowed' is replaced by 'highest-allowed'
- * @param callables - nullable
- * @return non-null
- */
- public <T> List<Future<T>> invokeAll(
- final ThreadPoolExecutionMode proposedExecutionMode,
- @Nullable final List<? extends Callable<T>> callables) {
-
- if(isEmpty(callables)) {
- return emptyList();
- }
-
- requires(proposedExecutionMode, "proposedExecutionMode");
-
- final ThreadPoolExecutionMode executionMode =
- ThreadPoolExecutionMode.honorHighestConcurrencyAllowed(proposedExecutionMode);
-
- switch (executionMode) {
- case PARALLEL:
- return invokeAll(concurrentExecutor, callables);
-
- case SEQUENTIAL:
- {
- final Future<List<T>> commonFuture =
- uncheckedCast(invokeAll(concurrentExecutor,
- singletonList(toSingleTask(callables))).get(0));
-
- return IntStream.range(0, callables.size())
- .mapToObj(index->new FutureWithIndexIntoFutureOfList<T>(commonFuture, index))
- .collect(toList());
- }
-
- case SEQUENTIAL_WITHIN_CALLING_THREAD:
- {
- return callables.stream()
- .map(FutureTask::new)
- .peek(FutureTask::run) // immediately run task on submission
- .collect(toList());
- }
-
- default:
- throw _Exceptions.unmatchedCase(executionMode);
- }
-
- }
-
- /**
- * Executes specified {@code callables} on the default executor.
- * See {@link ThreadPoolExecutor#invokeAll(java.util.Collection)}
- * @param callables nullable
- * @return non-null
- */
- public <T> List<Future<T>> invokeAll(@Nullable final List<? extends Callable<T>> callables) {
- return invokeAll(HIGHEST_CONCURRENCY_EXECUTION_MODE_ALLOWED, callables);
- }
-
- /**
- * Waits if necessary for the computation to complete. Suppresses checked exceptions.
- * @param futures
- * @return list of computation results.
- */
- public List<?> join(@Nullable final List<? extends Future<?>> futures) {
- if (futures == null) {
- return null;
- }
-
- final long t0 = System.nanoTime();
- try{
- final List<Object> returnValues = _Lists.newArrayList();
- for (Future<?> future : futures) {
- returnValues.add(join(future));
- }
- return returnValues;
- } finally {
- final long t1 = System.nanoTime();
- log.info("join'ing {} tasks: waited {} milliseconds ", futures.size(), 0.000_001 * (t1-t0));
- }
- }
-
- /**
- * Waits if necessary for the computation to complete. Re-throws any checked exception as RuntimeException.
- * @param futures
- * @return list of computation results.
- */
- public <T> List<T> joinGatherFailures(final List<? extends Future<T>> futures) {
- if (futures == null) {
- return null;
- }
-
- final long t0 = System.nanoTime();
- try{
- final List<T> returnValues = _Lists.newArrayList();
- for (Future<T> future : futures) {
- final T result;
- try {
- result = future.get();
- } catch (InterruptedException | ExecutionException e) {
- throw _Exceptions.unrecoverable(e);
- }
- returnValues.add(result);
- }
- return returnValues;
- } finally {
- final long t1 = System.nanoTime();
- log.info("join'ing {} tasks: waited {} milliseconds ", futures.size(), 0.000_001 * (t1-t0));
- }
- }
-
-
- /**
- * Waits if necessary for the computation to complete. (Suppresses checked exceptions.)
- * @param future
- * @return the computation result
- */
- public <T> T join(final Future<T> future) {
- try {
- return future.get();
- } catch (InterruptedException | ExecutionException e) {
- // ignore
- return null;
- }
- }
-
- @Override
- public String toString() {
- return concurrentExecutor.toString();
- }
-
- // -- HELPERS
-
- private <T> List<Future<T>> invokeAll(
- ThreadPoolExecutor executor,
- @Nullable final List<? extends Callable<T>> callables) {
-
- if(isEmpty(callables)) {
- return Collections.emptyList();
- }
- try {
- return executor.invokeAll(timed(executor, callables));
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- }
-
- private static <T> List<Callable<T>> timed(
- final ThreadPoolExecutor executor,
- final List<? extends Callable<T>> callables) {
-
- final long queuedAt = System.currentTimeMillis();
- return callables.stream()
- .map(callable -> timed(callable, executor.getQueue().size(), queuedAt))
- .collect(Collectors.toList());
- }
-
- private static <T> Callable<T> timed(
- final Callable<T> callable,
- final int queueSize,
- final long queuedAt) {
-
- return () -> {
- final long startedAt = System.currentTimeMillis();
- if(log.isDebugEnabled()) {
- log.debug("START: workQueue.size: {}, waited for: {}ms, {}",
- queueSize,
- startedAt - queuedAt,
- callable.toString());
- }
- try {
- return callable.call();
- } finally {
- final long completedAt = System.currentTimeMillis();
- if(log.isDebugEnabled()) {
- log.debug("END: completed in: {}ms, {}",
- completedAt - startedAt,
- callable.toString());
- }
- }
- };
- }
-
- private <T> Callable<List<T>> toSingleTask(final List<? extends Callable<T>> callables) {
- return () -> {
- final List<T> resultList = _Lists.newArrayList();
- for(Callable<T> callable : callables) {
- resultList.add(callable.call()); // any exceptions thrown are propagated
- }
- return resultList;
- };
- }
-
- private static boolean isEmpty(Collection<?> x) { return x==null || x.size() == 0; }
-
-}
diff --git a/legacy/extensions/core/commons/src/test/java/org/apache/isis/legacy/commons/internal/encoding/ByteEncoderDecoderRoundtripTest.java b/legacy/extensions/core/commons/src/test/java/org/apache/isis/legacy/commons/internal/encoding/ByteEncoderDecoderRoundtripTest.java
deleted file mode 100644
index e895548..0000000
--- a/legacy/extensions/core/commons/src/test/java/org/apache/isis/legacy/commons/internal/encoding/ByteEncoderDecoderRoundtripTest.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.encoding;
-
-import java.io.IOException;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import org.apache.isis.legacy.commons.internal.encoding.DataInputExtended;
-import org.apache.isis.legacy.commons.internal.encoding.DataInputStreamExtended;
-import org.apache.isis.legacy.commons.internal.encoding.DataOutputExtended;
-import org.apache.isis.legacy.commons.internal.encoding.DataOutputStreamExtended;
-import org.apache.isis.legacy.commons.internal.encoding.Encodable;
-
-public class ByteEncoderDecoderRoundtripTest {
-
- private DataOutputStreamExtended outputImpl;
- private DataInputStreamExtended inputImpl;
-
- @Before
- public void setUp() throws Exception {
- final PipedInputStream pipedInputStream = new PipedInputStream();
- final PipedOutputStream pipedOutputStream = new PipedOutputStream(pipedInputStream);
- outputImpl = new DataOutputStreamExtended(pipedOutputStream);
- inputImpl = new DataInputStreamExtended(pipedInputStream);
- }
-
- @After
- public void tearDown() throws Exception {
- // does nothing yet
- }
-
- @Test
- public void encodeAndDecodeBoolean() throws IOException {
- outputImpl.writeBoolean(true);
- outputImpl.writeBoolean(false);
-
- assertThat(inputImpl.readBoolean(), is(equalTo(true)));
- assertThat(inputImpl.readBoolean(), is(equalTo(false)));
- }
-
- @Test
- public void encodeAndDecodeByteArray() throws IOException {
- final byte[] bytes = { 3, 76, -1, 21 };
- outputImpl.writeBytes(bytes);
- final byte[] decodedBytes = inputImpl.readBytes();
-
- assertThatArraysEqual(bytes, decodedBytes);
- }
-
- @Test
- public void encodeAndDecodeInt() throws IOException {
- outputImpl.writeInt(245);
- outputImpl.writeInt(-456);
-
- assertThat(inputImpl.readInt(), is(equalTo(245)));
- assertThat(inputImpl.readInt(), is(equalTo(-456)));
- }
-
- @Test
- public void encodeAndDecodeLong() throws IOException {
- outputImpl.writeLong(245L);
- outputImpl.writeLong(-456L);
-
- assertThat(inputImpl.readLong(), is(equalTo(245L)));
- assertThat(inputImpl.readLong(), is(equalTo(-456L)));
- }
-
- @Test
- public void encodeAndDecodeObject() throws IOException {
- outputImpl.writeEncodable(new EncodableObject());
-
- final Object object = inputImpl.readEncodable(Object.class);
- assertThat(object, is(instanceOf(EncodableObject.class)));
-
- final EncodableObject encodeableObject = (EncodableObject) object;
- assertThat(encodeableObject.field, is(equalTo("test field")));
- }
-
- @Test
- public void encodeAndDecodeNullObject() throws IOException {
- outputImpl.writeEncodable(null);
-
- final Object object = inputImpl.readEncodable(Object.class);
- assertThat(object, is(nullValue()));
- }
-
- @Test
- public void encodeAndDecodeObjectArray() throws IOException {
- final EncodableObject[] array = new EncodableObject[] { new EncodableObject(), new EncodableObject(), new EncodableObject() };
- outputImpl.writeEncodables(array);
-
- final Encodable[] objects = inputImpl.readEncodables(Encodable.class);
- assertThat(objects.length, is(3));
- final EncodableObject encodeableObject = (EncodableObject) objects[2];
- assertThat(encodeableObject.field, is(equalTo("test field")));
- }
-
- @Test
- public void encodeAndDecodeNullObjectArray() throws IOException {
- outputImpl.writeEncodables(null);
-
- final Encodable[] objects = inputImpl.readEncodables(Encodable.class);
- assertThat(objects, is(nullValue()));
- }
-
- @Test
- public void encodeAndDecodeString() throws IOException {
- outputImpl.writeUTF("test");
- outputImpl.writeUTF("");
- outputImpl.writeUTF("second");
-
- assertThat(inputImpl.readUTF(), is(equalTo("test")));
- assertThat(inputImpl.readUTF(), is(equalTo("")));
- assertThat(inputImpl.readUTF(), is(equalTo("second")));
- }
-
- @Test
- public void encodeAndDecodeStringArray() throws IOException {
- final String[] list = { "one", "two", "three" };
- outputImpl.writeUTFs(list);
-
- final String[] returnedList = inputImpl.readUTFs();
-
- assertThat(returnedList.length, is(equalTo(list.length)));
- assertThat(returnedList[0], is(equalTo(list[0])));
- assertThat(returnedList[1], is(equalTo(list[1])));
- assertThat(returnedList[2], is(equalTo(list[2])));
- }
-
- private void assertThatArraysEqual(final byte[] bytes, final byte[] decodedBytes) {
- assertThat(decodedBytes.length, is(equalTo(bytes.length)));
- for (int i = 0; i < bytes.length; i++) {
- assertThat(decodedBytes[i], is(equalTo(bytes[i])));
- }
- }
-
-}
-
-class EncodableObject implements Encodable {
- String field;
-
- public EncodableObject() {
- }
-
- public EncodableObject(final DataInputExtended input) throws IOException {
- field = input.readUTF();
- }
-
- @Override
- public void encode(final DataOutputExtended output) throws IOException {
- output.writeUTF("test field");
- }
-
-}
diff --git a/legacy/extensions/core/commons/src/test/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolSupportTest.java b/legacy/extensions/core/commons/src/test/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolSupportTest.java
deleted file mode 100644
index 6cc4502..0000000
--- a/legacy/extensions/core/commons/src/test/java/org/apache/isis/legacy/commons/internal/threadpool/ThreadPoolSupportTest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.commons.internal.threadpool;
-
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.stream.Collectors;
-
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import org.apache.isis.commons.internal.collections._Lists;
-
-@Deprecated
-class ThreadPoolSupportTest {
-
- private ThreadPoolSupport pool;
- private Buffer buffer;
-
- @BeforeEach
- void setUp() throws Exception {
- pool = new ThreadPoolSupport();
- buffer = new Buffer();
- }
-
- @AfterEach
- void tearDown() throws Exception {
- pool.close();
- }
-
- @Test
- void shouldPreserveSequence_whenNoThread() {
- buffer.append("A");
- buffer.append("B");
- buffer.append("C");
- Assertions.assertEquals("ABC", buffer.toString());
- }
-
- @Test
- void shouldPreserveSequence_whenSequentialExecution() {
- runSequentialExecutionWithMode(ThreadPoolExecutionMode.SEQUENTIAL);
- }
-
- @Test
- void shouldPreserveSequence_whenSequentialExecutionWithinCallingThread() {
- runSequentialExecutionWithMode(ThreadPoolExecutionMode.SEQUENTIAL_WITHIN_CALLING_THREAD);
- }
-
- // -- HELPER
-
- void runSequentialExecutionWithMode(ThreadPoolExecutionMode executionMode) {
-
- final List<Future<Object>> futures = _Lists.newArrayList();
-
- final List<Callable<Object>> tasks = _Lists.of(
- ()->{buffer.append("A"); return "A";},
- ()->{buffer.append("B"); return "B";},
- ()->{buffer.append("C"); return "C";},
- ()->{buffer.append("D"); return "D";},
- ()->{buffer.append("E"); return "E";},
- ()->{buffer.append("F"); return "F";},
- ()->{buffer.append("G"); return "G";},
- ()->{buffer.append("H"); return "H";},
- ()->{buffer.append("I"); return "I";},
- ()->{buffer.append("J"); return "J";}
- );
-
- for(int i=0; i<256; ++i) {
- final List<Future<Object>> taskFutures = pool.invokeAll(executionMode, tasks);
- pool.joinGatherFailures(taskFutures);
- futures.addAll(taskFutures);
- }
-
- final String resultString = futures.stream()
- .map(future->{try {
- return future.get();
- } catch (InterruptedException | ExecutionException e) {
- return ""+e;
- }})
- .map(result->""+result)
- .collect(Collectors.joining());
-
- final String buffer_allowedSequencesRemoved = buffer.toString().replace("ABCDEFGHIJ", "");
- final String result_allowedSequencesRemoved = resultString.replace("ABCDEFGHIJ", "");
-
-
- Assertions.assertEquals("", buffer_allowedSequencesRemoved);
- Assertions.assertEquals("", result_allowedSequencesRemoved);
-
- }
-
- /** thread-safe StringBuffer */
- private static class Buffer {
-
- final StringBuffer sb = new StringBuffer();
-
- public Buffer append(final CharSequence c) {
- synchronized (sb) {
- sb.append(c);
- }
- return this;
- }
-
- @Override
- public String toString() {
- synchronized (sb) {
- return sb.toString();
- }
- }
-
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/.gitignore b/legacy/extensions/core/metamodel/.gitignore
deleted file mode 100644
index a48e45b..0000000
--- a/legacy/extensions/core/metamodel/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/target-ide
diff --git a/legacy/extensions/core/metamodel/pom.xml b/legacy/extensions/core/metamodel/pom.xml
deleted file mode 100644
index b6eb8ee..0000000
--- a/legacy/extensions/core/metamodel/pom.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.isis.legacy</groupId>
- <artifactId>isis-legacy</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../../pom.xml</relativePath>
- </parent>
-
- <artifactId>isis-legacy-metamodel</artifactId>
- <name>Apache Isis Legacy - Metamodel</name>
- <description>
- To ease migration from Apache Isis versions 1.16+ to 2.0.0.
- </description>
-
- <properties>
- <jar-plugin.automaticModuleName>org.apache.isis.legacy.metamodel</jar-plugin.automaticModuleName>
- <git-plugin.propertiesDir>org/apache/isis/legacy/metamodel</git-plugin.propertiesDir>
- </properties>
-
- <dependencies>
-
- <!-- JDO API (non transient, provided by plugin) -->
- <dependency>
- <!-- v3.2 not available yet, use datanucleus staging for now -->
- <!-- <groupId>javax.jdo</groupId> -->
- <!-- <artifactId>jdo-api</artifactId> -->
- <groupId>org.datanucleus</groupId>
- <artifactId>javax.jdo</artifactId>
- <!-- provided by plugins -->
- <scope>provided</scope>
- </dependency>
-
- <!-- LEGACY DEPENDENCY -->
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
-
- <!-- CORE -->
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-applib</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.legacy</groupId>
- <artifactId>isis-legacy-applib</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.persistence</groupId>
- <artifactId>isis-persistence-jdo-applib</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-metamodel</artifactId>
- <scope>compile</scope>
- </dependency>
-
-
- <!-- TEST DEPENDENCY -->
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-internaltestsupport</artifactId>
- <scope>test</scope>
- <exclusions>
- <!-- whatever unittestsupport is dependent on, it should not be transitive -->
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/legacy/extensions/core/metamodel/src/main/adoc/antora.yml b/legacy/extensions/core/metamodel/src/main/adoc/antora.yml
deleted file mode 100644
index 3938f85..0000000
--- a/legacy/extensions/core/metamodel/src/main/adoc/antora.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name: legacy
-version: latest
diff --git a/legacy/extensions/core/metamodel/src/main/adoc/modules/metamodel/nav.adoc b/legacy/extensions/core/metamodel/src/main/adoc/modules/metamodel/nav.adoc
deleted file mode 100644
index 6485415..0000000
--- a/legacy/extensions/core/metamodel/src/main/adoc/modules/metamodel/nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-include::legacy:ROOT:partial$component-nav.adoc[]
diff --git a/legacy/extensions/core/metamodel/src/main/adoc/modules/metamodel/pages/about.adoc b/legacy/extensions/core/metamodel/src/main/adoc/modules/metamodel/pages/about.adoc
deleted file mode 100644
index 1bf059a..0000000
--- a/legacy/extensions/core/metamodel/src/main/adoc/modules/metamodel/pages/about.adoc
+++ /dev/null
@@ -1,6 +0,0 @@
-= MetaModel
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-WARNING: TODO: v2: to document
-
diff --git a/legacy/extensions/core/metamodel/src/main/adoc/modules/metamodel/partials/module-nav.adoc b/legacy/extensions/core/metamodel/src/main/adoc/modules/metamodel/partials/module-nav.adoc
deleted file mode 100644
index 23d349b..0000000
--- a/legacy/extensions/core/metamodel/src/main/adoc/modules/metamodel/partials/module-nav.adoc
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-* xref:legacy:metamodel:about.adoc[MetaModel]
-
-
-
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/color/ColorValueFacet.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/color/ColorValueFacet.java
deleted file mode 100644
index 7126017..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/color/ColorValueFacet.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.color;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.spec.ManagedObject;
-
-public interface ColorValueFacet extends Facet {
-
- int colorValue(ManagedObject object);
-
- ManagedObject createValue(ManagedObject object, int color);
-}
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/color/ColorValueFacetUsingSemanticsProviderFactory.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/color/ColorValueFacetUsingSemanticsProviderFactory.java
deleted file mode 100644
index f1f8883..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/color/ColorValueFacetUsingSemanticsProviderFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.color;
-
-import org.apache.isis.legacy.applib.value.Color;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueFacetUsingSemanticsProviderFactory;
-
-public class ColorValueFacetUsingSemanticsProviderFactory extends ValueFacetUsingSemanticsProviderFactory<Color> {
-
- public ColorValueFacetUsingSemanticsProviderFactory() {
- super();
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Class<?> type = processClassContext.getCls();
- final FacetHolder holder = processClassContext.getFacetHolder();
-
- if (type != Color.class) {
- return;
- }
- addFacets(new ColorValueSemanticsProvider(holder));
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/color/ColorValueSemanticsProvider.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/color/ColorValueSemanticsProvider.java
deleted file mode 100644
index f860962..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/color/ColorValueSemanticsProvider.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.color;
-
-import java.text.DecimalFormat;
-
-import org.apache.isis.applib.adapters.EncoderDecoder;
-import org.apache.isis.applib.adapters.Parser;
-import org.apache.isis.applib.exceptions.recoverable.TextEntryParseException;
-import org.apache.isis.legacy.applib.value.Color;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueSemanticsProviderAndFacetAbstract;
-import org.apache.isis.core.metamodel.spec.ManagedObject;
-
-
-public class ColorValueSemanticsProvider
-extends ValueSemanticsProviderAndFacetAbstract<Color>
-implements ColorValueFacet {
-
- public static Class<? extends Facet> type() {
- return ColorValueFacet.class;
- }
-
- private static final Color DEFAULT_VALUE = Color.BLACK;
- private static final int TYPICAL_LENGTH = 4;
-
- /**
- * Required because implementation of {@link Parser} and
- * {@link EncoderDecoder}.
- */
- public ColorValueSemanticsProvider() {
- this(null);
- }
-
- public ColorValueSemanticsProvider(final FacetHolder holder) {
- super(type(), holder, Color.class, TYPICAL_LENGTH, -1, Immutability.IMMUTABLE, EqualByContent.NOT_HONOURED, DEFAULT_VALUE);
- }
-
- // //////////////////////////////////////////////////////////////////
- // Parser
- // //////////////////////////////////////////////////////////////////
-
- @Override
- protected Color doParse(final Object context, final String text) {
- try {
- if (text.startsWith("0x")) {
- return new Color(Integer.parseInt(text.substring(2), 16));
- } else if (text.startsWith("#")) {
- return new Color(Integer.parseInt(text.substring(1), 16));
- } else {
- return new Color(Integer.parseInt(text));
- }
- } catch (final NumberFormatException e) {
- throw new TextEntryParseException("Not a number " + text, e);
- }
- }
-
- @Override
- public String titleString(final Object object) {
- final Color color = (Color) object;
- return color.title();
- }
-
- @Override
- public String titleStringWithMask(final Object object, final String usingMask) {
- final Color color = (Color) object;
- return titleString(new DecimalFormat(usingMask), color.intValue());
- }
-
- // //////////////////////////////////////////////////////////////////
- // Encode, Decode
- // //////////////////////////////////////////////////////////////////
-
- @Override
- protected String doEncode(final Color color) {
- return Integer.toHexString(color.intValue());
- }
-
- @Override
- protected Color doRestore(final String data) {
- return new Color(Integer.parseInt(data, 16));
- }
-
- // //////////////////////////////////////////////////////////////////
- // ColorValueFacet
- // //////////////////////////////////////////////////////////////////
-
- @Override
- public int colorValue(final ManagedObject object) {
- if (object == null) {
- return 0;
- }
- final Color color = (Color) object.getPojo();
- return color.intValue();
- }
-
- @Override
- public ManagedObject createValue(final ManagedObject object, final int colorAsInt) {
- final Color color = new Color(colorAsInt);
- return getObjectManager().adapt(color);
- }
-
- @Override
- public String toString() {
- return "ColorValueSemanticsProvider";
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/image/ImageValueFacetUsingSemanticsProviderFactory.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/image/ImageValueFacetUsingSemanticsProviderFactory.java
deleted file mode 100644
index b8521f2..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/image/ImageValueFacetUsingSemanticsProviderFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.image;
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueFacetUsingSemanticsProviderFactory;
-import org.apache.isis.legacy.applib.value.Image;
-
-public class ImageValueFacetUsingSemanticsProviderFactory extends ValueFacetUsingSemanticsProviderFactory<Image> {
-
- public ImageValueFacetUsingSemanticsProviderFactory() {
- super();
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Class<?> type = processClassContext.getCls();
- final FacetHolder holder = processClassContext.getFacetHolder();
-
- if (type != org.apache.isis.legacy.applib.value.Image.class) {
- return;
- }
- addFacets(new ImageValueSemanticsProvider(holder));
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/image/ImageValueSemanticsProvider.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/image/ImageValueSemanticsProvider.java
deleted file mode 100644
index e4a7efd..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/image/ImageValueSemanticsProvider.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.image;
-
-import java.awt.image.BufferedImage;
-import java.util.Optional;
-
-import org.apache.isis.commons.internal.image._Images;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.value.image.ImageValueSemanticsProviderAbstract;
-import org.apache.isis.core.metamodel.spec.ManagedObject;
-import org.apache.isis.legacy.applib.value.Image;
-
-import lombok.val;
-
-public class ImageValueSemanticsProvider
-extends ImageValueSemanticsProviderAbstract<Image> {
-
- public ImageValueSemanticsProvider(final FacetHolder holder) {
- super(holder, Image.class);
- }
-
- @Override
- public int getHeight(final ManagedObject object) {
- return unwrap(object).getHeight();
- }
-
- @Override
- public int getWidth(final ManagedObject object) {
- return unwrap(object).getWidth();
- }
-
- @Override
- public Optional<BufferedImage> getImage(ManagedObject object) {
- val image = unwrap(object);
- if(image.isEmpty()) {
- return Optional.empty();
- }
- val pixels = image.getPixels();
- return Optional.ofNullable(_Images.fromPixels(pixels));
- }
-
- @Override
- protected String doEncode(Image image) {
- return _Images.toBase64(_Images.fromPixels(image.getPixels()));
- }
-
- @Override
- protected Image doRestore(String base64ImageData) {
- return new Image(_Images.toPixels(_Images.fromBase64(base64ImageData)));
- }
-
- @Override
- public Facet getUnderlyingFacet() {
- return null;
- }
-
- /**
- * Not required because {@link #alwaysReplace()} is <tt>false</tt>.
- */
- @Override
- public void setUnderlyingFacet(final Facet underlyingFacet) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean alwaysReplace() {
- return false;
- }
-
- @Override
- public boolean isFallback() {
- return false;
- }
-
- @Override
- public String toString() {
- return "ImageValueSemanticsProvider: ";
- }
-
- // -- HELPER
-
- private Image unwrap(final ManagedObject object) {
- return (Image) object.getPojo();
- }
-
-
-}
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/money/MoneyValueFacet.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/money/MoneyValueFacet.java
deleted file mode 100644
index a86802b..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/money/MoneyValueFacet.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.money;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.spec.ManagedObject;
-
-public interface MoneyValueFacet extends Facet {
-
- float getAmount(ManagedObject object);
-
- String getCurrencyCode(ManagedObject object);
-
- ManagedObject createValue(float amount, String currencyCode);
-
-}
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/money/MoneyValueFacetUsingSemanticsProviderFactory.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/money/MoneyValueFacetUsingSemanticsProviderFactory.java
deleted file mode 100644
index 2d7163d..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/money/MoneyValueFacetUsingSemanticsProviderFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.money;
-
-import org.apache.isis.legacy.applib.value.Money;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueFacetUsingSemanticsProviderFactory;
-
-public class MoneyValueFacetUsingSemanticsProviderFactory extends ValueFacetUsingSemanticsProviderFactory<Money> {
-
- public MoneyValueFacetUsingSemanticsProviderFactory() {
- super();
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Class<?> type = processClassContext.getCls();
- final FacetHolder holder = processClassContext.getFacetHolder();
-
- if (type != Money.class) {
- return;
- }
- addFacets(new MoneyValueSemanticsProvider(holder));
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/money/MoneyValueSemanticsProvider.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/money/MoneyValueSemanticsProvider.java
deleted file mode 100644
index ce8a999..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/money/MoneyValueSemanticsProvider.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.money;
-
-import java.text.DecimalFormat;
-import java.text.NumberFormat;
-import java.text.ParseException;
-import java.util.Currency;
-import java.util.Map;
-
-import org.apache.isis.applib.adapters.EncoderDecoder;
-import org.apache.isis.applib.adapters.Parser;
-import org.apache.isis.applib.exceptions.recoverable.TextEntryParseException;
-import org.apache.isis.commons.internal.base._Strings;
-import org.apache.isis.legacy.applib.value.Money;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueSemanticsProviderAndFacetAbstract;
-import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
-import org.apache.isis.core.metamodel.spec.ManagedObject;
-
-public class MoneyValueSemanticsProvider
-extends ValueSemanticsProviderAndFacetAbstract<Money>
-implements MoneyValueFacet {
-
- private static Class<? extends Facet> type() {
- return MoneyValueFacet.class;
- }
-
- private static final NumberFormat DEFAULT_NUMBER_FORMAT;
- private static final NumberFormat DEFAULT_CURRENCY_FORMAT;
- private static final String LOCAL_CURRENCY_CODE;
- private static final int TYPICAL_LENGTH = 18;
- private static final Money DEFAULT_VALUE = null; // no default
-
- private final String defaultCurrencyCode;
-
- static {
- DEFAULT_NUMBER_FORMAT = NumberFormat.getNumberInstance();
- DEFAULT_CURRENCY_FORMAT = NumberFormat.getCurrencyInstance();
- DEFAULT_NUMBER_FORMAT.setMinimumFractionDigits(DEFAULT_CURRENCY_FORMAT.getMinimumFractionDigits());
- DEFAULT_NUMBER_FORMAT.setMaximumFractionDigits(DEFAULT_CURRENCY_FORMAT.getMaximumFractionDigits());
- LOCAL_CURRENCY_CODE = getDefaultCurrencyCode();
- }
-
- private static String getDefaultCurrencyCode() {
- try {
- return DEFAULT_CURRENCY_FORMAT.getCurrency().getCurrencyCode();
- } catch (final UnsupportedOperationException e) {
- return "";
- }
- }
-
- /**
- * Required because implementation of {@link Parser} and
- * {@link EncoderDecoder}.
- */
- public MoneyValueSemanticsProvider() {
- this(null);
- }
-
- public MoneyValueSemanticsProvider(final FacetHolder holder) {
- super(type(), holder, Money.class, TYPICAL_LENGTH, -1, Immutability.IMMUTABLE, EqualByContent.HONOURED, DEFAULT_VALUE);
-
- defaultCurrencyCode =
- getConfiguration().getLegacy().getValueTypes().getMoney().getCurrency()
- .filter(_Strings::isNotEmpty)
- .orElse(LOCAL_CURRENCY_CODE);
- }
-
- // //////////////////////////////////////////////////////////////////
- // Parser
- // //////////////////////////////////////////////////////////////////
-
- @Override
- protected Money doParse(final Object context, final String text) {
- final String entry = text.trim();
- final int pos = entry.lastIndexOf(' ');
- if (endsWithCurrencyCode(entry, pos)) {
- final String value = entry.substring(0, pos);
- final String code = entry.substring(pos + 1);
- return parseNumberAndCurrencyCode(value, code);
- } else {
- return parseDerivedValue(context, entry);
- }
- }
-
- private boolean endsWithCurrencyCode(final String entry, final int pos) {
- final String suffix = entry.substring(pos + 1);
- final boolean isCurrencyCode = suffix.length() == 3 && Character.isLetter(suffix.charAt(0)) && Character.isLetter(suffix.charAt(1)) && Character.isLetter(suffix.charAt(2));
- return isCurrencyCode;
- }
-
- private Money parseDerivedValue(final Object original, final String entry) {
- Money money = (Money) original;
- if (money == null || money.getCurrency().equals(LOCAL_CURRENCY_CODE)) {
- try {
- final double value = DEFAULT_CURRENCY_FORMAT.parse(entry).doubleValue();
- money = new Money(value, LOCAL_CURRENCY_CODE);
- return money;
- } catch (final ParseException ignore) {
- }
- }
-
- try {
- final double value = DEFAULT_NUMBER_FORMAT.parse(entry).doubleValue();
- final String currencyCode = money == null ? defaultCurrencyCode : money.getCurrency();
- money = new Money(value, currencyCode);
- return money;
- } catch (final ParseException ex) {
- throw new TextEntryParseException("Not a distinguishable money value " + entry, ex);
- }
- }
-
- private Money parseNumberAndCurrencyCode(final String amount, final String code) {
- final String currencyCode = code.toUpperCase();
- try {
- Currency.getInstance(currencyCode.toUpperCase());
- } catch (final IllegalArgumentException e) {
- throw new TextEntryParseException("Invalid currency code " + currencyCode, e);
- }
- try {
- final Money money = new Money(DEFAULT_NUMBER_FORMAT.parse(amount).doubleValue(), currencyCode);
- return money;
- } catch (final ParseException e) {
- throw new TextEntryParseException("Invalid money entry", e);
- }
- }
-
- @Override
- public String titleString(final Object object) {
- if (object == null) {
- return "";
- }
- final Money money = (Money) object;
- final boolean localCurrency = LOCAL_CURRENCY_CODE.equals(money.getCurrency());
- if (localCurrency) {
- return DEFAULT_CURRENCY_FORMAT.format(money.doubleValue());
- } else {
- return DEFAULT_NUMBER_FORMAT.format(money.doubleValue()) + " " + money.getCurrency();
- }
- }
-
- @Override
- public String titleStringWithMask(final Object value, final String usingMask) {
- if (value == null) {
- return "";
- }
- final Money money = (Money) value;
- return new DecimalFormat(usingMask).format(money.doubleValue());
- }
-
- // //////////////////////////////////////////////////////////////////
- // EncoderDecoder
- // //////////////////////////////////////////////////////////////////
-
- @Override
- protected String doEncode(final Money money) {
- final String value = String.valueOf(money.doubleValue()) + " " + money.getCurrency();
- return value;
- }
-
- @Override
- protected Money doRestore(final String data) {
- final String dataString = data;
- final int pos = dataString.indexOf(' ');
- final String amount = dataString.substring(0, pos);
- final String currency = dataString.substring(pos + 1);
- return new Money(Double.valueOf(amount).doubleValue(), currency);
- }
-
- // //////////////////////////////////////////////////////////////////
- // MoneyValueFacet
- // //////////////////////////////////////////////////////////////////
-
- @Override
- public float getAmount(final ManagedObject object) {
- final Money money = (Money) object.getPojo();
- if (money == null) {
- return 0.0f;
- } else {
- return money.floatValue();
- }
- }
-
- @Override
- public String getCurrencyCode(final ManagedObject object) {
- final Money money = (Money) object.getPojo();
- if (money == null) {
- return "";
- } else {
- return money.getCurrency();
- }
- }
-
- @Override
- public ManagedObject createValue(final float amount, final String currencyCode) {
- return getObjectManager().adapt(new Money(amount, currencyCode));
- }
-
- // /////// toString ///////
-
- @Override
- public String toString() {
- return "MoneyValueSemanticsProvider: " + getDefaultCurrencyCode();
- }
-
- @Override public void appendAttributesTo(final Map<String, Object> attributeMap) {
- super.appendAttributesTo(attributeMap);
- attributeMap.put("defaultCurrencyCode", defaultCurrencyCode);
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/percentage/PercentageValueFacetUsingSemanticsProviderFactory.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/percentage/PercentageValueFacetUsingSemanticsProviderFactory.java
deleted file mode 100644
index 0f2661e..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/percentage/PercentageValueFacetUsingSemanticsProviderFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.percentage;
-
-import org.apache.isis.legacy.applib.value.Percentage;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueFacetUsingSemanticsProviderFactory;
-
-public class PercentageValueFacetUsingSemanticsProviderFactory
-extends ValueFacetUsingSemanticsProviderFactory<Percentage> {
-
- public PercentageValueFacetUsingSemanticsProviderFactory() {
- super();
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Class<?> type = processClassContext.getCls();
- final FacetHolder holder = processClassContext.getFacetHolder();
-
- if (type != Percentage.class) {
- return;
- }
- addFacets(new PercentageValueSemanticsProvider(holder));
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/percentage/PercentageValueSemanticsProvider.java b/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/percentage/PercentageValueSemanticsProvider.java
deleted file mode 100644
index 6179457..0000000
--- a/legacy/extensions/core/metamodel/src/main/java/org/apache/isis/legacy/metamodel/facets/value/percentage/PercentageValueSemanticsProvider.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value.percentage;
-
-import java.text.DecimalFormat;
-import java.text.NumberFormat;
-import java.text.ParseException;
-
-import org.apache.isis.applib.adapters.EncoderDecoder;
-import org.apache.isis.applib.adapters.Parser;
-import org.apache.isis.applib.exceptions.recoverable.TextEntryParseException;
-import org.apache.isis.legacy.applib.value.Percentage;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueSemanticsProviderAndFacetAbstract;
-import org.apache.isis.core.metamodel.facets.value.floats.FloatingPointValueFacet;
-import org.apache.isis.core.metamodel.spec.ManagedObject;
-
-public class PercentageValueSemanticsProvider
-extends ValueSemanticsProviderAndFacetAbstract<Percentage>
-implements FloatingPointValueFacet {
-
- private static final NumberFormat PERCENTAGE_FORMAT = NumberFormat.getPercentInstance();
- private static final NumberFormat DECIMAL_FORMAT = NumberFormat.getNumberInstance();
-
- private static final Percentage DEFAULT_VALUE = new Percentage(0.0f);
- private static final int TYPICAL_LENGTH = 12;
-
- public static Class<? extends Facet> type() {
- return FloatingPointValueFacet.class;
- }
-
- private NumberFormat format = PERCENTAGE_FORMAT;
-
- /**
- * Required because implementation of {@link Parser} and
- * {@link EncoderDecoder}.
- */
- public PercentageValueSemanticsProvider() {
- this(null);
- }
-
- public PercentageValueSemanticsProvider(final FacetHolder holder) {
- super(type(), holder, Percentage.class, TYPICAL_LENGTH, -1, Immutability.IMMUTABLE, EqualByContent.HONOURED, DEFAULT_VALUE);
-
- final String formatRequired = getConfiguration().getLegacy().getValueTypes().getPercentage().getFormat();
-
- if (formatRequired == null) {
- format = PERCENTAGE_FORMAT;
- } else {
- format = new DecimalFormat(formatRequired);
- }
- }
-
- // //////////////////////////////////////////////////////////////////
- // Parser
- // //////////////////////////////////////////////////////////////////
-
- @Override
- protected Percentage doParse(final Object context, final String text) {
- try {
- return new Percentage(Float.valueOf(format.parse(text).floatValue()));
- } catch (final ParseException e) {
- try {
- return new Percentage(asFloat(text));
- } catch (final ParseException ee) {
- throw new TextEntryParseException("Not a number " + text, ee);
- }
- }
- }
-
- private Float asFloat(final String text) throws ParseException {
- return Float.valueOf(DECIMAL_FORMAT.parse(text).floatValue());
- }
-
- @Override
- public String titleString(final Object value) {
- return titleString(format, value);
- }
-
- private String titleString(final NumberFormat formatter, final Object value) {
- return value == null ? "" : format.format(((Percentage) value).floatValue());
- }
-
- @Override
- public String titleStringWithMask(final Object value, final String usingMask) {
- return titleString(new DecimalFormat(usingMask), value);
- }
-
- // //////////////////////////////////////////////////////////////////
- // EncoderDecoder
- // //////////////////////////////////////////////////////////////////
-
- @Override
- protected String doEncode(final Percentage per) {
- return String.valueOf(per.floatValue());
- }
-
- @Override
- protected Percentage doRestore(final String data) {
- return new Percentage(Float.valueOf(data).floatValue());
- }
-
- // //////////////////////////////////////////////////////////////////
- // FloatingPointValueFacet
- // //////////////////////////////////////////////////////////////////
-
- @Override
- public Float floatValue(final ManagedObject object) {
- final Percentage per = (Percentage) object.getPojo();
- return Float.valueOf(per.floatValue());
- }
-
- @Override
- public ManagedObject createValue(final Float value) {
- return getObjectManager().adapt(value);
- }
-
- // //////////////////////////////////////////////////////////////////
- // PropertyDefaultFacet
- // //////////////////////////////////////////////////////////////////
-
- public Object getDefault(final ManagedObject inObject) {
- return Float.valueOf(0.0f);
- }
-
- // //// toString ////////////////////////////////////////////////////
-
- @Override
- public String toString() {
- return "PercentageValueSemanticsProvider: " + format;
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/ColorValueSemanticsProviderTest.java b/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/ColorValueSemanticsProviderTest.java
deleted file mode 100644
index 9fb9b61..0000000
--- a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/ColorValueSemanticsProviderTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.apache.isis.applib.exceptions.recoverable.TextEntryParseException;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
-import org.apache.isis.legacy.applib.value.Color;
-import org.apache.isis.legacy.metamodel.facets.value.color.ColorValueSemanticsProvider;
-
-public class ColorValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
-
- private ColorValueSemanticsProvider value;
- private Color color;
- private FacetHolder holder;
-
- @Before
- public void setUpObjects() throws Exception {
- color = new Color(0x3366ff);
- allowMockAdapterToReturn(color);
- holder = new FacetHolderImpl();
-
- setValue(value = new ColorValueSemanticsProvider(holder));
- }
-
- @Test
- public void testParseValidString() throws Exception {
- final Object newValue = value.parseTextEntry(null, "#3366fF");
- assertEquals(color, newValue);
- }
-
- @Test
- public void testParseInvalidString() throws Exception {
- try {
- value.parseTextEntry(null, "red");
- fail();
- } catch (final TextEntryParseException expected) {
- }
- }
-
- @Test
- public void testTitleOf() {
- assertEquals("#3366FF", value.displayTitleOf(color));
- }
-
- @Test
- public void testTitleOfBlack() {
- assertEquals("Black", value.displayTitleOf(new Color(0)));
- }
-
- @Test
- public void testTitleOfWhite() {
- assertEquals("White", value.displayTitleOf(new Color(0xffffff)));
- }
-
- @Test
- public void testEncode() {
- assertEquals("3366ff", value.toEncodedString(color));
- }
-
- @Test
- public void testDecode() throws Exception {
- final Object newValue = value.fromEncodedString("3366ff");
- assertEquals(color, newValue);
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/ImageValueSemanticsProviderTest.java b/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/ImageValueSemanticsProviderTest.java
deleted file mode 100644
index 81c978c..0000000
--- a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/ImageValueSemanticsProviderTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value;
-
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-
-import org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2.Mode;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.legacy.applib.value.Image;
-import org.apache.isis.legacy.metamodel.facets.value.image.ImageValueSemanticsProvider;
-
-import lombok.val;
-
-public class ImageValueSemanticsProviderTest {
-
- @Rule
- public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
- @Mock
- private FacetHolder mockFacetHolder;
-
- private ImageValueSemanticsProvider adapter;
-
- @Before
- public void setUp() throws Exception {
- adapter = new ImageValueSemanticsProvider(mockFacetHolder);
- }
-
- @Test
- public void roundtrip() throws Exception {
-
- val encodedImageData = adapter.toEncodedString(new Image(getPixels()));
- val restoredImage = adapter.fromEncodedString(encodedImageData);
-
- val pixels = restoredImage.getPixels();
-
-// debug
-// System.out.println(_Ints.tableForm(getPixels(), 10, Integer::toHexString));
-// System.out.println();
-// System.out.println();
-// System.out.println(_Ints.tableForm(pixels, 10, Integer::toHexString));
-
- assertArrayEquals(getPixels(), pixels);
-
- }
-
- // -- SAMPLE
-
- private int[][] getPixels() {
- final int[][] array = new int[10][10];
- array[0][0] = 0xFEFDFCFB;
- array[0][1] = 0x3F218A;
- array[0][3] = 0x123456;
- array[0][4] = 0x7FFFFF;
- array[0][5] = -0x7FFFFF;
- array[0][6] = -0x700000;
- return array;
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/MoneyValueSemanticsProviderTest.java b/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/MoneyValueSemanticsProviderTest.java
deleted file mode 100644
index 833d103..0000000
--- a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/MoneyValueSemanticsProviderTest.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value;
-
-import java.util.Locale;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.apache.isis.applib.exceptions.recoverable.TextEntryParseException;
-import org.apache.isis.core.metamodel.context.MetaModelContextAware;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
-import org.apache.isis.legacy.applib.value.Money;
-import org.apache.isis.legacy.metamodel.facets.value.money.MoneyValueSemanticsProvider;
-
-public class MoneyValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
-
- private static final String POUND_SYMBOL = "\u00A3";
- private static final String EURO_SYMBOL = "\u20AC";
- private MoneyValueSemanticsProvider adapter;
- private Money originalMoney;
- private FacetHolder holder;
-
- @Before
- public void setUpObjects() throws Exception {
- Locale.setDefault(Locale.UK);
- holder = new FacetHolderImpl();
- ((MetaModelContextAware)holder).setMetaModelContext(super.metaModelContext);
-
- setValue(adapter = new MoneyValueSemanticsProvider(holder));
- }
-
- private Money createMoney(final double amount, final String currency) {
- return new Money(amount, currency);
- }
-
- @Test
- public void testLocale() {
- assertEquals(Locale.UK, Locale.getDefault());
- }
-
- @Test
- public void testEncoding() {
- originalMoney = new Money(10.5, "gbp");
- final String data = adapter.toEncodedString(originalMoney);
- assertEquals("10.5 GBP", data);
- }
-
- @Test
- public void testDecoding() {
- final Object restored = adapter.fromEncodedString("23.77 FFR");
- final Money expected = new Money(23.77, "FFR");
- assertEquals(expected, restored);
- }
-
- @Test
- public void testTitleOfWithPounds() {
- originalMoney = new Money(10.5, "gbp");
- assertEquals(POUND_SYMBOL + "10.50", adapter.displayTitleOf(originalMoney));
- }
-
- @Test
- public void testTitleOfWithNonLocalCurrency() {
- assertEquals("10.50 USD", adapter.displayTitleOf(createMoney(10.50, "usd")));
- }
-
- @Test
- public void testTitleWithUnknownCurrency() {
- assertEquals("10.50 UNK", adapter.displayTitleOf(createMoney(10.50, "UNK")));
- }
-
- @Test
- public void testUserEntryWithCurrency() {
- final Money money = createMoney(10.5, "gbp");
- final Money parsed = adapter.parseTextEntry(money, "22.45 USD");
- assertEquals(new Money(22.45, "usd"), parsed);
- }
-
- @Test
- public void testNewUserEntryUsesPreviousCurrency() {
- originalMoney = new Money(10.5, "gbp");
- final Object parsed = adapter.parseTextEntry(originalMoney, "22.45");
- assertEquals(new Money(22.45, "gbp"), parsed);
- }
-
- @Test
- public void testReplacementEntryForDefaultCurrency() {
- // MoneyValueSemanticsProvider adapter = new
- // MoneyValueSemanticsProvider(new Money(10.3, "gbp"));
- final Object parsed = adapter.parseTextEntry(originalMoney, POUND_SYMBOL + "80.90");
- assertEquals(new Money(80.90, "gbp"), parsed);
- }
-
- @Test
- public void testSpecifyingCurrencyInEntry() {
- final Object parsed = adapter.parseTextEntry(originalMoney, "3021.50 EUr");
- assertEquals("3,021.50 EUR", adapter.displayTitleOf(parsed));
- }
-
- @Test
- public void testUsingLocalCurrencySymbol() {
- // MoneyValueSemanticsProvider adapter = new
- // MoneyValueSemanticsProvider(new Money(0L, "gbp"));
- final Object parsed = adapter.parseTextEntry(originalMoney, POUND_SYMBOL + "3021.50");
- assertEquals(POUND_SYMBOL + "3,021.50", adapter.titleString(parsed));
- }
-
- @Test
- public void testInvalidCurrencyCodeIsRejected() throws Exception {
- try {
- adapter.parseTextEntry(originalMoney, "3021.50 XYZ");
- fail("invalid code accepted " + adapter);
- } catch (final TextEntryParseException expected) {
- }
- }
-
- @Test
- public void testInvalidCurrencySymbolIsRejected() throws Exception {
- try {
- adapter.parseTextEntry(originalMoney, EURO_SYMBOL + "3021.50");
- fail("invalid code accepted " + adapter);
- } catch (final TextEntryParseException expected) {
- }
- }
-
- @Test
- public void testNewValueDefaultsToLocalCurrency() throws Exception {
- final Money parsed = adapter.parseTextEntry(originalMoney, "3021.50");
- assertEquals(POUND_SYMBOL + "3,021.50", adapter.displayTitleOf(parsed));
- }
-
- @Test
- public void testUnrelatedCurrencySymbolIsRejected() throws Exception {
- final Money money = createMoney(1, "eur");
- try {
- adapter.parseTextEntry(money, "$3021.50");
- fail("invalid code accepted " + adapter);
- } catch (final TextEntryParseException expected) {
- }
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/PercentageValueSemanticsProviderTest.java b/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/PercentageValueSemanticsProviderTest.java
deleted file mode 100644
index 1599631..0000000
--- a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/PercentageValueSemanticsProviderTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import org.apache.isis.core.metamodel.context.MetaModelContextAware;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
-import org.apache.isis.legacy.applib.value.Percentage;
-import org.apache.isis.legacy.metamodel.facets.value.percentage.PercentageValueSemanticsProvider;
-
-public class PercentageValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
- private PercentageValueSemanticsProvider adapter;
- private Percentage percentage;
- private FacetHolder holder;
-
- @Before
- public void setUpObjects() throws Exception {
-
- percentage = new Percentage(0.105f);
- allowMockAdapterToReturn(percentage);
-
- holder = new FacetHolderImpl();
- ((MetaModelContextAware)holder).setMetaModelContext(super.metaModelContext);
-
- setValue(adapter = new PercentageValueSemanticsProvider(holder));
- }
-
- @Test
- public void testAsEncodedString() {
- final String encoded = getEncodeableFacet().toEncodedString(mockAdapter);
- assertEquals("0.105", encoded);
- }
-
- @Test
- public void testParseTextEntryWithNumber() {
- final Percentage parsed = adapter.parseTextEntry(percentage, "21%");
- assertEquals(new Percentage(0.21f), parsed);
- }
-
- @Test
- public void testParseTextEntryWithNumberAndDecimalPoint() {
- final Percentage parsed = adapter.parseTextEntry(percentage, "21.4%");
- assertEquals(new Percentage(0.214f), parsed);
- }
-
- @Test
- public void testParseTextEntryWithBlank() {
- final Percentage parsed = adapter.parseTextEntry(percentage, "");
- assertNull(parsed);
- }
-
- @Test
- public void testRestoreFromEncodedString() {
- final Object restored = adapter.fromEncodedString("0.2134");
- assertEquals(new Percentage(0.2134f), restored);
- }
-
- @Test
- public void testTitleOf() {
- assertEquals("10%", adapter.displayTitleOf(percentage));
- }
-
- @Test
- public void testFloatValue() {
- assertEquals(0.105f, adapter.floatValue(mockAdapter), 0.0f);
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/PolishMoneyValueSemanticsProviderTest.java b/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/PolishMoneyValueSemanticsProviderTest.java
deleted file mode 100644
index ff935f3..0000000
--- a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/PolishMoneyValueSemanticsProviderTest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value;
-
-import java.util.Locale;
-
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.apache.isis.applib.exceptions.recoverable.TextEntryParseException;
-import org.apache.isis.core.metamodel.context.MetaModelContextAware;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
-import org.apache.isis.legacy.applib.value.Money;
-import org.apache.isis.legacy.metamodel.facets.value.money.MoneyValueSemanticsProvider;
-
-@Ignore
-// TODO once the semantics provider has a way to reset the formatters for the new
-// local then this test can be reinstated.
-public class PolishMoneyValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
-
-
- private static final String CURRENCY_SPACE = "\u00a0";
- private static final String ZLOTYCH_SYMBOL = "\u007a\u0142";
- private static final String EURO_SYMBOL = "\u20AC";
- private MoneyValueSemanticsProvider adapter;
- private Money originalMoney;
- private FacetHolder holder;
-
- @Before
- public void setUpObjects() throws Exception {
-
- Locale.setDefault(new Locale("pl", "PL"));
- originalMoney = new Money(10.50, "pln");
- holder = new FacetHolderImpl();
- ((MetaModelContextAware)holder).setMetaModelContext(super.metaModelContext);
-
- super.setValue(adapter = new MoneyValueSemanticsProvider(holder));
- }
-
- private Money createMoney(final double amount, final String currency) {
- return new Money(amount, currency);
- }
-
- @Test
- public void testLocale() {
- assertEquals("PL", Locale.getDefault().getCountry());
- assertEquals("pl", Locale.getDefault().getLanguage());
- }
-
- @Test
- public void testEncoding() {
- final String data = adapter.toEncodedString(originalMoney);
- assertEquals("10.5 PLN", data);
- }
-
- @Test
- public void testDecoding() {
- final Object restored = adapter.fromEncodedString("23.77 FFR");
- final Money expected = new Money(23.77, "FFR");
- assertEquals(expected, restored);
- }
-
- @Test
- public void testTitleOfWithZlotych() {
- assertEquals("10,5 " + ZLOTYCH_SYMBOL, adapter.displayTitleOf(originalMoney));
- }
-
- @Test
- public void testTitleOfWithNonLocalCurrency() {
- assertEquals("10,5 USD", adapter.displayTitleOf(createMoney(10.50, "usd")));
- }
-
- @Test
- public void testTitleWithUnknownCurrency() {
- assertEquals("10,5 UNK", adapter.displayTitleOf(createMoney(10.50, "UNK")));
- }
-
- @Test
- public void testUserEntryWithCurrency() {
- final Money money = createMoney(10.5, "gbp");
- final Money parsed = adapter.parseTextEntry(money, "22,45 USD");
- assertEquals(new Money(22.45, "usd"), parsed);
- }
-
- @Test
- public void testUserEntryUsesPreviousCurrency() {
- final Object parsed = adapter.parseTextEntry(originalMoney, "22,45");
- assertEquals(new Money(22.45, "pln"), parsed);
- }
-
- @Test
- public void testReplacementEntryForDefaultCurrency() {
- final Object parsed = adapter.parseTextEntry(originalMoney, "80,90 " + ZLOTYCH_SYMBOL);
- assertEquals(new Money(80.90, "pln"), parsed);
- }
-
- @Test
- public void testSpecifyingCurrencyInEntry() {
- final Object parsed = adapter.parseTextEntry(originalMoney, "3021,50 cad");
- assertEquals("3" + CURRENCY_SPACE + "021,5 CAD", adapter.displayTitleOf(parsed));
- }
-
- @Test
- public void testUsingLocalCurrencySymbol() {
- // MoneyValueSemanticsProvider adapter = new
- // MoneyValueSemanticsProvider(new Money(0L, "gbp"));
- final Object parsed = adapter.parseTextEntry(originalMoney, "3021,50 " + ZLOTYCH_SYMBOL);
- assertEquals("3" + CURRENCY_SPACE + "021,5 " + ZLOTYCH_SYMBOL, adapter.titleString(parsed));
- }
-
- @Test
- public void testInvalidCurrencySuffixRejected() throws Exception {
- final Object parsed = adapter.parseTextEntry(originalMoney, "3" + CURRENCY_SPACE + "021,50 Dm");
- assertEquals("3" + CURRENCY_SPACE + "021,5 " + ZLOTYCH_SYMBOL, adapter.titleString(parsed));
- }
-
- @Test
- public void testInvalidCurrencySymbolIsRejected() throws Exception {
- try {
- adapter.parseTextEntry(originalMoney, EURO_SYMBOL + "3021.50");
- fail("invalid code accepted " + adapter);
- } catch (final TextEntryParseException expected) {
- }
- }
-
- @Test
- public void testNewValueDefaultsToLocalCurrency() throws Exception {
- final Money parsed = adapter.parseTextEntry(originalMoney, "3021,50");
- assertEquals("3" + CURRENCY_SPACE + "021,5 " + ZLOTYCH_SYMBOL, adapter.displayTitleOf(parsed));
- }
-
- @Test
- public void testUnrelatedCurrencySymbolIsRejected() throws Exception {
- final Money money = createMoney(1, "eur");
- try {
- adapter.parseTextEntry(money, "$3021.50");
- fail("invalid code accepted " + adapter);
- } catch (final TextEntryParseException expected) {
- }
- }
-
-}
diff --git a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/ValueSemanticsProviderAbstractTestCase.java b/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/ValueSemanticsProviderAbstractTestCase.java
deleted file mode 100644
index bf51eb1..0000000
--- a/legacy/extensions/core/metamodel/src/test/java/org/apache/isis/legacy/metamodel/facets/value/ValueSemanticsProviderAbstractTestCase.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.metamodel.facets.value;
-
-import java.util.Locale;
-
-import org.jmock.Expectations;
-import org.jmock.auto.Mock;
-import org.junit.After;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
-import org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2.Mode;
-import org.apache.isis.core.metamodel._testing.MetaModelContext_forTesting;
-import org.apache.isis.core.metamodel.context.MetaModelContext;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
-import org.apache.isis.core.metamodel.facets.object.encodeable.encoder.EncodableFacetUsingEncoderDecoder;
-import org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet;
-import org.apache.isis.core.metamodel.facets.object.parseable.parser.ParseableFacetUsingParser;
-import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueSemanticsProviderAndFacetAbstract;
-import org.apache.isis.core.metamodel.spec.ManagedObject;
-import org.apache.isis.core.security.authentication.AuthenticationContext;
-
-public abstract class ValueSemanticsProviderAbstractTestCase {
-
- @Rule
- public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
- @Mock protected FacetHolder mockFacetHolder;
- @Mock protected AuthenticationContext mockAuthenticationContext;
- @Mock protected ManagedObject mockAdapter;
-
- protected MetaModelContext metaModelContext;
-
- private ValueSemanticsProviderAndFacetAbstract<?> valueSemanticsProvider;
- private EncodableFacetUsingEncoderDecoder encodeableFacet;
- private ParseableFacetUsingParser parseableFacet;
-
- @Before
- public void setUp() throws Exception {
-
- Locale.setDefault(Locale.UK);
-
- metaModelContext = MetaModelContext_forTesting.builder()
- .authenticationContext(mockAuthenticationContext)
- .build();
-
- context.checking(new Expectations() {
- {
-
- never(mockAuthenticationContext);
- //never(mockSessionServiceInternal);
-
- allowing(mockFacetHolder).getMetaModelContext();
- will(returnValue(metaModelContext));
- }
- });
- }
-
- @After
- public void tearDown() throws Exception {
- context.assertIsSatisfied();
- }
-
- protected void allowMockAdapterToReturn(final Object pojo) {
- context.checking(new Expectations() {
- {
- allowing(mockAdapter).getPojo();
- will(returnValue(pojo));
- }
- });
- }
-
- protected void setValue(final ValueSemanticsProviderAndFacetAbstract<?> value) {
- this.valueSemanticsProvider = value;
- this.encodeableFacet = new EncodableFacetUsingEncoderDecoder(
- value,
- mockFacetHolder);
- this.parseableFacet = new ParseableFacetUsingParser(value, mockFacetHolder);
- }
-
- protected ValueSemanticsProviderAndFacetAbstract<?> getValue() {
- return valueSemanticsProvider;
- }
-
- protected EncodableFacet getEncodeableFacet() {
- return encodeableFacet;
- }
-
- protected ParseableFacet getParseableFacet() {
- return parseableFacet;
- }
-
- protected ManagedObject createAdapter(final Object object) {
- return mockAdapter;
- }
-
- @Test
- public void testParseNull() throws Exception {
- Assume.assumeThat(valueSemanticsProvider.getParser(), is(not(nullValue())));
- try {
- valueSemanticsProvider.parseTextEntry(null, null);
- fail();
- } catch (final IllegalArgumentException expected) {
- }
- }
-
- @Test
- public void testParseEmptyString() throws Exception {
- Assume.assumeThat(valueSemanticsProvider.getParser(), is(not(nullValue())));
-
- final Object newValue = valueSemanticsProvider.parseTextEntry(null, "");
- assertNull(newValue);
- }
-
- @Test
- public void testDecodeNULL() throws Exception {
- Assume.assumeThat(valueSemanticsProvider.getEncoderDecoder(), is(not(nullValue())));
-
- final Object newValue = encodeableFacet.fromEncodedString(EncodableFacetUsingEncoderDecoder.ENCODED_NULL);
- assertNull(newValue);
- }
-
- @Test
- public void testEmptyEncoding() {
- Assume.assumeThat(valueSemanticsProvider.getEncoderDecoder(), is(not(nullValue())));
-
- assertEquals(EncodableFacetUsingEncoderDecoder.ENCODED_NULL, encodeableFacet.toEncodedString(null));
- }
-
- @Test
- public void testTitleOfForNullObject() {
- assertEquals("", valueSemanticsProvider.displayTitleOf(null));
- }
-}
diff --git a/legacy/extensions/core/runtime/.gitignore b/legacy/extensions/core/runtime/.gitignore
deleted file mode 100644
index a48e45b..0000000
--- a/legacy/extensions/core/runtime/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/target-ide
diff --git a/legacy/extensions/core/runtime/pom.xml b/legacy/extensions/core/runtime/pom.xml
deleted file mode 100644
index 373adcc..0000000
--- a/legacy/extensions/core/runtime/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.isis.legacy</groupId>
- <artifactId>isis-legacy</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../../pom.xml</relativePath>
- </parent>
-
- <artifactId>isis-legacy-runtime</artifactId>
- <name>Apache Isis Legacy - Runtime</name>
- <description>
- To ease migration from Apache Isis versions 1.16+ to 2.0.0.
- </description>
-
- <properties>
- <jar-plugin.automaticModuleName>org.apache.isis.legacy.runtime</jar-plugin.automaticModuleName>
- <git-plugin.propertiesDir>org/apache/isis/legacy/runtime</git-plugin.propertiesDir>
- </properties>
-
- <dependencies>
-
- <!-- JDO API (non transient, provided by plugin) -->
- <dependency>
- <!-- v3.2 not available yet, use datanucleus staging for now -->
- <!-- <groupId>javax.jdo</groupId> -->
- <!-- <artifactId>jdo-api</artifactId> -->
- <groupId>org.datanucleus</groupId>
- <artifactId>javax.jdo</artifactId>
- <!-- provided by plugins -->
- <scope>provided</scope>
- </dependency>
-
- <!-- LEGACY DEPENDENCY -->
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
-
- <!-- CORE -->
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-applib</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.legacy</groupId>
- <artifactId>isis-legacy-applib</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.persistence</groupId>
- <artifactId>isis-persistence-jdo-applib</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.persistence</groupId>
- <artifactId>isis-persistence-jdo-datanucleus</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-ui</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-runtime</artifactId>
- <scope>compile</scope>
- </dependency>
-
-
- <!-- TEST DEPENDENCY -->
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-internaltestsupport</artifactId>
- <scope>test</scope>
- <exclusions>
- <!-- whatever unittestsupport is dependent on, it should not be transitive -->
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/legacy/extensions/core/runtime/src/main/adoc/antora.yml b/legacy/extensions/core/runtime/src/main/adoc/antora.yml
deleted file mode 100644
index 3938f85..0000000
--- a/legacy/extensions/core/runtime/src/main/adoc/antora.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name: legacy
-version: latest
diff --git a/legacy/extensions/core/runtime/src/main/adoc/modules/runtime/nav.adoc b/legacy/extensions/core/runtime/src/main/adoc/modules/runtime/nav.adoc
deleted file mode 100644
index 6485415..0000000
--- a/legacy/extensions/core/runtime/src/main/adoc/modules/runtime/nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-include::legacy:ROOT:partial$component-nav.adoc[]
diff --git a/legacy/extensions/core/runtime/src/main/adoc/modules/runtime/pages/about.adoc b/legacy/extensions/core/runtime/src/main/adoc/modules/runtime/pages/about.adoc
deleted file mode 100644
index cd1987a..0000000
--- a/legacy/extensions/core/runtime/src/main/adoc/modules/runtime/pages/about.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= Runtime
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-WARNING: TODO
diff --git a/legacy/extensions/core/runtime/src/main/adoc/modules/runtime/partials/module-nav.adoc b/legacy/extensions/core/runtime/src/main/adoc/modules/runtime/partials/module-nav.adoc
deleted file mode 100644
index 7b27889..0000000
--- a/legacy/extensions/core/runtime/src/main/adoc/modules/runtime/partials/module-nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-* xref:legacy:runtime:about.adoc[Runtime]
-
-
-
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/jdo/datanucleus5/datanucleus/valuetypes/IsisMoneyMapping.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/jdo/datanucleus5/datanucleus/valuetypes/IsisMoneyMapping.java
deleted file mode 100644
index 09284c8..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/jdo/datanucleus5/datanucleus/valuetypes/IsisMoneyMapping.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.legacy.runtime.jdo.datanucleus5.datanucleus.valuetypes;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-
-import org.datanucleus.ClassLoaderResolver;
-import org.datanucleus.ClassNameConstants;
-import org.datanucleus.ExecutionContext;
-import org.datanucleus.NucleusContext;
-import org.datanucleus.metadata.AbstractMemberMetaData;
-import org.datanucleus.store.rdbms.RDBMSStoreManager;
-import org.datanucleus.store.rdbms.mapping.MappingManager;
-import org.datanucleus.store.rdbms.mapping.java.SingleFieldMultiMapping;
-import org.datanucleus.store.rdbms.table.Column;
-import org.datanucleus.store.rdbms.table.Table;
-
-import org.apache.isis.legacy.applib.value.Money;
-
-public class IsisMoneyMapping extends SingleFieldMultiMapping {
-
- public IsisMoneyMapping() {
-
- }
-
- @Override
- public Class<?> getJavaType() {
-
- return Money.class;
- }
-
- @Override
- public void initialize(final AbstractMemberMetaData mmd, final Table container, final ClassLoaderResolver clr) {
-
- super.initialize(mmd, container, clr);
- addColumns();
- }
-
- @Override
- public void initialize(final RDBMSStoreManager storeMgr, final String type) {
-
- super.initialize(storeMgr, type);
-
- addColumns();
- }
-
- private void addColumns() {
-
- // amount
- addColumns(ClassNameConstants.JAVA_LANG_LONG);
-
- // currency
- addColumnWithLength(ClassNameConstants.JAVA_LANG_STRING, 3);
- }
-
- public void addColumnWithLength(final String typeName, final int columnLength) {
-
- final MappingManager mgr = getStoreManager().getMappingManager();
- Column column = null;
- if (table != null) {
- column = mgr.createColumn(this, typeName, getNumberOfColumnMappings());
- /* TODO metaData.setJdbcType("NCHAR") */
- column.setColumnMetaData(column.getColumnMetaData().setLength(columnLength));
- }
- mgr.createColumnMapping(this, column, typeName);
- }
-
- @Override
- public Object getValueForColumnMapping(final NucleusContext nucleusCtx, final int index, final Object value) {
-
- final Money m = ((Money) value);
- switch (index) {
- case 0:
- return m.longValue();
- case 1:
- return m.getCurrency();
- }
- throw new IndexOutOfBoundsException("Wrong index: " + index);
- }
-
- @Override
- public void setObject(final ExecutionContext ec, final PreparedStatement preparedStmt, final int[] exprIndex,
- final Object value) {
-
- if (value instanceof Money) {
- final Money m = ((Money) value);
- getColumnMapping(0).setLong(preparedStmt, exprIndex[0], m.longValue());
- getColumnMapping(1).setString(preparedStmt, exprIndex[1], m.getCurrency());
- } else {
- getColumnMapping(0).setLong(preparedStmt, exprIndex[0], 0l);
- getColumnMapping(1).setString(preparedStmt, exprIndex[1], null);
- }
- }
-
- @Override
- public Object getObject(final ExecutionContext ec, final ResultSet resultSet, final int[] exprIndex) {
-
- try {
- // Check for null entries
- if (getColumnMapping(0).getObject(resultSet, exprIndex[0]) == null
- || getColumnMapping(1).getObject(resultSet, exprIndex[1]) == null) {
- return null;
- }
- } catch (final Exception e) {
- // Do nothing
- }
-
- final long amount = getColumnMapping(0).getLong(resultSet, exprIndex[0]);
- final String currency = getColumnMapping(1).getString(resultSet, exprIndex[1]);
- if (currency == null) {
- return null;
- }
- return new Money(((Long) amount).doubleValue() / 100, currency);
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/snapshot/DomSerializer.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/snapshot/DomSerializer.java
deleted file mode 100644
index 20545b7..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/snapshot/DomSerializer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.snapshot;
-
-import java.io.OutputStream;
-import java.io.Writer;
-
-import org.w3c.dom.Element;
-
-public interface DomSerializer {
- public String serialize(final Element domElement);
-
- public void serializeTo(final Element domElement, final OutputStream os) throws Exception;
-
- public void serializeTo(final Element domElement, final Writer w) throws Exception;
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/snapshot/DomSerializerJaxp.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/snapshot/DomSerializerJaxp.java
deleted file mode 100644
index ab96494..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/snapshot/DomSerializerJaxp.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.snapshot;
-
-import java.io.CharArrayWriter;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.w3c.dom.Element;
-
-public class DomSerializerJaxp implements DomSerializer {
-
- private final TransformerFactory transformerFactory;
- private final Transformer newTransformer;
-
- public DomSerializerJaxp() throws TransformerConfigurationException {
- this.transformerFactory = TransformerFactory.newInstance();
- this.newTransformer = transformerFactory.newTransformer();
- }
-
- @Override
- public String serialize(final Element domElement) {
- final CharArrayWriter caw = new CharArrayWriter();
- try {
- serializeTo(domElement, caw);
- return caw.toString();
- } catch (final Exception e) {
- return null;
- }
- }
-
- @Override
- public void serializeTo(final Element domElement, final OutputStream os) throws Exception {
- final OutputStreamWriter osw = new OutputStreamWriter(os);
- serializeTo(domElement, osw);
- }
-
- @Override
- public void serializeTo(final Element domElement, final Writer writer) throws Exception {
- final Source source = new DOMSource(domElement);
- final Result result = new StreamResult(writer);
- newTransformer.transform(source, result);
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/sysout/SystemPrinter.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/sysout/SystemPrinter.java
deleted file mode 100644
index fe2d0e2..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/sysout/SystemPrinter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.sysout;
-
-import java.io.PrintStream;
-
-public class SystemPrinter {
-
- private final PrintStream output;
-
- public SystemPrinter() {
- this(System.out);
- }
-
- public SystemPrinter(final PrintStream output) {
- this.output = output;
- }
-
- protected PrintStream getOutput() {
- return output;
- }
-
- public void printErrorMessage(final String message) {
- output.println("Error: " + message);
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/system/persistence/LoggingLocation.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/system/persistence/LoggingLocation.java
deleted file mode 100644
index 487daa1..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/system/persistence/LoggingLocation.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.legacy.runtime.system.persistence;
-
-public enum LoggingLocation {
- ENTRY(">>"), EXIT("<<");
- final String prefix;
- private LoggingLocation(String prefix) {
- this.prefix = prefix;
- }
-}
\ No newline at end of file
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/system/persistence/ObjectFactory.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/system/persistence/ObjectFactory.java
deleted file mode 100644
index af0337f..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/system/persistence/ObjectFactory.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.system.persistence;
-
-import java.lang.reflect.Modifier;
-
-import org.apache.isis.applib.services.inject.ServiceInjector;
-import org.apache.isis.core.metamodel.spec.ObjectInstantiationException;
-
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-
-@RequiredArgsConstructor
-public class ObjectFactory {
-
- @NonNull private final ServiceInjector serviceInjector;
-
- public <T> T instantiate(final Class<T> cls) throws ObjectInstantiationException {
-
- if (serviceInjector == null) {
- throw new IllegalStateException("ServiceInjector is not available (no open session)");
- }
- if (Modifier.isAbstract(cls.getModifiers())) {
- throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
- }
- final T newInstance;
- if (Modifier.isAbstract(cls.getModifiers())) {
- throw new ObjectInstantiationException("Cannot create an instance of an abstract class: " + cls);
- }
- try {
- newInstance = cls.newInstance();
- } catch (final IllegalAccessException | InstantiationException e) {
- throw new ObjectInstantiationException(e);
- }
-
- serviceInjector.injectServicesInto(newInstance);
- return newInstance;
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/system/persistence/SuspendableListener.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/system/persistence/SuspendableListener.java
deleted file mode 100644
index 360796d..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/system/persistence/SuspendableListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.legacy.runtime.system.persistence;
-
-public interface SuspendableListener {
-
- boolean isSuspended();
-
- void setSuspended(boolean suspend);
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/AbstractServletOrFilterMapping.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/AbstractServletOrFilterMapping.java
deleted file mode 100644
index b9c1e8c..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/AbstractServletOrFilterMapping.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.web;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-public abstract class AbstractServletOrFilterMapping {
- private final Class<?> servletOrFilterClass;
- private final List<String> pathSpecs;
- private final Map<String, String> initParams;
-
- @SuppressWarnings("unchecked")
- public AbstractServletOrFilterMapping(final Class<?> servletOrFilterClass, final String... pathSpecs) {
- this(servletOrFilterClass, Collections.EMPTY_MAP, pathSpecs);
- }
-
- public AbstractServletOrFilterMapping(final Class<?> servletOrFilterClass, final Map<String, String> initParams, final String... pathSpecs) {
- this.servletOrFilterClass = servletOrFilterClass;
- this.initParams = initParams;
- this.pathSpecs = new ArrayList<String>(Arrays.asList(pathSpecs));
- }
-
- protected Class<?> getServletOrFilterClass() {
- return servletOrFilterClass;
- }
-
- public Map<String, String> getInitParams() {
- return Collections.unmodifiableMap(initParams);
- }
-
- public List<String> getPathSpecs() {
- return Collections.unmodifiableList(pathSpecs);
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/FilterSpecification.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/FilterSpecification.java
deleted file mode 100644
index 3840b3e..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/FilterSpecification.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.web;
-
-import java.util.Map;
-
-public final class FilterSpecification extends AbstractServletOrFilterMapping {
-
- /**
- * @param filterClass
- * - should extend <tt>javax.servlet.Filter</tt>
- */
- public FilterSpecification(final Class<?> filterClass, final Map<String, String> initParams, final String... mappings) {
- super(filterClass, initParams, mappings);
- }
-
- /**
- * @param filterClass
- * - should extend <tt>javax.servlet.Filter</tt>
- */
- public FilterSpecification(final Class<?> filterClass, final String... pathSpecs) {
- super(filterClass, pathSpecs);
- }
-
- public Class<?> getFilterClass() {
- return getServletOrFilterClass();
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/ServletSpecification.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/ServletSpecification.java
deleted file mode 100644
index 5ae55de..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/ServletSpecification.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.web;
-
-import java.util.Map;
-
-public final class ServletSpecification extends AbstractServletOrFilterMapping {
-
- /**
- * @param servletClass
- * - should extend <tt>javax.servlet.Servlet</tt>
- */
- public ServletSpecification(final Class<?> servletClass, final Map<String, String> initParams, final String... mappings) {
- super(servletClass, initParams, mappings);
- }
-
- /**
- * @param servletClass
- * - should extend <tt>javax.servlet.Servlet</tt>
- */
- public ServletSpecification(final Class<?> servletClass, final String... pathSpecs) {
- super(servletClass, pathSpecs);
- }
-
- public Class<?> getServletClass() {
- return getServletOrFilterClass();
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/WebAppSpecification.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/WebAppSpecification.java
deleted file mode 100644
index a841b73..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/web/WebAppSpecification.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.web;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.isis.core.metamodel.commons.MapUtil;
-
-/**
- * Defines what servlets, mappings etc are required from an embedded web server.
- */
-public final class WebAppSpecification {
-
- private Map<String, String> contextParams = new LinkedHashMap<String, String>();
- private final List<Class<?>> servletContextListeners = new ArrayList<Class<?>>();
- private final List<ServletSpecification> servletSpecifications = new ArrayList<ServletSpecification>();
- private final List<FilterSpecification> filterSpecifications = new ArrayList<FilterSpecification>();
- private final List<String> resourcePaths = new ArrayList<String>();
- private final List<String> welcomeFiles = new ArrayList<String>();
- private String logHint;
-
- // ///////////////////////////////////////////////////////////
- // Context Params
- // ///////////////////////////////////////////////////////////
-
- public void addContextParams(final String... contextParams) {
- this.contextParams = MapUtil.asMap(contextParams);
- }
-
- public Map<String, String> getContextParams() {
- return Collections.unmodifiableMap(contextParams);
- }
-
- // ///////////////////////////////////////////////////////////
- // Servlet Context Listeners
- // ///////////////////////////////////////////////////////////
-
- public void addServletContextListener(final Class<?> servletContextListenerClass) {
- servletContextListeners.add(servletContextListenerClass);
- }
-
- public List<Class<?>> getServletContextListeners() {
- return servletContextListeners;
- }
-
- // ///////////////////////////////////////////////////////////
- // Servlet Mappings
- // ///////////////////////////////////////////////////////////
-
- public void addServletSpecification(final Class<?> servletClass, final String... pathSpecs) {
- servletSpecifications.add(new ServletSpecification(servletClass, pathSpecs));
- }
-
- public void addServletSpecification(final Class<?> servletClass, final Map<String, String> initParams, final String... pathSpecs) {
- servletSpecifications.add(new ServletSpecification(servletClass, initParams, pathSpecs));
- }
-
- public List<ServletSpecification> getServletSpecifications() {
- return servletSpecifications;
- }
-
- // ///////////////////////////////////////////////////////////
- // Filter Mappings
- // ///////////////////////////////////////////////////////////
-
- public void addFilterSpecification(final Class<?> filterClass, final String... pathSpecs) {
- filterSpecifications.add(new FilterSpecification(filterClass, pathSpecs));
- }
-
- public void addFilterSpecification(final Class<?> filterClass, final Map<String, String> initParams, final String... pathSpecs) {
- filterSpecifications.add(new FilterSpecification(filterClass, initParams, pathSpecs));
- }
-
- public List<FilterSpecification> getFilterSpecifications() {
- return filterSpecifications;
- }
-
- // ///////////////////////////////////////////////////////////
- // Resources
- // ///////////////////////////////////////////////////////////
-
- public void addResourcePath(final String path) {
- resourcePaths.add(path);
- }
-
- public List<String> getResourcePaths() {
- return resourcePaths;
- }
-
- // ///////////////////////////////////////////////////////////
- // Welcome Files
- // ///////////////////////////////////////////////////////////
-
- public void addWelcomeFile(final String path) {
- welcomeFiles.add(path);
- }
-
- public List<String> getWelcomeFiles() {
- return welcomeFiles;
- }
-
- // ///////////////////////////////////////////////////////////
- // Candifloss
- // ///////////////////////////////////////////////////////////
-
- public String getLogHint() {
- return logHint;
- }
-
- public void setLogHint(final String logHint) {
- this.logHint = logHint;
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisColorPanel.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisColorPanel.java
deleted file mode 100644
index 646d94b..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisColorPanel.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.wicket.ui.components.scalars.isisapplib;
-
-import org.apache.isis.legacy.applib.value.Color;
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldParseableAbstract;
-
-/**
- * Panel for rendering scalars of type {@link Color} Isis' applib.Color.
- */
-public class IsisColorPanel extends ScalarPanelTextFieldParseableAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public IsisColorPanel(final String id, final ScalarModel scalarModel) {
- super(id, scalarModel);
- }
-
- @Override
- protected String getScalarPanelType() {
- return "isisColorPanel";
- }
-
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisColorPanelFactory.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisColorPanelFactory.java
deleted file mode 100644
index 1f4b422..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisColorPanelFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.wicket.ui.components.scalars.isisapplib;
-
-import org.apache.wicket.Component;
-
-import org.apache.isis.legacy.applib.value.Color;
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.components.scalars.ComponentFactoryScalarAbstract;
-
-/**
- * {@link ComponentFactory} for {@link IsisColorPanel}.
- */
-public class IsisColorPanelFactory extends ComponentFactoryScalarAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public IsisColorPanelFactory() {
- super(IsisColorPanel.class, Color.class);
- }
-
- @Override
- public Component createComponent(final String id, final ScalarModel scalarModel) {
- return new IsisColorPanel(id, scalarModel);
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisMoneyPanel.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisMoneyPanel.java
deleted file mode 100644
index 2b0dfa6..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisMoneyPanel.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.wicket.ui.components.scalars.isisapplib;
-
-import org.apache.isis.legacy.applib.value.Money;
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldParseableAbstract;
-
-/**
- * Panel for rendering scalars of type {@link Money} Isis' applib.Money.
- */
-public class IsisMoneyPanel extends ScalarPanelTextFieldParseableAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public IsisMoneyPanel(final String id, final ScalarModel scalarModel) {
- super(id, scalarModel);
- }
-
- @Override
- protected String getScalarPanelType() {
- return "isisMoneyPanel";
- }
-
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisMoneyPanelFactory.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisMoneyPanelFactory.java
deleted file mode 100644
index d76ce81..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisMoneyPanelFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.wicket.ui.components.scalars.isisapplib;
-
-import org.apache.wicket.Component;
-
-import org.apache.isis.legacy.applib.value.Money;
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.components.scalars.ComponentFactoryScalarAbstract;
-
-/**
- * {@link ComponentFactory} for {@link IsisMoneyPanel}.
- */
-public class IsisMoneyPanelFactory extends ComponentFactoryScalarAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public IsisMoneyPanelFactory() {
- super(IsisMoneyPanel.class, Money.class);
- }
-
- @Override
- public Component createComponent(final String id, final ScalarModel scalarModel) {
- return new IsisMoneyPanel(id, scalarModel);
- }
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisPercentagePanel.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisPercentagePanel.java
deleted file mode 100644
index 7f45b20..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisPercentagePanel.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.wicket.ui.components.scalars.isisapplib;
-
-import org.apache.isis.legacy.applib.value.Percentage;
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldParseableAbstract;
-
-/**
- * Panel for rendering scalars of type {@link Percentage} Isis'
- * applib.Percentage.
- */
-public class IsisPercentagePanel extends ScalarPanelTextFieldParseableAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public IsisPercentagePanel(final String id, final ScalarModel scalarModel) {
- super(id, scalarModel);
- }
-
- @Override
- protected String getScalarPanelType() {
- return "isisPercentagePanel";
- }
-
-
-}
diff --git a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisPercentagePanelFactory.java b/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisPercentagePanelFactory.java
deleted file mode 100644
index 7bbb0a8..0000000
--- a/legacy/extensions/core/runtime/src/main/java/org/apache/isis/legacy/runtime/viewer/wicket/ui/components/scalars/isisapplib/IsisPercentagePanelFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.legacy.runtime.viewer.wicket.ui.components.scalars.isisapplib;
-
-import org.apache.wicket.Component;
-
-import org.apache.isis.legacy.applib.value.Percentage;
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.components.scalars.ComponentFactoryScalarAbstract;
-
-/**
- * {@link ComponentFactory} for {@link IsisPercentagePanel}.
- */
-public class IsisPercentagePanelFactory extends ComponentFactoryScalarAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public IsisPercentagePanelFactory() {
- super(IsisPercentagePanel.class, Percentage.class);
- }
-
- @Override
- public Component createComponent(final String id, final ScalarModel scalarModel) {
- return new IsisPercentagePanel(id, scalarModel);
- }
-
-}
diff --git a/legacy/mappings/restclient/pom.xml b/legacy/mappings/restclient/pom.xml
deleted file mode 100644
index 9ad73fa..0000000
--- a/legacy/mappings/restclient/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.isis.legacy</groupId>
- <artifactId>isis-legacy</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>isis-legacy-restclient</artifactId>
- <name>Apache Isis Legacy - REST Client</name>
- <description>
- As defined in Isis v1.x RO Applib.
- </description>
-
- <properties>
- <jar-plugin.automaticModuleName>org.apache.isis.legacy.restclient</jar-plugin.automaticModuleName>
- <git-plugin.propertiesDir>org/apache/isis/legacy/restclient</git-plugin.propertiesDir>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-restfulobjects-applib</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.commons</groupId>
- <artifactId>isis-commons</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- TESTING -->
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-internaltestsupport</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/legacy/mappings/restclient/src/main/adoc/antora.yml b/legacy/mappings/restclient/src/main/adoc/antora.yml
deleted file mode 100644
index 3938f85..0000000
--- a/legacy/mappings/restclient/src/main/adoc/antora.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name: legacy
-version: latest
diff --git a/legacy/mappings/restclient/src/main/adoc/modules/restclient/nav.adoc b/legacy/mappings/restclient/src/main/adoc/modules/restclient/nav.adoc
deleted file mode 100644
index 6485415..0000000
--- a/legacy/mappings/restclient/src/main/adoc/modules/restclient/nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-include::legacy:ROOT:partial$component-nav.adoc[]
diff --git a/legacy/mappings/restclient/src/main/adoc/modules/restclient/pages/about.adoc b/legacy/mappings/restclient/src/main/adoc/modules/restclient/pages/about.adoc
deleted file mode 100644
index 66e103c..0000000
--- a/legacy/mappings/restclient/src/main/adoc/modules/restclient/pages/about.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= REST Client (Legacy)
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-WARNING: TODO
diff --git a/legacy/mappings/restclient/src/main/adoc/modules/restclient/partials/module-nav.adoc b/legacy/mappings/restclient/src/main/adoc/modules/restclient/partials/module-nav.adoc
deleted file mode 100644
index 3326290..0000000
--- a/legacy/mappings/restclient/src/main/adoc/modules/restclient/partials/module-nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-* xref:legacy:restclient:about.adoc[REST Client]
-
-
-
diff --git a/legacy/mappings/restclient/src/main/java/org/apache/isis/legacy/restclient/ClientRequestFactory.java b/legacy/mappings/restclient/src/main/java/org/apache/isis/legacy/restclient/ClientRequestFactory.java
deleted file mode 100644
index 669a0a3..0000000
--- a/legacy/mappings/restclient/src/main/java/org/apache/isis/legacy/restclient/ClientRequestFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.legacy.restclient;
-
-import java.net.URI;
-
-import org.apache.isis.legacy.restclient.lib.ClientExecutor;
-
-/**
- * Compatibility layer, legacy of deprecated resteasy client API.
- *
- */
-public interface ClientRequestFactory {
-
- <T> T createProxy(Class<T> clazz);
-
- URI getBase();
-
- static ClientRequestFactory of(final ClientExecutor clientExecutor, final URI baseUri) {
-
- return new ClientRequestFactory() {
-
- @Override
- public <T> T createProxy(Class<T> clazz) {
- return RestEasyLegacy.proxy(clientExecutor.webTarget(baseUri), clazz);
- }
-
- @Override
- public URI getBase() {
- return baseUri;
- }
-
- };
- }
-
-}
diff --git a/legacy/mappings/restclient/src/main/java/org/apache/isis/legacy/restclient/RepresentationWalker.java b/legacy/mappings/restclient/src/main/java/org/apache/isis/legacy/restclient/RepresentationWalker.java
deleted file mode 100644
index 9f39758..0000000
--- a/legacy/mappings/restclient/src/main/java/org/apache/isis/legacy/restclient/RepresentationWalker.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.legacy.restclient;
-
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status.Family;
-
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-
-import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
-import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
-import org.apache.isis.viewer.restfulobjects.applib.RestfulResponse;
-
-import lombok.AllArgsConstructor;
-
-public class RepresentationWalker {
-
- @AllArgsConstructor
- static class Step {
- private final String key;
- private final LinkRepresentation link;
- private final RestfulResponse<? extends JsonRepresentation> response;
- private String error;
- private final Exception exception;
-
- @Override
- public String toString() {
- return "Step [key=" + key + ", link=" + (link != null ? link.getHref() : "(null)")
- + ", error=" + error + "]";
- }
-
- }
-
- private final RestfulClient restfulClient;
- private final List<Step> steps = new LinkedList<>();
-
- public RepresentationWalker(final RestfulClient restfulClient, final Response response) {
- this.restfulClient = restfulClient;
- final RestfulResponse<JsonRepresentation> jsonResp = RestfulResponse.of(response);
-
- addStep(null, null, null, jsonResp, null, null);
- }
-
- private Step addStep(
- final String key,
- final LinkRepresentation link,
- final JsonRepresentation body,
- final RestfulResponse<JsonRepresentation> jsonResp,
- final String error,
- final Exception ex) {
-
- final Step step = new Step(key, link, jsonResp, error, ex);
- steps.add(0, step);
- if (error != null) {
- if (jsonResp.getStatus().getFamily() != Family.SUCCESSFUL) {
- step.error = "response status code: " + jsonResp.getStatus();
- }
- }
- return step;
- }
-
- public void walk(final String path) {
- walk(path, null);
- }
-
- public void walk(final String path, final JsonRepresentation invokeBody) {
- final Step previousStep = currentStep();
- if (previousStep.error != null) {
- return;
- }
-
- final RestfulResponse<? extends JsonRepresentation> jsonResponse = previousStep.response;
- JsonRepresentation entity;
- try {
- entity = jsonResponse.getEntity();
- } catch (final Exception e) {
- addStep(path, null, null, null, "exception: " + e.getMessage(), e);
- return;
- }
-
- LinkRepresentation link;
- try {
- link = entity.getLink(path);
- } catch (final Exception e) {
- addStep(path, null, null, null, "exception: " + e.getMessage(), e);
- return;
- }
- if (link == null) {
- addStep(path, null, null, null, "no such link '" + path + "'", null);
- return;
- }
-
- final RestfulResponse<JsonRepresentation> response;
- try {
- if (invokeBody != null) {
- response = restfulClient.follow(link, invokeBody);
- } else {
- response = restfulClient.follow(link);
- }
- } catch (final Exception e) {
- addStep(path, link, null, null, "failed to follow link: " + e.getMessage(), e);
- return;
- }
-
- addStep(path, link, null, response, null, null);
- }
-
- /**
- * The entity returned from the previous walk.
- *
- * <p>
- * Will return null if the previous walk returned an error.
- */
- public JsonRepresentation getEntity() throws JsonParseException, JsonMappingException, IOException {
- final Step currentStep = currentStep();
- if (currentStep.response == null || currentStep.error != null) {
- return null;
- }
- return currentStep.response.getEntity();
- }
-
- /**
... 1185 lines suppressed ...