org.opencms.xml.types
Class A_CmsXmlValueTextBase

java.lang.Object
  extended by org.opencms.xml.types.A_CmsXmlContentValue
      extended by org.opencms.xml.types.A_CmsXmlValueTextBase
All Implemented Interfaces:
java.lang.Comparable, I_CmsWidgetParameter, I_CmsXmlContentValue, I_CmsXmlSchemaType
Direct Known Subclasses:
CmsXmlBooleanValue, CmsXmlColorValue, CmsXmlDateTimeValue, CmsXmlLocaleValue

public abstract class A_CmsXmlValueTextBase
extends A_CmsXmlContentValue

Base class for XML content value implementations that require only a simple XML plain text node.

Since:
6.0.0
Version:
$Revision: 1.10 $
Author:
Alexander Kandzior

Field Summary
protected  java.lang.String m_stringValue
          The String value of the element node.
 
Fields inherited from class org.opencms.xml.types.A_CmsXmlContentValue
m_defaultValue, m_document, m_element, m_locale, m_maxOccurs, m_minOccurs, m_name
 
Fields inherited from interface org.opencms.xml.types.I_CmsXmlSchemaType
XSI_NAMESPACE, XSI_NAMESPACE_ATTRIBUTE_NO_SCHEMA_LOCATION
 
Constructor Summary
protected A_CmsXmlValueTextBase()
          Default constructor for a xml content type that initializes some internal values.
protected A_CmsXmlValueTextBase(I_CmsXmlDocument document, org.dom4j.Element element, java.util.Locale locale, I_CmsXmlSchemaType type)
          Initializes the required members for this XML content value.
protected A_CmsXmlValueTextBase(java.lang.String name, java.lang.String minOccurs, java.lang.String maxOccurs)
          Initializes the schema type descriptor values for this type descriptor.
 
Method Summary
 java.lang.String getStringValue(CmsObject cms)
          Returns the value of this XML content node as a String.
 void setStringValue(CmsObject cms, java.lang.String value)
          Sets the provided String as value of this XML content node.
 
Methods inherited from class org.opencms.xml.types.A_CmsXmlContentValue
appendXmlSchema, compareTo, equals, generateXml, getContentDefinition, getDefault, getDefault, getDocument, getElement, getId, getIndex, getKey, getLocale, getMaxIndex, getMaxOccurs, getMinOccurs, getName, getPath, getPlainText, hasError, hashCode, isSimpleType, moveDown, moveUp, moveValue, readSchemaDefinition, setContentDefinition, setDefault, setKeyPrefix, toString, validateValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opencms.xml.types.I_CmsXmlSchemaType
createValue, getSchemaDefinition, getTypeName, newInstance
 

Field Detail

m_stringValue

protected java.lang.String m_stringValue
The String value of the element node.

Constructor Detail

A_CmsXmlValueTextBase

protected A_CmsXmlValueTextBase()
Default constructor for a xml content type that initializes some internal values.


A_CmsXmlValueTextBase

protected A_CmsXmlValueTextBase(I_CmsXmlDocument document,
                                org.dom4j.Element element,
                                java.util.Locale locale,
                                I_CmsXmlSchemaType type)
Initializes the required members for this XML content value.

Parameters:
document - the XML content instance this value belongs to
element - the XML element that contains this value
locale - the locale this value is created for
type - the type instance to create the value for

A_CmsXmlValueTextBase

protected A_CmsXmlValueTextBase(java.lang.String name,
                                java.lang.String minOccurs,
                                java.lang.String maxOccurs)
Initializes the schema type descriptor values for this type descriptor.

Parameters:
name - the name of the XML node containing the value according to the XML schema
minOccurs - minimum number of occurences of this type according to the XML schema
maxOccurs - maximum number of occurences of this type according to the XML schema
Method Detail

getStringValue

public java.lang.String getStringValue(CmsObject cms)
                                throws CmsRuntimeException
Description copied from interface: I_CmsXmlContentValue
Returns the value of this XML content node as a String.

Parameters:
cms - an initialized instance of a CmsObject
Returns:
the value of this XML content node as a String
Throws:
CmsRuntimeException
See Also:
I_CmsXmlContentValue.getStringValue(CmsObject)

setStringValue

public void setStringValue(CmsObject cms,
                           java.lang.String value)
                    throws CmsIllegalArgumentException
Description copied from interface: I_CmsXmlContentValue
Sets the provided String as value of this XML content node.

This method does provide processing of the content based on the users current OpenCms context. This can be used e.g. for link extraction and replacement in the content.

Parameters:
cms - an initialized instance of a CmsObject
value - the value to set
Throws:
CmsIllegalArgumentException
See Also:
I_CmsXmlContentValue.setStringValue(org.opencms.file.CmsObject, java.lang.String)