Berin Loritsch wrote:
> Just out of curiosity, can you specify an array of things?
>
> /**
>   * @MyAttribute({Entry("name","value"), Entry("name,"value")})
>   */
>
> Not critical at this juncture, just curious.

Yes, but you'd have to write it like this:

 @MyAttribute (new Object[]{ new Entry ("name","value"), new
Entry("name,"value")})

Basically, an attribute is just a Java expression that results in an
Object, with some syntactic sugar on top of it. "@MyAttribute" is short
for "@new MyAttribute ()". Then the compiler strips the initial @ and
what's left will be the attribute. If I write the above as:

 @new MyAttribute (new Object[]{ new Entry ("name","value"), new
Entry("name,"value")})

You'll see it the way it will be. So, you can for example do this:

 @Long (System.currentTimeMillis ())

which will result in a Long attribute that will hold the time the
attribute was loaded. (Not very useful.)

/LS


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to