1 package org.codehaus.modello.plugins.xml.metadata;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import org.codehaus.modello.metadata.AssociationMetadata;
26
27
28
29
30 public class XmlAssociationMetadata implements AssociationMetadata {
31 public static final String ID = XmlAssociationMetadata.class.getName();
32
33 public static final String EXPLODE_MODE = "explode";
34
35 public static final String INLINE_MODE = "inline";
36
37 public static final String ITEMS_STYLE_FLAT = "flat";
38
39 public static final String ITEMS_STYLE_WRAPPED = "wrapped";
40
41 private String tagName;
42
43 private String itemsStyle = ITEMS_STYLE_WRAPPED;
44
45 private String mapStyle = INLINE_MODE;
46
47 private boolean reference;
48
49 public String getTagName() {
50 return tagName;
51 }
52
53 public void setTagName(String tagName) {
54 this.tagName = tagName;
55 }
56
57 public String getItemsStyle() {
58 return itemsStyle;
59 }
60
61 public void setItemsStyle(String itemsStyle) {
62 if (ITEMS_STYLE_FLAT.equals(itemsStyle) || ITEMS_STYLE_WRAPPED.equals(itemsStyle)) {
63 this.itemsStyle = itemsStyle;
64 } else {
65
66 this.itemsStyle = ITEMS_STYLE_WRAPPED;
67 }
68 }
69
70 public boolean isFlatItems() {
71 return ITEMS_STYLE_FLAT.equals(itemsStyle);
72 }
73
74 public boolean isWrappedItems() {
75 return ITEMS_STYLE_WRAPPED.equals(itemsStyle);
76 }
77
78
79
80
81 public String getMapStyle() {
82 return mapStyle;
83 }
84
85
86
87
88 public void setMapStyle(String mapStyle) {
89 if (mapStyle == null) {
90 this.mapStyle = INLINE_MODE;
91 } else {
92 this.mapStyle = mapStyle;
93 }
94 }
95
96 public boolean isMapInline() {
97 return INLINE_MODE.equals(mapStyle);
98 }
99
100 public boolean isMapExplode() {
101 return EXPLODE_MODE.equals(mapStyle);
102 }
103
104 public boolean isReference() {
105 return reference;
106 }
107
108 public void setReference(boolean reference) {
109 this.reference = reference;
110 }
111 }