:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or 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.

== Mixin actions

A number of mixin actions contribute through the `JodaLocalDateHolder` interface, demonstrate the use of `joda.time.LocalDate` as a parameter and as a return type.
For example:

* the `updateReadOnlyProperty` action is:
+
[source,java]
----
include::holder/JodaLocalDateHolder_updateReadOnlyProperty.java[tags=class]
----

* the `updateReadOnlyOptionalProperty` action is:
+
[source,java]
----
include::holder/JodaLocalDateHolder_updateReadOnlyOptionalProperty.java[tags=class]
----

* the `actionReturning` action is:
+
[source,java]
----
include::holder/JodaLocalDateHolder_actionReturning.java[tags=class]
----


* the `actionReturningCollection` action is:
+
[source,java]
----
include::holder/JodaLocalDateHolder_actionReturningCollection.java[tags=class]
----

== Mixin properties

We also use the interface to contribute a mixin property:

* the `mixinProperty` property:
+
[source,java]
----
include::holder/JodaLocalDateHolder_mixinProperty.java[tags=class]
----


== @PropertyLayout(labelPosition=...)

To demonstrate support for label positions using `@PropertyLayout(labelPosition=...)`, the entity and view model objects both implement the extended `JodaLocalDateHolder2` interface:

[source,java]
----
include::holder/JodaLocalDateHolder2.java[tags=class]
----

<.> The default methods have annotations that are automatically inherited.
<.> Position to the left
<.> Using `@PropertyLayout(fieldSetId=...)` positions the properties into the appropriate `<field-set>` within the `Xxx.layout.xml` layout file.
<.> Position label on top
<.> Position label to the right
+
CAUTION: currently not supported
<.> Hide the label completely.


== @PropertyLayout(renderDay=...)

To demonstrate support for `@PropertyLayout(renderDay=...)` -- to simplify the modelling "[inclusive, exclusive)" date ranges -- the entity and view model objects both implement the extended `JodaLocalDateHolder3` interface.
All methods have a default implementation:

[source,java]
----
include::holder/JodaLocalDateHolder3.java[tags=class]
----

<.> Render the value as the day before
<.> Render the value unchanged
<.> Render the value as the day before

