How to get property type value is Stirng[] | Community
Skip to main content
October 16, 2015
Solved

How to get property type value is Stirng[]

  • October 16, 2015
  • 5 replies
  • 1206 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh
boolean multi = property.isMultiple(); if (multi) { Value[] values = property.getValues(); ... } 

5 replies

Peter_Puzanovs
New Participant
October 16, 2015

You could have tried using instanceof worked well for me before(https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op2.html)

smacdonald2008
New Participant
October 16, 2015
joerghoh
joerghohAccepted solution
Employee
October 16, 2015
boolean multi = property.isMultiple(); if (multi) { Value[] values = property.getValues(); ... } 
October 16, 2015

Sorry, i check the https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op2.html content, it seeming not fit the problem. Note: this is JCR API.

October 16, 2015

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?