Details
-
New Feature
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
Description
Add support for
<function>
<description>
Determines if the class or interface represented by this ContentBean object is either the same as, or is a
subclass of, the class or interface represented by the specified fully qualified class name parameter.
It returns true if so; otherwise it returns false.
</description>
<name>isBeanType</name>
<function-class>org.hippoecm.hst.util.ContentBeanUtils</function-class>
<function-signature>boolean isBeanType(org.hippoecm.hst.content.beans.standard.ContentBean, java.lang.String)</function-signature>
<example>
<c:if test="${hst:isBeanType(bean, 'org.hippoecm.hst.content.beans.standard.HippoFolderBean')}">
</example>
</function>
In ContentBeanUtils :
// typeName = Fully qualified classname of class to check against
public static boolean isBeanType(ContentBean contentBean, String typeName)
Also, it must be better if the method allows simple class name as well. e.g., NewsBean as well as org.example.beans.NewsBean.
Attachments
Issue Links
- relates to
-
HSTTWO-2207 Support hst:isNodeType JSTL function
- Closed