How to determine if a JCR property is multivalue?

限于喜欢 提交于 2020-02-04 03:33:26

问题


How do you determine if a JCR property is multivalve? I tried calling getType() on the property but that returns the same value if it's a String or String Array.

Thanks!


回答1:


Using the isMultiple() method of the Property class you can determine if the property is multi-valued or not.

Property prop = node.getProperty("some-property");
if (prop.isMultiple()) {
    //do something
} else {
    //do something else
}


来源:https://stackoverflow.com/questions/42822066/how-to-determine-if-a-jcr-property-is-multivalue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!