public final class CmsJspObjectValueWrapper extends java.util.AbstractCollection<java.lang.String>
Modifier and Type | Field and Description |
---|---|
protected CmsObject |
m_cms
The wrapped OpenCms user context.
|
protected static CmsJspObjectValueWrapper |
NULL_VALUE_WRAPPER
Constant for the null (non existing) value.
|
Modifier and Type | Method and Description |
---|---|
static CmsJspObjectValueWrapper |
createWrapper(CmsObject cms,
java.lang.Object value)
Factory method to create a new XML content value wrapper.
|
boolean |
equals(java.lang.Object obj) |
CmsObject |
getCmsObject()
Returns the current cms context.
|
java.util.Map<java.lang.Object,java.lang.Boolean> |
getContains()
Returns a lazy initialized Map that provides Booleans which
indicate if if the wrapped values String representation contains a specific String.
|
boolean |
getExists()
Returns
true in case there was an object wrapped. |
boolean |
getIsEmpty()
Returns
true in case the object is empty, that is either null or an empty String. |
boolean |
getIsEmptyOrWhitespaceOnly()
Returns
true in case the object is empty or whitespace only, that is either null or an empty String. |
java.util.Map<java.lang.Object,java.lang.Boolean> |
getIsEqual()
Returns a lazy initialized Map that provides Booleans which
indicate if an Object is equal to the wrapped object.
|
boolean |
getIsSet()
Returns
true in case the wrapped value exists and is not empty or whitespace only. |
boolean |
getIsSetNotNone()
Returns
true in case the wrapped value exists, is not empty or whitespace only
and is also not equal to the String 'none' . |
java.lang.Long |
getMathCeil()
Calculates the next largest integer from the wrapped value.
|
java.lang.Long |
getMathFloor()
Calculates the next smallest integer from the wrapped value.
|
java.lang.Long |
getMathRound()
Calculates the next integer from the wrapped value by rounding.
|
java.lang.Object |
getObjectValue()
Returns the wrapped object value.
|
java.lang.String |
getStringValue()
Deprecated.
use
getToString() instead |
java.lang.String |
getStripHtml()
Assumes the wrapped value is a String and strips all HTML markup from this String.
|
boolean |
getToBoolean()
Converts the wrapped value to a boolean.
|
java.util.Date |
getToDate()
Converts the wrapped value to a date.
|
java.lang.Double |
getToDouble()
Parses the wrapped value to a Double precision float.
|
java.lang.Double |
getToFloat()
Parses the wrapped value to a Double precision float.
|
CmsJspImageBean |
getToImage()
Returns a scaled image bean from the wrapped value.
|
CmsJspInstanceDateBean |
getToInstanceDate()
Converts a date to an instance date bean.
|
java.lang.Long |
getToInteger()
Parses the wrapped value to a Long integer.
|
java.lang.String |
getToLink()
Returns the substituted link to the wrapped value.
|
java.lang.Long |
getToLong()
Parses the wrapped value to a Long integer.
|
CmsJspResourceWrapper |
getToResource()
Converts a date to an instance date bean.
|
java.lang.String |
getToString()
Returns the wrapped value as a String.
|
java.util.Map<java.lang.Object,java.lang.String> |
getTrimToSize()
Returns a lazy initialized map that provides trimmed to size strings of the wrapped object string value.
|
int |
hashCode() |
boolean |
isEmpty()
Supports the use of the
empty operator in the JSP EL by implementing the Collection interface. |
java.util.Iterator<java.lang.String> |
iterator()
Supports the use of the
empty operator in the JSP EL by implementing the Collection interface. |
int |
size()
Supports the use of the
empty operator in the JSP EL by implementing the Collection interface. |
protected static java.lang.String |
substituteLink(CmsObject cms,
java.lang.String target)
Returns the substituted link to the given target.
|
java.lang.Double |
toDouble(java.lang.Double def)
Parses the wrapped value to a Double precision float, returning the default in case the number can not be parsed.
|
java.lang.Double |
toFloat(java.lang.Double def)
Parses the wrapped value to a Double precision float, returning the default in case the number can not be parsed.
|
java.lang.Long |
toInteger(java.lang.Long def)
Parses the wrapped value to a Long integer, returning the default in case the number can not be parsed.
|
java.lang.Long |
toLong(java.lang.Long def)
Parses the wrapped value to a Long integer, returning the default in case the number can not be parsed.
|
java.lang.String |
toString() |
add, addAll, clear, contains, containsAll, remove, removeAll, retainAll, toArray, toArray
protected static final CmsJspObjectValueWrapper NULL_VALUE_WRAPPER
public static CmsJspObjectValueWrapper createWrapper(CmsObject cms, java.lang.Object value)
In case either parameter is null
, the NULL_VALUE_WRAPPER
is returned.
cms
- the current users OpenCms contextvalue
- the object to warpnull
if any parameter is null
public boolean getExists()
true
in case there was an object wrapped.true
in case there was an object wrappedpublic boolean getIsEmpty()
true
in case the object is empty, that is either null
or an empty String.
In case the object does not exist, true
is returned.
true
in case the object is emptypublic boolean getIsEmptyOrWhitespaceOnly()
true
in case the object is empty or whitespace only, that is either null
or an empty String.
In case the object does not exist, true
is returned.
true
in case the object is emptypublic java.lang.Object getObjectValue()
public java.util.Date getToDate()
A_CmsJspValueWrapper.getToDate()
public CmsJspResourceWrapper getToResource()
A_CmsJspValueWrapper.getToResource()
public int hashCode()
hashCode
in interface java.util.Collection<java.lang.String>
Object.hashCode()
public java.lang.String toString()
toString
in class java.util.AbstractCollection<java.lang.String>
Object.toString()
protected static java.lang.String substituteLink(CmsObject cms, java.lang.String target)
cms
- the cms contexttarget
- the link targetpublic boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection<java.lang.String>
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public CmsObject getCmsObject()
public java.util.Map<java.lang.Object,java.lang.Boolean> getContains()
The Object parameter is transformed to it's String representation to perform this check.
public java.util.Map<java.lang.Object,java.lang.Boolean> getIsEqual()
public boolean getIsSet()
true
in case the wrapped value exists and is not empty or whitespace only.true
in case the wrapped value exists and is not empty or whitespace onlypublic boolean getIsSetNotNone()
true
in case the wrapped value exists, is not empty or whitespace only
and is also not equal to the String 'none'
.true
in case the wrapped value exists, is not empty or whitespace only
and is also not equal to the String 'none'
public java.lang.Long getMathCeil()
Note that the result is an Object of type Long
,
so in case the wrapped value can not be converted to a number, null
is returned.
This means you can check for an empty
result in the EL.
public java.lang.Long getMathFloor()
Note that the result is an Object of type Long
,
so in case the wrapped value can not be converted to a number, null
is returned.
This means you can check for an empty
result in the EL.
public java.lang.Long getMathRound()
Note that the result is an Object of type Long
,
so in case the wrapped value can not be converted to a number, null
is returned.
This means you can check for an empty
result in the EL.
@Deprecated public java.lang.String getStringValue()
getToString()
instead
This will return the empty String ""
when getExists()
returns false
.
public java.lang.String getStripHtml()
public boolean getToBoolean()
public java.lang.Double getToDouble()
Note that the result is an Object of type Double
,
so in case the wrapped value can not be converted to a number, null
is returned.
This means you can check for an empty
result in the EL.
public java.lang.Double getToFloat()
Note that the result is an Object of type Double
,
so in case the wrapped value can not be converted to a number, null
is returned.
This means you can check for an empty
result in the EL.
public CmsJspImageBean getToImage()
In case the value does not point to an image resource, null
is returned.
public CmsJspInstanceDateBean getToInstanceDate()
public java.lang.Long getToInteger()
Note that the result is an Object of type Long
,
so in case the wrapped value can not be converted to a number, null
is returned.
This means you can check for an empty
result in the EL.
getToLong()
public java.lang.String getToLink()
In case no link can be substituted from the wrapped value, an empty String ""
is returned.
public java.lang.Long getToLong()
Note that the result is an Object of type Long
,
so in case the wrapped value can not be converted to a number, null
is returned.
This means you can check for an empty
result in the EL.
getToInteger()
public java.lang.String getToString()
This will always be at least an empty String ""
, never null
.
public java.util.Map<java.lang.Object,java.lang.String> getTrimToSize()
public boolean isEmpty()
empty
operator in the JSP EL by implementing the Collection interface.isEmpty
in interface java.util.Collection<java.lang.String>
isEmpty
in class java.util.AbstractCollection<java.lang.String>
getIsEmptyOrWhitespaceOnly()
which is the inverse of getIsSet()
.AbstractCollection.isEmpty()
,
getIsEmptyOrWhitespaceOnly()
,
getIsSet()
public java.util.Iterator<java.lang.String> iterator()
empty
operator in the JSP EL by implementing the Collection interface.iterator
in interface java.lang.Iterable<java.lang.String>
iterator
in interface java.util.Collection<java.lang.String>
iterator
in class java.util.AbstractCollection<java.lang.String>
isEmpty()
is true
,
otherwise an Iterator that will return the String value of this wrapper exactly once.AbstractCollection.size()
public int size()
empty
operator in the JSP EL by implementing the Collection interface.size
in interface java.util.Collection<java.lang.String>
size
in class java.util.AbstractCollection<java.lang.String>
AbstractCollection.size()
public java.lang.Double toDouble(java.lang.Double def)
def
- the default in case the wrapped value can not be converted to a numbertoFloat(Double)
public java.lang.Double toFloat(java.lang.Double def)
def
- the default in case the wrapped value can not be converted to a numbertoDouble(Double)
public java.lang.Long toInteger(java.lang.Long def)
def
- the default in case the wrapped value can not be converted to a numbertoLong(Long)
public java.lang.Long toLong(java.lang.Long def)
def
- the default in case the wrapped value can not be converted to a numbertoInteger(Long)