OK - I guess then that file install handles this as a String and iPOJO does
the conversion to a String array.

/Bengt


2012/11/28 Clement Escoffier <[email protected]>

> Hi,
>
> iPOJO supports the {…} and […] syntax. I don't know about file install.
>
> Regards,
>
> Clement
>
> On 28 nov. 2012, at 09:36, Bengt Rodehav <[email protected]> wrote:
>
> > Just tried it and it works very well with the web console. However, I use
> > file install (3.2.6) with "write back" enabled. When I look in the
> property
> > file it looks like this:
> >
> > *  qualifiers = [Ljava.lang.String;@50b742d3*
> >
> > And on restart that is also what is displayed in the web console. In
> other
> > words, file install and the metadata service are handling arrays in
> > different, incompatible, ways. The metadata service uses the cardinality
> > property. File install does not recognize the cardinality property but
> > instead uses the special syntax "{A,B,C}" to recognize an array.
> >
> > I think the way to fix this is to make file install recognize array types
> > and then persist them using the {...} syntax.
> >
> > Also, if I put {A,B} in the properties file and then look in the web
> > console how this is interpreted, it looks like one   string with the
> value
> > "{A,B}" instead of two strings with the values "A" and "B" respectively.
> It
> > makes me wonder whether it is file install or iPOJO itself that supports
> > the {...} syntax.
> >
> > Do you think I should create a JIRA for this? (for file install)
> >
> > /Bengt
> >
> >
> > 2012/11/28 Bengt Rodehav <[email protected]>
> >
> >> Thanks a lot for your help!
> >>
> >> /Bengt
> >>
> >>
> >> 2012/11/28 Jan Willem Janssen <[email protected]>
> >>
> >>> -----BEGIN PGP SIGNED MESSAGE-----
> >>> Hash: SHA1
> >>>
> >>> On 11/28/12 8:55 AM, Bengt Rodehav wrote:
> >>>> I have a configuration property that is an array of String. I use
> >>>> iPOJO to define it as follows:
> >>>>
> >>>> *  @Property(name = "qualifiers", mandatory = false)* *  private
> >>>> String[] mQualifiers;*
> >>>>
> >>>> If I put the following in my property file it works perfectly:
> >>>>
> >>>> *  qualifiers={A,B,C}*
> >>>>
> >>>> However, I always create a metadata.xml for the metadata service
> >>>> but I can't find anywhere how to specify the type to "array of
> >>>> String". How can I do that?
> >>>
> >>> Use the cardinality property for that: if you want to have an array of
> >>> Strings, you can define an attribute of type "String" with cardinality
> >>> greater than 0 to indicate its an array, e.g.,:
> >>>
> >>>  <AD name="qualifiers" id="my.id" type="String" cardinality="3">
> >>>
> >>> This will make it an array of strings of at most three elements. Use
> >>> the value of Integer.MAX_VALUE to disable the upper limit.
> >>>
> >>> - --
> >>> Met vriendelijke groeten | Kind regards
> >>>
> >>> Jan Willem Janssen | Software Architect
> >>> +31 631 765 814
> >>>
> >>> /My world is:/
> >>>
> >>> Luminis Technologies B.V.
> >>> IJsselburcht 3
> >>> 6825 BS  Arnhem
> >>> +31 88 586 46 30
> >>>
> >>> http://www.luminis-technologies.com
> >>> http://www.luminis.eu
> >>>
> >>> KvK (CoC) 09 16 28 93
> >>> BTW (VAT) NL8169.78.566.B.01
> >>> -----BEGIN PGP SIGNATURE-----
> >>> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> >>> Comment: GPGTools - http://gpgtools.org
> >>> Comment: Using GnuPG with undefined - http://www.enigmail.net/
> >>>
> >>> iQIcBAEBAgAGBQJQtcS5AAoJEKF/mP2eHDc4bQ4QAOL2uMpl73wGHQUgCEe8qceR
> >>> gYBzqVOWgDvr3GRfF8bNkFXf5nJXVFWOLTTs51EKVRN/2Slt57wuRUr+15Gv/yPg
> >>> jUUtc09b/cfERLLAF1eC0oSQV7YzzEmVkKn/Vk6CdJBwqSWAJs5F74Y/I+Yyt6Ok
> >>> w/VMt4Ame9GzwQ/9w+2/TZq1ZJVSBWiCQ933X48X1wy8j0rxe178UKxXDow4B/xk
> >>> I1fjavO4DkG5z1ceyaukVjLTuGuyioWXc5mzNGRtfrkV+2IAO7e1EbG+83eQ+gYX
> >>> eo8bgw04M6hk56CEtuwjjvAoCSGvz1Mx6/nANrMMpojiGEcIhL5OpkCjbjZsWCPD
> >>> NMGjPTAyscrHNkXEVDhiuAuFo4QcovXWtkpwOJ1alLJJatk8PHQvTt2cClLT3cfZ
> >>> BplTr5Bolb45IQ0iJsyz/3+NFyorZA6cucrVfHUIAlQf/76a+k/GUUnS7cW4aF5i
> >>> OrjZuDB54XKUDFI+FY15XV9c/SRaMiAgiWoBL9mdZZelhJvMdIPC7OY46YOlsagU
> >>> 9rL7iX4SKIO1IJ9UnVzN6qEnOOB7h5Rvid7KPGyoHYdy9fC8PSeo7Yo+Cnm6wm92
> >>> Gf/37x0hRDJETjByENMMFuxtimwkCs+6HtSwnVk2zHoLSiQAxQvJ+Mp+nEPxiP+M
> >>> gvbUCjxV8ynB7znNe8Bs
> >>> =YYLN
> >>> -----END PGP SIGNATURE-----
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [email protected]
> >>> For additional commands, e-mail: [email protected]
> >>>
> >>>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to