| 1 package com.protomatter.syslog.xml; 2 3 52 53 import java.io.*; 54 import java.net.*; 55 import java.util.*; 56 import java.text.*; 57 58 import com.protomatter.xml.*; 59 import com.protomatter.syslog.*; 60 import org.jdom.*; 61 62 65 public class SimpleSyslogMailSubjectFormatter_Helper 66 extends BasicLogger_Helper 67 { 68 132 public void configure(Object o, Element e) 133 throws SyslogInitException 134 { 135 super.configure(o, e); 136 SimpleSyslogMailSubjectFormatter format = (SimpleSyslogMailSubjectFormatter)o; 137 138 String tmp = e.getChildTextTrim("showCaller", e.getNamespace()); 139 if (tmp != null) 140 format.setShowCaller("true".equalsIgnoreCase(tmp)); 141 142 tmp = e.getChildTextTrim("showChannel", e.getNamespace()); 143 if (tmp != null) 144 format.setShowChannel("true".equalsIgnoreCase(tmp)); 145 146 tmp = e.getChildTextTrim("showThreadName", e.getNamespace()); 147 if (tmp != null) 148 format.setShowThreadName("true".equalsIgnoreCase(tmp)); 149 150 tmp = e.getChildTextTrim("showHostName", e.getNamespace()); 151 if (tmp != null) 152 format.setShowHostName("true".equalsIgnoreCase(tmp)); 153 } 154 155 public Element getConfiguration(Object o, Element element) 156 { 157 Element e = super.getConfiguration(o, element); 158 SimpleSyslogMailSubjectFormatter format = (SimpleSyslogMailSubjectFormatter)o; 159 160 element.getChildren().add((new Element("showCaller")). 161 setText(String.valueOf(format.getShowCaller()))); 162 element.getChildren().add((new Element("showChannel")). 163 setText(String.valueOf(format.getShowChannel()))); 164 element.getChildren().add((new Element("showThreadName")). 165 setText(String.valueOf(format.getShowThreadName()))); 166 element.getChildren().add((new Element("showHostName")). 167 setText(String.valueOf(format.getShowHostName()))); 168 return element; 169 } 170 } 171 | Popular Tags |