Skip to content

Commit 36fada6

Browse files
author
xingwanxiang
committed
add chinese DownloadFileNameEncoder
1 parent deb9c35 commit 36fada6

File tree

14 files changed

+1054
-465
lines changed

14 files changed

+1054
-465
lines changed

jmesa/pom.xml

Lines changed: 449 additions & 0 deletions
Large diffs are not rendered by default.

jmesa/src/org/jmesa/core/CoreContextFactory.java

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
* @author Jeff Johnston
4444
*/
4545
public class CoreContextFactory {
46-
46+
4747
private final static String COLUMN_SORT = "columnSort";
4848
private final static String ROW_FILTER = "rowFilter";
4949
private final static String FILTER_MATCHER_MAP = "filterMatcherMap";
50-
50+
5151
private WebContext webContext;
5252
private FilterMatcherRegistry registry;
5353
private RowFilter rowFilter;
@@ -68,19 +68,19 @@ public class CoreContextFactory {
6868
* @param webContext The WebContext for the table.
6969
*/
7070
public CoreContextFactory(boolean autoFilterAndSort, WebContext webContext) {
71-
71+
7272
this.autoFilterAndSort = autoFilterAndSort;
7373
this.webContext = webContext;
7474
}
7575

7676
protected FilterMatcherRegistry getFilterMatcherRegistry() {
77-
78-
if (registry == null) {
77+
78+
if (registry == null) {
7979
registry = new FilterMatcherRegistry();
80-
80+
8181
FilterMatcherMap filterMatcherMap = PreferencesUtils.<FilterMatcherMap>createClassFromPreferences(getPreferences(), FILTER_MATCHER_MAP);
8282
Map<MatcherKey, FilterMatcher> filterMatchersMap = filterMatcherMap.getFilterMatchers();
83-
83+
8484
for (Map.Entry<MatcherKey, FilterMatcher> entry : filterMatchersMap.entrySet()) {
8585
registry.addFilterMatcher(entry.getKey(), entry.getValue());
8686
}
@@ -96,13 +96,13 @@ protected FilterMatcherRegistry getFilterMatcherRegistry() {
9696
* @param matcher The FilterMatcher instance.
9797
*/
9898
public void addFilterMatcher(MatcherKey key, FilterMatcher matcher) {
99-
99+
100100
SupportUtils.setWebContext(matcher, webContext);
101101
getFilterMatcherRegistry().addFilterMatcher(key, matcher);
102102
}
103103

104104
protected RowFilter getRowFilter() {
105-
105+
106106
if (rowFilter == null) {
107107
rowFilter = PreferencesUtils.<RowFilter>createClassFromPreferences(getPreferences(), ROW_FILTER);
108108
}
@@ -117,12 +117,12 @@ protected RowFilter getRowFilter() {
117117
* @param rowFilter The RowFilter instance.
118118
*/
119119
public void setRowFilter(RowFilter rowFilter) {
120-
120+
121121
this.rowFilter = rowFilter;
122122
}
123123

124124
protected ColumnSort getColumnSort() {
125-
125+
126126
if (columnSort == null) {
127127
columnSort = PreferencesUtils.<ColumnSort>createClassFromPreferences(getPreferences(), COLUMN_SORT);
128128
}
@@ -136,12 +136,12 @@ protected ColumnSort getColumnSort() {
136136
* @param columnSort The ColumnSort instance.
137137
*/
138138
public void setColumnSort(ColumnSort columnSort) {
139-
139+
140140
this.columnSort = columnSort;
141141
}
142142

143143
protected Preferences getPreferences() {
144-
144+
145145
if (preferences == null) {
146146
preferences = PreferencesFactory.getPreferences(webContext);
147147
}
@@ -155,12 +155,12 @@ protected Preferences getPreferences() {
155155
* @param preferences The Preferences instance.
156156
*/
157157
public void setPreferences(Preferences preferences) {
158-
158+
159159
this.preferences = preferences;
160160
}
161161

162162
protected Messages getMessages() {
163-
163+
164164
if (messages == null) {
165165
messages = MessagesFactory.getMessages(webContext);
166166
}
@@ -174,7 +174,7 @@ protected Messages getMessages() {
174174
* @param messages The Messages instance.
175175
*/
176176
public void setMessages(Messages messages) {
177-
177+
178178
this.messages = messages;
179179
}
180180

@@ -183,10 +183,11 @@ public void setMessages(Messages messages) {
183183
*
184184
* @param items The Collection of Beans or Maps.
185185
* @param limit The Limit instance.
186+
* @param worksheet excel worksheet
186187
* @return The newly created CoreContext object.
187188
*/
188189
public CoreContext createCoreContext(Collection<?> items, Limit limit, Worksheet worksheet) {
189-
190+
190191
Items itemsImpl;
191192

192193
if (autoFilterAndSort) {

jmesa/src/org/jmesa/core/message/Messages.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@
2222
* @author Jeff Johnston
2323
*/
2424
public interface Messages extends Serializable {
25-
25+
2626
/**
2727
* Get the resource property.
28+
* @param code code
29+
* @return message
2830
*/
2931
public String getMessage(String code);
3032

3133
/**
3234
* Get the resource property.
35+
* @param args other args
36+
* @param code code
37+
* @return message
3338
*/
3439
public String getMessage(String code, Object[] args);
3540
}

jmesa/src/org/jmesa/core/message/MessagesFactory.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,23 @@
1919

2020
/**
2121
* A factory to create different Messages.
22-
*
22+
*
2323
* @since 2.3
2424
* @author Jeff Johnston
2525
*/
2626
public class MessagesFactory {
27-
27+
2828
private static final String JMESA_MESSAGES_LOCATION = "jmesaMessagesLocation";
2929

3030
private MessagesFactory() {}
3131

3232
/**
33+
* @param webContext web context
34+
*
3335
* @return The default messages.
3436
*/
3537
public static Messages getMessages(WebContext webContext) {
36-
38+
3739
String jmesaMessagesLocation = (String) webContext.getApplicationInitParameter(JMESA_MESSAGES_LOCATION);
3840
return new ResourceBundleMessages(jmesaMessagesLocation, webContext);
3941
}

0 commit comments

Comments
 (0)