org.opencms.xml.types
Class CmsXmlPlainTextStringValue

java.lang.Object
  extended by org.opencms.xml.types.A_CmsXmlContentValue
      extended by org.opencms.xml.types.A_CmsXmlValueCdataBase
          extended by org.opencms.xml.types.CmsXmlPlainTextStringValue
All Implemented Interfaces:
java.lang.Comparable<I_CmsXmlSchemaType>, I_CmsWidgetParameter, I_CmsXmlContentValue, I_CmsXmlSchemaType

public class CmsXmlPlainTextStringValue
extends A_CmsXmlValueCdataBase

Describes the XML content type "OpenCmsPlainTextString".

Since:
7.5.2
Version:
$Revision: 1.1 $
Author:
Mario Jaeger

Field Summary
static java.lang.String TYPE_NAME
          The name of this type as used in the XML schema.
 
Fields inherited from class org.opencms.xml.types.A_CmsXmlValueCdataBase
m_stringValue
 
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
CmsXmlPlainTextStringValue()
          Creates a new, empty schema type descriptor of type "OpenCmsString".
CmsXmlPlainTextStringValue(I_CmsXmlDocument document, org.dom4j.Element element, java.util.Locale locale, I_CmsXmlSchemaType type)
          Creates a new XML content value of type "OpenCmsString".
CmsXmlPlainTextStringValue(java.lang.String name, java.lang.String minOccurs, java.lang.String maxOccurs)
          Creates a new schema type descriptor for the type "OpenCmsString".
 
Method Summary
 I_CmsXmlContentValue createValue(I_CmsXmlDocument document, org.dom4j.Element element, java.util.Locale locale)
          Creates a XML content value object for this type.
 java.lang.String getPlainText(CmsObject cms)
          Returns the value of this XML content node as a plain text String.
 java.lang.String getSchemaDefinition()
          Returns a String representation of the XML definition for this schema type.
 java.lang.String getTypeName()
          Returns the schema type name.
 I_CmsXmlSchemaType newInstance(java.lang.String name, java.lang.String minOccurs, java.lang.String maxOccurs)
          Creates a new instance of this XML schema type initialized with the given values.
 
Methods inherited from class org.opencms.xml.types.A_CmsXmlValueCdataBase
getStringValue, setStringValue
 
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, hasError, hashCode, isSearchable, 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
 

Field Detail

TYPE_NAME

public static final java.lang.String TYPE_NAME
The name of this type as used in the XML schema.

See Also:
Constant Field Values
Constructor Detail

CmsXmlPlainTextStringValue

public CmsXmlPlainTextStringValue()
Creates a new, empty schema type descriptor of type "OpenCmsString".


CmsXmlPlainTextStringValue

public CmsXmlPlainTextStringValue(I_CmsXmlDocument document,
                                  org.dom4j.Element element,
                                  java.util.Locale locale,
                                  I_CmsXmlSchemaType type)
Creates a new XML content value of type "OpenCmsString".

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

CmsXmlPlainTextStringValue

public CmsXmlPlainTextStringValue(java.lang.String name,
                                  java.lang.String minOccurs,
                                  java.lang.String maxOccurs)
Creates a new schema type descriptor for the type "OpenCmsString".

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

createValue

public I_CmsXmlContentValue createValue(I_CmsXmlDocument document,
                                        org.dom4j.Element element,
                                        java.util.Locale locale)
Description copied from interface: I_CmsXmlSchemaType
Creates a XML content value object for this type.

Parameters:
document - the XML content instance this value belongs to
element - the XML element to create the value from
locale - the locale to create the value for
Returns:
the created XML content value object
See Also:
I_CmsXmlSchemaType.createValue(I_CmsXmlDocument, org.dom4j.Element, Locale)

getPlainText

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

Plain text in this context means a pure textual representation of the content (i.e. without html tags). The plain text may be null, too, if there is no sound or useful textual representation (i.e. color values).

Specified by:
getPlainText in interface I_CmsXmlContentValue
Overrides:
getPlainText in class A_CmsXmlValueCdataBase
Parameters:
cms - an initialized instance of a CmsObject
Returns:
the value of this XML content node as a plain text String
See Also:
I_CmsXmlContentValue.getPlainText(org.opencms.file.CmsObject)

getSchemaDefinition

public java.lang.String getSchemaDefinition()
Description copied from interface: I_CmsXmlSchemaType
Returns a String representation of the XML definition for this schema type.

Returns:
a String representation of the XML definition for this schema type
See Also:
I_CmsXmlSchemaType.getSchemaDefinition()

getTypeName

public java.lang.String getTypeName()
Description copied from interface: I_CmsXmlSchemaType
Returns the schema type name.

By convention, a XML schema type name has the form "OpenCms + ${name}". Examples are "OpenCmsString" or "OpenCmsBoolean".

The schema type name is fixed by the implementation.

Returns:
the schema type name
See Also:
I_CmsXmlSchemaType.getTypeName()

newInstance

public I_CmsXmlSchemaType newInstance(java.lang.String name,
                                      java.lang.String minOccurs,
                                      java.lang.String maxOccurs)
Description copied from interface: I_CmsXmlSchemaType
Creates a new instance of this XML schema type initialized with the given values.

Parameters:
name - the name to use in the xml document
minOccurs - minimum number of occurrences
maxOccurs - maximum number of occurrences
Returns:
a new instance of this XML content type initialized with the given values
See Also:
I_CmsXmlSchemaType.newInstance(java.lang.String, java.lang.String, java.lang.String)