# Status of annotation attributes?

**URL:** <https://discuss.kotlinlang.org/t/status-of-annotation-attributes/1194>\
**Category:** Uncategorized\
**Created:** [April 21, 2012, 5:11pm UTC](https://discuss.kotlinlang.org/t/status-of-annotation-attributes/1194 "2012-04-21T17:11:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cedricbeust](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/cedricbeust/32/1429_2.png) [@cedricbeust](https://discuss.kotlinlang.org/u/cedricbeust)\
**Post date:** [April 21, 2012, 5:11pm UTC](https://discuss.kotlinlang.org/t/status-of-annotation-attributes/1194/1 "2012-04-21T17:11:09Z")

</div>

Can somebody clarify the situation with annotation attributes? I'm a bit confused because [this bug (KT-1522)](http://youtrack.jetbrains.com/issue/KT-1522) appears to be closed but all that seems supported is

```kotlin
[Foo]
[Foo("valueConstructor")]
```

but not arbitrary attributes, such as:

```kotlin
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target(java.lang.annotation.ElementType.METHOD)
public @interface Parameter {
    String description() default "";
}
```

I also looked in the entire code base and couldn’t find anything besides [Inject] and [Intrinsic(“kotlin.javaClass.property”)].

I think KT-1522 should be reopened and bumped up, most modern Java frameworks need attributes to function properly, not having them is hindering what we can do with Kotlin today.

Thanks!

---

<div class="post-metadata">

**Author:** ![talios](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/talios/32/1612_2.png) [@talios](https://discuss.kotlinlang.org/u/talios)\
**Post date:** [April 21, 2012, 11:27pm UTC](https://discuss.kotlinlang.org/t/status-of-annotation-attributes/1194/2 "2012-04-21T23:27:30Z")

</div>

Support for it seems to be there, as I was doing this the other day in a bit of JSF test code:

ManagedBean(name = “login”)  
RequestScoped  
class LoginController {

&nbsp;&nbsp;ManagedProperty(value = “#{userProfile}”)  
&nbsp;&nbsp;public var userProfile : UserProfileController? = null;

---

<div class="post-metadata">

**Author:** ![cedricbeust](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/cedricbeust/32/1429_2.png) [@cedricbeust](https://discuss.kotlinlang.org/u/cedricbeust)\
**Post date:** [April 22, 2012, 4:28pm UTC](https://discuss.kotlinlang.org/t/status-of-annotation-attributes/1194/3 "2012-04-22T16:28:17Z")

</div>

Indeed, it works. Thanks Marc!

What’s the bracket syntax for, then?&nbsp;&nbsp;([Test])

---

<div class="post-metadata">

**Author:** ![talios](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/talios/32/1612_2.png) [@talios](https://discuss.kotlinlang.org/u/talios)\
**Post date:** [April 23, 2012, 12:07pm UTC](https://discuss.kotlinlang.org/t/status-of-annotation-attributes/1194/4 "2012-04-23T12:07:57Z")

</div>

The bracket syntax still seems to work, and might just be a throw back for familiarity ( altho thats the .NET syntax rather than Java ).

One reason I could see to keep it is that it visually breaks up the code to identify it as something “different”.&nbsp;&nbsp;The syntax without works nicer with lower case annotations, such as maybe:

test fun foo() {  
}

over

Test fun foo() {  
}

---

<div class="post-metadata">

**Author:** ![cedricbeust](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/cedricbeust/32/1429_2.png) [@cedricbeust](https://discuss.kotlinlang.org/u/cedricbeust)\
**Post date:** [April 23, 2012, 3:15pm UTC](https://discuss.kotlinlang.org/t/status-of-annotation-attributes/1194/5 "2012-04-23T15:15:09Z")

</div>

I think I prefer if the annotations stand out somehow instead of having them just look like a regular class, doesn't matter how ([Test], @Test, or whatever).

What’s the current thinking of the language team? Are annotations going to stay as they are, with no marker?

Also, any plan of being able to specify annotations in Kotlin at some point?

–  
Cédric

---

<div class="post-metadata">

**Author:** ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)\
**Post date:** [April 23, 2012, 3:17pm UTC](https://discuss.kotlinlang.org/t/status-of-annotation-attributes/1194/6 "2012-04-23T15:17:34Z")

</div>

Currently annotations have an optional marker: the square brackets. We believe that there are many cases where such a marker just clutters the code, e.g. modifier annotations that have no parameters, so we provide a shorthand syntax, too.
