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 2014/07/11 12:56:26 UTC
[14/61] [partial] ISIS-831: digression: moving progmodel/facets into
metamodel/facets
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetAbstract.java
deleted file mode 100644
index 4c5ce24..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetAbstract.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.core.progmodel.facets.members.order;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.MultipleValueFacetAbstract;
-import org.apache.isis.core.metamodel.facets.members.order.MemberOrderFacet;
-
-public abstract class MemberOrderFacetAbstract extends MultipleValueFacetAbstract implements MemberOrderFacet {
-
- public static Class<? extends Facet> type() {
- return MemberOrderFacet.class;
- }
-
- private final String name;
- private final String sequence;
-
- public MemberOrderFacetAbstract(final String name, final String sequence, final FacetHolder holder) {
- super(type(), holder);
- this.name = valueElse(name, "");
- this.sequence = valueElse(sequence, "1");
- }
-
- private static String valueElse(final String name, final String string) {
- return !Strings.isNullOrEmpty(name) ? name : string;
- }
-
- @Override
- public String name() {
- return name;
- }
-
- @Override
- public String sequence() {
- return sequence;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetAnnotation.java
deleted file mode 100644
index b34bf8b..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetAnnotation.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.core.progmodel.facets.members.order;
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-
-public class MemberOrderFacetAnnotation extends MemberOrderFacetAbstract {
-
- public MemberOrderFacetAnnotation(final String name, final String sequence, final FacetHolder holder) {
- super(name, sequence, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetFactory.java
deleted file mode 100644
index ef8ce40..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetFactory.java
+++ /dev/null
@@ -1,80 +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.progmodel.facets.members.order;
-
-import java.util.Properties;
-
-import org.apache.isis.applib.annotation.MemberOrder;
-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.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.order.MemberOrderFacet;
-
-public class MemberOrderFacetFactory extends FacetFactoryAbstract implements ContributeeMemberFacetFactory {
-
- public MemberOrderFacetFactory() {
- super(FeatureType.MEMBERS);
- }
-
- @Override
- public void process(final ProcessMethodContext processMethodContext) {
-
- MemberOrderFacet memberOrderFacet = createFromMetadataPropertiesIfPossible(processMethodContext);
- if(memberOrderFacet == null) {
- memberOrderFacet = createFromAnnotationIfPossible(processMethodContext);
- }
-
- // no-op if facet is null
- FacetUtil.addFacet(memberOrderFacet);
- }
-
- @Override
- public void process(final ProcessContributeeMemberContext processMemberContext) {
- final MemberOrderFacet memberOrderFacet = createFromMetadataPropertiesIfPossible(processMemberContext);
-
- // no-op if facet is null
- FacetUtil.addFacet(memberOrderFacet);
- }
-
- private static MemberOrderFacet createFromMetadataPropertiesIfPossible(
- final ProcessContextWithMetadataProperties<? extends FacetHolder> pcwmp) {
-
- final FacetHolder holder = pcwmp.getFacetHolder();
-
- final MemberOrderFacet memberOrderFacet;
- final Properties properties = pcwmp.metadataProperties("memberOrder");
- if(properties != null) {
- memberOrderFacet = new MemberOrderFacetProperties(properties, holder);
- } else {
- memberOrderFacet = null;
- }
- return memberOrderFacet;
- }
-
- private static MemberOrderFacet createFromAnnotationIfPossible(final ProcessMethodContext processMethodContext) {
- final MemberOrder annotation = Annotations.getAnnotation(processMethodContext.getMethod(), MemberOrder.class);
- return annotation != null ? new MemberOrderFacetAnnotation(annotation.name(), annotation.sequence(), processMethodContext.getFacetHolder()) : null;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetProperties.java
deleted file mode 100644
index b525971..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderFacetProperties.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.core.progmodel.facets.members.order;
-
-import java.util.Properties;
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-
-public class MemberOrderFacetProperties extends MemberOrderFacetAbstract {
-
- public MemberOrderFacetProperties(Properties properties, FacetHolder holder) {
- this(name(properties), sequence(properties), holder);
- }
-
- private static String sequence(Properties properties) {
- return properties.getProperty("sequence");
- }
-
- private static String name(Properties properties) {
- return properties.getProperty("name");
- }
-
- private MemberOrderFacetProperties(final String name, final String sequence, final FacetHolder holder) {
- super(name, sequence, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetAnnotation.java
deleted file mode 100644
index 4738dd0..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetAnnotation.java
+++ /dev/null
@@ -1,32 +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.progmodel.facets.members.resolve;
-
-import org.apache.isis.applib.annotation.Render;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.resolve.RenderFacetAbstract;
-
-public class RenderFacetAnnotation extends RenderFacetAbstract {
-
- public RenderFacetAnnotation(final FacetHolder holder, Render.Type value) {
- super(value, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetProperties.java
deleted file mode 100644
index f0bbeae..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetProperties.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.progmodel.facets.members.resolve;
-
-import java.util.Properties;
-
-import org.apache.isis.applib.annotation.Render;
-import org.apache.isis.applib.annotation.Render.Type;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.resolve.RenderFacetAbstract;
-
-public class RenderFacetProperties extends RenderFacetAbstract {
-
- public RenderFacetProperties(final Properties properties, FacetHolder holder) {
- super(renderTypeFrom(properties), holder);
- }
-
- private static Type renderTypeFrom(Properties properties) {
- String value = properties.getProperty("value");
- // same default as in Render.Type.value()
- return value != null? Render.Type.valueOf(value): Render.Type.EAGERLY;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetViaResolveAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetViaResolveAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetViaResolveAnnotation.java
deleted file mode 100644
index a8f5072..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderFacetViaResolveAnnotation.java
+++ /dev/null
@@ -1,32 +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.progmodel.facets.members.resolve;
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.resolve.RenderFacetAbstract;
-
-public class RenderFacetViaResolveAnnotation extends RenderFacetAbstract {
-
- @SuppressWarnings("deprecation")
- public RenderFacetViaResolveAnnotation(final FacetHolder holder, org.apache.isis.applib.annotation.Resolve.Type value) {
- super(value.getRenderType(), holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderOrResolveFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderOrResolveFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderOrResolveFacetFactory.java
deleted file mode 100644
index ffbea4b..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/resolve/RenderOrResolveFacetFactory.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.core.progmodel.facets.members.resolve;
-
-import java.util.Properties;
-
-import org.apache.isis.applib.annotation.Render;
-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.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.resolve.RenderFacet;
-
-public class RenderOrResolveFacetFactory extends FacetFactoryAbstract
- implements ContributeeMemberFacetFactory {
-
- public RenderOrResolveFacetFactory() {
- super(FeatureType.MEMBERS);
- }
-
- @Override
- public void process(final ProcessMethodContext processMethodContext) {
-
- RenderFacet renderFacet = createFromMetadataPropertiesIfPossible(processMethodContext);
- if(renderFacet == null) {
- renderFacet = createFromRenderAnnotationIfPossible(processMethodContext);
- }
- if(renderFacet == null) {
- renderFacet = createFromResolveAnnotationIfPossible(processMethodContext);
- }
-
- // no-op if null
- FacetUtil.addFacet(renderFacet);
- }
-
- @Override
- public void process(ProcessContributeeMemberContext processMemberContext) {
- RenderFacet renderFacet = createFromMetadataPropertiesIfPossible(processMemberContext);
- // no-op if null
- FacetUtil.addFacet(renderFacet);
- }
-
- private static RenderFacet createFromMetadataPropertiesIfPossible(
- final ProcessContextWithMetadataProperties<? extends FacetHolder> pcwmp) {
-
- final FacetHolder holder = pcwmp.getFacetHolder();
-
- final Properties properties = pcwmp.metadataProperties("render");
- return properties != null ? new RenderFacetProperties(properties, holder) : null;
- }
-
- private static RenderFacet createFromRenderAnnotationIfPossible(final ProcessMethodContext processMethodContext) {
- final Render renderAnnotation = Annotations.getAnnotation(processMethodContext.getMethod(), Render.class);
- return renderAnnotation == null ? null : new RenderFacetAnnotation(processMethodContext.getFacetHolder(), renderAnnotation.value());
- }
-
- // @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());
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/aggregated/annotation/AggregatedAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/aggregated/annotation/AggregatedAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/aggregated/annotation/AggregatedAnnotationFacetFactory.java
deleted file mode 100644
index 5cada0c..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/aggregated/annotation/AggregatedAnnotationFacetFactory.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.core.progmodel.facets.object.aggregated.annotation;
-
-import org.apache.isis.applib.annotation.Aggregated;
-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.facets.Annotations;
-import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.object.aggregated.ParentedFacet;
-
-public class AggregatedAnnotationFacetFactory extends FacetFactoryAbstract {
-
- public AggregatedAnnotationFacetFactory() {
- super(FeatureType.OBJECTS_ONLY);
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Aggregated annotation = Annotations.getAnnotation(processClassContext.getCls(), Aggregated.class);
- FacetUtil.addFacet(create(annotation, processClassContext.getFacetHolder()));
- }
-
- private ParentedFacet create(final Aggregated annotation, final FacetHolder holder) {
- return annotation == null ? null : new ParentedFacetSinceAggregatedAnnotation(holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/aggregated/annotation/ParentedFacetSinceAggregatedAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/aggregated/annotation/ParentedFacetSinceAggregatedAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/aggregated/annotation/ParentedFacetSinceAggregatedAnnotation.java
deleted file mode 100644
index 696c9d6..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/aggregated/annotation/ParentedFacetSinceAggregatedAnnotation.java
+++ /dev/null
@@ -1,31 +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.progmodel.facets.object.aggregated.annotation;
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.aggregated.ParentedFacetAbstract;
-
-public class ParentedFacetSinceAggregatedAnnotation extends ParentedFacetAbstract {
-
- public ParentedFacetSinceAggregatedAnnotation(final FacetHolder holder) {
- super(holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/autocomplete/annotation/AutoCompleteAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/autocomplete/annotation/AutoCompleteAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/autocomplete/annotation/AutoCompleteAnnotationFacetFactory.java
deleted file mode 100644
index 00a8412..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/autocomplete/annotation/AutoCompleteAnnotationFacetFactory.java
+++ /dev/null
@@ -1,69 +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.progmodel.facets.object.autocomplete.annotation;
-
-import org.apache.isis.applib.annotation.AutoComplete;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManagerAware;
-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.facets.Annotations;
-import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.object.autocomplete.AutoCompleteFacet;
-import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
-import org.apache.isis.core.metamodel.runtimecontext.ServicesInjectorAware;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderAware;
-
-public class AutoCompleteAnnotationFacetFactory extends FacetFactoryAbstract implements AdapterManagerAware, ServicesInjectorAware, SpecificationLoaderAware {
-
- private AdapterManager adapterManager;
- private ServicesInjector servicesInjector;
-
- public AutoCompleteAnnotationFacetFactory() {
- super(FeatureType.OBJECTS_POST_PROCESSING_ONLY);
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final AutoComplete annotation = Annotations.getAnnotation(processClassContext.getCls(), AutoComplete.class);
- FacetUtil.addFacet(create(annotation, processClassContext.getFacetHolder()));
- }
-
- private AutoCompleteFacet create(final AutoComplete annotation, final FacetHolder holder) {
- if(annotation == null) { return null; }
-
- Class<?> repositoryClass = annotation.repository();
- String actionName = annotation.action();
-
- return new AutoCompleteFacetAnnotation(holder, repositoryClass, actionName, getSpecificationLoader(), adapterManager, servicesInjector);
- }
-
- @Override
- public void setAdapterManager(AdapterManager adapterManager) {
- this.adapterManager = adapterManager;
- }
-
- @Override
- public void setServicesInjector(ServicesInjector servicesInjector) {
- this.servicesInjector = servicesInjector;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/autocomplete/annotation/AutoCompleteFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/autocomplete/annotation/AutoCompleteFacetAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/autocomplete/annotation/AutoCompleteFacetAnnotation.java
deleted file mode 100644
index 712f9fb..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/autocomplete/annotation/AutoCompleteFacetAnnotation.java
+++ /dev/null
@@ -1,37 +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.progmodel.facets.object.autocomplete.annotation;
-
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.autocomplete.AutoCompleteFacetAbstract;
-import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
-
-public class AutoCompleteFacetAnnotation extends AutoCompleteFacetAbstract {
-
- public AutoCompleteFacetAnnotation(FacetHolder holder, Class<?> repositoryClass, String actionName, SpecificationLoader specificationLoader, AdapterManager adapterManager, ServicesInjector servicesInjector) {
- super(holder, repositoryClass, actionName, specificationLoader, adapterManager, servicesInjector);
- }
-
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bookmarkable/annotation/BookmarkableAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bookmarkable/annotation/BookmarkableAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bookmarkable/annotation/BookmarkableAnnotationFacetFactory.java
deleted file mode 100644
index 70ba660..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bookmarkable/annotation/BookmarkableAnnotationFacetFactory.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.core.progmodel.facets.object.bookmarkable.annotation;
-
-import java.lang.reflect.Method;
-import java.util.List;
-
-import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.Bookmarkable;
-import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManagerAware;
-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.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.actions.semantics.ActionSemanticsFacet;
-import org.apache.isis.core.metamodel.facets.object.bookmarkable.BookmarkPolicyFacet;
-import org.apache.isis.core.metamodel.facets.object.bookmarkable.BookmarkPolicyFacetFallback;
-import org.apache.isis.core.metamodel.facets.object.bookmarkable.BookmarkPolicyFacetViaBookmarkableAnnotation;
-import org.apache.isis.core.metamodel.methodutils.MethodScope;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.Contributed;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorVisiting;
-import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
-import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
-import org.apache.isis.core.progmodel.facets.object.title.TitleMethodFacetFactory;
-
-public class BookmarkableAnnotationFacetFactory extends FacetFactoryAbstract implements MetaModelValidatorRefiner {
-
- public BookmarkableAnnotationFacetFactory() {
- super(FeatureType.OBJECTS_AND_ACTIONS);
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Bookmarkable annotation = Annotations.getAnnotation(processClassContext.getCls(), Bookmarkable.class);
- FacetUtil.addFacet(create(annotation, processClassContext.getFacetHolder()));
- }
-
- @Override
- public void process(final ProcessMethodContext processMethodContext) {
- final Bookmarkable annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Bookmarkable.class);
- FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
- }
-
- private BookmarkPolicyFacet create(final Bookmarkable annotation, final FacetHolder holder) {
- return annotation == null ? new BookmarkPolicyFacetFallback(holder) : new BookmarkPolicyFacetViaBookmarkableAnnotation(holder, annotation.value());
- }
-
-
- /**
- * Violation if there is an action that is bookmarkable but does not have safe action semantics.
- */
- @Override
- public void refineMetaModelValidator(MetaModelValidatorComposite metaModelValidator, IsisConfiguration configuration) {
- metaModelValidator.add(new MetaModelValidatorVisiting(new MetaModelValidatorVisiting.Visitor() {
-
- @Override
- public boolean visit(ObjectSpecification objectSpec, ValidationFailures validationFailures) {
- final Class<?> cls = objectSpec.getCorrespondingClass();
-
- final List<ObjectAction> objectActions = objectSpec.getObjectActions(Contributed.EXCLUDED);
- for (final ObjectAction objectAction : objectActions) {
- final BookmarkPolicyFacet bookmarkFacet = objectAction.getFacet(BookmarkPolicyFacet.class);
- if(bookmarkFacet == null || bookmarkFacet.isNoop() || bookmarkFacet.value() == BookmarkPolicy.NEVER) {
- continue;
- }
- final ActionSemanticsFacet semanticsFacet = objectAction.getFacet(ActionSemanticsFacet.class);
- if(semanticsFacet == null || semanticsFacet.isNoop() || semanticsFacet.value() != Of.SAFE) {
- validationFailures.add(
- "Action %s is bookmarkable but action semantics are not explicitly indicated as being safe. Either add @ActionSemantics(Of.Safe), or remove @Bookmarkable.",
- objectAction.getIdentifier().toClassAndNameIdentityString());
- }
- }
- return true;
- }
- }));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/ChoicesFacetFromBoundedAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/ChoicesFacetFromBoundedAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/ChoicesFacetFromBoundedAbstract.java
deleted file mode 100644
index 6f618e5..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/ChoicesFacetFromBoundedAbstract.java
+++ /dev/null
@@ -1,124 +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.progmodel.facets.object.bounded;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-import org.apache.isis.applib.events.UsabilityEvent;
-import org.apache.isis.applib.events.ValidityEvent;
-import org.apache.isis.applib.marker.Bounded;
-import org.apache.isis.applib.query.Query;
-import org.apache.isis.applib.query.QueryFindAllInstances;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.QuerySubmitter;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.choices.ChoicesFacet;
-import org.apache.isis.core.metamodel.interactions.DisablingInteractionAdvisor;
-import org.apache.isis.core.metamodel.interactions.ObjectValidityContext;
-import org.apache.isis.core.metamodel.interactions.UsabilityContext;
-import org.apache.isis.core.metamodel.interactions.ValidatingInteractionAdvisor;
-import org.apache.isis.core.metamodel.interactions.ValidityContext;
-import org.apache.isis.core.metamodel.spec.ObjectAdapterUtils;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-
-/**
- * A fixed number of choices because the number of instances of this class is bounded.
- *
- * <p>
- * Typically viewers will interpret this information by displaying all instances
- * of the class in a drop-down list box or similar widget.
- *
- * <p>
- * In the standard Apache Isis Programming Model, corresponds to annotating the
- * member with {@link org.apache.isis.applib.annotation.Bounded Bounded} annotation
- * or implementing the {@link Bounded} marker interface.
- */
-public abstract class ChoicesFacetFromBoundedAbstract extends FacetAbstract implements ChoicesFacet, DisablingInteractionAdvisor, ValidatingInteractionAdvisor {
-
- public static Class<? extends Facet> type() {
- return ChoicesFacet.class;
- }
-
- private final QuerySubmitter querySubmitter;
-
- public ChoicesFacetFromBoundedAbstract(final FacetHolder holder, final QuerySubmitter querySubmitter) {
- super(type(), holder, Derivation.NOT_DERIVED);
- this.querySubmitter = querySubmitter;
- }
-
- protected QuerySubmitter getQuerySubmitter() {
- return querySubmitter;
- }
-
- @Override
- public String invalidates(final ValidityContext<? extends ValidityEvent> context) {
- if (!(context instanceof ObjectValidityContext)) {
- return null;
- }
- final ObjectAdapter target = context.getTarget();
- if(target == null) {
- return null;
- }
-
- // ensure that the target is of the correct type
- if(!(getFacetHolder() instanceof ObjectSpecification)) {
- // should never be the case
- return null;
- }
-
- final ObjectSpecification objectSpec = getObjectSpecification();
- return objectSpec == target.getSpecification()? null: "Invalid type";
- }
-
- private ObjectSpecification getObjectSpecification() {
- return (ObjectSpecification) getFacetHolder();
- }
-
- @Override
- public String disables(final UsabilityContext<? extends UsabilityEvent> context) {
- final ObjectAdapter target = context.getTarget();
- return disabledReason(target);
- }
-
- /**
- * Optional hook method for subclasses to override.
- */
- public String disabledReason(final ObjectAdapter inObject) {
- return "Bounded";
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public Object[] getChoices(ObjectAdapter adapter) {
- final Query query = new QueryFindAllInstances(getObjectSpecification().getFullIdentifier());
- final List<ObjectAdapter> allInstancesAdapter = getQuerySubmitter().allMatchingQuery(query);
- final List<ObjectAdapter> adapters = Lists.newArrayList(allInstancesAdapter.iterator());
- final List<Object> pojos = Lists.transform(adapters, ObjectAdapter.Functions.getObject());
- return Lists.newArrayList(pojos).toArray();
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/annotation/BoundedAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/annotation/BoundedAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/annotation/BoundedAnnotationFacetFactory.java
deleted file mode 100644
index 239cc27..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/annotation/BoundedAnnotationFacetFactory.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.core.progmodel.facets.object.bounded.annotation;
-
-import org.apache.isis.applib.annotation.Bounded;
-import org.apache.isis.core.metamodel.adapter.QuerySubmitter;
-import org.apache.isis.core.metamodel.adapter.QuerySubmitterAware;
-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.facets.Annotations;
-import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.choices.ChoicesFacet;
-
-public class BoundedAnnotationFacetFactory extends FacetFactoryAbstract implements QuerySubmitterAware {
-
- private QuerySubmitter querySubmitter;
-
- public BoundedAnnotationFacetFactory() {
- super(FeatureType.OBJECTS_ONLY);
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Bounded annotation = Annotations.getAnnotation(processClassContext.getCls(), Bounded.class);
- FacetUtil.addFacet(create(annotation, processClassContext.getFacetHolder()));
- }
-
- private ChoicesFacet create(final Bounded annotation, final FacetHolder holder) {
- return annotation == null ? null : new ChoicesFacetFromBoundedAnnotation(holder, querySubmitter);
- }
-
- @Override
- public void setQuerySubmitter(final QuerySubmitter querySubmitter) {
- this.querySubmitter = querySubmitter;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/annotation/ChoicesFacetFromBoundedAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/annotation/ChoicesFacetFromBoundedAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/annotation/ChoicesFacetFromBoundedAnnotation.java
deleted file mode 100644
index 7d41be0..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/annotation/ChoicesFacetFromBoundedAnnotation.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.core.progmodel.facets.object.bounded.annotation;
-
-import org.apache.isis.core.metamodel.adapter.QuerySubmitter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.progmodel.facets.object.bounded.ChoicesFacetFromBoundedAbstract;
-
-public class ChoicesFacetFromBoundedAnnotation extends ChoicesFacetFromBoundedAbstract {
-
- public ChoicesFacetFromBoundedAnnotation(final FacetHolder holder, QuerySubmitter querySubmitter) {
- super(holder, querySubmitter);
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/markerifc/BoundedMarkerInterfaceFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/markerifc/BoundedMarkerInterfaceFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/markerifc/BoundedMarkerInterfaceFacetFactory.java
deleted file mode 100644
index f81c3cf..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/markerifc/BoundedMarkerInterfaceFacetFactory.java
+++ /dev/null
@@ -1,60 +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.progmodel.facets.object.bounded.markerifc;
-
-import java.lang.reflect.Method;
-
-import org.apache.isis.applib.marker.Bounded;
-import org.apache.isis.core.metamodel.adapter.QuerySubmitter;
-import org.apache.isis.core.metamodel.adapter.QuerySubmitterAware;
-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.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.choices.ChoicesFacet;
-
-public class BoundedMarkerInterfaceFacetFactory extends FacetFactoryAbstract implements QuerySubmitterAware {
-
- private QuerySubmitter querySubmitter;
-
- public BoundedMarkerInterfaceFacetFactory() {
- super(FeatureType.OBJECTS_ONLY);
- }
-
- @Override
- public void process(final ProcessClassContext processClassContaxt) {
- final boolean implementsMarker = Bounded.class.isAssignableFrom(processClassContaxt.getCls());
- FacetUtil.addFacet(create(implementsMarker, processClassContaxt.getFacetHolder()));
- }
-
- private ChoicesFacet create(final boolean implementsMarker, final FacetHolder holder) {
- return implementsMarker ? new ChoicesFacetFromBoundedFacetMarkerInterface(holder, querySubmitter) : null;
- }
-
- public boolean recognizes(final Method method) {
- return false;
- }
-
- @Override
- public void setQuerySubmitter(QuerySubmitter querySubmitter) {
- this.querySubmitter = querySubmitter;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/markerifc/ChoicesFacetFromBoundedFacetMarkerInterface.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/markerifc/ChoicesFacetFromBoundedFacetMarkerInterface.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/markerifc/ChoicesFacetFromBoundedFacetMarkerInterface.java
deleted file mode 100644
index ecde14c..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/bounded/markerifc/ChoicesFacetFromBoundedFacetMarkerInterface.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.core.progmodel.facets.object.bounded.markerifc;
-
-import org.apache.isis.core.metamodel.adapter.QuerySubmitter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.progmodel.facets.object.bounded.ChoicesFacetFromBoundedAbstract;
-
-public class ChoicesFacetFromBoundedFacetMarkerInterface extends ChoicesFacetFromBoundedAbstract {
-
- public ChoicesFacetFromBoundedFacetMarkerInterface(
- final FacetHolder holder, final QuerySubmitter querySubmitter) {
- super(holder, querySubmitter);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/CallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/CallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/CallbackFacetAbstract.java
deleted file mode 100644
index 0814b9f..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/CallbackFacetAbstract.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.core.progmodel.facets.object.callbacks;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackFacet;
-
-/**
- * Adapter superclass for {@link Facet}s for {@link CallbackFacet}.
- */
-public abstract class CallbackFacetAbstract extends FacetAbstract implements CallbackFacet {
-
- public CallbackFacetAbstract(final Class<? extends Facet> facetType, final FacetHolder holder) {
- super(facetType, holder, Derivation.NOT_DERIVED);
- }
-
- @Override
- public abstract void invoke(ObjectAdapter object);
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetAbstract.java
deleted file mode 100644
index 10374d8..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetAbstract.java
+++ /dev/null
@@ -1,37 +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.progmodel.facets.object.callbacks.create;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.callbacks.CreatedCallbackFacet;
-import org.apache.isis.core.progmodel.facets.object.callbacks.CallbackFacetAbstract;
-
-public abstract class CreatedCallbackFacetAbstract extends CallbackFacetAbstract implements CreatedCallbackFacet {
-
- public static Class<? extends Facet> type() {
- return CreatedCallbackFacet.class;
- }
-
- public CreatedCallbackFacetAbstract(final FacetHolder holder) {
- super(type(), holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetFactory.java
deleted file mode 100644
index 49a3a30..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetFactory.java
+++ /dev/null
@@ -1,62 +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.progmodel.facets.object.callbacks.create;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-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.methodutils.MethodScope;
-import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
-import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
-
-public class CreatedCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
- private static final String[] PREFIXES = { MethodPrefixConstants.CREATED_PREFIX, };
-
- public CreatedCallbackFacetFactory() {
- super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Class<?> cls = processClassContext.getCls();
- final FacetHolder holder = processClassContext.getFacetHolder();
-
- final List<Facet> facets = new ArrayList<Facet>();
- final List<Method> methods = new ArrayList<Method>();
-
- Method method = null;
- method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.CREATED_PREFIX, void.class, NO_PARAMETERS_TYPES);
- if (method != null) {
- methods.add(method);
- facets.add(new CreatedCallbackFacetViaMethod(method, holder));
- }
-
- processClassContext.removeMethods(methods);
- FacetUtil.addFacets(facets);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetViaMethod.java
deleted file mode 100644
index 01e9014..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/create/CreatedCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,77 +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.progmodel.facets.object.callbacks.create;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.util.AdapterInvokeUtils;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet.Intent;
-
-public class CreatedCallbackFacetViaMethod extends CreatedCallbackFacetAbstract implements ImperativeFacet {
-
- private final List<Method> methods = new ArrayList<Method>();
-
- public CreatedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
- super(holder);
- addMethod(method);
- }
-
- @Override
- public void addMethod(final Method method) {
- methods.add(method);
- }
-
- @Override
- public Intent getIntent(final Method method) {
- return Intent.LIFECYCLE;
- }
-
- @Override
- public List<Method> getMethods() {
- return Collections.unmodifiableList(methods);
- }
-
- @Override
- public boolean impliesResolve() {
- return false;
- }
-
- @Override
- public boolean impliesObjectChanged() {
- return false;
- }
-
- @Override
- public void invoke(final ObjectAdapter adapter) {
- AdapterInvokeUtils.invokeAll(methods, adapter);
- }
-
- @Override
- protected String toStringValues() {
- return "methods=" + methods;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadCallbackFacetFactory.java
deleted file mode 100644
index 7118d21..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadCallbackFacetFactory.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.core.progmodel.facets.object.callbacks.load;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-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.methodutils.MethodScope;
-import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
-import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
-
-public class LoadCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
- private static final String[] PREFIXES = { MethodPrefixConstants.LOADED_PREFIX, MethodPrefixConstants.LOADING_PREFIX, };
-
- public LoadCallbackFacetFactory() {
- super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Class<?> cls = processClassContext.getCls();
- final FacetHolder facetHolder = processClassContext.getFacetHolder();
-
- final List<Facet> facets = new ArrayList<Facet>();
- final List<Method> methods = new ArrayList<Method>();
-
- Method method = null;
- method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.LOADING_PREFIX, void.class, NO_PARAMETERS_TYPES);
- if (method != null) {
- methods.add(method);
- facets.add(new LoadingCallbackFacetViaMethod(method, facetHolder));
- }
-
- method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.LOADED_PREFIX, void.class, NO_PARAMETERS_TYPES);
- if (method != null) {
- methods.add(method);
- facets.add(new LoadedCallbackFacetViaMethod(method, facetHolder));
- }
-
- processClassContext.removeMethods(methods);
- FacetUtil.addFacets(facets);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadedCallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadedCallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadedCallbackFacetAbstract.java
deleted file mode 100644
index 1cfd5c2..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadedCallbackFacetAbstract.java
+++ /dev/null
@@ -1,37 +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.progmodel.facets.object.callbacks.load;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.callbacks.LoadedCallbackFacet;
-import org.apache.isis.core.progmodel.facets.object.callbacks.CallbackFacetAbstract;
-
-public abstract class LoadedCallbackFacetAbstract extends CallbackFacetAbstract implements LoadedCallbackFacet {
-
- public static Class<? extends Facet> type() {
- return LoadedCallbackFacet.class;
- }
-
- public LoadedCallbackFacetAbstract(final FacetHolder holder) {
- super(type(), holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadedCallbackFacetViaMethod.java
deleted file mode 100644
index 2c8cf86..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadedCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,76 +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.progmodel.facets.object.callbacks.load;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.util.AdapterInvokeUtils;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-public class LoadedCallbackFacetViaMethod extends LoadedCallbackFacetAbstract implements ImperativeFacet {
-
- private final List<Method> methods = new ArrayList<Method>();
-
- public LoadedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
- super(holder);
- addMethod(method);
- }
-
- @Override
- public void addMethod(final Method method) {
- methods.add(method);
- }
-
- @Override
- public List<Method> getMethods() {
- return Collections.unmodifiableList(methods);
- }
-
- @Override
- public Intent getIntent(final Method method) {
- return Intent.LIFECYCLE;
- }
-
- @Override
- public boolean impliesResolve() {
- return false;
- }
-
- @Override
- public boolean impliesObjectChanged() {
- return false;
- }
-
- @Override
- public void invoke(final ObjectAdapter adapter) {
- AdapterInvokeUtils.invokeAll(methods, adapter);
- }
-
- @Override
- protected String toStringValues() {
- return "methods=" + methods;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadingCallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadingCallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadingCallbackFacetAbstract.java
deleted file mode 100644
index 3fae31d..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadingCallbackFacetAbstract.java
+++ /dev/null
@@ -1,37 +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.progmodel.facets.object.callbacks.load;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.callbacks.LoadingCallbackFacet;
-import org.apache.isis.core.progmodel.facets.object.callbacks.CallbackFacetAbstract;
-
-public abstract class LoadingCallbackFacetAbstract extends CallbackFacetAbstract implements LoadingCallbackFacet {
-
- public static Class<? extends Facet> type() {
- return LoadingCallbackFacet.class;
- }
-
- public LoadingCallbackFacetAbstract(final FacetHolder holder) {
- super(type(), holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadingCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadingCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadingCallbackFacetViaMethod.java
deleted file mode 100644
index 5a97e2b..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/load/LoadingCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,77 +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.progmodel.facets.object.callbacks.load;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.util.AdapterInvokeUtils;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet.Intent;
-
-public class LoadingCallbackFacetViaMethod extends LoadingCallbackFacetAbstract implements ImperativeFacet {
-
- private final List<Method> methods = new ArrayList<Method>();
-
- public LoadingCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
- super(holder);
- addMethod(method);
- }
-
- @Override
- public void addMethod(final Method method) {
- methods.add(method);
- }
-
- @Override
- public List<Method> getMethods() {
- return Collections.unmodifiableList(methods);
- }
-
- @Override
- public Intent getIntent(final Method method) {
- return Intent.LIFECYCLE;
- }
-
- @Override
- public boolean impliesResolve() {
- return false;
- }
-
- @Override
- public boolean impliesObjectChanged() {
- return false;
- }
-
- @Override
- public void invoke(final ObjectAdapter adapter) {
- AdapterInvokeUtils.invokeAll(methods, adapter);
- }
-
- @Override
- protected String toStringValues() {
- return "methods=" + methods;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/7227418b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/persist/PersistCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/persist/PersistCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/persist/PersistCallbackFacetFactory.java
deleted file mode 100644
index c6a0bd8..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/persist/PersistCallbackFacetFactory.java
+++ /dev/null
@@ -1,80 +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.progmodel.facets.object.callbacks.persist;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-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.facets.object.callbacks.PersistedCallbackFacet;
-import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
-import org.apache.isis.core.metamodel.methodutils.MethodScope;
-import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
-import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
-
-public class PersistCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
- private static final String[] PREFIXES = { MethodPrefixConstants.PERSISTED_PREFIX, MethodPrefixConstants.PERSISTING_PREFIX, };
-
- public PersistCallbackFacetFactory() {
- super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
- }
-
- @Override
- public void process(final ProcessClassContext processClassContext) {
- final Class<?> cls = processClassContext.getCls();
- final FacetHolder facetHolder = processClassContext.getFacetHolder();
-
- final List<Facet> facets = new ArrayList<Facet>();
- final List<Method> methods = new ArrayList<Method>();
-
- Method method = null;
- method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.PERSISTING_PREFIX, void.class, NO_PARAMETERS_TYPES);
- if (method != null) {
- methods.add(method);
- final PersistingCallbackFacet facet = facetHolder.getFacet(PersistingCallbackFacet.class);
- if (facet == null) {
- facets.add(new PersistingCallbackFacetViaMethod(method, facetHolder));
- } else {
- facet.addMethod(method);
- }
- }
-
- method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.PERSISTED_PREFIX, void.class, NO_PARAMETERS_TYPES);
- if (method != null) {
- methods.add(method);
- final PersistedCallbackFacet facet = facetHolder.getFacet(PersistedCallbackFacet.class);
- if (facet == null) {
- facets.add(new PersistedCallbackFacetViaMethod(method, facetHolder));
- } else {
- facet.addMethod(method);
- }
- }
-
- processClassContext.removeMethods(methods);
- FacetUtil.addFacets(facets);
- }
-
-}