1 29 30 package nextapp.echo2.webrender.servermessage; 31 32 import org.w3c.dom.Document ; 33 import org.w3c.dom.Element ; 34 35 import nextapp.echo2.webrender.ClientProperties; 36 import nextapp.echo2.webrender.ServerMessage; 37 38 43 public class ClientPropertiesStore { 44 45 52 public static void renderStoreDirective(ServerMessage serverMessage, ClientProperties clientProperties) { 53 Document document = serverMessage.getDocument(); 54 Element messagePartElement = serverMessage.addPart(ServerMessage.GROUP_ID_INIT, "EchoClientProperties.MessageProcessor"); 55 Element storeElement = document.createElement("store"); 56 messagePartElement.appendChild(storeElement); 57 58 String [] propertyNames = clientProperties.getPropertyNames(); 59 for (int i = 0; i < propertyNames.length; ++i) { 60 Element propertyElement = document.createElement("property"); 61 storeElement.appendChild(propertyElement); 62 propertyElement.setAttribute("name", propertyNames[i]); 63 propertyElement.setAttribute("value", clientProperties.getString(propertyNames[i])); 64 } 65 } 66 67 68 private ClientPropertiesStore() { } 69 } 70 | Popular Tags |