public class Annotation extends Object:
Runtime representation of an annotation attached to a reflected type, constructor, method, property, attribute or parameter.
The arguments map stores annotation argument values as source text. This keeps reflection lightweight and avoids guessing a runtime boxed value for enum constants or type references. argumentTypes exposes the token kind recorded by the compiler (String, Int, Identifier, ...).
import klyn.databases.entities
@Entity(tableName="T_Users")
public class User:
pass
annotation = User.type.annotations[0]
assert annotation.name == "Entity"
assert annotation.argument("tableName") == "T_Users"| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | argumentTypes | Annotation argument token kinds. |
| public readonly property | arguments | Annotation arguments as raw source values. |
| public readonly property | namename as String: |
Annotation name. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Annotation | Builds annotation metadata. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | argument | Returns an annotation argument value or a default value. |
| public | argumentType | Returns an annotation argument token kind or a default value. |
| public | hasArgument | Returns true when an argument is explicitly present. |
| public override | toStringtoString() as String: |
Returns a readable representation of the annotation. |