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/03 14:01:06 UTC
[isis] 02/02: ISIS-1742: deletes @Resolve annotation and supporting
facets.
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
commit fb9c4d1c7427d1bafe31415e58edbf980066a299
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 3 15:00:50 2017 +0100
ISIS-1742: deletes @Resolve annotation and supporting facets.
---
.../org/apache/isis/applib/annotation/Resolve.java | 70 ---------
.../facets/members/render/RenderFacet.java | 4 -
.../render/annotprop/RenderFacetAnnotation.java | 36 -----
.../annotprop/RenderFacetOrResolveFactory.java | 23 +--
.../annotprop/RenderFacetViaResolveAnnotation.java | 36 -----
...ationFacetFactoryTest_withRenderAnnotation.java | 154 --------------------
...tionFacetFactoryTest_withResolveAnnotation.java | 160 ---------------------
7 files changed, 1 insertion(+), 482 deletions(-)
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Resolve.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Resolve.java
deleted file mode 100644
index 16959a0..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Resolve.java
+++ /dev/null
@@ -1,70 +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 CollectionLayout#render()} instead.
- */
-@Deprecated
-@Inherited
-@Target( ElementType.METHOD )
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Resolve {
-
- /**
- * @deprecated - use {@link RenderType} instead.
- */
- @Deprecated
- public enum Type {
- /**
- * @deprecated - use {@link RenderType#EAGERLY} instead.
- */
- @Deprecated
- EAGERLY(RenderType.EAGERLY),
- /**
- * @deprecated - use {@link RenderType#LAZILY} instead.
- */
- @Deprecated
- LAZILY(RenderType.LAZILY);
-
- private final org.apache.isis.applib.annotation.RenderType renderType;
-
- private Type(RenderType renderType) {
- this.renderType = renderType;
- }
-
- @Deprecated
- public org.apache.isis.applib.annotation.RenderType getRenderType() {
- return renderType;
- }
- }
-
- /**
- * @deprecated - use {@link CollectionLayout#render()} instead.
- */
- @Deprecated
- Type value() default Type.EAGERLY;
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/RenderFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/RenderFacet.java
index cf25f54..adcfb4c 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/RenderFacet.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/RenderFacet.java
@@ -20,15 +20,11 @@
package org.apache.isis.core.metamodel.facets.members.render;
import org.apache.isis.applib.annotation.RenderType;
-import org.apache.isis.applib.annotation.Resolve;
import org.apache.isis.core.metamodel.facets.SingleValueFacet;
/**
* Indicates that a class member should be rendered eagerly/lazily and so should
* be presented in the viewer in an appropriate manner.
- *
- * <p>
- * @see Resolve
*/
public interface RenderFacet extends SingleValueFacet<RenderType> {
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetAnnotation.java
deleted file mode 100644
index 9605808..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetAnnotation.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.core.metamodel.facets.members.render.annotprop;
-
-import org.apache.isis.applib.annotation.RenderType;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.render.RenderFacetAbstract;
-
-/**
- * @deprecated
- */
-@Deprecated
-public class RenderFacetAnnotation extends RenderFacetAbstract {
-
- public RenderFacetAnnotation(final FacetHolder holder, RenderType value) {
- super(value, holder);
- }
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetOrResolveFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetOrResolveFactory.java
index 41ea403..394c123 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetOrResolveFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetOrResolveFactory.java
@@ -21,24 +21,19 @@ package org.apache.isis.core.metamodel.facets.members.render.annotprop;
import java.util.Properties;
-import org.apache.isis.applib.annotation.Resolve;
import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facetapi.FacetUtil;
import org.apache.isis.core.metamodel.facetapi.FeatureType;
import org.apache.isis.core.metamodel.facetapi.MetaModelValidatorRefiner;
-import org.apache.isis.core.metamodel.facets.Annotations;
import org.apache.isis.core.metamodel.facets.ContributeeMemberFacetFactory;
import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
import org.apache.isis.core.metamodel.facets.members.render.RenderFacet;
-import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorForDeprecatedAnnotation;
public class RenderFacetOrResolveFactory extends FacetFactoryAbstract
implements ContributeeMemberFacetFactory, MetaModelValidatorRefiner {
- private final MetaModelValidatorForDeprecatedAnnotation resolveValidator = new MetaModelValidatorForDeprecatedAnnotation(Resolve.class);
public RenderFacetOrResolveFactory() {
super(FeatureType.MEMBERS);
@@ -48,9 +43,6 @@ public class RenderFacetOrResolveFactory extends FacetFactoryAbstract
public void process(final ProcessMethodContext processMethodContext) {
RenderFacet renderFacet = createFromMetadataPropertiesIfPossible(processMethodContext);
- if(renderFacet == null) {
- renderFacet = resolveValidator.flagIfPresent(createFromResolveAnnotationIfPossible(processMethodContext), processMethodContext);
- }
// no-op if null
FacetUtil.addFacet(renderFacet);
@@ -72,27 +64,14 @@ public class RenderFacetOrResolveFactory extends FacetFactoryAbstract
return properties != null ? new RenderFacetProperties(properties, holder) : null;
}
- // @Render was originally called @Resolve, so look for that annotation instead.
- @SuppressWarnings("deprecation")
- private static RenderFacet createFromResolveAnnotationIfPossible(final ProcessMethodContext processMethodContext) {
- final org.apache.isis.applib.annotation.Resolve resolveAnnotation =
- Annotations.getAnnotation(processMethodContext.getMethod(), org.apache.isis.applib.annotation.Resolve.class);
- return resolveAnnotation == null ? null : new RenderFacetViaResolveAnnotation(processMethodContext.getFacetHolder(), resolveAnnotation.value());
- }
@Override
public void refineMetaModelValidator(final MetaModelValidatorComposite metaModelValidator, final IsisConfiguration configuration) {
- metaModelValidator.add(resolveValidator);
+
}
- @Override
- public void setServicesInjector(final ServicesInjector servicesInjector) {
- super.setServicesInjector(servicesInjector);
- IsisConfiguration configuration = servicesInjector.getConfigurationServiceInternal();
- resolveValidator.setConfiguration(configuration);
- }
}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetViaResolveAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetViaResolveAnnotation.java
deleted file mode 100644
index ea33f34..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/render/annotprop/RenderFacetViaResolveAnnotation.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.core.metamodel.facets.members.render.annotprop;
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.render.RenderFacetAbstract;
-
-/**
- * @deprecated
- */
-@Deprecated
-public class RenderFacetViaResolveAnnotation extends RenderFacetAbstract {
-
- @SuppressWarnings("deprecation")
- public RenderFacetViaResolveAnnotation(final FacetHolder holder, org.apache.isis.applib.annotation.Resolve.Type value) {
- super(value.getRenderType(), holder);
- }
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/members/resolve/RenderOrResolveAnnotationFacetFactoryTest_withRenderAnnotation.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/members/resolve/RenderOrResolveAnnotationFacetFactoryTest_withRenderAnnotation.java
deleted file mode 100644
index 7901e83..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/members/resolve/RenderOrResolveAnnotationFacetFactoryTest_withRenderAnnotation.java
+++ /dev/null
@@ -1,154 +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.members.resolve;
-
-import java.util.Collection;
-
-import org.apache.isis.applib.annotation.RenderType;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
-import org.apache.isis.core.metamodel.facets.FacetedMethod;
-import org.apache.isis.core.metamodel.facets.members.render.RenderFacet;
-import org.apache.isis.core.metamodel.facets.members.render.annotprop.RenderFacetAnnotation;
-import org.apache.isis.core.metamodel.facets.members.render.annotprop.RenderFacetOrResolveFactory;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class RenderOrResolveAnnotationFacetFactoryTest_withRenderAnnotation extends AbstractFacetFactoryTest {
-
- private RenderFacetOrResolveFactory facetFactory;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- facetFactory = new RenderFacetOrResolveFactory();
- }
-
- @Override
- protected void tearDown() throws Exception {
- facetFactory = null;
- super.tearDown();
- }
-
- public void testAnnotationWithNoHintPickedUpOnProperty() {
-
- class Customer {
- @SuppressWarnings("unused")
- public int getNumberOfOrders() {
- return 0;
- }
- }
-
- facetedMethod = FacetedMethod.createForProperty(Customer.class, "numberOfOrders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final Facet facet = facetedMethod.getFacet(RenderFacet.class);
- assertNotNull(facet);
- assertTrue(facet instanceof RenderFacetAnnotation);
- RenderFacet resolveFacet = (RenderFacet) facet;
- assertThat(resolveFacet.value(), is(RenderType.EAGERLY));
-
- assertNoMethodsRemoved();
- }
-
- public void testAnnotationWithEagerlyHintPickedUpOnProperty() {
-
- class Customer {
- @SuppressWarnings("unused")
- public int getNumberOfOrders() {
- return 0;
- }
- }
-
- facetedMethod = FacetedMethod.createForProperty(Customer.class, "numberOfOrders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
- assertThat(facet.value(), is(RenderType.EAGERLY));
- }
-
- public void testAnnotationForLazilyPickedUpOnProperty() {
-
- class Customer {
- @SuppressWarnings("unused")
- public int getNumberOfOrders() {
- return 0;
- }
- }
-
- facetedMethod = FacetedMethod.createForProperty(Customer.class, "numberOfOrders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
- assertThat(facet.value(), is(RenderType.LAZILY));
- }
-
- public void testAnnotationNoHintPickedUpOnCollection() {
- class Customer {
- @SuppressWarnings("unused")
- public Collection<?> getOrders() {
- return null;
- }
- }
- facetedMethod = FacetedMethod.createForCollection(Customer.class, "orders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final Facet facet = facetedMethod.getFacet(RenderFacet.class);
- assertNotNull(facet);
- assertTrue(facet instanceof RenderFacetAnnotation);
- RenderFacet resolveFacet = (RenderFacet) facet;
- assertThat(resolveFacet.value(), is(RenderType.EAGERLY));
-
- assertNoMethodsRemoved();
- }
-
- public void testAnnotationEagerlyHintPickedUpOnCollection() {
- class Customer {
- @SuppressWarnings("unused")
- public Collection<?> getOrders() {
- return null;
- }
- }
- facetedMethod = FacetedMethod.createForCollection(Customer.class, "orders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
- assertThat(facet.value(), is(RenderType.EAGERLY));
- }
-
- public void testAnnotationWithLazilyHintPickedUpOnCollection() {
- class Customer {
- @SuppressWarnings("unused")
- public Collection<?> getOrders() {
- return null;
- }
- }
- facetedMethod = FacetedMethod.createForCollection(Customer.class, "orders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
- assertThat(facet.value(), is(RenderType.LAZILY));
- }
-
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/members/resolve/RenderOrResolveAnnotationFacetFactoryTest_withResolveAnnotation.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/members/resolve/RenderOrResolveAnnotationFacetFactoryTest_withResolveAnnotation.java
deleted file mode 100644
index ec71f5d..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/members/resolve/RenderOrResolveAnnotationFacetFactoryTest_withResolveAnnotation.java
+++ /dev/null
@@ -1,160 +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.members.resolve;
-
-import java.util.Collection;
-
-import org.apache.isis.applib.annotation.RenderType;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
-import org.apache.isis.core.metamodel.facets.FacetedMethod;
-import org.apache.isis.core.metamodel.facets.members.render.RenderFacet;
-import org.apache.isis.core.metamodel.facets.members.render.annotprop.RenderFacetOrResolveFactory;
-import org.apache.isis.core.metamodel.facets.members.render.annotprop.RenderFacetViaResolveAnnotation;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class RenderOrResolveAnnotationFacetFactoryTest_withResolveAnnotation extends AbstractFacetFactoryTest {
-
- private RenderFacetOrResolveFactory facetFactory;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- facetFactory = new RenderFacetOrResolveFactory();
- }
-
- @Override
- protected void tearDown() throws Exception {
- facetFactory = null;
- super.tearDown();
- }
-
- public void testAnnotationWithNoHintPickedUpOnProperty() {
-
- class Customer {
- @SuppressWarnings({ "deprecation", "unused" })
- @org.apache.isis.applib.annotation.Resolve
- public int getNumberOfOrders() {
- return 0;
- }
- }
-
- facetedMethod = FacetedMethod.createForProperty(Customer.class, "numberOfOrders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final Facet facet = facetedMethod.getFacet(RenderFacet.class);
- assertNotNull(facet);
- assertTrue(facet instanceof RenderFacetViaResolveAnnotation);
- RenderFacet resolveFacet = (RenderFacet) facet;
- assertThat(resolveFacet.value(), is(RenderType.EAGERLY));
-
- assertNoMethodsRemoved();
- }
-
- public void testAnnotationWithEagerlyHintPickedUpOnProperty() {
-
- class Customer {
- @SuppressWarnings({ "deprecation", "unused" })
- @org.apache.isis.applib.annotation.Resolve(org.apache.isis.applib.annotation.Resolve.Type.EAGERLY)
- public int getNumberOfOrders() {
- return 0;
- }
- }
-
- facetedMethod = FacetedMethod.createForProperty(Customer.class, "numberOfOrders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
- assertThat(facet.value(), is(RenderType.EAGERLY));
- }
-
- public void testAnnotationForLazilyPickedUpOnProperty() {
-
- class Customer {
- @SuppressWarnings({ "deprecation", "unused" })
- @org.apache.isis.applib.annotation.Resolve(org.apache.isis.applib.annotation.Resolve.Type.LAZILY)
- public int getNumberOfOrders() {
- return 0;
- }
- }
-
- facetedMethod = FacetedMethod.createForProperty(Customer.class, "numberOfOrders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
- assertThat(facet.value(), is(RenderType.LAZILY));
- }
-
- public void testAnnotationNoHintPickedUpOnCollection() {
- class Customer {
- @SuppressWarnings({ "deprecation", "unused" })
- @org.apache.isis.applib.annotation.Resolve
- public Collection<?> getOrders() {
- return null;
- }
- }
- facetedMethod = FacetedMethod.createForCollection(Customer.class, "orders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final Facet facet = facetedMethod.getFacet(RenderFacet.class);
- assertNotNull(facet);
- assertTrue(facet instanceof RenderFacetViaResolveAnnotation);
- RenderFacet resolveFacet = (RenderFacet) facet;
- assertThat(resolveFacet.value(), is(RenderType.EAGERLY));
-
- assertNoMethodsRemoved();
- }
-
- public void testAnnotationEagerlyHintPickedUpOnCollection() {
- class Customer {
- @SuppressWarnings({ "deprecation", "unused" })
- @org.apache.isis.applib.annotation.Resolve(org.apache.isis.applib.annotation.Resolve.Type.EAGERLY)
- public Collection<?> getOrders() {
- return null;
- }
- }
- facetedMethod = FacetedMethod.createForCollection(Customer.class, "orders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
- assertThat(facet.value(), is(RenderType.EAGERLY));
- }
-
- public void testAnnotationWithLazilyHintPickedUpOnCollection() {
- class Customer {
- @SuppressWarnings({ "deprecation", "unused" })
- @org.apache.isis.applib.annotation.Resolve(org.apache.isis.applib.annotation.Resolve.Type.LAZILY)
- public Collection<?> getOrders() {
- return null;
- }
- }
- facetedMethod = FacetedMethod.createForCollection(Customer.class, "orders");
- facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));
-
- final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
- assertThat(facet.value(), is(RenderType.LAZILY));
- }
-
-
-}
--
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.