[
https://issues.apache.org/jira/browse/DAFFODIL-2983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Olabusayo Kilo updated DAFFODIL-2983:
-------------------------------------
Priority: Minor (was: Major)
> 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
> Priority: Minor
> Labels: beginner
>
> 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)