问题
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