1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.helger.schematron.pure.model;
18
19 import java.io.Serializable;
20
21 import javax.annotation.Nonnull;
22 import javax.annotation.Nullable;
23 import javax.annotation.concurrent.NotThreadSafe;
24
25 import com.helger.commons.lang.ICloneable;
26 import com.helger.commons.string.ToStringGenerator;
27 import com.helger.schematron.CSchematronXML;
28 import com.helger.xml.microdom.IMicroElement;
29
30
31
32
33
34
35 @NotThreadSafe
36 public class PSLinkableGroup implements ICloneable <PSLinkableGroup>, Serializable
37 {
38 private String m_sRole;
39 private String m_sSubject;
40
41 public PSLinkableGroup ()
42 {}
43
44 public void setRole (@Nullable final String sRole)
45 {
46 m_sRole = sRole;
47 }
48
49
50
51
52
53
54
55
56
57
58 @Nullable
59 public String getRole ()
60 {
61 return m_sRole;
62 }
63
64 public void setSubject (@Nullable final String sSubject)
65 {
66 m_sSubject = sSubject;
67 }
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85 @Nullable
86 public String getSubject ()
87 {
88 return m_sSubject;
89 }
90
91 public static boolean isLinkableAttribute (@Nullable final String sAttrName)
92 {
93 return CSchematronXML.ATTR_ROLE.equals (sAttrName) || CSchematronXML.ATTR_SUBJECT.equals (sAttrName);
94 }
95
96 public void fillMicroElement (@Nonnull final IMicroElement aElement)
97 {
98 aElement.setAttribute (CSchematronXML.ATTR_ROLE, m_sRole);
99 aElement.setAttribute (CSchematronXML.ATTR_SUBJECT, m_sSubject);
100 }
101
102 @Nonnull
103 public PSLinkableGroup getClone ()
104 {
105 final PSLinkableGroupl/PSLinkableGroup.html#PSLinkableGroup">PSLinkableGroup ret = new PSLinkableGroup ();
106 ret.setRole (m_sRole);
107 ret.setSubject (m_sSubject);
108 return ret;
109 }
110
111 @Override
112 public String toString ()
113 {
114 return new ToStringGenerator (this).appendIfNotNull ("role", m_sRole)
115 .appendIfNotNull ("subject", m_sSubject)
116 .getToString ();
117 }
118 }