Skip to content

Commit

Permalink
小改进:注解和toString方法
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Zhou committed Jun 5, 2012
1 parent 36e17c9 commit a3ad509
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ private FormParameter parseParameterKey(String paramKey) {
String fieldKey = toLowerCase(parts[3]);
String additionalInfo = parts.length > 4 ? parts[4] : null;

// 取得规格化的group/field key,即压缩格式
// 取得规格化的group/field key,即:
// 如果fieldKeyFormat=compressed,则为压缩格式;
// 如果fieldKeyFormat=uncompressed,则为非压缩格式;
// 如果group或field不存在,则暂且保持key原值,后面会报警告。
GroupConfig groupConfig = getFormConfig().getGroupConfigByKey(groupKey);

if (groupConfig != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import javax.servlet.http.HttpServletRequest;

import com.alibaba.citrus.service.requestcontext.parser.ParserRequestContext;
import com.alibaba.citrus.util.ToStringBuilder;

final class FormParameters {
private final Map<String, FormParameter> params = createHashMap();
private final Map<String, FormParameter> params = createLinkedHashMap();
private final HttpServletRequest request;
private final ParserRequestContext prc;

Expand Down Expand Up @@ -53,6 +54,11 @@ public String getStringValue(String normalizedKey) {
}
}

@Override
public String toString() {
return new ToStringBuilder().append("FormParameters").append(params.values()).toString();
}

/**
* 代表一个表单参数的信息。
*/
Expand All @@ -73,5 +79,10 @@ final static class FormParameter {
this.originalKey = originalKey;
this.normalizedKey = normalizedKey;
}

@Override
public String toString() {
return normalizedKey;
}
}
}

0 comments on commit a3ad509

Please sign in to comment.