Expand my Community achievements bar.

SOLVED

How to get property type value is Stirng[]

Avatar

Former Community Member

Hi there,

Now i need to assert a property type is "String[]", please see below:

[img]option.png[/img]

But I find that there is no specified value for type "String[]", please see below:

[img]string.png[/img]

Anyone know how to assert the type?

 

Thanks a lot in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor
boolean multi = property.isMultiple(); if (multi) { Value[] values = property.getValues(); ... } 

View solution in original post

5 Replies

Avatar

Correct answer by
Employee Advisor
boolean multi = property.isMultiple(); if (multi) { Value[] values = property.getValues(); ... } 

Avatar

Former Community Member

smacdonald2008 wrote...

Take a look here - there are some examples on http://www.day.com/specs/jsr170/javadocs/jcr-1.0/javax/jcr/PropertyType.html that may help:

http://www.javased.com/index.php?api=javax.jcr.PropertyType

 


Exactly!!!!! Thanks a lot.

Now i know to assert and get the multi type property.

But if need to assign multi values to multi property, how to do that?