You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/10/09 17:45:00 UTC
[isis] branch dev/2.0.0/ISIS-1742-remove-deprecations updated:
ISIS-1742: deletes @ObjectType annotation + facets, updates .adocs
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch dev/2.0.0/ISIS-1742-remove-deprecations
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1742-remove-deprecations by this push:
new 8f536ce ISIS-1742: deletes @ObjectType annotation + facets, updates .adocs
8f536ce is described below
commit 8f536ce9f21b24f26714004b5a0614e294a0a57b
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Oct 9 18:23:00 2017 +0100
ISIS-1742: deletes @ObjectType annotation + facets, updates .adocs
---
.../rgant/_rgant-DomainObject_objectType.adoc | 2 +-
.../guides/rgant/_rgant-ViewModel_objectType.adoc | 2 +-
.../guides/rgant/_rgant_aaa_deprecated.adoc | 6 ----
.../apache/isis/applib/annotation/ObjectType.java | 41 ----------------------
.../DomainObjectAnnotationFacetFactory.java | 19 ++--------
.../ObjectSpecIdFacetFromObjectTypeAnnotation.java | 41 ----------------------
.../core/metamodel/spec/ObjectSpecification.java | 1 -
.../ObjectTypeAnnotationFacetFactoryTest.java | 9 ++---
todo-deprecation-list.txt | 7 ++--
9 files changed, 14 insertions(+), 114 deletions(-)
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-DomainObject_objectType.adoc b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-DomainObject_objectType.adoc
index 0d0aff2..679d574 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-DomainObject_objectType.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-DomainObject_objectType.adoc
@@ -40,7 +40,7 @@ public class Order {
The rules of precedence are:
1. xref:../rgant/rgant.adoc#_rgant_Discriminator[`@Discriminator`]
-2. `@DomainObject#objectType`, or xref:../rgant/rgant.adoc#_rgant_aaa_deprecated[`@ObjectType`] (deprecated)
+2. `@DomainObject#objectType`
3. xref:../rgant/rgant.adoc#_rgant_PersistenceCapable[`@PersistenceCapable`], if at least the `schema` attribute is defined. +
+
If both `schema` and `table` are defined, then the value is "`schema.table`".
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-ViewModel_objectType.adoc b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-ViewModel_objectType.adoc
index baf9c56..341f70c 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-ViewModel_objectType.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant-ViewModel_objectType.adoc
@@ -40,7 +40,7 @@ public class Order {
The rules of precedence are:
1. xref:../rgant/rgant.adoc#_rgant_Discriminator[`@Discriminator`]
-2. `@DomainObject#objectType`, or xref:../rgant/rgant.adoc#_rgant_ViewModel_objectType[`@ViewModel#objectType()`], or xref:../rgant/rgant.adoc#_rgant_aaa_deprecated[`@ObjectType`] (deprecated)
+2. `@DomainObject#objectType`, or xref:../rgant/rgant.adoc#_rgant_ViewModel_objectType[`@ViewModel#objectType()`]
3. xref:../rgant/rgant.adoc#_rgant_PersistenceCapable[`@PersistenceCapable`], if at least the `schema` attribute is defined. +
+
If both `schema` and `table` are defined, then the value is "`schema.table`".
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc
index 09a9ae6..42e1944 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc
@@ -22,12 +22,6 @@ The annotations listed in the table below are still supported by Apache Isis, bu
|Layer
|xref:../ugvw/ugvw.adoc#_ugvw_layout_file-based[File-based layout]?
-|`@ObjectType`
-|For constructing the external identifier (URI) of an entity instance (part of its URL in both Wicket viewer and Restful Objects viewer).
-Also part of the toString representation of bookmarks, if using the Bookmark Service
-|xref:../rgant/rgant.adoc#_rgant-DomainObject_objectType[`@DomainObject#objectType()`]
-|Domain
-|
|`@Optional`
|Specifies that a property or action parameter is not mandatory.
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/ObjectType.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/ObjectType.java
deleted file mode 100644
index 4bf9e6e..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/ObjectType.java
+++ /dev/null
@@ -1,41 +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.applib.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @deprecated - use {@link DomainObject#objectType()} instead.
- */
-@Deprecated
-@Inherited
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ObjectType {
- /**
- * @deprecated - use {@link DomainObject#objectType()} instead.
- */
- @Deprecated
- String value();
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
index b339e86..dc645e5 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
@@ -28,7 +28,6 @@ import com.google.common.collect.Maps;
import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.applib.annotation.Nature;
-import org.apache.isis.applib.annotation.ObjectType;
import org.apache.isis.applib.services.HasTransactionId;
import org.apache.isis.applib.services.eventbus.ObjectCreatedEvent;
import org.apache.isis.applib.services.eventbus.ObjectLoadedEvent;
@@ -63,7 +62,6 @@ import org.apache.isis.core.metamodel.facets.object.domainobject.choices.Choices
import org.apache.isis.core.metamodel.facets.object.domainobject.editing.ImmutableFacetForDomainObjectAnnotation;
import org.apache.isis.core.metamodel.facets.object.domainobject.objectspecid.ObjectSpecIdFacetForDomainObjectAnnotation;
import org.apache.isis.core.metamodel.facets.object.domainobject.objectspecid.ObjectSpecIdFacetForJdoPersistenceCapableAnnotation;
-import org.apache.isis.core.metamodel.facets.object.domainobject.objectspecid.ObjectSpecIdFacetFromObjectTypeAnnotation;
import org.apache.isis.core.metamodel.facets.object.domainobject.publishing.PublishedObjectFacetForDomainObjectAnnotation;
import org.apache.isis.core.metamodel.facets.object.domainobject.recreatable.RecreatableObjectFacetForDomainObjectAnnotation;
import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
@@ -77,7 +75,6 @@ import org.apache.isis.core.metamodel.services.persistsession.PersistenceSession
import org.apache.isis.core.metamodel.spec.ObjectSpecId;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorForDeprecatedAnnotation;
import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorForValidationFailures;
import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorVisiting;
import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
@@ -88,7 +85,6 @@ import org.apache.isis.objectstore.jdo.metamodel.facets.object.persistencecapabl
public class DomainObjectAnnotationFacetFactory extends FacetFactoryAbstract
implements MetaModelValidatorRefiner, PostConstructMethodCache {
- private final MetaModelValidatorForDeprecatedAnnotation objectTypeValidator = new MetaModelValidatorForDeprecatedAnnotation(ObjectType.class);
private final MetaModelValidatorForValidationFailures autoCompleteInvalid = new MetaModelValidatorForValidationFailures();
private final MetaModelValidatorForMixinTypes mixinTypeValidator = new MetaModelValidatorForMixinTypes("@DomainObject#nature=MIXIN");
@@ -261,15 +257,8 @@ public class DomainObjectAnnotationFacetFactory extends FacetFactoryAbstract
final DomainObject domainObject = Annotations.getAnnotation(cls, DomainObject.class);
final FacetHolder facetHolder = processClassContext.getFacetHolder();
- // check for the deprecated annotation first
- final ObjectType annotation = Annotations.getAnnotation(processClassContext.getCls(), ObjectType.class);
- Facet facet = objectTypeValidator.flagIfPresent(
- ObjectSpecIdFacetFromObjectTypeAnnotation.create(annotation, processClassContext.getFacetHolder()));
-
- // else check from @DomainObject(objectType=...)
- if(facet == null) {
- facet = ObjectSpecIdFacetForDomainObjectAnnotation.create(domainObject, facetHolder);
- }
+ // check from @DomainObject(objectType=...)
+ Facet facet = ObjectSpecIdFacetForDomainObjectAnnotation.create(domainObject, facetHolder);
// else check for @PersistenceCapable(schema=...)
if(facet == null) {
@@ -503,8 +492,6 @@ public class DomainObjectAnnotationFacetFactory extends FacetFactoryAbstract
}));
- metaModelValidator.add(objectTypeValidator);
-
metaModelValidator.add(autoCompleteInvalid);
metaModelValidator.add(mixinTypeValidator);
}
@@ -517,8 +504,6 @@ public class DomainObjectAnnotationFacetFactory extends FacetFactoryAbstract
super.setServicesInjector(servicesInjector);
IsisConfiguration configuration = getConfiguration();
- objectTypeValidator.setConfiguration(configuration);
-
this.persistenceSessionServiceInternal = servicesInjector.getPersistenceSessionServiceInternal();
}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/objectspecid/ObjectSpecIdFacetFromObjectTypeAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/objectspecid/ObjectSpecIdFacetFromObjectTypeAnnotation.java
deleted file mode 100644
index 5f5281b..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/objectspecid/ObjectSpecIdFacetFromObjectTypeAnnotation.java
+++ /dev/null
@@ -1,41 +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.core.metamodel.facets.object.domainobject.objectspecid;
-
-import org.apache.isis.applib.annotation.ObjectType;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.objectspecid.ObjectSpecIdFacet;
-import org.apache.isis.core.metamodel.facets.object.objectspecid.ObjectSpecIdFacetAbstract;
-
-/**
- * @deprecated
- */
-@Deprecated
-public class ObjectSpecIdFacetFromObjectTypeAnnotation extends ObjectSpecIdFacetAbstract {
-
- public static ObjectSpecIdFacet create(final ObjectType annotation, final FacetHolder holder) {
- return annotation != null ? new ObjectSpecIdFacetFromObjectTypeAnnotation(annotation.value(), holder) : null;
- }
-
- private ObjectSpecIdFacetFromObjectTypeAnnotation(final String value,
- final FacetHolder holder) {
- super(value, holder);
- }
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java
index f2dea29..dd405ea 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java
@@ -25,7 +25,6 @@ import java.util.List;
import com.google.common.base.Function;
-import org.apache.isis.applib.annotation.ObjectType;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.consent.Consent;
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/domainobject/ObjectTypeAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/domainobject/ObjectTypeAnnotationFacetFactoryTest.java
index d6b4721..44d0bd8 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/domainobject/ObjectTypeAnnotationFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/domainobject/ObjectTypeAnnotationFacetFactoryTest.java
@@ -21,10 +21,11 @@ package org.apache.isis.core.metamodel.facets.object.domainobject;
import org.junit.Before;
import org.junit.Test;
-import org.apache.isis.applib.annotation.ObjectType;
+
+import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryJUnit4TestCase;
import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
-import org.apache.isis.core.metamodel.facets.object.domainobject.objectspecid.ObjectSpecIdFacetFromObjectTypeAnnotation;
+import org.apache.isis.core.metamodel.facets.object.domainobject.objectspecid.ObjectSpecIdFacetForDomainObjectAnnotation;
import org.apache.isis.core.metamodel.facets.object.objectspecid.ObjectSpecIdFacet;
import org.apache.isis.core.metamodel.spec.ObjectSpecId;
@@ -45,7 +46,7 @@ public class ObjectTypeAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
@Test
public void objectTypeAnnotationPickedUpOnClass() {
- @ObjectType("CUS")
+ @DomainObject(objectType = "CUS")
class Customer {
}
@@ -56,7 +57,7 @@ public class ObjectTypeAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
final ObjectSpecIdFacet facet = facetHolder.getFacet(ObjectSpecIdFacet.class);
assertThat(facet, is(not(nullValue())));
- assertThat(facet instanceof ObjectSpecIdFacetFromObjectTypeAnnotation, is(true));
+ assertThat(facet instanceof ObjectSpecIdFacetForDomainObjectAnnotation, is(true));
assertThat(facet.value(), is(ObjectSpecId.of("CUS")));
}
diff --git a/todo-deprecation-list.txt b/todo-deprecation-list.txt
index 61b40b2..13cc3c0 100644
--- a/todo-deprecation-list.txt
+++ b/todo-deprecation-list.txt
@@ -17,7 +17,6 @@ org.apache.isis.applib.annotation
RegEx.java - entire annotation, use @Property(regexPatternFlags=...) or @Parameter(regexPatternFlags=...) instead; or alternatively NEW SUPPORT for JSR-303 @Pattern annotation (http://beanvalidation.org/1.0/spec/, chapter 6).
- ObjectType.java - entire annotation, use @DomainObject(objectType=...) or @javax.jdo.annotations.Discriminator instead.
Parameter.java
minLength() attribute; not supported. For autocomplete, use @MinLength annotation.
@@ -381,11 +380,15 @@ org.apache.isis.applib.annotation
NotPersisted.java - entire annotation, use @Property(notPersisted=...) instead
-
NotPersistable.java - entire annotation, not supported and does nothing
+
+ ObjectType.java - entire annotation, use @DomainObject(objectType=...) or @javax.jdo.annotations.Discriminator instead.
+
When.java - entire enum, no replacement (believe is unused within the framwork)
+
+
org.apache.isis.applib.marker - remove these marker interfaces (tend to use annotations in preference)
Auditable.java
--
To stop receiving notification emails like this one, please contact
['"commits@isis.apache.org" <co...@isis.apache.org>'].