Package org.opencms.xml.types
Class CmsXmlSerialDateValue
java.lang.Object
org.opencms.xml.types.A_CmsXmlContentValue
org.opencms.xml.types.A_CmsXmlValueTextBase
org.opencms.xml.types.CmsXmlSerialDateValue
- All Implemented Interfaces:
Comparable<I_CmsXmlSchemaType>
,I_CmsWidgetParameter
,I_CmsXmlContentValue
,I_CmsXmlSchemaType
,I_CmsXmlValidateWithMessage
,I_CmsJsonFormattableValue
public class CmsXmlSerialDateValue
extends A_CmsXmlValueTextBase
implements I_CmsXmlValidateWithMessage, I_CmsJsonFormattableValue
Describes the XML content type "OpenCmsSerialDate".
- Since:
- 11.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opencms.xml.types.I_CmsXmlContentValue
I_CmsXmlContentValue.SearchContentType
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of this type as used in the XML schema.Fields inherited from class org.opencms.xml.types.A_CmsXmlValueTextBase
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
ConstructorDescriptionCreates a new, empty schema type descriptor of type "OpenCmsDateTime".CmsXmlSerialDateValue
(String name, String minOccurs, String maxOccurs) Creates a new schema type descriptor for the type "OpenCmsDateTime".CmsXmlSerialDateValue
(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale, I_CmsXmlSchemaType type) Creates a new XML content value of type "OpenCmsSerialDate". -
Method Summary
Modifier and TypeMethodDescriptioncreateValue
(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale) Creates a XML content value object for this type.getDefault
(Locale locale) Returns the default value for a node of this type in the current schema.Returns a String representation of the XML definition for this schema type.Returns the schema type name.boolean
The default implementation always returnstrue
.newInstance
(String name, String minOccurs, String maxOccurs) Creates a new instance of this XML schema type initialized with the given values.Gets the JSON representation of the value.boolean
validateValue
(String value) Checks if a given value is valid according to the validation rule (regular expression) used for validation of this schema type in the XML schema.validateWithMessage
(String value) Checks if a given value is valid according validation rules of this schema type in the XML schema.Methods inherited from class org.opencms.xml.types.A_CmsXmlValueTextBase
getPlainText, getStringValue, setStringValue
Methods inherited from class org.opencms.xml.types.A_CmsXmlContentValue
appendXmlSchema, compareTo, equals, generateXml, getChoiceMaxOccurs, getContentDefinition, getDefault, getDocument, getElement, getId, getIndex, getKey, getLocale, getMaxIndex, getMaxOccurs, getMinOccurs, getName, getPath, getRelationType, getXmlIndex, hasError, hashCode, isChoiceOption, isChoiceType, isSimpleType, moveDown, moveUp, moveValue, readSchemaDefinition, setContentDefinition, setDefault, setKeyPrefix, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opencms.xml.types.I_CmsXmlContentValue
getSearchContentType
-
Field Details
-
TYPE_NAME
The name of this type as used in the XML schema.- See Also:
-
-
Constructor Details
-
CmsXmlSerialDateValue
public CmsXmlSerialDateValue()Creates a new, empty schema type descriptor of type "OpenCmsDateTime". -
CmsXmlSerialDateValue
public CmsXmlSerialDateValue(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale, I_CmsXmlSchemaType type) Creates a new XML content value of type "OpenCmsSerialDate".- Parameters:
document
- the XML content instance this value belongs toelement
- the XML element that contains this valuelocale
- the locale this value is created fortype
- the type instance to create the value for
-
CmsXmlSerialDateValue
Creates a new schema type descriptor for the type "OpenCmsDateTime".- Parameters:
name
- the name of the XML node containing the value according to the XML schemaminOccurs
- minimum number of occurrences of this type according to the XML schemamaxOccurs
- maximum number of occurrences of this type according to the XML schema
-
-
Method Details
-
createValue
public I_CmsXmlContentValue createValue(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale) Description copied from interface:I_CmsXmlSchemaType
Creates a XML content value object for this type.- Specified by:
createValue
in interfaceI_CmsXmlSchemaType
- Parameters:
document
- the XML content instance this value belongs toelement
- the XML element to create the value fromlocale
- the locale to create the value for- Returns:
- the created XML content value object
- See Also:
-
getDefault
Description copied from interface:I_CmsXmlSchemaType
Returns the default value for a node of this type in the current schema.- Specified by:
getDefault
in interfaceI_CmsXmlSchemaType
- Overrides:
getDefault
in classA_CmsXmlContentValue
- Parameters:
locale
- the locale to generate the default value for- Returns:
- the default value for a node of this type in the current schema
- See Also:
-
getSchemaDefinition
Description copied from interface:I_CmsXmlSchemaType
Returns a String representation of the XML definition for this schema type.- Specified by:
getSchemaDefinition
in interfaceI_CmsXmlSchemaType
- Returns:
- a String representation of the XML definition for this schema type
- See Also:
-
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.
- Specified by:
getTypeName
in interfaceI_CmsXmlSchemaType
- Returns:
- the schema type name
- See Also:
-
isSearchable
Description copied from class:A_CmsXmlContentValue
The default implementation always returnstrue
.- Specified by:
isSearchable
in interfaceI_CmsXmlContentValue
- Overrides:
isSearchable
in classA_CmsXmlContentValue
- Returns:
true
in case this value is searchable by default- See Also:
-
newInstance
Description copied from interface:I_CmsXmlSchemaType
Creates a new instance of this XML schema type initialized with the given values.- Specified by:
newInstance
in interfaceI_CmsXmlSchemaType
- Parameters:
name
- the name to use in the xml documentminOccurs
- minimum number of occurrencesmaxOccurs
- maximum number of occurrences- Returns:
- a new instance of this XML content type initialized with the given values
- See Also:
-
toJson
Description copied from interface:I_CmsJsonFormattableValue
Gets the JSON representation of the value.- Specified by:
toJson
in interfaceI_CmsJsonFormattableValue
- Parameters:
cms
- the CMS context- Returns:
- the JSON representation of the value
- See Also:
-
validateValue
Description copied from interface:I_CmsXmlSchemaType
Checks if a given value is valid according to the validation rule (regular expression) used for validation of this schema type in the XML schema.To have a more refined validation according to the special requirements of the content type, use custom validation rules in the appinfo which are processed with
I_CmsXmlContentHandler.resolveValidation(CmsObject, I_CmsXmlContentValue, org.opencms.xml.content.CmsXmlContentErrorHandler)
.- Specified by:
validateValue
in interfaceI_CmsXmlSchemaType
- Overrides:
validateValue
in classA_CmsXmlContentValue
- Parameters:
value
- the value to validate- Returns:
- the validation rule (regular expression) used for this schema type in the XML schema
- See Also:
-
validateWithMessage
Description copied from interface:I_CmsXmlValidateWithMessage
Checks if a given value is valid according validation rules of this schema type in the XML schema.In contrast to
I_CmsXmlSchemaType.validateValue(String)
a specific error message is returned in the case of validation errors.- Specified by:
validateWithMessage
in interfaceI_CmsXmlValidateWithMessage
- Parameters:
value
- the value to validate- Returns:
null
if the value is valid, a localized error message otherwise.- See Also:
-