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