jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Kennedy <da...@us.ibm.com>
Subject Multivalue or single?
Date Mon, 19 Jun 2006 21:18:27 GMT
If I have a node, the name of a property and a single value, how can I 
determine if I need to add the value to an array and use the multivalue 
setter or not?  Using 
getProperty(propertyName).getDefinition().isMultiple() won't work since 
the property may not exist (it was set to null...PathNotFoundException). 
Invoking setProperty(propertyName, value) and catching the 
ValueFormatException doesn't work since you don't know if the exception 
came from the property being multivalued or from a conversion error. 
Iterating over the propertyDefinitions from the nodetype (and mixins) 
isn't efficient.   What's the recommended way to determine whether to use 
the multivalue or single value setProperty method?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message