1 13 package com.tonbeller.wcf.convert; 14 15 import java.util.Locale ; 16 import java.util.ResourceBundle ; 17 18 import org.w3c.dom.Element ; 19 20 import com.tonbeller.wcf.format.FormatException; 21 22 23 26 public abstract class NodeConverterBase implements NodeConverter { 27 String elementName; 28 29 33 public String getElementName() { 34 return elementName; 35 } 36 37 41 public void setElementName(String elementName) { 42 this.elementName = elementName; 43 } 44 47 public void checkRequired(Locale locale, Element elem, boolean empty) { 48 if (!"true".equals(elem.getAttribute("required"))) 49 return; 50 if (empty) { 51 ResourceBundle rb = ResourceBundle.getBundle("com.tonbeller.wcf.convert.messages", locale); 52 throw new FormatException(rb.getString("wcf.input.required")); 53 } 54 } 55 56 } 57 | Popular Tags |