You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Olabusayo Kilo (Jira)" <ji...@apache.org> on 2026/07/15 14:46:00 UTC
[jira] [Assigned] (DAFFODIL-2983) Add new EnumValueSimple Trait for CalendarFirstDayOfWeek
[ https://issues.apache.org/jira/browse/DAFFODIL-2983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olabusayo Kilo reassigned DAFFODIL-2983:
----------------------------------------
Assignee: Olabusayo Kilo
> Add new EnumValueSimple Trait for CalendarFirstDayOfWeek
> --------------------------------------------------------
>
> Key: DAFFODIL-2983
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2983
> Project: Daffodil
> Issue Type: Improvement
> Components: Back End, Clean Ups
> Affects Versions: 3.10.0
> Reporter: Olabusayo Kilo
> Assignee: Olabusayo Kilo
> Priority: Minor
> Labels: beginner
> Fix For: 4.3.0
>
>
> In daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/Properties.scala, we have the code below
> {code:scala}
> + //
> + // Special case for CalendarFirstDayOfWeek
> + //
> + case "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" |
> + "Saturday" =>
> {code}
> The special case for CalendarFirstDayOfWeek feels a bit too specific for this generic trait. Maybe this is an exception that the property generator should do? Maybe EnumValue just becomes different variants of toString implementations for different kinds of enums, e.g.:
> {code:scala}
> trait EnumValue extends EnumValueBase {
> override def toString = {
> /* current implementation with initial lower case unlessall upper
> case, without calendar first day of week exception */
> }
> }
> trait EnumValueSimple extends EnumValueBase {
> override def toString = getNameFromClass(this)
> }
> {code}
> Most classes would just look like this to get the normal behavior:
> {code:scala}
> sealed trait SeparatorSuppressionPolicy extends EnumValue
> {code}
> But CalendarFirstDayOfWeek would look like this:
> {code:scala}
> sealed trait CalendarFirstDayOfWeek extends EnumValueSimple
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)