@@ -84,102 +84,25 @@ public static InputLocation of() {
84
84
return EMPTY ;
85
85
}
86
86
87
- /**
88
- * Creates a new InputLocation with the specified source.
89
- * The created instance is processed through ModelObjectProcessor for optimization.
90
- *
91
- * @param source the input source
92
- * @return a new InputLocation instance
93
- */
94
87
public static InputLocation of (InputSource source ) {
95
- return ModelObjectProcessor . processObject ( new InputLocation (source ) );
88
+ return new InputLocation (0 , 0 , source );
96
89
}
97
90
98
- /**
99
- * Creates a new InputLocation with the specified line and column numbers.
100
- * The created instance is processed through ModelObjectProcessor for optimization.
101
- *
102
- * @param lineNumber the line number
103
- * @param columnNumber the column number
104
- * @return a new InputLocation instance
105
- */
106
91
public static InputLocation of (int lineNumber , int columnNumber ) {
107
- return ModelObjectProcessor . processObject ( new InputLocation (lineNumber , columnNumber ) );
92
+ return new InputLocation (lineNumber , columnNumber );
108
93
}
109
94
110
- /**
111
- * Creates a new InputLocation with the specified line number, column number, and source.
112
- * The created instance is processed through ModelObjectProcessor for optimization.
113
- *
114
- * @param lineNumber the line number
115
- * @param columnNumber the column number
116
- * @param source the input source
117
- * @return a new InputLocation instance
118
- */
119
95
public static InputLocation of (int lineNumber , int columnNumber , InputSource source ) {
120
- return ModelObjectProcessor . processObject ( new InputLocation (lineNumber , columnNumber , source ) );
96
+ return new InputLocation (lineNumber , columnNumber , source );
121
97
}
122
98
123
- /**
124
- * Creates a new InputLocation with the specified line number, column number, source, and self location key.
125
- * The created instance is processed through ModelObjectProcessor for optimization.
126
- *
127
- * @param lineNumber the line number
128
- * @param columnNumber the column number
129
- * @param source the input source
130
- * @param selfLocationKey the self location key
131
- * @return a new InputLocation instance
132
- */
133
99
public static InputLocation of (int lineNumber , int columnNumber , InputSource source , Object selfLocationKey ) {
134
- return ModelObjectProcessor . processObject ( new InputLocation (lineNumber , columnNumber , source , selfLocationKey ) );
100
+ return new InputLocation (lineNumber , columnNumber , source , selfLocationKey );
135
101
}
136
102
137
- /**
138
- * Creates a new InputLocation with the specified line number, column number, source, and locations map.
139
- * The created instance is processed through ModelObjectProcessor for optimization.
140
- *
141
- * @param lineNumber the line number
142
- * @param columnNumber the column number
143
- * @param source the input source
144
- * @param locations the locations map
145
- * @return a new InputLocation instance
146
- */
147
103
public static InputLocation of (
148
104
int lineNumber , int columnNumber , InputSource source , Map <Object , InputLocation > locations ) {
149
- return ModelObjectProcessor .processObject (new InputLocation (lineNumber , columnNumber , source , locations ));
150
- }
151
-
152
- public int getLineNumber () {
153
- return lineNumber ;
154
- }
155
-
156
- public int getColumnNumber () {
157
- return columnNumber ;
158
- }
159
-
160
- public InputSource getSource () {
161
- return source ;
162
- }
163
-
164
- @ Override
165
- public InputLocation getLocation (Object key ) {
166
- return locations != null ? locations .get (key ) : null ;
167
- }
168
-
169
- public Map <Object , InputLocation > getLocations () {
170
- return locations ;
171
- }
172
-
173
- /**
174
- * Gets the parent InputLocation where this InputLocation may have been imported from.
175
- * Can return {@code null}.
176
- *
177
- * @return InputLocation
178
- * @since 4.0.0
179
- */
180
- @ Override
181
- public InputLocation getImportedFrom () {
182
- return importedFrom ;
105
+ return new InputLocation (lineNumber , columnNumber , source , locations );
183
106
}
184
107
185
108
/**
@@ -211,7 +134,7 @@ public static InputLocation merge(InputLocation target, InputLocation source, bo
211
134
}
212
135
213
136
return new InputLocation (-1 , -1 , InputSource .merge (source .getSource (), target .getSource ()), locations );
214
- } // -- InputLocation merge( InputLocation, InputLocation, boolean )
137
+ }
215
138
216
139
/**
217
140
* Merges the {@code source} location into the {@code target} location.
@@ -250,7 +173,40 @@ public static InputLocation merge(InputLocation target, InputLocation source, Co
250
173
}
251
174
252
175
return new InputLocation (-1 , -1 , InputSource .merge (source .getSource (), target .getSource ()), locations );
253
- } // -- InputLocation merge( InputLocation, InputLocation, java.util.Collection )
176
+ }
177
+
178
+ public int getLineNumber () {
179
+ return lineNumber ;
180
+ }
181
+
182
+ public int getColumnNumber () {
183
+ return columnNumber ;
184
+ }
185
+
186
+ public InputSource getSource () {
187
+ return source ;
188
+ }
189
+
190
+ @ Override
191
+ public InputLocation getLocation (Object key ) {
192
+ return locations != null ? locations .get (key ) : null ;
193
+ }
194
+
195
+ public Map <Object , InputLocation > getLocations () {
196
+ return locations ;
197
+ }
198
+
199
+ /**
200
+ * Gets the parent InputLocation where this InputLocation may have been imported from.
201
+ * Can return {@code null}.
202
+ *
203
+ * @return InputLocation
204
+ * @since 4.0.0
205
+ */
206
+ @ Override
207
+ public InputLocation getImportedFrom () {
208
+ return importedFrom ;
209
+ }
254
210
255
211
@ Override
256
212
public boolean equals (Object o ) {
0 commit comments