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 2013/08/07 06:43:13 UTC
[1/2] ISIS-488: facet factory for JDO @Column annotation
Updated Branches:
refs/heads/master fb7446b26 -> f8ebd1bdc
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/OptionalAnnotationFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/OptionalAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/OptionalAnnotationFacetFactoryTest.java
index c76791a..eecc715 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/OptionalAnnotationFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/OptionalAnnotationFacetFactoryTest.java
@@ -38,7 +38,6 @@ public class OptionalAnnotationFacetFactoryTest extends AbstractFacetFactoryTest
final OptionalAnnotationForPropertyFacetFactory facetFactory = new OptionalAnnotationForPropertyFacetFactory();
class Customer {
- @SuppressWarnings("unused")
@Optional
public String getFirstName() {
return null;
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/test/resources/org/apache/isis/core/metamodel/layoutmetadata/json/ExampleDomainObject.layout.properties
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/resources/org/apache/isis/core/metamodel/layoutmetadata/json/ExampleDomainObject.layout.properties b/core/metamodel/src/test/resources/org/apache/isis/core/metamodel/layoutmetadata/json/ExampleDomainObject.layout.properties
index f859198..76309bf 100644
--- a/core/metamodel/src/test/resources/org/apache/isis/core/metamodel/layoutmetadata/json/ExampleDomainObject.layout.properties
+++ b/core/metamodel/src/test/resources/org/apache/isis/core/metamodel/layoutmetadata/json/ExampleDomainObject.layout.properties
@@ -38,25 +38,26 @@ memberOrder.description.sequence=1
memberOrder.category.sequence=2
memberOrder.complete.sequence=3
+# Properties (Misc)
+memberOrder.versionSequence.name=Misc
+memberOrder.versionSequence.sequence=4
+
+
# Properties (Detail)
memberOrder.dueBy.name=Detail
memberOrder.cost.name=Detail
memberOrder.notes.name=Detail
memberOrder.attachment.name=Detail
-memberOrder.dueBy.sequence=1
-memberOrder.cost.sequence=2
-memberOrder.notes.sequence=3
-memberOrder.attachment.sequence=4
-
-# Properties (Misc)
-memberOrder.versionSequence.name=Misc
-memberOrder.versionSequence.sequence=1
+memberOrder.dueBy.sequence=5
+memberOrder.cost.sequence=6
+memberOrder.notes.sequence=7
+memberOrder.attachment.sequence=8
#Collections
-memberOrder.dependencies.sequence=1
-memberOrder.similarItems.sequence=2
+memberOrder.dependencies.sequence=9
+memberOrder.similarItems.sequence=10
#Actions (freestanding)
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/example/application/claims/viewer-dnd/ide/eclipse/launch/claims-viewer-dnd.launch
----------------------------------------------------------------------
diff --git a/example/application/claims/viewer-dnd/ide/eclipse/launch/claims-viewer-dnd.launch b/example/application/claims/viewer-dnd/ide/eclipse/launch/claims-viewer-dnd.launch
index 185395e..c60635b 100644
--- a/example/application/claims/viewer-dnd/ide/eclipse/launch/claims-viewer-dnd.launch
+++ b/example/application/claims/viewer-dnd/ide/eclipse/launch/claims-viewer-dnd.launch
@@ -13,7 +13,9 @@
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;applib&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;berkeley-persistor&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&qu
ot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;bytecode-cglib&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;bytecode-javassist&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;claims-commandline&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&q
uot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;claims-dom&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;claims-fixture&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;claims-service&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;
no&quot;?&gt;&#10;&lt;javaProject name=&quot;claims-webapp&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;classic-skin&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;commons&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&a
mp;lt;javaProject name=&quot;core&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;dnd-viewer&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;example-claims&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;exa
mples&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;headless&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;headless-applib&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;headless-embedded&quot;/&gt;
&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;headless-junit&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;headless-viewer&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;hibernate-persistor&quot;/&gt;&#10;"
typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;html-viewer&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;http-remoting&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;http-remoting-client&quot;/&gt;&#10;" typeId="org.ecl
ipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;http-remoting-server&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;metamodel&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;isis-parent&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourc
eContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;plugins&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;release&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;remoting&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <
container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;runtime&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;scimpi&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;scimpi-dispatcher&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?x
ml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;scimpi-servlet&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;sql&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;sql-integrationtests&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&am
p;quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;sql-persistor&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;trunk&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;webapp&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quo
t; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;webserver&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;xml-persistor&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;xstream-marshalling&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot
;no&quot;?&gt;&#10;&lt;default/&gt;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/>
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.Isis"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--type exploration --viewer dnd"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="claims-viewer-dnd"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/example/application/claims/viewer-scimpi/ide/eclipse/launch/claims-viewer-scimpi.launch
----------------------------------------------------------------------
diff --git a/example/application/claims/viewer-scimpi/ide/eclipse/launch/claims-viewer-scimpi.launch b/example/application/claims/viewer-scimpi/ide/eclipse/launch/claims-viewer-scimpi.launch
index 959db1e..206b682 100644
--- a/example/application/claims/viewer-scimpi/ide/eclipse/launch/claims-viewer-scimpi.launch
+++ b/example/application/claims/viewer-scimpi/ide/eclipse/launch/claims-viewer-scimpi.launch
@@ -12,6 +12,8 @@
</mapAttribute>
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="claims-viewer-scimpi"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/example/application/claims/viewer-wicket/ide/eclipse/launch/claims-viewer-wicket.launch
----------------------------------------------------------------------
diff --git a/example/application/claims/viewer-wicket/ide/eclipse/launch/claims-viewer-wicket.launch b/example/application/claims/viewer-wicket/ide/eclipse/launch/claims-viewer-wicket.launch
index e808f36..d3afdc3 100644
--- a/example/application/claims/viewer-wicket/ide/eclipse/launch/claims-viewer-wicket.launch
+++ b/example/application/claims/viewer-wicket/ide/eclipse/launch/claims-viewer-wicket.launch
@@ -13,6 +13,8 @@
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="true"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.bytecode.identity&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.alternatives.bytecode.javassist&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceC
ontainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.embedded&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.objectstores.nosql&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.
apache.isis.runtimes.dflt.objectstores.sql-impl&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.objectstores.sql-tests-common&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.objectstores.sql-tests-served&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&
lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.objectstores.xml&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.alternatives.progmodel.groovy-applib&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.alternatives.progmodel.groovy-metamodel&q
uot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.alternatives.progmodel.wrapper-applib&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.alternatives.progmodel.wrapper-metamodel&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF
-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.remoting.common&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.remoting.marshalling-encode&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.remoting.marshalling-serialize&quot;/&gt;&#13;&#10;" typeId="or
g.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.remoting.marshalling-xstream&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.remoting.transport-http-client&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quo
t;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.remoting.transport-http-server&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.remoting.transport-sockets&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.security.file&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/>
; <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.security.ldap&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.applib&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.core.commons&quot;/&gt;&#13;&#10
;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.core.metamodel&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.core.progmodel&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&l
t;javaProject name=&quot;org.apache.isis.runtimes.dflt.runtime&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.core.testsupport&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.webapp&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&a
mp;quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.webserver&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.defaults.bytecode&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.runtimes.dflt.objectstores.dflt&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jd
t.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.progmodels.dflt&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.defaults.security&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;or
g.apache.isis.examples.apps.bdd-claims-commandline&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.bdd-claims-concordion&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.bdd-claims-dom&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&
;quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.bdd-claims-fixture&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.bdd-claims-service&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.claims-commandline&quot;/&gt;&#13;&#1
0;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.claims-dom&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.claims-fixture&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt
;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.claims-service&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.claims-webapp&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.ecs&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento=&q
uot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.expenses-commandline&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.expenses-dom&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.expenses-fixtures&quot;/
&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.expenses-scimpi&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.expenses-services&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalon
e=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.expenses-webapp&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.groovy-claims-commandline&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.groovy-claims-dom&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContain
er.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.groovy-claims-fixture&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.groovy-claims-service&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name
=&quot;org.apache.isis.examples.apps.groovy-claims-webapp&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.library&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.orders&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&a
mp;quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.shoppingcart-cart&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.shoppingcart-catalogue&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.apps.shoppingcart-dom&quot;/&gt;&#13;&#10;" t
ypeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.examples.progmodel.namefile&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.skins.classic-skin&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#1
0;&lt;javaProject name=&quot;org.apache.isis.support.archetypes.application&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.support.archetypes.exploration&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.support.archetypes.scimpi&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.support.prototype-dom&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.support.prototype-fixture&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.support.prototype-objstore-default&quot;/&gt;&#1
3;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.support.prototype-quickrun&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.support.prototype-viewer-html&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&q
uot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.support.prototype-viewer-wicket&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.bdd-common&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.bdd-concordion&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container m
emento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.dnd&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.html&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.junit&quot;/&gt;&#13;&#10;" typeId="org
.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.restful-applib&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.restful-viewer&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProj
ect name=&quot;org.apache.isis.viewer.scimpi-dispatcher&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.scimpi-servlet&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.wicket-applib&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&
;quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.wicket-metamodel&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.wicket-model&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.wicket-ui&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sou
rceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.apache.isis.viewer.wicket-viewer&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/>
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="claims-viewer-wicket"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java b/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java
index b15d476..7161b53 100644
--- a/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java
+++ b/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java
@@ -26,16 +26,15 @@ import java.util.SortedSet;
import java.util.TreeSet;
import javax.jdo.JDOHelper;
-import javax.jdo.annotations.Column;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.VersionStrategy;
import javax.jdo.spi.PersistenceCapable;
import com.google.common.base.Objects;
-import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
import org.joda.time.LocalDate;
+
import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.annotation.Audited;
import org.apache.isis.applib.annotation.AutoComplete;
@@ -44,7 +43,6 @@ import org.apache.isis.applib.annotation.Bulk;
import org.apache.isis.applib.annotation.CssClass;
import org.apache.isis.applib.annotation.Disabled;
import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.MemberGroupLayout;
import org.apache.isis.applib.annotation.MinLength;
import org.apache.isis.applib.annotation.MultiLine;
import org.apache.isis.applib.annotation.Named;
@@ -117,9 +115,8 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
private String description;
+ @javax.jdo.annotations.Column(allowsNull="false")
@RegEx(validation = "\\w[@&:\\-\\,\\.\\+ \\w]*")
- // only words, spaces and selected punctuation accepted
-
public String getDescription() {
return description;
}
@@ -135,7 +132,7 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
@javax.jdo.annotations.Persistent(defaultFetchGroup="true")
private LocalDate dueBy;
- @Optional
+ @javax.jdo.annotations.Column(allowsNull="true")
@CssClass("x-key")
public LocalDate getDueBy() {
return dueBy;
@@ -184,6 +181,7 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
private Category category;
+ @javax.jdo.annotations.Column(allowsNull="false")
public Category getCategory() {
return category;
}
@@ -198,8 +196,8 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
private String ownedBy;
+ @javax.jdo.annotations.Column(allowsNull="false")
@Hidden
- // not shown in the UI
public String getOwnedBy() {
return ownedBy;
}
@@ -217,7 +215,6 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
private boolean complete;
@Disabled
- // cannot be edited as a property
public boolean isComplete() {
return complete;
}
@@ -257,8 +254,7 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
private BigDecimal cost;
- @Column(scale = 2)
- @Optional
+ @javax.jdo.annotations.Column(allowsNull="true", scale=2)
public BigDecimal getCost() {
return cost;
}
@@ -283,8 +279,8 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
private String notes;
+ @javax.jdo.annotations.Column(allowsNull="true")
@Hidden(where=Where.ALL_TABLES)
- @Optional
@MultiLine(numberOfLines=5)
public String getNotes() {
return notes;
@@ -301,7 +297,7 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
private Blob attachment;
@javax.jdo.annotations.Persistent(defaultFetchGroup="false")
- @Optional
+ @javax.jdo.annotations.Column(allowsNull="true")
@Hidden(where=Where.STANDALONE_TABLES)
public Blob getAttachment() {
return attachment;
[2/2] git commit: ISIS-488: facet factory for JDO @Column annotation
Posted by da...@apache.org.
ISIS-488: facet factory for JDO @Column annotation
- MandatoryDerivedFromJdoColumnAnnotationFacetFactory
- refactored the MandatoryFacetAbstract hierarchy
- check for incompatibilities between Isis' and JDO's default treatments of nullable fields.
- new @Mandatory annotation
- fixes to Isis provided JDO entities (PublishedEvent, ApplicationSettingJdo, UserSettingJdo).
Also:
- trivial refactorings to BigDecimalDerivedFromJdoColumnAnnotationFacetFactory (from whence cloned)
- fix to LayoutMetadataJsonReader unit test
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/f8ebd1bd
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/f8ebd1bd
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/f8ebd1bd
Branch: refs/heads/master
Commit: f8ebd1bdcc94229209c7b97c2107d176b84cb81f
Parents: fb7446b
Author: Dan Haywood <da...@apache.org>
Authored: Tue Aug 6 12:35:31 2013 +0200
Committer: Dan Haywood <da...@apache.org>
Committed: Wed Aug 7 06:42:31 2013 +0200
----------------------------------------------------------------------
.../applib/service/publish/PublishedEvent.java | 63 ++++---
.../service/settings/ApplicationSettingJdo.java | 10 ++
.../service/settings/SettingAbstractJdo.java | 3 +
.../applib/service/settings/UserSettingJdo.java | 12 +-
...ataNucleusPersistenceMechanismInstaller.java | 3 +
...ivedFromJdoColumnAnnotationFacetFactory.java | 8 +-
.../MandatoryFacetDerivedFromJdoColumn.java | 36 ++++
...toryFacetInferredFromAbsenceOfJdoColumn.java | 35 ++++
...toryFromJdoColumnAnnotationFacetFactory.java | 174 +++++++++++++++++++
...FacetDerivedFromJdoPrimaryKeyAnnotation.java | 13 +-
...FromJdoColumnAnnotationFacetFactoryTest.java | 10 +-
...FromJdoColumnAnnotationFacetFactoryTest.java | 147 ++++++++++++++++
...leObjectWithBigDecimalColumnAnnotations.java | 93 ++++++++++
...leObjectWithColumnAllowsNullAnnotations.java | 101 +++++++++++
.../SimpleObjectWithColumnAnnotations.java | 98 -----------
.../isis/applib/annotation/Mandatory.java | 54 ++++++
.../apache/isis/applib/annotation/Optional.java | 11 ++
.../core/metamodel/facetapi/FacetAbstract.java | 4 +-
.../mandatory/MandatoryFacetAbstract.java | 39 ++++-
.../facets/mandatory/MandatoryFacetDefault.java | 22 +--
...toryFacetInvertedByOptionalForParameter.java | 17 +-
...atoryFacetOptionalViaMethodForParameter.java | 17 +-
...datoryAnnotationForPropertyFacetFactory.java | 49 ++++++
.../MandatoryFacetExplicitForProperty.java | 37 ++++
...atoryFacetInvertedByOptionalForProperty.java | 20 +--
...datoryFacetOptionalViaMethodForProperty.java | 18 +-
.../dflt/ProgrammingModelFacetsJava5.java | 2 +
.../MandatoryAnnotationFacetFactoryTest.java | 53 ++++++
.../OptionalAnnotationFacetFactoryTest.java | 1 -
.../json/ExampleDomainObject.layout.properties | 21 +--
.../ide/eclipse/launch/claims-viewer-dnd.launch | 2 +
.../eclipse/launch/claims-viewer-scimpi.launch | 2 +
.../eclipse/launch/claims-viewer-wicket.launch | 2 +
.../dom/src/main/java/dom/todo/ToDoItem.java | 20 +--
34 files changed, 936 insertions(+), 261 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEvent.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEvent.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEvent.java
index 9ffc0c8..1b0c65c 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEvent.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEvent.java
@@ -28,8 +28,10 @@ import org.apache.isis.applib.annotation.ActionSemantics.Of;
import org.apache.isis.applib.annotation.Bulk;
import org.apache.isis.applib.annotation.Hidden;
import org.apache.isis.applib.annotation.Immutable;
+import org.apache.isis.applib.annotation.Mandatory;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.MultiLine;
+import org.apache.isis.applib.annotation.NotPersisted;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.annotation.Title;
import org.apache.isis.applib.annotation.Where;
@@ -48,9 +50,11 @@ public class PublishedEvent {
QUEUED, PROCESSED
}
- // {{ Title (property)
+ // //////////////////////////////////////
+
private String title;
+ @javax.jdo.annotations.Column(allowsNull="false")
@Title
@Hidden
public String getTitle() {
@@ -60,10 +64,9 @@ public class PublishedEvent {
public void setTitle(final String title) {
this.title = title;
}
- // }}
+ // //////////////////////////////////////
- // {{ Timestamp (property)
private long timestamp;
@MemberOrder(sequence = "1")
@@ -74,12 +77,12 @@ public class PublishedEvent {
public void setTimestamp(final long timestamp) {
this.timestamp = timestamp;
}
- // }}
+
+ // //////////////////////////////////////
- // {{ Id (property)
- @javax.jdo.annotations.PrimaryKey
private String id;
+ @javax.jdo.annotations.PrimaryKey
@MemberOrder(sequence = "2")
public String getId() {
return id;
@@ -88,10 +91,9 @@ public class PublishedEvent {
public void setId(final String id) {
this.id = id;
}
- // }}
-
- // {{ TransactionId (property)
+ // //////////////////////////////////////
+
private String transactionId;
/**
@@ -105,10 +107,9 @@ public class PublishedEvent {
public void setTransactionId(final String transactionId) {
this.transactionId = transactionId;
}
- // }}
-
- // {{ Sequence (property)
+ // //////////////////////////////////////
+
private int sequence;
/**
@@ -122,12 +123,12 @@ public class PublishedEvent {
public void setSequence(final int sequence) {
this.sequence = sequence;
}
- // }}
-
+
+ // //////////////////////////////////////
- // {{ EventType (property)
private EventType eventType;
+ @javax.jdo.annotations.Column(allowsNull="false")
@MemberOrder(sequence = "3")
public EventType getEventType() {
return eventType;
@@ -136,12 +137,12 @@ public class PublishedEvent {
public void setEventType(final EventType eventType) {
this.eventType = eventType;
}
- // }}
-
- // {{ User (property)
+ // //////////////////////////////////////
+
private String user;
+ @javax.jdo.annotations.Column(allowsNull="false")
@MemberOrder(sequence = "4")
public String getUser() {
return user;
@@ -150,12 +151,12 @@ public class PublishedEvent {
public void setUser(final String user) {
this.user = user;
}
- // }}
-
- // {{ State (property)
+ // //////////////////////////////////////
+
private State state;
+ @javax.jdo.annotations.Column(allowsNull="false")
@MemberOrder(sequence = "5")
public State getState() {
return state;
@@ -168,12 +169,11 @@ public class PublishedEvent {
setState(state);
return this;
}
- // }}
-
- // {{ SerializedForm (property)
+ // //////////////////////////////////////
@javax.jdo.annotations.NotPersistent
+ @NotPersisted
@MultiLine(numberOfLines=20)
@Hidden(where=Where.ALL_TABLES)
@MemberOrder(sequence = "6")
@@ -185,10 +185,9 @@ public class PublishedEvent {
final byte[] zippedBytes = IoUtils.toUtf8ZippedBytes("serializedForm", serializedForm);
setSerializedFormZipped(zippedBytes);
}
- // }}
-
+
+ // //////////////////////////////////////
- // {{ SerializedFormZipped (property)
@javax.jdo.annotations.Column
private byte[] serializedFormZipped;
@@ -200,10 +199,10 @@ public class PublishedEvent {
public void setSerializedFormZipped(final byte[] serializedFormZipped) {
this.serializedFormZipped = serializedFormZipped;
}
- // }}
-
-
+
+ // //////////////////////////////////////
+
@Bulk
@ActionSemantics(Of.IDEMPOTENT)
@MemberOrder(sequence="10")
@@ -226,13 +225,13 @@ public class PublishedEvent {
}
- // {{ injected: DomainObjectContainer
+ // //////////////////////////////////////
+
private DomainObjectContainer container;
public void setDomainObjectContainer(final DomainObjectContainer container) {
this.container = container;
}
- // }}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingJdo.java
index 8e726c2..4a9b60f 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/ApplicationSettingJdo.java
@@ -43,6 +43,8 @@ public class ApplicationSettingJdo extends SettingAbstractJdo implements Applica
super.setKey(key);
}
+ // //////////////////////////////////////
+
@Persistent
@Override
public String getDescription() {
@@ -52,6 +54,10 @@ public class ApplicationSettingJdo extends SettingAbstractJdo implements Applica
public void setDescription(String description) {
super.setDescription(description);
}
+
+ // //////////////////////////////////////
+
+ @javax.jdo.annotations.Column(allowsNull="false")
@Persistent
@Override
public String getValueRaw() {
@@ -61,6 +67,10 @@ public class ApplicationSettingJdo extends SettingAbstractJdo implements Applica
public void setValueRaw(String valueAsRaw) {
super.setValueRaw(valueAsRaw);
}
+
+ // //////////////////////////////////////
+
+ @javax.jdo.annotations.Column(allowsNull="false")
@Persistent
@Override
public SettingType getType() {
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/SettingAbstractJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/SettingAbstractJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/SettingAbstractJdo.java
index c79cb92..8e6f8da 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/SettingAbstractJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/SettingAbstractJdo.java
@@ -37,6 +37,7 @@ public abstract class SettingAbstractJdo extends org.apache.isis.applib.services
private String key;
+ @javax.jdo.annotations.Column(allowsNull="false")
public String getKey() {
return key;
}
@@ -71,6 +72,7 @@ public abstract class SettingAbstractJdo extends org.apache.isis.applib.services
private SettingType type;
+ @javax.jdo.annotations.Column(allowsNull="false")
public SettingType getType() {
return type;
}
@@ -83,6 +85,7 @@ public abstract class SettingAbstractJdo extends org.apache.isis.applib.services
private String valueRaw;
+ @javax.jdo.annotations.Column(allowsNull="false")
public String getValueRaw() {
return valueRaw;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdo.java
index cd7ba63..cc6e4d4 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/settings/UserSettingJdo.java
@@ -55,6 +55,8 @@ public class UserSettingJdo extends SettingAbstractJdo implements UserSetting {
this.user = user;
}
+ // //////////////////////////////////////
+
@Title(sequence="10")
@PrimaryKey
@Override
@@ -66,7 +68,8 @@ public class UserSettingJdo extends SettingAbstractJdo implements UserSetting {
super.setKey(key);
}
-
+ // //////////////////////////////////////
+
@Persistent
@Override
public String getDescription() {
@@ -77,6 +80,9 @@ public class UserSettingJdo extends SettingAbstractJdo implements UserSetting {
super.setDescription(description);
}
+ // //////////////////////////////////////
+
+ @javax.jdo.annotations.Column(allowsNull="false")
@Title(prepend=" = ", sequence="30")
@Persistent
@Override
@@ -88,6 +94,10 @@ public class UserSettingJdo extends SettingAbstractJdo implements UserSetting {
public void setValueRaw(String valueAsRaw) {
super.setValueRaw(valueAsRaw);
}
+
+ // //////////////////////////////////////
+
+ @javax.jdo.annotations.Column(allowsNull="false")
@Persistent
@Override
public SettingType getType() {
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java b/component/objectstore/jdo/jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
index abcd5f1..144e0b1 100644
--- a/component/objectstore/jdo/jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
+++ b/component/objectstore/jdo/jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
@@ -49,6 +49,7 @@ import org.apache.isis.objectstore.jdo.metamodel.facets.object.embeddedonly.JdoE
import org.apache.isis.objectstore.jdo.metamodel.facets.object.persistencecapable.JdoPersistenceCapableAnnotationFacetFactory;
import org.apache.isis.objectstore.jdo.metamodel.facets.object.query.JdoQueryAnnotationFacetFactory;
import org.apache.isis.objectstore.jdo.metamodel.facets.prop.column.BigDecimalDerivedFromJdoColumnAnnotationFacetFactory;
+import org.apache.isis.objectstore.jdo.metamodel.facets.prop.column.MandatoryFromJdoColumnAnnotationFacetFactory;
import org.apache.isis.objectstore.jdo.metamodel.facets.prop.primarykey.JdoPrimaryKeyAnnotationFacetFactory;
import org.apache.isis.objectstore.jdo.metamodel.specloader.validator.JdoMetaModelValidator;
@@ -189,6 +190,8 @@ public class DataNucleusPersistenceMechanismInstaller extends PersistenceMechani
programmingModel.addFactory(JdoQueryAnnotationFacetFactory.class);
programmingModel.addFactory(BigDecimalDerivedFromJdoColumnAnnotationFacetFactory.class);
+ // must appear after JdoPrimaryKeyAnnotationFacetFactory (above)
+ programmingModel.addFactory(MandatoryFromJdoColumnAnnotationFacetFactory.class);
programmingModel.addFactory(AuditableAnnotationInJdoApplibFacetFactory.class);
programmingModel.addFactory(AuditableMarkerInterfaceInJdoApplibFacetFactory.class);
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactory.java b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactory.java
index d425366..c6372d8 100644
--- a/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactory.java
+++ b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactory.java
@@ -41,14 +41,15 @@ public class BigDecimalDerivedFromJdoColumnAnnotationFacetFactory extends FacetF
@Override
public void process(final ProcessMethodContext processMethodContext) {
+
+ final Column annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Column.class);
+
if(BigDecimal.class != processMethodContext.getMethod().getReturnType()) {
return;
- }
-
+ }
final BigDecimalValueFacet facet;
final FacetedMethod holder = processMethodContext.getFacetHolder();
- final Column annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Column.class);
if (annotation == null) {
facet = new BigDecimalFacetFallback(holder);
} else {
@@ -60,5 +61,6 @@ public class BigDecimalDerivedFromJdoColumnAnnotationFacetFactory extends FacetF
Integer valueElseDefault(final int value, final int defaultValue) {
return value != -1? value: defaultValue;
}
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFacetDerivedFromJdoColumn.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFacetDerivedFromJdoColumn.java b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFacetDerivedFromJdoColumn.java
new file mode 100644
index 0000000..c789c25
--- /dev/null
+++ b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFacetDerivedFromJdoColumn.java
@@ -0,0 +1,36 @@
+/*
+ * 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.objectstore.jdo.metamodel.facets.prop.column;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
+
+/**
+ * Derived by presence of an <tt>@Column</tt> method.
+ */
+public class MandatoryFacetDerivedFromJdoColumn extends MandatoryFacetAbstract {
+
+
+ public MandatoryFacetDerivedFromJdoColumn(final FacetHolder holder, boolean required ) {
+ super(holder, Semantics.of(required));
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFacetInferredFromAbsenceOfJdoColumn.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFacetInferredFromAbsenceOfJdoColumn.java b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFacetInferredFromAbsenceOfJdoColumn.java
new file mode 100644
index 0000000..14e5d7c
--- /dev/null
+++ b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFacetInferredFromAbsenceOfJdoColumn.java
@@ -0,0 +1,35 @@
+/*
+ * 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.objectstore.jdo.metamodel.facets.prop.column;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
+
+/**
+ * Derived by absence of an <tt>@Column</tt> method.
+ */
+public class MandatoryFacetInferredFromAbsenceOfJdoColumn extends MandatoryFacetAbstract {
+
+ public MandatoryFacetInferredFromAbsenceOfJdoColumn(final FacetHolder holder, final boolean required) {
+ super(holder, Semantics.of(required));
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFromJdoColumnAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFromJdoColumnAnnotationFacetFactory.java b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFromJdoColumnAnnotationFacetFactory.java
new file mode 100644
index 0000000..4bb74e2
--- /dev/null
+++ b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryFromJdoColumnAnnotationFacetFactory.java
@@ -0,0 +1,174 @@
+/*
+ * 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.objectstore.jdo.metamodel.facets.prop.column;
+
+import java.util.List;
+
+import javax.jdo.annotations.Column;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+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.FacetedMethod;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacet;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetDefault;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAssociationFilters;
+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.MetaModelValidatorVisiting.Visitor;
+import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
+import org.apache.isis.core.progmodel.facets.properties.mandatory.annotation.MandatoryFacetExplicitForProperty;
+import org.apache.isis.objectstore.jdo.metamodel.facets.prop.primarykey.OptionalFacetDerivedFromJdoPrimaryKeyAnnotation;
+
+
+public class MandatoryFromJdoColumnAnnotationFacetFactory extends FacetFactoryAbstract implements MetaModelValidatorRefiner {
+
+ public MandatoryFromJdoColumnAnnotationFacetFactory() {
+ super(FeatureType.PROPERTIES_ONLY);
+ }
+
+ @Override
+ public void process(final ProcessMethodContext processMethodContext) {
+ final Column annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Column.class);
+
+ final FacetedMethod holder = processMethodContext.getFacetHolder();
+
+ final MandatoryFacet existingFacet = holder.getFacet(MandatoryFacet.class);
+ if(existingFacet != null) {
+
+ if (existingFacet instanceof OptionalFacetDerivedFromJdoPrimaryKeyAnnotation) {
+ // do not replace this facet;
+ // we must keep an optional facet here for different reasons
+ return;
+ }
+ if (existingFacet instanceof MandatoryFacetExplicitForProperty) {
+ // do not replace this facet;
+ // an explicit @Mandatory annotation cannot be overridden by @Column annotation
+ return;
+ }
+ }
+
+ boolean required = whetherRequired(processMethodContext, annotation);
+ MandatoryFacet facet = annotation != null
+ ? new MandatoryFacetDerivedFromJdoColumn(holder, required)
+ : new MandatoryFacetInferredFromAbsenceOfJdoColumn(holder, required);
+
+
+ // as a side-effect, will chain any existing facets.
+ // we'll exploit this fact for meta-model validation (see #refineMetaModelValidator(), below)
+ FacetUtil.addFacet(facet);
+
+ // however, if a @Column was explicitly provided, and the underlying facet
+ // was the simple MandatoryFacetDefault (from an absence of @Optional or @Mandatory),
+ // then don't chain, simply replace.
+ if(facet instanceof MandatoryFacetDerivedFromJdoColumn && facet.getUnderlyingFacet() instanceof MandatoryFacetDefault) {
+ facet.setUnderlyingFacet(null);
+ }
+ }
+
+ private static boolean whetherRequired(final ProcessMethodContext processMethodContext, final Column annotation) {
+
+ final String allowsNull = annotation != null ? annotation.allowsNull() : null;
+
+ if(Strings.isNullOrEmpty(allowsNull)) {
+ final Class<?> returnType = processMethodContext.getMethod().getReturnType();
+ // per JDO spec
+ return returnType != null && returnType.isPrimitive();
+ } else {
+ return "false".equalsIgnoreCase(allowsNull.trim());
+ }
+ }
+
+ @Override
+ public void refineMetaModelValidator(MetaModelValidatorComposite metaModelValidator, IsisConfiguration configuration) {
+ metaModelValidator.add(new MetaModelValidatorVisiting(newValidatorVisitor()));
+ }
+
+ private Visitor newValidatorVisitor() {
+ return new MetaModelValidatorVisiting.Visitor() {
+
+ @Override
+ public boolean visit(ObjectSpecification objectSpec, ValidationFailures validationFailures) {
+ validate(objectSpec, validationFailures);
+ return true;
+ }
+
+ private void validate(ObjectSpecification objectSpec, ValidationFailures validationFailures) {
+
+ List<ObjectAssociation> associations = objectSpec.getAssociations(ObjectAssociationFilters.PROPERTIES);
+ for (ObjectAssociation association : associations) {
+
+
+ MandatoryFacet facet = association.getFacet(MandatoryFacet.class);
+
+ MandatoryFacet underlying = (MandatoryFacet) facet.getUnderlyingFacet();
+ if(underlying == null) {
+ continue;
+ }
+
+ if(facet instanceof MandatoryFacetDerivedFromJdoColumn) {
+
+ if(association.isNotPersisted()) {
+ validationFailures.add("%s: @javax.jdo.annotations.Column found on non-persisted property; please remove)", association.getIdentifier().toClassAndNameIdentityString());
+ continue;
+ }
+
+ if(underlying.isInvertedSemantics() == facet.isInvertedSemantics()) {
+ continue;
+ }
+
+ if(underlying.isInvertedSemantics()) {
+ // ie @Optional
+ validationFailures.add("%s: incompatible usage of Isis' @Optional annotation and @javax.jdo.annotations.Column; use just @javax.jdo.annotations.Column(allowNulls=\"...\")", association.getIdentifier().toClassAndNameIdentityString());
+ } else {
+ validationFailures.add("%s: incompatible Isis' default of required/optional properties vs JDO; add @javax.jdo.annotations.Column(allowNulls=\"...\")", association.getIdentifier().toClassAndNameIdentityString());
+ }
+ }
+
+ if(facet instanceof MandatoryFacetInferredFromAbsenceOfJdoColumn) {
+
+ if(association.isNotPersisted()) {
+ // nothing to do.
+ continue;
+ }
+
+ if(underlying.isInvertedSemantics() == facet.isInvertedSemantics()) {
+ continue;
+ }
+ if(underlying.isInvertedSemantics()) {
+ // ie @Optional
+ validationFailures.add("%s: incompatible usage of Isis' @Optional annotation and @javax.jdo.annotations.Column; use just @javax.jdo.annotations.Column(allowNulls=\"...\")", association.getIdentifier().toClassAndNameIdentityString());
+ } else {
+ validationFailures.add("%s: incompatible default handling of required/optional properties between Isis and JDO; add @javax.jdo.annotations.Column(allowsNull=\"...\")", association.getIdentifier().toClassAndNameIdentityString());
+ }
+ }
+ }
+ }
+ };
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/primarykey/OptionalFacetDerivedFromJdoPrimaryKeyAnnotation.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/primarykey/OptionalFacetDerivedFromJdoPrimaryKeyAnnotation.java b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/primarykey/OptionalFacetDerivedFromJdoPrimaryKeyAnnotation.java
index 3bc5382..ac4085f 100644
--- a/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/primarykey/OptionalFacetDerivedFromJdoPrimaryKeyAnnotation.java
+++ b/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/primarykey/OptionalFacetDerivedFromJdoPrimaryKeyAnnotation.java
@@ -21,7 +21,7 @@ package org.apache.isis.objectstore.jdo.metamodel.facets.prop.primarykey;
import javax.jdo.annotations.PrimaryKey;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetDefault;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
@@ -34,17 +34,10 @@ import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefault
* the property as optional, meaning that the {@link PrimaryKey} property is left
* untouched by Isis.
*/
-public class OptionalFacetDerivedFromJdoPrimaryKeyAnnotation extends
- MandatoryFacetDefault {
+public class OptionalFacetDerivedFromJdoPrimaryKeyAnnotation extends MandatoryFacetAbstract {
public OptionalFacetDerivedFromJdoPrimaryKeyAnnotation(final FacetHolder holder) {
- super(holder);
+ super(holder, Semantics.OPTIONAL);
}
- @Override
- public boolean isInvertedSemantics() {
- return true;
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest.java b/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest.java
index a29938c..e8129dd 100644
--- a/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest.java
+++ b/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest.java
@@ -63,7 +63,7 @@ public class BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest extends Ab
}
public void testAnnotationPickedUpOnProperty() throws Exception {
- final Class<?> cls = SimpleObjectWithColumnAnnotations.class;
+ final Class<?> cls = SimpleObjectWithBigDecimalColumnAnnotations.class;
final Method method = cls.getMethod("getBigDecimalPropertyWithColumnAnnotation");
facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
@@ -75,7 +75,7 @@ public class BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest extends Ab
}
public void testAnnotationDefaultsLengthIfMissing() throws Exception {
- final Class<?> cls = SimpleObjectWithColumnAnnotations.class;
+ final Class<?> cls = SimpleObjectWithBigDecimalColumnAnnotations.class;
final Method method = cls.getMethod("getBigDecimalPropertyWithColumnAnnotationMissingLength");
facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
@@ -86,7 +86,7 @@ public class BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest extends Ab
}
public void testAnnotationDefaultsScaleIfMissing() throws Exception {
- final Class<?> cls = SimpleObjectWithColumnAnnotations.class;
+ final Class<?> cls = SimpleObjectWithBigDecimalColumnAnnotations.class;
final Method method = cls.getMethod("getBigDecimalPropertyWithColumnAnnotationMissingScale");
facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
@@ -98,7 +98,7 @@ public class BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest extends Ab
public void testNoFacetIfPropertyTypeIsNotBigDecimal() throws Exception {
- final Class<?> cls = SimpleObjectWithColumnAnnotations.class;
+ final Class<?> cls = SimpleObjectWithBigDecimalColumnAnnotations.class;
final Method method = cls.getMethod("getStringPropertyWithColumnAnnotation");
facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
@@ -108,7 +108,7 @@ public class BigDecimalDerivedFromJdoColumnAnnotationFacetFactoryTest extends Ab
public void testFallbackFacetIfPropertyIsNotAnnotated() throws Exception {
- final Class<?> cls = SimpleObjectWithColumnAnnotations.class;
+ final Class<?> cls = SimpleObjectWithBigDecimalColumnAnnotations.class;
final Method method = cls.getMethod("getBigDecimalPropertyWithoutColumnAnnotation");
facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryDerivedFromJdoColumnAnnotationFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryDerivedFromJdoColumnAnnotationFacetFactoryTest.java b/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryDerivedFromJdoColumnAnnotationFacetFactoryTest.java
new file mode 100644
index 0000000..91b9057
--- /dev/null
+++ b/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/MandatoryDerivedFromJdoColumnAnnotationFacetFactoryTest.java
@@ -0,0 +1,147 @@
+/*
+ * 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.objectstore.jdo.metamodel.facets.prop.column;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import javax.jdo.annotations.PrimaryKey;
+
+import org.junit.Assert;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacet;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.members.disabled.DisabledFacet;
+import org.apache.isis.core.progmodel.facets.value.bigdecimal.BigDecimalValueFacet;
+
+public class MandatoryDerivedFromJdoColumnAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+ private MandatoryFromJdoColumnAnnotationFacetFactory facetFactory;
+ private Class<?> cls;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ facetFactory = new MandatoryFromJdoColumnAnnotationFacetFactory();
+ cls = SimpleObjectWithColumnAllowsNullAnnotations.class;
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ facetFactory = null;
+ super.tearDown();
+ }
+
+ public void testFeatureTypes() {
+ final List<FeatureType> featureTypes = facetFactory.getFeatureTypes();
+ assertFalse(contains(featureTypes, FeatureType.OBJECT));
+ assertTrue(contains(featureTypes, FeatureType.PROPERTY));
+ assertFalse(contains(featureTypes, FeatureType.COLLECTION));
+ assertFalse(contains(featureTypes, FeatureType.ACTION));
+ assertFalse(contains(featureTypes, FeatureType.ACTION_PARAMETER));
+ }
+
+ public void testPrimitiveWithNoAnnotation_isMandatory() throws Exception {
+ final Method method = cls.getMethod("getPrimitiveWithNoAnnotation");
+ facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
+
+ final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof MandatoryFacetInferredFromAbsenceOfJdoColumn);
+ assertThat(facet.isInvertedSemantics(), is(false));
+ }
+
+ public void testPrimitiveWithNoAllowsNull_isMandatory() throws Exception {
+ final Method method = cls.getMethod("getPrimitiveWithNoAllowsNull");
+ facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
+
+ final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn);
+ assertThat(facet.isInvertedSemantics(), is(false));
+ }
+
+ public void testPrimitiveWithAllowsNullFalse() throws Exception {
+ final Method method = cls.getMethod("getPrimitiveWithAllowsNullFalse");
+ facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
+
+ final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn);
+ assertThat(facet.isInvertedSemantics(), is(false));
+ }
+
+ public void testPrimitiveWithAllowsNullTrue() throws Exception {
+ final Method method = cls.getMethod("getPrimitiveWithAllowsNullTrue");
+ facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
+
+ final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn);
+ assertThat(facet.isInvertedSemantics(), is(true));
+ }
+
+ public void testReferenceWithNoAnnotation_isOptional() throws Exception {
+ final Method method = cls.getMethod("getReferenceWithNoAnnotation");
+ facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
+
+ final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof MandatoryFacetInferredFromAbsenceOfJdoColumn);
+ assertThat(facet.isInvertedSemantics(), is(true));
+ }
+
+ public void testReferenceWithNoAllowsNull_isOptional() throws Exception {
+ final Method method = cls.getMethod("getReferenceWithNoAllowsNull");
+ facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
+
+ final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn);
+ assertThat(facet.isInvertedSemantics(), is(true));
+ }
+
+ public void testReferenceWithAllowsNullFalse() throws Exception {
+ final Method method = cls.getMethod("getReferenceWithAllowsNullFalse");
+ facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
+
+ final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn);
+ assertThat(facet.isInvertedSemantics(), is(false));
+ }
+
+ public void testReferenceWithAllowsNullTrue() throws Exception {
+ final Method method = cls.getMethod("getReferenceWithAllowsNullTrue");
+ facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod));
+
+ final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn);
+ assertThat(facet.isInvertedSemantics(), is(true));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithBigDecimalColumnAnnotations.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithBigDecimalColumnAnnotations.java b/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithBigDecimalColumnAnnotations.java
new file mode 100644
index 0000000..fb4f0e7
--- /dev/null
+++ b/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithBigDecimalColumnAnnotations.java
@@ -0,0 +1,93 @@
+/*
+ * 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.objectstore.jdo.metamodel.facets.prop.column;
+
+import java.math.BigDecimal;
+
+import javax.jdo.annotations.Column;
+
+import org.apache.isis.applib.annotation.MemberOrder;
+
+
+public class SimpleObjectWithBigDecimalColumnAnnotations {
+
+ private BigDecimal bigDecimalPropertyWithColumnAnnotation;
+
+ @Column(length=12,scale=3)
+ public BigDecimal getBigDecimalPropertyWithColumnAnnotation() {
+ return bigDecimalPropertyWithColumnAnnotation;
+ }
+
+ public void setBigDecimalPropertyWithColumnAnnotation(final BigDecimal val) {
+ this.bigDecimalPropertyWithColumnAnnotation = val;
+ }
+
+ // //////////////////////////////////////
+
+ private BigDecimal bigDecimalPropertyWithColumnAnnotationMissingLength;
+
+ @Column(scale=3)
+ public BigDecimal getBigDecimalPropertyWithColumnAnnotationMissingLength() {
+ return bigDecimalPropertyWithColumnAnnotationMissingLength;
+ }
+
+ public void setBigDecimalPropertyWithColumnAnnotationMissingLength(final BigDecimal val) {
+ this.bigDecimalPropertyWithColumnAnnotationMissingLength = val;
+ }
+
+ // //////////////////////////////////////
+
+ private BigDecimal bigDecimalPropertyWithColumnAnnotationMissingScale;
+
+ @Column(length=12)
+ public BigDecimal getBigDecimalPropertyWithColumnAnnotationMissingScale() {
+ return bigDecimalPropertyWithColumnAnnotationMissingScale;
+ }
+
+ public void setBigDecimalPropertyWithColumnAnnotationMissingScale(final BigDecimal val) {
+ this.bigDecimalPropertyWithColumnAnnotationMissingScale = val;
+ }
+
+ // //////////////////////////////////////
+
+ private String stringPropertyWithColumnAnnotation;
+
+ @Column(length=12, scale=3)
+ public String getStringPropertyWithColumnAnnotation() {
+ return stringPropertyWithColumnAnnotation;
+ }
+
+ public void setStringPropertyWithColumnAnnotation(final String stringPropertyWithColumnAnnotation) {
+ this.stringPropertyWithColumnAnnotation = stringPropertyWithColumnAnnotation;
+ }
+
+ // //////////////////////////////////////
+
+ private BigDecimal bigDecimalPropertyWithoutColumnAnnotation;
+
+ public BigDecimal getBigDecimalPropertyWithoutColumnAnnotation() {
+ return bigDecimalPropertyWithoutColumnAnnotation;
+ }
+
+ public void setBigDecimalPropertyWithoutColumnAnnotation(final BigDecimal bigDecimalPropertyWithoutColumnAnnotation) {
+ this.bigDecimalPropertyWithoutColumnAnnotation = bigDecimalPropertyWithoutColumnAnnotation;
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithColumnAllowsNullAnnotations.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithColumnAllowsNullAnnotations.java b/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithColumnAllowsNullAnnotations.java
new file mode 100644
index 0000000..2d89052
--- /dev/null
+++ b/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithColumnAllowsNullAnnotations.java
@@ -0,0 +1,101 @@
+/*
+ * 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.objectstore.jdo.metamodel.facets.prop.column;
+
+import javax.jdo.annotations.Column;
+
+
+public class SimpleObjectWithColumnAllowsNullAnnotations {
+
+
+ private int primitiveWithNoAnnotation;
+ public int getPrimitiveWithNoAnnotation() {
+ return primitiveWithNoAnnotation;
+ }
+ public void setPrimitiveWithNoAnnotation(int primitive) {
+ this.primitiveWithNoAnnotation = primitive;
+ }
+
+ private int primitiveWithNoAllowsNull;
+ @Column
+ public int getPrimitiveWithNoAllowsNull() {
+ return primitiveWithNoAllowsNull;
+ }
+ public void setPrimitiveWithNoAllowsNull(int primitive) {
+ this.primitiveWithNoAllowsNull = primitive;
+ }
+
+ private int primitiveWithAllowsNullFalse;
+ @Column(allowsNull="false")
+ public int getPrimitiveWithAllowsNullFalse() {
+ return primitiveWithAllowsNullFalse;
+ }
+ public void setPrimitiveWithAllowsNullFalse(int primitive) {
+ this.primitiveWithAllowsNullFalse = primitive;
+ }
+
+
+ private int primitiveWithAllowsNullTrue;
+ @Column(allowsNull="true")
+ public int getPrimitiveWithAllowsNullTrue() {
+ return primitiveWithAllowsNullTrue;
+ }
+ public void setPrimitiveWithAllowsNullTrue(int primitive) {
+ this.primitiveWithAllowsNullTrue = primitive;
+ }
+
+
+ private String referenceWithNoAnnotation;
+ public String getReferenceWithNoAnnotation() {
+ return referenceWithNoAnnotation;
+ }
+ public void setReferenceWithNoAnnotation(String reference) {
+ this.referenceWithNoAnnotation = reference;
+ }
+
+ private String referenceWithNoAllowsNull;
+ @Column
+ public String getReferenceWithNoAllowsNull() {
+ return referenceWithNoAllowsNull;
+ }
+ public void setReferenceWithNoAllowsNull(String reference) {
+ this.referenceWithNoAllowsNull = reference;
+ }
+
+ private String referenceWithAllowsNullFalse;
+ @Column(allowsNull="false")
+ public String getReferenceWithAllowsNullFalse() {
+ return referenceWithAllowsNullFalse;
+ }
+ public void setReferenceWithAllowsNullFalse(String referenceWithAllowsNullFalse) {
+ this.referenceWithAllowsNullFalse = referenceWithAllowsNullFalse;
+ }
+
+
+ private String referenceWithAllowsNullTrue;
+ @Column(allowsNull="true")
+ public String getReferenceWithAllowsNullTrue() {
+ return referenceWithAllowsNullTrue;
+ }
+ public void setReferenceWithAllowsNullTrue(String referenceWithAllowsNullTrue) {
+ this.referenceWithAllowsNullTrue = referenceWithAllowsNullTrue;
+ }
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithColumnAnnotations.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithColumnAnnotations.java b/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithColumnAnnotations.java
deleted file mode 100644
index 7949f38..0000000
--- a/component/objectstore/jdo/jdo-metamodel/src/test/java/org/apache/isis/objectstore/jdo/metamodel/facets/prop/column/SimpleObjectWithColumnAnnotations.java
+++ /dev/null
@@ -1,98 +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.objectstore.jdo.metamodel.facets.prop.column;
-
-import java.math.BigDecimal;
-
-import javax.jdo.annotations.Column;
-
-import org.apache.isis.applib.annotation.MemberOrder;
-
-
-public class SimpleObjectWithColumnAnnotations {
-
- // {{ BigDecimalPropertyWithColumnAnnotation (property)
- private BigDecimal bigDecimalPropertyWithColumnAnnotation;
-
- @Column(length=12,scale=3)
- public BigDecimal getBigDecimalPropertyWithColumnAnnotation() {
- return bigDecimalPropertyWithColumnAnnotation;
- }
-
- public void setBigDecimalPropertyWithColumnAnnotation(final BigDecimal val) {
- this.bigDecimalPropertyWithColumnAnnotation = val;
- }
- // }}
-
- // {{ BigDecimalPropertyWithColumnAnnotation (property)
- private BigDecimal bigDecimalPropertyWithColumnAnnotationMissingLength;
-
- @Column(scale=3)
- public BigDecimal getBigDecimalPropertyWithColumnAnnotationMissingLength() {
- return bigDecimalPropertyWithColumnAnnotationMissingLength;
- }
-
- public void setBigDecimalPropertyWithColumnAnnotationMissingLength(final BigDecimal val) {
- this.bigDecimalPropertyWithColumnAnnotationMissingLength = val;
- }
- // }}
-
- // {{ BigDecimalPropertyWithColumnAnnotationMissingScale (property)
- private BigDecimal bigDecimalPropertyWithColumnAnnotationMissingScale;
-
- @Column(length=12)
- public BigDecimal getBigDecimalPropertyWithColumnAnnotationMissingScale() {
- return bigDecimalPropertyWithColumnAnnotationMissingScale;
- }
-
- public void setBigDecimalPropertyWithColumnAnnotationMissingScale(final BigDecimal val) {
- this.bigDecimalPropertyWithColumnAnnotationMissingScale = val;
- }
- // }}
-
- // {{ StringPropertyWithColumnAnnotation (property)
- private String stringPropertyWithColumnAnnotation;
-
- @Column(length=12, scale=3)
- public String getStringPropertyWithColumnAnnotation() {
- return stringPropertyWithColumnAnnotation;
- }
-
- public void setStringPropertyWithColumnAnnotation(final String stringPropertyWithColumnAnnotation) {
- this.stringPropertyWithColumnAnnotation = stringPropertyWithColumnAnnotation;
- }
- // }}
-
- // {{ BigDecimalPropertyWithoutColumnAnnotation (property)
- private BigDecimal bigDecimalPropertyWithoutColumnAnnotation;
-
- public BigDecimal getBigDecimalPropertyWithoutColumnAnnotation() {
- return bigDecimalPropertyWithoutColumnAnnotation;
- }
-
- public void setBigDecimalPropertyWithoutColumnAnnotation(final BigDecimal bigDecimalPropertyWithoutColumnAnnotation) {
- this.bigDecimalPropertyWithoutColumnAnnotation = bigDecimalPropertyWithoutColumnAnnotation;
- }
- // }}
-
-
-
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/applib/src/main/java/org/apache/isis/applib/annotation/Mandatory.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Mandatory.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Mandatory.java
new file mode 100644
index 0000000..3d701a2
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Mandatory.java
@@ -0,0 +1,54 @@
+/*
+ * 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;
+
+/**
+ * Indicates that a property is mandatory.
+ *
+ * <p>
+ * Isis' default is that properties are mandatory unless otherwise
+ * annotated as optional, most typically indicated using the {@link Optional} annotation.
+ *
+ * <p>
+ * However, if using the JDO/DataNucleus objectstore, it is sometimes necessary
+ * to annotate a property as optional (using <tt>javax.jdo.annotations.Column(allowNulls="true")</tt>)
+ * even if the property is logically mandatory. For example, this can occur when
+ * the property is in a subtype class that has been "rolled up" to the superclass
+ * table using <tt>@javax.jdo.annotations.Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE)</tt>.
+ *
+ * <p>
+ * This annotation, therefore, is intended to override any objectstore-specific
+ * annotation, so that Isis can apply the constraint even though the objectstore
+ * is unable to do so.
+ *
+ * @see Optional
+ */
+@Inherited
+@Target({ ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Mandatory {
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java
index c13c29c..6abeead 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Optional.java
@@ -27,6 +27,17 @@ import java.lang.annotation.Target;
/**
* Indicates that a property or parameter is not mandatory.
+ *
+ * <p>
+ * Isis' default is that properties/parameters are mandatory unless otherwise
+ * annotated as optional; this is most typically done using this annotation.
+ *
+ * <p>
+ * Note that there is another related annotation, {@link Mandatory}, which can be
+ * used to force a property or parameter as being mandatory. This is only
+ * rarely required; see the {@link Mandatory} annotation javadoc for further discussion.
+ *
+ * @see Mandatory
*/
@Inherited
@Target({ ElementType.METHOD, ElementType.PARAMETER })
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetAbstract.java
index ab6f09b..90e2fe4 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetAbstract.java
@@ -87,7 +87,9 @@ public abstract class FacetAbstract implements Facet {
@Override
public void setUnderlyingFacet(final Facet underlyingFacet) {
- Ensure.ensureThatArg(underlyingFacet.facetType(), IsisMatchers.classEqualTo(facetType));
+ if(underlyingFacet != null) {
+ Ensure.ensureThatArg(underlyingFacet.facetType(), IsisMatchers.classEqualTo(facetType));
+ }
this.underlyingFacet = underlyingFacet;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetAbstract.java
index 5da491b..36dd206 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetAbstract.java
@@ -20,6 +20,7 @@
package org.apache.isis.core.metamodel.facets.mandatory;
import org.apache.isis.applib.events.ValidityEvent;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facetapi.Facet;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
@@ -27,15 +28,51 @@ import org.apache.isis.core.metamodel.interactions.ActionArgumentContext;
import org.apache.isis.core.metamodel.interactions.PropertyModifyContext;
import org.apache.isis.core.metamodel.interactions.ProposedHolder;
import org.apache.isis.core.metamodel.interactions.ValidityContext;
+import org.apache.isis.core.metamodel.spec.ObjectAdapterUtils;
public abstract class MandatoryFacetAbstract extends MarkerFacetAbstract implements MandatoryFacet {
public static Class<? extends Facet> type() {
return MandatoryFacet.class;
}
+
+ public enum Semantics {
+ REQUIRED,
+ OPTIONAL;
- public MandatoryFacetAbstract(final FacetHolder holder) {
+ public static Semantics of(boolean required) {
+ return required ? REQUIRED: OPTIONAL;
+ }
+ }
+
+ private Semantics semantics;
+
+ public MandatoryFacetAbstract(final FacetHolder holder, final Semantics semantics) {
super(type(), holder);
+ this.semantics = semantics;
+ }
+
+ /**
+ * If not specified or, if a string, then zero length.
+ */
+ @Override
+ public final boolean isRequiredButNull(final ObjectAdapter adapter) {
+ if(!isInvertedSemantics()) {
+ final Object object = ObjectAdapterUtils.unwrapObject(adapter);
+ if (object == null) {
+ return true;
+ }
+ // special case string handling.
+ final String str = ObjectAdapterUtils.unwrapObjectAsString(adapter);
+ return str != null && str.length() == 0;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean isInvertedSemantics() {
+ return this.semantics == Semantics.OPTIONAL;
}
@Override
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetDefault.java
index 30c8b3f..b72eb18 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/mandatory/MandatoryFacetDefault.java
@@ -19,9 +19,7 @@
package org.apache.isis.core.metamodel.facets.mandatory;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.spec.ObjectAdapterUtils;
/**
* Whether a property or a parameter is mandatory (not optional).
@@ -38,26 +36,8 @@ import org.apache.isis.core.metamodel.spec.ObjectAdapterUtils;
public class MandatoryFacetDefault extends MandatoryFacetAbstract {
public MandatoryFacetDefault(final FacetHolder holder) {
- super(holder);
+ super(holder, Semantics.REQUIRED);
}
- /**
- * If not specified or, if a string, then zero length.
- */
- @Override
- public boolean isRequiredButNull(final ObjectAdapter adapter) {
- final Object object = ObjectAdapterUtils.unwrapObject(adapter);
- if (object == null) {
- return true;
- }
- // special case string handling.
- final String str = ObjectAdapterUtils.unwrapObjectAsString(adapter);
- return str != null && str.length() == 0;
- }
-
- @Override
- public boolean isInvertedSemantics() {
- return false;
- }
}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/MandatoryFacetInvertedByOptionalForParameter.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/MandatoryFacetInvertedByOptionalForParameter.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/MandatoryFacetInvertedByOptionalForParameter.java
index 21ff14f..40919e3 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/MandatoryFacetInvertedByOptionalForParameter.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/MandatoryFacetInvertedByOptionalForParameter.java
@@ -19,9 +19,9 @@
package org.apache.isis.core.progmodel.facets.param.mandatory.annotation;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract.Semantics;
/**
* Derived by presence of an <tt>@Optional</tt> method.
@@ -33,21 +33,8 @@ import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
public class MandatoryFacetInvertedByOptionalForParameter extends MandatoryFacetAbstract {
public MandatoryFacetInvertedByOptionalForParameter(final FacetHolder holder) {
- super(holder);
+ super(holder, Semantics.OPTIONAL);
}
- /**
- * Always returns <tt>false</tt>, indicating that the facet holder is in
- * fact optional.
- */
- @Override
- public boolean isRequiredButNull(final ObjectAdapter adapter) {
- return false;
- }
-
- @Override
- public boolean isInvertedSemantics() {
- return true;
- }
}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForParameter.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForParameter.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForParameter.java
index 1c7231f..da490f7 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForParameter.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForParameter.java
@@ -19,7 +19,6 @@
package org.apache.isis.core.progmodel.facets.param.mandatory.staticmethod;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
@@ -33,21 +32,7 @@ import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
public class MandatoryFacetOptionalViaMethodForParameter extends MandatoryFacetAbstract {
public MandatoryFacetOptionalViaMethodForParameter(final FacetHolder holder) {
- super(holder);
- }
-
- /**
- * Always returns <tt>false</tt>, indicating that the facet holder is in
- * fact optional.
- */
- @Override
- public boolean isRequiredButNull(final ObjectAdapter adapter) {
- return false;
- }
-
- @Override
- public boolean isInvertedSemantics() {
- return true;
+ super(holder, Semantics.OPTIONAL);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryAnnotationForPropertyFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryAnnotationForPropertyFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryAnnotationForPropertyFacetFactory.java
new file mode 100644
index 0000000..191b02f
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryAnnotationForPropertyFacetFactory.java
@@ -0,0 +1,49 @@
+/*
+ * 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.properties.mandatory.annotation;
+
+import org.apache.isis.applib.annotation.Mandatory;
+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.mandatory.MandatoryFacet;
+
+public class MandatoryAnnotationForPropertyFacetFactory extends FacetFactoryAbstract {
+
+ public MandatoryAnnotationForPropertyFacetFactory() {
+ super(FeatureType.PROPERTIES_ONLY);
+ }
+
+ @Override
+ public void process(final ProcessMethodContext processMethodContext) {
+ if (!Annotations.isAnnotationPresent(processMethodContext.getMethod(), Mandatory.class)) {
+ return;
+ }
+ final Mandatory annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Mandatory.class);
+ FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+ }
+
+ private MandatoryFacet create(final Mandatory annotation, final FacetHolder holder) {
+ return annotation != null ? new MandatoryFacetExplicitForProperty(holder) : null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryFacetExplicitForProperty.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryFacetExplicitForProperty.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryFacetExplicitForProperty.java
new file mode 100644
index 0000000..a633981
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryFacetExplicitForProperty.java
@@ -0,0 +1,37 @@
+/*
+ * 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.properties.mandatory.annotation;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
+
+/**
+ * Derived by presence of an <tt>@Mandatory</tt> annotation.
+ *
+ * <p>
+ * This implementation indicates that the {@link FacetHolder} <i>is</i>
+ * mandatory.
+ */
+public class MandatoryFacetExplicitForProperty extends MandatoryFacetAbstract {
+
+ public MandatoryFacetExplicitForProperty(final FacetHolder holder) {
+ super(holder, Semantics.REQUIRED);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryFacetInvertedByOptionalForProperty.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryFacetInvertedByOptionalForProperty.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryFacetInvertedByOptionalForProperty.java
index 371b3e5..6d87bbd 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryFacetInvertedByOptionalForProperty.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/annotation/MandatoryFacetInvertedByOptionalForProperty.java
@@ -19,12 +19,11 @@
package org.apache.isis.core.progmodel.facets.properties.mandatory.annotation;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
/**
- * Derived by presence of an <tt>@Optional</tt> method.
+ * Derived by presence of an <tt>@Optional</tt> annotation.
*
* <p>
* This implementation indicates that the {@link FacetHolder} is <i>not</i>
@@ -33,21 +32,6 @@ import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
public class MandatoryFacetInvertedByOptionalForProperty extends MandatoryFacetAbstract {
public MandatoryFacetInvertedByOptionalForProperty(final FacetHolder holder) {
- super(holder);
+ super(holder, Semantics.OPTIONAL);
}
-
- /**
- * Always returns <tt>false</tt>, indicating that the facet holder is in
- * fact optional.
- */
- @Override
- public boolean isRequiredButNull(final ObjectAdapter adapter) {
- return false;
- }
-
- @Override
- public boolean isInvertedSemantics() {
- return true;
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForProperty.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForProperty.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForProperty.java
index 9159f94..95adcfd 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForProperty.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForProperty.java
@@ -19,7 +19,6 @@
package org.apache.isis.core.progmodel.facets.properties.mandatory.staticmethod;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
@@ -33,21 +32,6 @@ import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
public class MandatoryFacetOptionalViaMethodForProperty extends MandatoryFacetAbstract {
public MandatoryFacetOptionalViaMethodForProperty(final FacetHolder holder) {
- super(holder);
+ super(holder, Semantics.OPTIONAL);
}
-
- /**
- * Always returns <tt>false</tt>, indicating that the facet holder is in
- * fact optional.
- */
- @Override
- public boolean isRequiredButNull(final ObjectAdapter adapter) {
- return false;
- }
-
- @Override
- public boolean isInvertedSemantics() {
- return true;
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
index ffd3eb0..543f9a7 100644
--- a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
+++ b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
@@ -154,6 +154,7 @@ import org.apache.isis.core.progmodel.facets.properties.defaults.fromtype.Proper
import org.apache.isis.core.progmodel.facets.properties.defaults.method.PropertyDefaultFacetFactory;
import org.apache.isis.core.progmodel.facets.properties.disabled.fromimmutable.DisabledFacetForPropertyDerivedFromImmutableTypeFacetFactory;
import org.apache.isis.core.progmodel.facets.properties.event.PostsPropertyChangedEventAnnotationFacetFactory;
+import org.apache.isis.core.progmodel.facets.properties.mandatory.annotation.MandatoryAnnotationForPropertyFacetFactory;
import org.apache.isis.core.progmodel.facets.properties.mandatory.annotation.OptionalAnnotationForPropertyFacetFactory;
import org.apache.isis.core.progmodel.facets.properties.mandatory.dflt.MandatoryDefaultForPropertiesFacetFactory;
import org.apache.isis.core.progmodel.facets.properties.mandatory.staticmethod.PropertyOptionalFacetFactory;
@@ -380,6 +381,7 @@ public final class ProgrammingModelFacetsJava5 extends ProgrammingModelAbstract
addFactory(OptionalAnnotationForPropertyFacetFactory.class);
addFactory(OptionalAnnotationForParameterFacetFactory.class);
+ addFactory(MandatoryAnnotationForPropertyFacetFactory.class);
addFactory(ParseableFacetFactory.class);
addFactory(PluralAnnotationFacetFactory.class);
http://git-wip-us.apache.org/repos/asf/isis/blob/f8ebd1bd/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/MandatoryAnnotationFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/MandatoryAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/MandatoryAnnotationFacetFactoryTest.java
new file mode 100644
index 0000000..9db30dd
--- /dev/null
+++ b/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mandatory/MandatoryAnnotationFacetFactoryTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.propparam.validate.mandatory;
+
+import java.lang.reflect.Method;
+
+import org.apache.isis.applib.annotation.Mandatory;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacet;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.properties.mandatory.annotation.MandatoryAnnotationForPropertyFacetFactory;
+import org.apache.isis.core.progmodel.facets.properties.mandatory.annotation.MandatoryFacetExplicitForProperty;
+
+public class MandatoryAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+ public void testMandatoryAnnotationPickedUpOnProperty() {
+ final MandatoryAnnotationForPropertyFacetFactory facetFactory = new MandatoryAnnotationForPropertyFacetFactory();
+
+ class Customer {
+ @Mandatory
+ public String getFirstName() {
+ return null;
+ }
+ }
+ final Method method = findMethod(Customer.class, "getFirstName");
+
+ facetFactory.process(new ProcessMethodContext(Customer.class, null, null, method, methodRemover, facetedMethod));
+
+ final Facet facet = facetedMethod.getFacet(MandatoryFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof MandatoryFacetExplicitForProperty);
+ }
+
+
+}