Author: nbelaevski
Date: 2009-07-12 18:33:31 -0400 (Sun, 12 Jul 2009)
New Revision: 14900
Modified:
framework/trunk/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java
Log:
framework/api: added EMPTY_HASH and EMPTY_LIST constants to JSLiteral
Modified: framework/trunk/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java
===================================================================
--- framework/trunk/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java 2009-07-10
18:15:12 UTC (rev 14899)
+++ framework/trunk/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java 2009-07-12
22:33:31 UTC (rev 14900)
@@ -30,8 +30,23 @@
/** Javascript literal text */
private String literal;
+
+ private static final class ImmutableJSLiteral extends JSLiteral {
+
+ public ImmutableJSLiteral(String literal) {
+ super(literal);
+ }
+
+ @Override
+ public void setLiteral(String literal) {
+ throw new UnsupportedOperationException();
+ }
+ };
+ public static final JSLiteral EMPTY_HASH = new ImmutableJSLiteral("{}");
+ public static final JSLiteral EMPTY_LIST = new ImmutableJSLiteral("[]");
+
/**
* Default constructor
*/
Show replies by date