1 31 32 package org.opencms.xml.types; 33 34 import org.opencms.file.CmsObject; 35 import org.opencms.main.CmsIllegalArgumentException; 36 import org.opencms.main.CmsRuntimeException; 37 import org.opencms.util.CmsStringUtil; 38 import org.opencms.xml.I_CmsXmlDocument; 39 40 import java.util.Locale ; 41 42 import org.dom4j.Element; 43 44 53 public abstract class A_CmsXmlValueTextBase extends A_CmsXmlContentValue { 54 55 56 protected String m_stringValue; 57 58 62 protected A_CmsXmlValueTextBase() { 63 64 super(); 65 } 66 67 75 protected A_CmsXmlValueTextBase(I_CmsXmlDocument document, Element element, Locale locale, I_CmsXmlSchemaType type) { 76 77 super(document, element, locale, type); 78 m_stringValue = element.getText(); 79 } 80 81 88 protected A_CmsXmlValueTextBase(String name, String minOccurs, String maxOccurs) { 89 90 super(name, minOccurs, maxOccurs); 91 } 92 93 96 public String getStringValue(CmsObject cms) throws CmsRuntimeException { 97 98 return m_stringValue; 99 } 100 101 104 public void setStringValue(CmsObject cms, String value) throws CmsIllegalArgumentException { 105 106 m_element.clearContent(); 107 if (CmsStringUtil.isNotEmpty(value)) { 108 m_element.addText(value); 109 } 110 m_stringValue = value; 111 } 112 } | Popular Tags |