Boolean data type
Value range of the Boolean data type
A Boolean data type can assume one of two possible values:
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.
Method name |
Return type |
Brief description |
Available since |
booleanValue |
boolean |
|
|
compare(boolean, boolean) |
int |
|
|
compareTo(Object) |
int |
|
|
describeConstable |
Optional |
|
|
equals(Object) |
boolean |
|
|
getBoolean(String) |
boolean |
|
|
getClass |
Class |
Class of the invoking object |
|
hashCode(boolean) |
int |
|
|
isCase(Object) |
boolean |
|
|
isNull |
boolean |
Checks whether an expression is null (zero) |
|
logicalAnd(boolean, boolean) |
boolean |
|
|
logicalOr(boolean, boolean) |
boolean |
|
|
logicalXor(boolean, boolean) |
boolean |
|
|
parseBoolean(String) |
boolean |
|
|
print |
void |
|
|
set(String, Object) |
Object |
|
|
toJSON |
String |
Convert to a JSON-compatible string representation including necessary quotes and escaping for immediate use. Handles Maps, Collections, Arrays, Numbers, Strings, Boolean, Date, and JsonElement. A date instance will be converted to an ISO-8601 formatted date string. Any object other than above will be converted using its 'toString()' value. |
5.2.11 |
toString |
String |
|
|
toString(boolean) |
String |
|
|
type |
String |
|
|
valueOf(String) |
Boolean |
|
|
valueOf(boolean) |
Boolean |
|
|
booleanValue
Method name |
Return type |
Available since |
booleanValue |
boolean |
|
Overview
compare(boolean, boolean)
Method name |
Return type |
Available since |
compare(boolean, boolean) |
int |
|
Overview
compareTo(Object)
Method name |
Return type |
Available since |
compareTo(Object) |
int |
|
Overview
describeConstable
Method name |
Return type |
Available since |
describeConstable |
Optional |
|
Overview
equals(Object)
Method name |
Return type |
Available since |
equals(Object) |
boolean |
|
Overview
getBoolean(String)
Method name |
Return type |
Available since |
getBoolean(String) |
boolean |
|
Overview
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 |
|
Overview
hashCode(boolean)
Method name |
Return type |
Available since |
hashCode(boolean) |
int |
|
Overview
isCase(Object)
Method name |
Return type |
Available since |
isCase(Object) |
boolean |
|
Overview
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 |
|
Overview
logicalAnd(boolean, boolean)
Method name |
Return type |
Available since |
logicalAnd(boolean, boolean) |
boolean |
|
Overview
logicalOr(boolean, boolean)
Method name |
Return type |
Available since |
logicalOr(boolean, boolean) |
boolean |
|
Overview
logicalXor(boolean, boolean)
Method name |
Return type |
Available since |
logicalXor(boolean, boolean) |
boolean |
|
Overview
parseBoolean(String)
Method name |
Return type |
Available since |
parseBoolean(String) |
boolean |
|
Overview
print
Method name |
Return type |
Available since |
print |
void |
|
Overview
set(String, Object)
Method name |
Return type |
Available since |
set(String, Object) |
Object |
|
Overview
toJSON
Convert to a JSON-compatible string representation including necessary quotes and escaping for immediate use. Handles Maps, Collections, Arrays, Numbers, Strings, Boolean, Date, and JsonElement. A date instance will be converted to an ISO-8601 formatted date string. Any object other than above will be converted using its 'toString()' value.
Method name |
Return type |
Available since |
toJSON |
String |
5.2.11 |
Overview
toString
Method name |
Return type |
Available since |
toString |
String |
|
Overview
toString(boolean)
Method name |
Return type |
Available since |
toString(boolean) |
String |
|
Overview
type
Method name |
Return type |
Available since |
type |
String |
|
Overview
valueOf(String)
Method name |
Return type |
Available since |
valueOf(String) |
Boolean |
|
Overview
valueOf(boolean)
Method name |
Return type |
Available since |
valueOf(boolean) |
Boolean |
|
Overview
Print version | Page start