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: MapAttribute.java
13 * Created: 2007-09-25
14 * Author: apohllo
15 * $Id: MapAttribute.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 /**
28 * Map attribute to metamodel node. Attributes:
29 * <ul>
30 * <li>typeName - the name of the type which is assigned to the node which corresponds to the attribute value
31 * <li>name - the name of the link which connects given node with the attribute node (attribute name, by default)
32 * <li>load - the class used to load the attribute (only special cases)
33 * <li>save - the class used to save the attribute (only special cases)
34 * </ul>
35 *
36 * @author AGH CAST Team
37 *
38 */
39 @Retention(RetentionPolicy.RUNTIME)
40 @Target(ElementType.METHOD)
41 @Documented
42 @Inherited
43 public @interface MapAttribute {
44 String typeName() default "";
45
46 String name() default "";
47
48 Class load() default Object.class; // Object.class works as null parameter
49
50 Class save() default Object.class; // Object.class works as null parameter
51 }