src/java/de/uapcore/lightpit/LightPITModule.java

changeset 11
737ab27e37b3
parent 10
89e3e6e28b69
child 18
a94b172c3a93
--- a/src/java/de/uapcore/lightpit/LightPITModule.java	Sat Dec 16 20:19:28 2017 +0100
+++ b/src/java/de/uapcore/lightpit/LightPITModule.java	Sun Dec 17 01:45:28 2017 +0100
@@ -71,7 +71,60 @@
     
     /**
      * Returns the properties key for the menu label.
-     * @return the properties key relative to the base name
+     * @return the properties key
      */
     String menuKey() default "menuLabel";
+    
+    /**
+     * Returns the properties key for the page title.
+     * 
+     * By default this is the same as the menu label.
+     * 
+     * @return the properties key
+     */
+    String titleKey() default "menuLabel";
+    
+    /**
+     * Class representing the annotation.
+     * This is necessary, because the EL resolver cannot deal with
+     * annotation objects.
+     * 
+     * Note, that only the properties which are interesting for the JSP pages
+     * are proxied by this object.
+     */
+    public static class ELProxy {
+        private final String bundleBaseName, modulePath, menuKey, titleKey;
+        
+        public static ELProxy convert(LightPITModule annotation) {
+            return new ELProxy(
+                    annotation.bundleBaseName(),
+                    annotation.modulePath(),
+                    annotation.menuKey(),
+                    annotation.titleKey()
+            );
+        }
+
+        private ELProxy(String bundleBaseName, String modulePath, String menuKey, String titleKey) {
+            this.bundleBaseName = bundleBaseName;
+            this.modulePath = modulePath;
+            this.menuKey = menuKey;
+            this.titleKey = titleKey;
+        }
+
+        public String getBundleBaseName() {
+            return bundleBaseName;
+        }
+
+        public String getMenuKey() {
+            return menuKey;
+        }
+
+        public String getModulePath() {
+            return modulePath;
+        }
+
+        public String getTitleKey() {
+            return titleKey;
+        }
+    }
 }

mercurial