如何确定JCR属性是否为多值? [英] How to determine if a JCR property is multivalue?
本文介绍了如何确定JCR属性是否为多值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何确定JCR属性是否为多阀?我尝试在属性上调用getType(),但是如果它是字符串或字符串数组,则返回相同的值。
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.
谢谢!
推荐答案
使用
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
}
这篇关于如何确定JCR属性是否为多值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文