📄 msgreslist.java
字号:
/* * Copyright (C) butor.com. All rights reserved. * * This software is published under the terms of the GNU Library General * Public License (GNU LGPL), a copy of which has been included with this * distribution in the LICENSE.txt file. */package org.butor.messageResources.service;import java.util.HashMap;import java.util.Iterator;import java.util.Locale;import org.butor.bls.IOutputResponse;import org.butor.bls.IRequest;import org.butor.bls.Service;import org.butor.bls.ServiceException;import org.butor.dataStruct.Message;import org.butor.messageResources.MessageResourcesService;import org.butor.messageResources.service.bean.MsgResListParam;import org.butor.messageResources.service.bean.MsgResListResult;/** * TODO * * @author sawanai * Jul 5, 2004 */public class MsgResList extends Service { /** * */ public MsgResList(String appName) { super(MsgResListParam.RPC_NAME +"-" +appName.toLowerCase()); } public String getDescription() { return "Message Resources list proclet."; } /** * ParamBean class * @see org.butor.bls.IService#getParamBeanClass() */ public Class getServiceParamBeanClass() { return MsgResListParam.class; } public IOutputResponse execute(IRequest request) throws ServiceException { IOutputResponse response = request.createResponse(); int stat = 0; response.startDataSet(MsgResListResult.class); //TODO to cause loading of english resources MessageResourcesService.getMessage(Locale.ENGLISH, "hey"); HashMap map = MessageResourcesService.getMessageResources(); if (map == null) { stat = 1000; response.addMessage(new Message(stat, Message.WARNING, "Message Resources is empty!")); } else { response.startDataSet(MsgResListResult.class); synchronized (map) { Iterator it = map.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); String value = (String) map.get(key); MsgResListResult record = new MsgResListResult(); record.setKey(key); record.setValue(value); response.addRecord(record); } } response.endDataSet(); } response.endResponse(stat); return response; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -