Start page
Start page
Start page

Start page / Template development / Template syntax / Data types / Boolean

Boolean data type Available from FirstSpirit Version 4.0

Value range of the Boolean data type

A Boolean data type can assume one of two possible values:

  • true
  • false

Boolean values are used in FIRSTspirit as return values of Input components and in expressions .

For further information on the Boolean data type, see the Sun API documentation: java.lang.Boolean

Definition

The Boolean data type can be explicitly used in expressions, e.g. for allocations

$CMS_SET(isValid, true)$

or in checks :

$CMS_IF(varName == true)$
...
$CMS_END_IF$

Definition using the standard input components

Different input components can be defined in the form area of a page or section template. These form elements can then be used to insert the actual editorial contents into the page. The Standard input components supported by FIRSTspirit return different data types.

The following standard input components return an object of data type Boolean :

Then, with the help of a $CMS_VALUE(...)$ instruction, methods can then be applied to this object:

$CMS_VALUE(IDENTIFIER.METHOD)$

Under IDENTIFIER , the resultnameparameter, defined in the input component, must be specified.

The object is generated by the following form objects:
CMS_INPUT_TOGGLE
Method name Return type Brief description Available since
booleanValue boolean
compareTo(Comparable) int
compareTo(Object) int
equals(Object) boolean
getBoolean(String) boolean
getClass Class Class of the invoking object
hashCode int
isCase(Object) boolean
isNull boolean Checks whether an expression is null (zero)
notify void
notifyAll void
parseBoolean(String) boolean
print void
set(String, Object) Object
toJson String Convert to JSON string representtion (only handles Maps, Collections, Arrays, Numbers, and Strings) 4.2.14
toString String
toString(boolean) String
type String
valueOf(String) Boolean
valueOf(boolean) Boolean
wait void
wait(long) void
wait(long, int) void

booleanValue

Method name Return type Available since
booleanValue boolean

compareTo(Comparable)

Method name Return type Available since
compareTo(Comparable) int

compareTo(Object)

Method name Return type Available since
compareTo(Object) int

equals(Object)

Method name Return type Available since
equals(Object) boolean

getBoolean(String)

Method name Return type Available since
getBoolean(String) boolean

getClass

The .getClass() (in Bean syntax: .class) method returns the class of the invoking object (cf. java.lang.Class).

Invocation:

$CMS_VALUE(myString.class)$
$CMS_VALUE(myString.getClass())$

Output:

java.lang.String
Method name Return type Available since
getClass Class

hashCode

Method name Return type Available since
hashCode int

isCase(Object)

Method name Return type Available since
isCase(Object) boolean

isNull

The .isNull() (in Bean syntax: .isNull) method checks whether an expression or object is null , e.g. storeElement.isNull(). In the case of objects with complex values or objects, the object decides when it is null. The data type DomElement for example always contains an empty document, thus it is never null. For this reason, checking an empty DOM editor input component by using the method .isNull() returns the value false, whereas checking the component with .isEmpty() would return the value true.

The method .isNull() returns a Boolean value as the check result. true is the check result if the expression or object is null and false if not.

Method name Return type Available since
isNull boolean

notify

Method name Return type Available since
notify void

notifyAll

Method name Return type Available since
notifyAll void

parseBoolean(String)

Method name Return type Available since
parseBoolean(String) boolean

print

Method name Return type Available since
print void

set(String, Object)

Method name Return type Available since
set(String, Object) Object

toJson

Convert to JSON string representtion (only handles Maps, Collections, Arrays, Numbers, and Strings)
Method name Return type Available since
toJson String 4.2.14

toString

Method name Return type Available since
toString String

toString(boolean)

Method name Return type Available since
toString(boolean) String

type

Method name Return type Available since
type String

valueOf(String)

Method name Return type Available since
valueOf(String) Boolean

valueOf(boolean)

Method name Return type Available since
valueOf(boolean) Boolean

wait

Method name Return type Available since
wait void

wait(long)

Method name Return type Available since
wait(long) void

wait(long, int)

Method name Return type Available since
wait(long, int) void

© 2005 - 2012 e-Spirit AG | All rights reserved. | Last change: 15.12.2010