SLING-5825 - Add support for implicit conversion of Enum to String

git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1751880 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/resources/SLING-INF/apps/sightly/scripts/use/TestEnumHolder.java b/src/main/resources/SLING-INF/apps/sightly/scripts/use/TestEnumHolder.java
new file mode 100644
index 0000000..5950edd
--- /dev/null
+++ b/src/main/resources/SLING-INF/apps/sightly/scripts/use/TestEnumHolder.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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 apps.sightly.scripts.use;
+
+public class TestEnumHolder {
+
+    enum TestEnum {
+        ENUM_CONSTANT;
+    }
+
+    public TestEnum getConstantValue() {
+        return TestEnum.ENUM_CONSTANT;
+    }
+
+}
diff --git a/src/main/resources/SLING-INF/apps/sightly/scripts/use/use.html b/src/main/resources/SLING-INF/apps/sightly/scripts/use/use.html
index 6882ef8..3bd39b9 100644
--- a/src/main/resources/SLING-INF/apps/sightly/scripts/use/use.html
+++ b/src/main/resources/SLING-INF/apps/sightly/scripts/use/use.html
@@ -21,16 +21,20 @@
     <head>
         <title>Sightly Use-API - Sling implementation</title>
     </head>
-    <body>
-        <div id="reqmodel" data-sly-use.reqmodel="${'org.apache.sling.scripting.sightly.testing.models.RequestModel' @
-            argument='SUCCESS'}">${reqmodel.title}</div>
+    <body data-sly-use.reqmodel="${'org.apache.sling.scripting.sightly.testing.models.RequestModel' @ argument='SUCCESS'}"
+          data-sly-use.resmodel="org.apache.sling.scripting.sightly.testing.models.ResourceModel"
+          data-sly-use.reqadapt="org.apache.sling.scripting.sightly.testing.adaptable.RequestAdapterUseObject"
+          data-sly-use.resadapt="org.apache.sling.scripting.sightly.testing.adaptable.ResourceAdapterUseObject"
+          data-sly-use.osgi="org.apache.sling.scripting.sightly.testing.use.TestService"
+          data-sly-use.repoNoPkg="RepoPojoNoPkg"
+          data-sly-use.testEnum="TestEnumHolder">
+        <div id="reqmodel">${reqmodel.title}</div>
         <div id="reqmodel-reqarg">${reqmodel.requestArgument}</div>
-        <div id="resmodel" data-sly-use.resmodel="org.apache.sling.scripting.sightly.testing.models.ResourceModel">${resmodel.title}</div>
-        <div id="reqadapt"
-             data-sly-use.reqadapt="org.apache.sling.scripting.sightly.testing.adaptable.RequestAdapterUseObject">${reqadapt.title}</div>
-        <div id="resadapt"
-             data-sly-use.resadapt="org.apache.sling.scripting.sightly.testing.adaptable.ResourceAdapterUseObject">${resadapt.title}</div>
-        <div id="osgi" data-sly-use.osgi="org.apache.sling.scripting.sightly.testing.use.TestService">${osgi.sayHello}</div>
-        <div id="repopojo-nopkg" data-sly-use.repoNoPkg="RepoPojoNoPkg">${repoNoPkg.FIELD}</div>
+        <div id="resmodel">${resmodel.title}</div>
+        <div id="reqadapt">${reqadapt.title}</div>
+        <div id="resadapt">${resadapt.title}</div>
+        <div id="osgi">${osgi.sayHello}</div>
+        <div id="repopojo-nopkg">${repoNoPkg.FIELD}</div>
+        <div id="test-enum">${testEnum.constantValue}</div>
     </body>
 </html>