View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: MapLink.java
13   * Created: 2007-09-25
14   * Author: apohllo, entrop
15   * $Id: MapLink.java 2232 2009-01-04 22:59:53Z apohllo $
16   */
17  
18  package pl.edu.agh.cast.model.mapper.annotation;
19  
20  import java.lang.annotation.Documented;
21  import java.lang.annotation.ElementType;
22  import java.lang.annotation.Inherited;
23  import java.lang.annotation.Retention;
24  import java.lang.annotation.RetentionPolicy;
25  import java.lang.annotation.Target;
26  
27  import pl.edu.agh.cast.model.mapper.Direction;
28  
29  /**
30   * Map link between two objects to metamodel link. Attributes:
31   * <ul>
32   * <li>name - the name of the link - must be the same at both sides
33   * <li>direction - Direction.SRC (def.)/ Direction.DST - indicates if this is source or destination of the link
34   * <li>load - the class used to load the link (only special cases)
35   * <li>save - the class used to save the link (only special cases)
36   * </ul>
37   *
38   * @author AGH CAST Team
39   *
40   */
41  @Retention(RetentionPolicy.RUNTIME)
42  @Target(ElementType.METHOD)
43  @Documented
44  @Inherited
45  public @interface MapLink {
46  	String name();
47  
48  	Direction direction() default Direction.SRC;
49  
50  	Class load() default Object.class; // Object.class works as null parameter
51  
52  	Class save() default Object.class; // Object.class works as null parameter
53  }