You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "Carl F. Hall" <ca...@et.gatech.edu> on 2010/01/05 19:53:12 UTC
Re: SCR Cardinality
Yes, I would like an unbounded array. The scr docs say to use Integer.MAX_INT but that isn't available in Integer nor can I specify it as a String since the field wants an int. What would be the correct way to specify an unbounded cardinality?
----- "Niels B Nielsen" <ni...@jpmorgan.com> wrote:
> Well, I assume you realise that you cannot replace an integer with an
> expression that could evaluate to an integer.
>
> So basically you are asking how to specify an unbounded cardinality?
>
> -----Original Message-----
> From: Carl F. Hall [mailto:carl.hall@et.gatech.edu]
> Sent: 17 December 2009 22:13
> To: users@felix.apache.org
> Subject: SCR Cardinality
>
> I'm trying to setup a property to be an array without giving it any
> initial values.
> I've tried using this:
>
> @Property(cardinality = Integer.MAX_VALUE)
> protected static final String PROP_ATTRIBUTES =
> "ldap.provider.attributes";
>
> But get this in my build:
> java.lang.NumberFormatException: For input string:
> "Integer.MAX_VALUE"
> at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> at java.lang.Integer.parseInt(Integer.java:449)
> at java.lang.Integer.valueOf(Integer.java:554)
> at
> org.apache.felix.scrplugin.tags.annotation.defaulttag.Util.getIntValue(Util.java:58)
> at
> org.apache.felix.scrplugin.tags.annotation.defaulttag.PropertyTag$1.cardinality(PropertyTag.java:47)
> at
> org.apache.felix.scrplugin.tags.annotation.defaulttag.PropertyTag.getNamedParameterMap(PropertyTag.java:226)
> at
> org.apache.felix.scrplugin.tags.annotation.defaulttag.AbstractTag.getNamedParameter(AbstractTag.java:47)
> ...
>
> I'm using version 1.0.0 of the annotations. Am I doing something
> wrong?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at http://www.jpmorgan.com/pages/disclosures/email.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: SCR Cardinality
Posted by "Carl F. Hall" <ca...@et.gatech.edu>.
Thanks for the clarification, Felix. I'll update my classes appropriately.
----- "Felix Meschberger" <fm...@gmail.com> wrote:
> Hi,
>
> On 05.01.2010 19:53, Carl F. Hall wrote:
> > Yes, I would like an unbounded array. The scr docs say to use
> Integer.MAX_INT but that isn't available in Integer nor can I specify
> it as a String since the field wants an int. What would be the
> correct way to specify an unbounded cardinality?
>
> As nasty as it is, you have to explicitly declare the number:
>
> −2147483648 for an unbounded Vector
> 2147483647 for an unbounded array
>
> When using the JavaDoc annotations you have the synthatic sugar of
> being
> able to say "+" for an unbounded array and "-" for an unbounded
> Vector.
> But this is obviously not possible with annotations.
>
> BTW: In Rev. 896326 I have enhanced the Property annotation JavaDoc
> to
> explicitly list the actual numeric values for these values to
> copy/paste...
>
> Regards
> Felix
>
> >
> >
> > ----- "Niels B Nielsen" <ni...@jpmorgan.com> wrote:
> >
> >> Well, I assume you realise that you cannot replace an integer with
> an
> >> expression that could evaluate to an integer.
> >>
> >> So basically you are asking how to specify an unbounded
> cardinality?
> >>
> >> -----Original Message-----
> >> From: Carl F. Hall [mailto:carl.hall@et.gatech.edu]
> >> Sent: 17 December 2009 22:13
> >> To: users@felix.apache.org
> >> Subject: SCR Cardinality
> >>
> >> I'm trying to setup a property to be an array without giving it
> any
> >> initial values.
> >> I've tried using this:
> >>
> >> @Property(cardinality = Integer.MAX_VALUE)
> >> protected static final String PROP_ATTRIBUTES =
> >> "ldap.provider.attributes";
> >>
> >> But get this in my build:
> >> java.lang.NumberFormatException: For input string:
> >> "Integer.MAX_VALUE"
> >> at
> >>
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> >> at java.lang.Integer.parseInt(Integer.java:449)
> >> at java.lang.Integer.valueOf(Integer.java:554)
> >> at
> >>
> org.apache.felix.scrplugin.tags.annotation.defaulttag.Util.getIntValue(Util.java:58)
> >> at
> >>
> org.apache.felix.scrplugin.tags.annotation.defaulttag.PropertyTag$1.cardinality(PropertyTag.java:47)
> >> at
> >>
> org.apache.felix.scrplugin.tags.annotation.defaulttag.PropertyTag.getNamedParameterMap(PropertyTag.java:226)
> >> at
> >>
> org.apache.felix.scrplugin.tags.annotation.defaulttag.AbstractTag.getNamedParameter(AbstractTag.java:47)
> >> ...
> >>
> >> I'm using version 1.0.0 of the annotations. Am I doing something
> >> wrong?
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> For additional commands, e-mail: users-help@felix.apache.org
> >>
> >>
> >> This email is confidential and subject to important disclaimers
> and
> >> conditions including on offers for the purchase or sale of
> >> securities, accuracy and completeness of information, viruses,
> >> confidentiality, legal privilege, and legal entity disclaimers,
> >> available at http://www.jpmorgan.com/pages/disclosures/email.
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: SCR Cardinality
Posted by Felix Meschberger <fm...@gmail.com>.
Hi,
On 05.01.2010 19:53, Carl F. Hall wrote:
> Yes, I would like an unbounded array. The scr docs say to use Integer.MAX_INT but that isn't available in Integer nor can I specify it as a String since the field wants an int. What would be the correct way to specify an unbounded cardinality?
As nasty as it is, you have to explicitly declare the number:
−2147483648 for an unbounded Vector
2147483647 for an unbounded array
When using the JavaDoc annotations you have the synthatic sugar of being
able to say "+" for an unbounded array and "-" for an unbounded Vector.
But this is obviously not possible with annotations.
BTW: In Rev. 896326 I have enhanced the Property annotation JavaDoc to
explicitly list the actual numeric values for these values to copy/paste...
Regards
Felix
>
>
> ----- "Niels B Nielsen" <ni...@jpmorgan.com> wrote:
>
>> Well, I assume you realise that you cannot replace an integer with an
>> expression that could evaluate to an integer.
>>
>> So basically you are asking how to specify an unbounded cardinality?
>>
>> -----Original Message-----
>> From: Carl F. Hall [mailto:carl.hall@et.gatech.edu]
>> Sent: 17 December 2009 22:13
>> To: users@felix.apache.org
>> Subject: SCR Cardinality
>>
>> I'm trying to setup a property to be an array without giving it any
>> initial values.
>> I've tried using this:
>>
>> @Property(cardinality = Integer.MAX_VALUE)
>> protected static final String PROP_ATTRIBUTES =
>> "ldap.provider.attributes";
>>
>> But get this in my build:
>> java.lang.NumberFormatException: For input string:
>> "Integer.MAX_VALUE"
>> at
>> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>> at java.lang.Integer.parseInt(Integer.java:449)
>> at java.lang.Integer.valueOf(Integer.java:554)
>> at
>> org.apache.felix.scrplugin.tags.annotation.defaulttag.Util.getIntValue(Util.java:58)
>> at
>> org.apache.felix.scrplugin.tags.annotation.defaulttag.PropertyTag$1.cardinality(PropertyTag.java:47)
>> at
>> org.apache.felix.scrplugin.tags.annotation.defaulttag.PropertyTag.getNamedParameterMap(PropertyTag.java:226)
>> at
>> org.apache.felix.scrplugin.tags.annotation.defaulttag.AbstractTag.getNamedParameter(AbstractTag.java:47)
>> ...
>>
>> I'm using version 1.0.0 of the annotations. Am I doing something
>> wrong?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>> This email is confidential and subject to important disclaimers and
>> conditions including on offers for the purchase or sale of
>> securities, accuracy and completeness of information, viruses,
>> confidentiality, legal privilege, and legal entity disclaimers,
>> available at http://www.jpmorgan.com/pages/disclosures/email.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org