Package org.opencms.xml.types
Class CmsXmlBooleanValue
java.lang.Object
org.opencms.xml.types.A_CmsXmlContentValue
org.opencms.xml.types.A_CmsXmlValueTextBase
org.opencms.xml.types.CmsXmlBooleanValue
- All Implemented Interfaces:
- Comparable<I_CmsXmlSchemaType>,- I_CmsWidgetParameter,- I_CmsXmlContentValue,- I_CmsXmlSchemaType,- I_CmsJsonFormattableValue
Describes the XML content type "OpenCmsBoolean".
- Since:
- 6.0.0
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.opencms.xml.types.I_CmsXmlContentValueI_CmsXmlContentValue.CmsSearchContentConfig, I_CmsXmlContentValue.SearchContentType
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe name of this type as used in the XML schema.static final StringThe validation rule used for this schema type.Fields inherited from class org.opencms.xml.types.A_CmsXmlValueTextBasem_stringValueFields inherited from class org.opencms.xml.types.A_CmsXmlContentValuem_defaultValue, m_document, m_element, m_locale, m_maxOccurs, m_minOccurs, m_nameFields inherited from interface org.opencms.xml.types.I_CmsXmlSchemaTypeXSI_NAMESPACE, XSI_NAMESPACE_ATTRIBUTE_NO_SCHEMA_LOCATION
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new, empty schema type descriptor of type "OpenCmsBoolean".CmsXmlBooleanValue(String name, String minOccurs, String maxOccurs) Creates a new schema type descriptor for the type "OpenCmsBoolean".CmsXmlBooleanValue(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale, I_CmsXmlSchemaType type) Creates a new XML content value of type "OpenCmsBoolean".
- 
Method SummaryModifier and TypeMethodDescriptioncreateValue(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale) Creates a XML content value object for this type.booleanReturns the boolean value as a boolean type.static booleangetBooleanValue(CmsObject cms, I_CmsWidgetParameter value) Returns the boolean value of the given widget parameter.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.booleanThe 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.voidsetStringValue(CmsObject cms, String value) Sets the provided String as value of this XML content node.Gets the JSON representation of the value.booleanvalidateValue(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.Methods inherited from class org.opencms.xml.types.A_CmsXmlValueTextBasegetPlainText, getStringValueMethods inherited from class org.opencms.xml.types.A_CmsXmlContentValueappendXmlSchema, 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, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opencms.xml.types.I_CmsXmlContentValuegetSearchContentConfig
- 
Field Details- 
TYPE_NAMEThe name of this type as used in the XML schema.- See Also:
 
- 
TYPE_RULEThe validation rule used for this schema type.- See Also:
 
 
- 
- 
Constructor Details- 
CmsXmlBooleanValuepublic CmsXmlBooleanValue()Creates a new, empty schema type descriptor of type "OpenCmsBoolean".
- 
CmsXmlBooleanValuepublic CmsXmlBooleanValue(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale, I_CmsXmlSchemaType type) Creates a new XML content value of type "OpenCmsBoolean".- 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
 
- 
CmsXmlBooleanValueCreates a new schema type descriptor for the type "OpenCmsBoolean".- 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 Details- 
getBooleanValueReturns the boolean value of the given widget parameter.- Parameters:
- cms- an initialized instance of a CmsObject
- value- the XML content value to get the boolean value of
- Returns:
- the boolean value of the given widget parameter
 
- 
createValuepublic I_CmsXmlContentValue createValue(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale) Description copied from interface:I_CmsXmlSchemaTypeCreates a XML content value object for this type.- Specified by:
- createValuein interface- I_CmsXmlSchemaType
- 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:
 
- 
getBooleanValueReturns the boolean value as a boolean type.- Returns:
- the boolean value as a boolean type
 
- 
getDefaultDescription copied from interface:I_CmsXmlSchemaTypeReturns the default value for a node of this type in the current schema.- Specified by:
- getDefaultin interface- I_CmsXmlSchemaType
- Overrides:
- getDefaultin class- A_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:
 
- 
getSchemaDefinitionDescription copied from interface:I_CmsXmlSchemaTypeReturns a String representation of the XML definition for this schema type.- Specified by:
- getSchemaDefinitionin interface- I_CmsXmlSchemaType
- Returns:
- a String representation of the XML definition for this schema type
- See Also:
 
- 
getTypeNameDescription copied from interface:I_CmsXmlSchemaTypeReturns 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:
- getTypeNamein interface- I_CmsXmlSchemaType
- Returns:
- the schema type name
- See Also:
 
- 
isSearchableDescription copied from class:A_CmsXmlContentValueThe default implementation always returnstrue.- Specified by:
- isSearchablein interface- I_CmsXmlContentValue
- Overrides:
- isSearchablein class- A_CmsXmlContentValue
- Returns:
- truein case this value is searchable by default
- See Also:
 
- 
newInstanceDescription copied from interface:I_CmsXmlSchemaTypeCreates a new instance of this XML schema type initialized with the given values.- Specified by:
- newInstancein interface- I_CmsXmlSchemaType
- 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:
 
- 
setStringValueDescription copied from interface:I_CmsXmlContentValueSets 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. - Specified by:
- setStringValuein interface- I_CmsWidgetParameter
- Specified by:
- setStringValuein interface- I_CmsXmlContentValue
- Overrides:
- setStringValuein class- A_CmsXmlValueTextBase
- Parameters:
- cms- an initialized instance of a CmsObject
- value- the value to set
- Throws:
- CmsIllegalArgumentException
- See Also:
 
- 
toJsonDescription copied from interface:I_CmsJsonFormattableValueGets the JSON representation of the value.- Specified by:
- toJsonin interface- I_CmsJsonFormattableValue
- Parameters:
- cms- the CMS context
- Returns:
- the JSON representation of the value
- See Also:
 
- 
validateValueDescription copied from interface:I_CmsXmlSchemaTypeChecks 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:
- validateValuein interface- I_CmsXmlSchemaType
- Overrides:
- validateValuein class- A_CmsXmlContentValue
- Parameters:
- value- the value to validate
- Returns:
- the validation rule (regular expression) used for this schema type in the XML schema
- See Also:
 
 
-