summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-12-15 22:10:23 +0200
committerMika Murtojarvi <mika@vaadin.com>2014-12-16 15:58:58 +0200
commit0de94d55c9c04aa93b66e6d6a83935d9ed25da5e (patch)
tree1decae8b19c0cd00ec18ee5daa79624a043f32c9 /server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java
parent6d96447d5d3d4c1f22c7d49478c1b10a62bf64e7 (diff)
downloadvaadin-framework-0de94d55c9c04aa93b66e6d6a83935d9ed25da5e.tar.gz
vaadin-framework-0de94d55c9c04aa93b66e6d6a83935d9ed25da5e.zip
Generic cleanup (#7749)
Change-Id: I274009ff733eeba6ac312324d0ba946f64d1a26a
Diffstat (limited to 'server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java')
-rw-r--r--server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java b/server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java
index 0a58fc549f..7b0c039e4a 100644
--- a/server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java
+++ b/server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java
@@ -718,4 +718,19 @@ public class DesignAttributeHandler implements Serializable {
}
}
+ /**
+ * Converts the given string attribute value to its corresponding boolean.
+ *
+ * An empty string is considered true (true when attribute exists),
+ * otherwise "false" and "true" are supported, all other input will throw an
+ * exception
+ *
+ * @param booleanValue
+ * the boolean value from an attribute
+ * @return the parsed boolean
+ */
+ public static boolean getBoolean(String booleanValue) {
+ return "".equals(booleanValue) ? true : Boolean.valueOf(booleanValue);
+ }
+
}