1
14
15 package com.liferay.portal.servlet.taglib.aui;
16
17 import com.liferay.portal.kernel.util.StringBundler;
18 import com.liferay.portal.kernel.util.StringUtil;
19 import com.liferay.portal.kernel.util.Validator;
20
21 import java.util.Set;
22 import java.util.TreeSet;
23
24
29 public class ScriptData {
30
31 public void append(String content, String use) {
32 if (Validator.isNull(use)) {
33 _rawSB.append(content);
34 }
35 else {
36 _callbackSB.append("(function() {" + content + "})();");
37
38 String[] useArray = StringUtil.split(use);
39
40 for (int i = 0; i < useArray.length; i++) {
41 _useSet.add(useArray[i]);
42 }
43 }
44 }
45
46 public StringBundler getCallbackSB() {
47 return _callbackSB;
48 }
49
50 public StringBundler getRawSB() {
51 return _rawSB;
52 }
53
54 public Set<String> getUseSet() {
55 return _useSet;
56 }
57
58 private StringBundler _callbackSB = new StringBundler();
59 private StringBundler _rawSB = new StringBundler();
60 private Set<String> _useSet = new TreeSet<String>();
61
62 }