package annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Denotes the association relationship of a field. * Used only for the UML static analyzer. * Fields without that annotation will be treated as: * 1. For non-list and non-array field: Single association relationship (--->) * 2. For list and array: Multiple relationship (---> 0..*) * Use this annotation to specify bonds and part-of relationships. */ @Retention(RetentionPolicy.CLASS) @Target(ElementType.FIELD) public @interface Assoc { /** * EFFECTS: Return the lower bond of the list or variable. Return 0 for nullable variables. * Defaults to 1 (single variable, means nonnull) or 0 (list, means empty-able). */ int lowerBond() default 1; /** * EFFECTS: Return the upper bond of the list. * Defaults to 1 (single variable) or -1 (list, means *) * REQUIRES: For a single variable, it must return 1. */ int upperBond() default -1; /** * EFFECTS: Returns whether the field is in a part-of relationship. * Defaults to false. */ boolean partOf() default false; }