Author: nbelaevski
Date: 2009-07-13 08:26:43 -0400 (Mon, 13 Jul 2009)
New Revision: 14910
Modified:
branches/community/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java
Log:
framework/api: added EMPTY_HASH and EMPTY_LIST constants to JSLiteral
Modified:
branches/community/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java
===================================================================
---
branches/community/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java 2009-07-13
11:01:29 UTC (rev 14909)
+++
branches/community/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java 2009-07-13
12:26:43 UTC (rev 14910)
@@ -31,7 +31,22 @@
/** 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
*/