1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.apt.generate;
21
22 import java.util.ArrayList;
23 import java.util.List;
24
25
26 public class TagInfo extends RendererInfo {
27 private List<PropertyInfo> properties = new ArrayList<>();
28 private String componentClassName;
29
30
31
32 @Deprecated
33 private String componentType;
34 private String tagName;
35 private String componentFamily;
36 private PropertyInfo bodyContent;
37 private boolean checkBodyContent;
38
39 public TagInfo(final String sourceClass, final String qualifiedName, final String[] rendererType) {
40 super(sourceClass, qualifiedName, rendererType);
41 tagName = ClassUtils.getSmallSimpleName(qualifiedName);
42 }
43
44
45
46
47 @Deprecated
48 public TagInfo(final String sourceClass, final String qualifiedName) {
49 super(sourceClass, qualifiedName);
50 }
51
52 public PropertyInfo getBodyContent() {
53 if (!checkBodyContent) {
54 checkBodyContent = true;
55 for (final PropertyInfo info : properties) {
56 if (info.isBodyContent()) {
57 bodyContent = info;
58 break;
59 }
60 }
61 }
62 return bodyContent;
63 }
64
65 public void setBodyContent(final PropertyInfo bodyContent) {
66 this.bodyContent = bodyContent;
67 }
68
69 public List<PropertyInfo> getProperties() {
70 return properties;
71 }
72
73 public int getPropertiesSize() {
74 return properties.size();
75 }
76
77 public int getPropertiesSizePlusOne() {
78 return properties.size() + 1;
79 }
80
81 public void setComponentClassName(final String componentClass) {
82 addImport(componentClass);
83 this.componentClassName = ClassUtils.getSimpleName(componentClass);
84 }
85
86 public String getComponentClassName() {
87 return componentClassName;
88 }
89
90 public String getComponentType() {
91 return componentType;
92 }
93
94 public void setComponentType(final String componentType) {
95 this.componentType = componentType;
96 }
97
98 public String getComponentFamily() {
99 return componentFamily;
100 }
101
102 public void setComponentFamily(final String componentFamily) {
103 this.componentFamily = componentFamily;
104 }
105
106 public String getTagName() {
107 return tagName;
108 }
109 }