Debian Codegraph @

net/sf/saxon/type/Converter.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.type;
9
10 import net.sf.saxon.lib.ConversionRules;
11 import net.sf.saxon.om.NamespaceResolver;
12 import net.sf.saxon.value.*;
13
14 import java.math.BigDecimal;
15
16 /**
17 * A converter implements conversions from one atomic type to another - that is, it implements the casting
18 * rules for a (source type, destination type) pair.
19 * <p>There is potentially one Converter implementation for each pair of (source, target) classes; though in many
20 * cases the same implementation handles a number of such pairs.</p>
21 * <p>In cases where the conversion rules are fixed (specifically, where they do not depend on differences between
22 * versions of the XSD or QT specifications), the appropriate Converter can be obtained as a static constant, for example
23 * {@link BooleanToDouble#INSTANCE}. In other cases the converter is parameterized by the {@link ConversionRules} object,
24 * and should be obtained by calling the appropriate factory method on the ConversionRules.</p>
25 * <p>Where the source type of the conversion is xs:string, the converter will always be a subclass of
26 * {@link StringConverter}</p>
27 */
28 public abstract class Converter {
29
30
31 /**
32 * Convenience method to convert a given value to a given type. Note: it is more efficient
33 * to obtain a converter in advance and to reuse it for multiple conversions
34 *
35 * @param value the value to be converted
36 * @param targetType the type to which the value is to be converted
37 * @param rules the conversion rules for the configuration
38 * @return the converted value
39 * @throws ValidationException if conversion fails
40 */
41
42 public static AtomicValue convert(AtomicValue value, AtomicType targetType, ConversionRules rules)
43 throws ValidationException {
44 Converter converter = rules.getConverter(value.getPrimitiveType(), targetType);
45 if (converter == null) {
46 ValidationFailure ve = new ValidationFailure("Cannot convert value from " + value.getPrimitiveType() + " to " + targetType);
47 ve.setErrorCode("FORG0001");
48 throw ve.makeException();
49 }
50 return converter.convert(value).asAtomic();
51 }
52
53
54 // All converters can hold a reference to the conversion rules, though many don't
55 private ConversionRules conversionRules;
56
57 // Protected constructor for a Converter
58
59 protected Converter() {
60 }
61
62 /**
63 * Construct a converter with a given set of conversion rules. For use in constructing subclasses
64 *
65 * @param rules the conversion rules for the configuration
66 */
67 protected Converter(ConversionRules rules) {
68 setConversionRules(rules);
69 }
70
71 /**
72 * Convert an atomic value from the source type to the target type
73 *
74 * @param input the atomic value to be converted, which the caller guarantees to be of the appropriate
75 * type for the converter. The results are undefined if the value is of the wrong type;
76 * possible outcomes are (apparent) success, or a ClassCastException.
77 * @return the result of the conversion, as an {@link AtomicValue}, if conversion succeeds, or a {@link ValidationFailure}
78 * object describing the reasons for failure if conversion is not possible. Note that the ValidationFailure
79 * object is not (and does not contain) an exception, because it does not necessarily result in an error being
80 * thrown, and creating exceptions on non-failure paths is expensive.
81 */
82
83 /*@NotNull*/
84 public abstract ConversionResult convert(AtomicValue input);
85
86 /**
87 * Set the conversion rules to be used by this Converter
88 *
89 * @param rules the conversion rules
90 */
91
92 public final void setConversionRules(ConversionRules rules) {
93 this.conversionRules = rules;
94 }
95
96 /**
97 * Get the conversion rules to be used by this Converter
98 *
99 * @return the conversion rules
100 */
101
102
103 public final ConversionRules getConversionRules() {
104 return conversionRules;
105 }
106
107 /**
108 * Ask if this converter will always succeed
109 *
110 * @return true if this Converter will never return a ValidationFailure
111 */
112
113 public boolean isAlwaysSuccessful() {
114 return false;
115 }
116
117 /**
118 * Provide a namespace resolver, needed for conversion to namespace-sensitive types such as QName and NOTATION.
119 * The resolver is ignored if the target type is not namespace-sensitive
120 *
121 * @param resolver the namespace resolver to be used
122 * @return a new Converter customised with the supplied namespace context. The original Converter is
123 * unchanged (see bug 2754)
124 */
125
126 public Converter setNamespaceResolver(NamespaceResolver resolver) {
127 return this;
128 // no action
129 }
130
131 /**
132 * Get the namespace resolver if one has been supplied
133 *
134 * @return the namespace resolver, or null if none has been supplied
135 */
136
137 /*@Nullable*/
138 public NamespaceResolver getNamespaceResolver() {
139 return null;
140 }
141
142 /**
143 * Specialisation for converters that always succeed
144 */
145
146 public static abstract class UnfailingConverter extends Converter {
147 @Override
148 public abstract AtomicValue convert(AtomicValue input);
149
150 @Override
151 public final boolean isAlwaysSuccessful() {
152 return true;
153 }
154 }
155
156 /**
157 * Converter that does nothing - it returns the input unchanged
158 */
159
160 public static class IdentityConverter extends Converter {
161 public final static IdentityConverter INSTANCE = new IdentityConverter();
162
163 public ConversionResult convert(AtomicValue input) {
164 return input;
165 }
166
167 public boolean isAlwaysSuccessful() {
168 return true;
169 }
170
171 }
172
173
174 /**
175 * Converter that does nothing except change the type annotation of the value. The caller
176 * is responsible for ensuring that this type annotation is legimite, that is, that the value
177 * is in the value space of this type
178 */
179
180 public static class UpCastingConverter extends UnfailingConverter {
181 private AtomicType newTypeAnnotation;
182
183 public UpCastingConverter(AtomicType annotation) {
184 this.newTypeAnnotation = annotation;
185 }
186
187 public AtomicValue convert(/*@NotNull*/ AtomicValue input) {
188 return input.copyAsSubType(newTypeAnnotation);
189 }
190
191 }
192
193 /**
194 * Converter that checks that a value belonging to a supertype is a valid
195 * instance of a subtype, and returns an instance of the subtype
196 */
197
198 public static class DownCastingConverter extends Converter {
199 private AtomicType newType;
200
201 public DownCastingConverter(AtomicType annotation, ConversionRules rules) {
202 this.newType = annotation;
203 setConversionRules(rules);
204 }
205
206 public AtomicType getTargetType() {
207 return newType;
208 }
209
210 /*@NotNull*/
211 public ConversionResult convert(/*@NotNull*/ AtomicValue input) {
212 return convert(input, input.getCanonicalLexicalRepresentation());
213 }
214
215 public ConversionResult convert(AtomicValue input, CharSequence lexicalForm) {
216 ValidationFailure f = newType.validate(input, lexicalForm, getConversionRules());
217 if (f == null) {
218 // success
219 return input.copyAsSubType(newType);
220 } else {
221 // validation failed
222 return f;
223 }
224 }
225
226 public ValidationFailure validate(AtomicValue input, CharSequence lexicalForm) {
227 return newType.validate(input, lexicalForm, getConversionRules());
228 }
229 }
230
231 /**
232 * Converter that operates in two phases, via an intermediate type
233 */
234
235 public static class TwoPhaseConverter extends Converter {
236 private Converter phaseOne;
237 private Converter phaseTwo;
238
239 public TwoPhaseConverter(Converter phaseOne, Converter phaseTwo) {
240 this.phaseOne = phaseOne;
241 this.phaseTwo = phaseTwo;
242 }
243
244 /*@Nullable*/
245 public static TwoPhaseConverter makeTwoPhaseConverter(
246 AtomicType inputType, AtomicType viaType, AtomicType outputType, ConversionRules rules) {
247 return new TwoPhaseConverter(
248 rules.getConverter(inputType, viaType),
249 rules.getConverter(viaType, outputType));
250 }
251
252 @Override
253 public Converter setNamespaceResolver(NamespaceResolver resolver) {
254 return new TwoPhaseConverter(phaseOne.setNamespaceResolver(resolver), phaseTwo.setNamespaceResolver(resolver));
255 }
256
257 /*@NotNull*/
258 public ConversionResult convert(AtomicValue input) {
259 ConversionResult temp = phaseOne.convert(input);
260 if (temp instanceof ValidationFailure) {
261 return temp;
262 }
263 AtomicValue aTemp = (AtomicValue)temp;
264 if (phaseTwo instanceof DownCastingConverter) {
265 return ((DownCastingConverter) phaseTwo).convert(aTemp, aTemp.getCanonicalLexicalRepresentation());
266 } else {
267 return phaseTwo.convert(aTemp);
268 }
269 }
270
271 }
272
273 /**
274 * Converts any value to untyped atomic
275 */
276
277 public static class ToUntypedAtomicConverter extends UnfailingConverter {
278 public static final ToUntypedAtomicConverter INSTANCE = new ToUntypedAtomicConverter();
279 public UntypedAtomicValue convert(AtomicValue input) {
280 return new UntypedAtomicValue(input.getStringValueCS());
281 }
282 }
283
284 /**
285 * Converts any value to a string
286 */
287
288 public static class ToStringConverter extends UnfailingConverter {
289 public static final ToStringConverter INSTANCE = new ToStringConverter();
290 public StringValue convert(AtomicValue input) {
291 return new StringValue(input.getStringValueCS());
292 }
293 }
294
295 /**
296 * Converts any numeric value to xs:float
297 */
298
299 public static class NumericToFloat extends UnfailingConverter {
300 public final static NumericToFloat INSTANCE = new NumericToFloat();
301 public FloatValue convert(AtomicValue input) {
302 return new FloatValue(((NumericValue)input).getFloatValue());
303 }
304 }
305
306 /**
307 * Converts a boolean to an xs:float
308 */
309
310 public static class BooleanToFloat extends UnfailingConverter {
311 public final static BooleanToFloat INSTANCE = new BooleanToFloat();
312 public FloatValue convert(AtomicValue input) {
313 return new FloatValue(((BooleanValue)input).getBooleanValue() ? 1.0f : 0.0f);
314 }
315 }
316
317 /**
318 * Converts any numeric value to a double.
319 */
320
321 public static class NumericToDouble extends UnfailingConverter {
322 public static final NumericToDouble INSTANCE = new NumericToDouble();
323 public DoubleValue convert(AtomicValue input) {
324 if (input instanceof DoubleValue) {
325 return (DoubleValue)input;
326 } else {
327 return new DoubleValue(((NumericValue)input).getDoubleValue());
328 }
329 }
330 }
331
332 /**
333 * Converts a boolean to a double
334 */
335
336 public static class BooleanToDouble extends UnfailingConverter {
337 public final static BooleanToDouble INSTANCE = new BooleanToDouble();
338 public DoubleValue convert(AtomicValue input) {
339 return new DoubleValue(((BooleanValue) input).getBooleanValue() ? 1.0e0 : 0.0e0);
340 }
341 }
342
343 /**
344 * Convers a double to a decimal
345 */
346
347 public static class DoubleToDecimal extends Converter {
348 public final static DoubleToDecimal INSTANCE = new DoubleToDecimal();
349 public ConversionResult convert(AtomicValue input) {
350 try {
351 return new BigDecimalValue(((DoubleValue) input).getDoubleValue());
352 } catch (ValidationException e) {
353 return e.getValidationFailure();
354 }
355 }
356 }
357
358 /**
359 * Converts a float to a decimal
360 */
361
362 public static class FloatToDecimal extends Converter {
363 public final static FloatToDecimal INSTANCE = new FloatToDecimal();
364 public ConversionResult convert(AtomicValue input) {
365 try {
366 return new BigDecimalValue(((FloatValue) input).getFloatValue());
367 } catch (ValidationException e) {
368 return e.getValidationFailure();
369 }
370 }
371 }
372
373 /**
374 * Converts an integer to a decimal
375 */
376
377 public static class IntegerToDecimal extends UnfailingConverter {
378 public final static IntegerToDecimal INSTANCE = new IntegerToDecimal();
379 public BigDecimalValue convert(AtomicValue input) {
380 if (input instanceof Int64Value) {
381 return new BigDecimalValue(((Int64Value) input).longValue());
382 } else {
383 return new BigDecimalValue(((BigIntegerValue) input).asDecimal());
384 }
385 }
386 }
387
388 /**
389 * Converts any numeric value to a decimal
390 */
391
392 public static class NumericToDecimal extends Converter {
393 public final static NumericToDecimal INSTANCE = new NumericToDecimal();
394 public ConversionResult convert(AtomicValue input) {
395 try {
396 BigDecimal decimal = ((NumericValue) input).getDecimalValue();
397 return new BigDecimalValue(decimal);
398 } catch (ValidationException e) {
399 return e.getValidationFailure();
400 }
401 }
402 }
403
404 /**
405 * Converts a boolean to a decimal
406 */
407
408 public static class BooleanToDecimal extends UnfailingConverter {
409 public final static BooleanToDecimal INSTANCE = new BooleanToDecimal();
410 public BigDecimalValue convert(AtomicValue input) {
411 return ((BooleanValue) input).getBooleanValue() ? BigDecimalValue.ONE : BigDecimalValue.ZERO;
412 }
413 }
414
415
416 /**
417 * Converts a double to an integer
418 */
419
420 public static class DoubleToInteger extends Converter {
421 public final static DoubleToInteger INSTANCE = new DoubleToInteger();
422 public ConversionResult convert(AtomicValue input) {
423 return IntegerValue.makeIntegerValue((DoubleValue)input);
424 }
425 }
426
427 /**
428 * Converts a float to an integer
429 */
430
431 public static class FloatToInteger extends Converter {
432 public final static FloatToInteger INSTANCE = new FloatToInteger();
433 public ConversionResult convert(AtomicValue input) {
434 return IntegerValue.makeIntegerValue(new DoubleValue(((FloatValue) input).getDoubleValue()));
435 }
436 }
437
438 /**
439 * Converts a decimal to an integer. Because an xs:integer is an xs:decimal,
440 * this must also be prepared to accept an xs:integer
441 */
442
443 public static class DecimalToInteger extends UnfailingConverter {
444 public final static DecimalToInteger INSTANCE = new DecimalToInteger();
445 public IntegerValue convert(AtomicValue input) {
446 if (input instanceof IntegerValue) {
447 return (IntegerValue)input;
448 }
449 return BigIntegerValue.makeIntegerValue(((BigDecimalValue) input).getDecimalValue().toBigInteger());
450 }
451 }
452
453 /**
454 * Converts any numeric value to an integer.
455 */
456
457 public static class NumericToInteger extends Converter {
458 public final static NumericToInteger INSTANCE = new NumericToInteger();
459 public ConversionResult convert(AtomicValue input) {
460 NumericValue in = (NumericValue) input;
461 try {
462 if (in instanceof IntegerValue) {
463 return in;
464 } else if (in instanceof DoubleValue) {
465 return IntegerValue.makeIntegerValue((DoubleValue) in);
466 } else if (in instanceof FloatValue) {
467 return IntegerValue.makeIntegerValue(new DoubleValue(in.getDoubleValue()));
468 } else {
469 return BigIntegerValue.makeIntegerValue(in.getDecimalValue().toBigInteger());
470 }
471 } catch (ValidationException e) {
472 return e.getValidationFailure();
473 }
474 }
475 }
476
477 /**
478 * Converts a boolean to an integer
479 */
480
481 public static class BooleanToInteger extends UnfailingConverter {
482 public final static BooleanToInteger INSTANCE = new BooleanToInteger();
483 public Int64Value convert(AtomicValue input) {
484 return ((BooleanValue) input).getBooleanValue() ? Int64Value.PLUS_ONE : Int64Value.ZERO;
485 }
486 }
487
488 /**
489 * Converts a duration to a dayTimeDuration
490 */
491
492 public static class DurationToDayTimeDuration extends UnfailingConverter {
493 public final static DurationToDayTimeDuration INSTANCE = new DurationToDayTimeDuration();
494 public DayTimeDurationValue convert(AtomicValue duration) {
495 DurationValue d = (DurationValue)duration;
496 if (d.signum() < 0) {
497 return new DayTimeDurationValue(-d.getDays(), -d.getHours(), -d.getMinutes(), -d.getSeconds(), -d.getNanoseconds());
498 } else {
499 return new DayTimeDurationValue(d.getDays(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getNanoseconds());
500 }
501 }
502 }
503
504 /**
505 * Converts a duration to a yearMonthDuration
506 */
507
508 public static class DurationToYearMonthDuration extends UnfailingConverter {
509 public final static DurationToYearMonthDuration INSTANCE = new DurationToYearMonthDuration();
510 public YearMonthDurationValue convert(AtomicValue input) {
511 return YearMonthDurationValue.fromMonths(((DurationValue) input).getTotalMonths());
512 }
513 }
514
515 /**
516 * Converts a date to a dateTime
517 */
518
519 public static class DateToDateTime extends UnfailingConverter {
520 public final static DateToDateTime INSTANCE = new DateToDateTime();
521 public DateTimeValue convert(AtomicValue input) {
522 return ((DateValue) input).toDateTime();
523 }
524 }
525
526 /**
527 * Converts a dateTime to a date
528 */
529
530 public static class DateTimeToDate extends UnfailingConverter {
531 public final static DateTimeToDate INSTANCE = new DateTimeToDate();
532 public DateValue convert(AtomicValue input) {
533 DateTimeValue dt = (DateTimeValue)input;
534 return new DateValue(dt.getYear(), dt.getMonth(), dt.getDay(), dt.getTimezoneInMinutes(), dt.isXsd10Rules());
535 }
536 }
537
538 /**
539 * Converts a dateTime to a gMonth
540 */
541
542 public static class DateTimeToGMonth extends UnfailingConverter {
543 public static final DateTimeToGMonth INSTANCE = new DateTimeToGMonth();
544 public GMonthValue convert(AtomicValue input) {
545 DateTimeValue dt = (DateTimeValue) input;
546 return new GMonthValue(dt.getMonth(), dt.getTimezoneInMinutes());
547 }
548 }
549
550 /**
551 * Converts a dateTime to a gYearMonth
552 */
553
554 public static class DateTimeToGYearMonth extends UnfailingConverter {
555 public static final DateTimeToGYearMonth INSTANCE = new DateTimeToGYearMonth();
556 public GYearMonthValue convert(AtomicValue input) {
557 DateTimeValue dt = (DateTimeValue) input;
558 return new GYearMonthValue(dt.getYear(), dt.getMonth(), dt.getTimezoneInMinutes(), dt.isXsd10Rules());
559 }
560 }
561
562 /**
563 * Converts a dateTime to a gYear
564 */
565
566 public static class DateTimeToGYear extends UnfailingConverter {
567 public static final DateTimeToGYear INSTANCE = new DateTimeToGYear();
568 public GYearValue convert(AtomicValue input) {
569 DateTimeValue dt = (DateTimeValue) input;
570 return new GYearValue(dt.getYear(), dt.getTimezoneInMinutes(), dt.isXsd10Rules());
571 }
572 }
573
574 /**
575 * Converts a dateTime to a gMonthDay
576 */
577
578 public static class DateTimeToGMonthDay extends UnfailingConverter {
579 public static final DateTimeToGMonthDay INSTANCE = new DateTimeToGMonthDay();
580 public GMonthDayValue convert(AtomicValue input) {
581 DateTimeValue dt = (DateTimeValue) input;
582 return new GMonthDayValue(dt.getMonth(), dt.getDay(), dt.getTimezoneInMinutes());
583 }
584 }
585
586 /**
587 * Converts a dateTime to a gDay
588 */
589
590 public static class DateTimeToGDay extends UnfailingConverter {
591 public final static DateTimeToGDay INSTANCE = new DateTimeToGDay();
592 public GDayValue convert(AtomicValue input) {
593 DateTimeValue dt = (DateTimeValue) input;
594 return new GDayValue(dt.getDay(), dt.getTimezoneInMinutes());
595 }
596 }
597
598 /**
599 * Converts a dateTime to a time
600 */
601
602 public static class DateTimeToTime extends UnfailingConverter {
603 public final static DateTimeToTime INSTANCE = new DateTimeToTime();
604 public TimeValue convert(AtomicValue input) {
605 DateTimeValue dt = (DateTimeValue) input;
606 return new TimeValue(dt.getHour(), dt.getMinute(), dt.getSecond(), dt.getNanosecond(), dt.getTimezoneInMinutes(), "");
607 }
608 }
609
610 /**
611 * Converts a numeric value to a boolean
612 */
613
614 public static class NumericToBoolean extends UnfailingConverter {
615 public static final NumericToBoolean INSTANCE = new NumericToBoolean();
616 public BooleanValue convert(AtomicValue input) {
617 return BooleanValue.get(((NumericValue)input).effectiveBooleanValue());
618 }
619 }
620
621 /**
622 * Converts base64 to hexBinary
623 */
624
625 public static class Base64BinaryToHexBinary extends UnfailingConverter {
626 public static final Base64BinaryToHexBinary INSTANCE = new Base64BinaryToHexBinary();
627 public HexBinaryValue convert(AtomicValue input) {
628 return new HexBinaryValue(((Base64BinaryValue)input).getBinaryValue());
629 }
630 }
631
632
633 /**
634 * Converts hexBinary to base64Binary
635 */
636
637 public static class HexBinaryToBase64Binary extends UnfailingConverter {
638 public static final HexBinaryToBase64Binary INSTANCE = new HexBinaryToBase64Binary();
639 public Base64BinaryValue convert(AtomicValue input) {
640 return new Base64BinaryValue(((HexBinaryValue)input).getBinaryValue());
641 }
642 }
643
644 /**
645 * Converts Notation to QName
646 */
647
648 public static class NotationToQName extends UnfailingConverter {
649 public static final NotationToQName INSTANCE = new NotationToQName();
650 public QNameValue convert(AtomicValue input) {
651 return new QNameValue(((NotationValue)input).getStructuredQName(), BuiltInAtomicType.QNAME);
652 }
653 }
654
655 /**
656 * Converts QName to Notation
657 */
658
659 public static class QNameToNotation extends UnfailingConverter {
660 public static final QNameToNotation INSTANCE = new QNameToNotation();
661 public NotationValue convert(AtomicValue input) {
662 return new NotationValue(((QNameValue)input).getStructuredQName(), BuiltInAtomicType.NOTATION);
663 }
664 }
665
666 /**
667 * Converter that implements the promotion rules to a required type of xs:double
668 */
669
670 public static class PromoterToDouble extends Converter {
671
672 /*@Nullable*/ private StringConverter stringToDouble = null;
673
674 /*@NotNull*/
675 @Override
676 public ConversionResult convert(AtomicValue input) {
677 if (input instanceof DoubleValue) {
678 return input;
679 } else if (input instanceof NumericValue) {
680 return new DoubleValue(((NumericValue) input).getDoubleValue());
681 } else if (input instanceof UntypedAtomicValue) {
682 if (stringToDouble == null) {
683 stringToDouble = BuiltInAtomicType.DOUBLE.getStringConverter(getConversionRules());
684 }
685 return stringToDouble.convert((UntypedAtomicValue)input);
686 } else {
687 ValidationFailure err = new ValidationFailure(
688 "Cannot promote non-numeric value to xs:double");
689 err.setErrorCode("XPTY0004");
690 return err;
691 }
692 }
693 }
694
695 /**
696 * Converter that implements the promotion rules to a required type of xs:float
697 */
698
699 public static class PromoterToFloat extends Converter {
700
701 /*@Nullable*/ private StringConverter stringToFloat = null;
702
703 /*@NotNull*/
704 @Override
705 public ConversionResult convert(/*@NotNull*/ AtomicValue input) {
706 if (input instanceof FloatValue) {
707 return input;
708 } else if (input instanceof DoubleValue) {
709 ValidationFailure err = new ValidationFailure(
710 "Cannot promote from xs:double to xs:float");
711 err.setErrorCode("XPTY0004");
712 return err;
713 } else if (input instanceof NumericValue) {
714 return new FloatValue((float) ((NumericValue) input).getDoubleValue());
715 } else if (input instanceof UntypedAtomicValue) {
716 if (stringToFloat == null) {
717 stringToFloat = BuiltInAtomicType.FLOAT.getStringConverter(getConversionRules());
718 }
719 return stringToFloat.convert((UntypedAtomicValue)input);
720 } else {
721 ValidationFailure err = new ValidationFailure(
722 "Cannot promote non-numeric value to xs:double");
723 err.setErrorCode("XPTY0004");
724 return err;
725 }
726 }
727 }
728
729
730 }
731