1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.ws.commons.schema;
21
22 import java.util.LinkedHashMap;
23 import java.util.Map;
24
25 public abstract class XmlSchemaObject {
26 int lineNumber;
27 int linePosition;
28 String sourceURI;
29
30
31
32
33
34
35
36 private Map metaInfoMap = null;
37
38
39
40
41
42 public Map getMetaInfoMap() {
43 return metaInfoMap;
44 }
45
46
47
48
49
50 public void setMetaInfoMap(Map metaInfoMap) {
51 this.metaInfoMap = metaInfoMap;
52 }
53
54
55
56
57
58
59
60
61 public void addMetaInfo(Object key,Object value){
62 if (metaInfoMap==null){
63 metaInfoMap = new LinkedHashMap();
64 }
65
66 metaInfoMap.put(key,value);
67 }
68
69
70
71
72
73 protected XmlSchemaObject() {
74 }
75
76 public int getLineNumber() {
77 return lineNumber;
78 }
79
80 public void setLineNumber(int lineNumber) {
81 this.lineNumber = lineNumber;
82 }
83
84 public int getLinePosition() {
85 return linePosition;
86 }
87
88 public void setLinePosition(int linePosition) {
89 this.linePosition = linePosition;
90 }
91
92 public String getSourceURI() {
93 return sourceURI;
94 }
95
96 public void setSourceURI(String sourceURI) {
97 this.sourceURI = sourceURI;
98 }
99
100 public boolean equals(Object what) {
101 if (what == this) {
102 return true;
103 }
104
105
106 if (!(what instanceof XmlSchemaObject)) {
107 return false;
108 }
109
110 XmlSchemaObject xso = (XmlSchemaObject) what;
111
112 if (this.lineNumber != xso.lineNumber) {
113 return false;
114 }
115
116 if (this.linePosition != xso.linePosition) {
117 return false;
118 }
119
120 if (this.sourceURI != null) {
121 if (!this.sourceURI.equals(xso.sourceURI)) {
122 return false;
123 }
124 } else {
125 if (xso.sourceURI != null) {
126 return false;
127 }
128 }
129
130 return true;
131 }
132
133 public String toString(String prefix, int tab) {
134 String xml = new String();
135 for (int i = 0; i < tab; i++)
136 xml += "\t";
137
138 xml += this.getClass().toString() + "\n";
139 return xml;
140 }
141 }