1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.apache.maven.plugins.assembly.model.io.xpp3;
25
26
27
28
29
30 import java.io.IOException;
31 import java.io.InputStream;
32 import java.io.Reader;
33 import java.text.DateFormat;
34 import org.apache.maven.plugins.assembly.model.Assembly;
35 import org.apache.maven.plugins.assembly.model.ContainerDescriptorHandlerConfig;
36 import org.apache.maven.plugins.assembly.model.DependencySet;
37 import org.apache.maven.plugins.assembly.model.FileItem;
38 import org.apache.maven.plugins.assembly.model.FileSet;
39 import org.apache.maven.plugins.assembly.model.ModuleBinaries;
40 import org.apache.maven.plugins.assembly.model.ModuleSet;
41 import org.apache.maven.plugins.assembly.model.ModuleSources;
42 import org.apache.maven.plugins.assembly.model.UnpackOptions;
43 import org.codehaus.plexus.util.xml.XmlStreamReader;
44 import org.codehaus.plexus.util.xml.pull.EntityReplacementMap;
45 import org.codehaus.plexus.util.xml.pull.MXParser;
46 import org.codehaus.plexus.util.xml.pull.XmlPullParser;
47 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
48
49
50
51
52
53
54 @SuppressWarnings( "all" )
55 public class AssemblyXpp3Reader
56 {
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72 private boolean addDefaultEntities = true;
73
74
75
76
77 public final ContentTransformer contentTransformer;
78
79
80
81
82
83
84 public AssemblyXpp3Reader()
85 {
86 this( new ContentTransformer()
87 {
88 public String transform( String source, String fieldName )
89 {
90 return source;
91 }
92 } );
93 }
94
95 public AssemblyXpp3Reader(ContentTransformer contentTransformer)
96 {
97 this.contentTransformer = contentTransformer;
98 }
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116 private boolean checkFieldWithDuplicate( XmlPullParser parser, String tagName, String alias, java.util.Set<String> parsed )
117 throws XmlPullParserException
118 {
119 if ( !( parser.getName().equals( tagName ) || parser.getName().equals( alias ) ) )
120 {
121 return false;
122 }
123 if ( !parsed.add( tagName ) )
124 {
125 throw new XmlPullParserException( "Duplicated tag: '" + tagName + "'", parser, null );
126 }
127 return true;
128 }
129
130
131
132
133
134
135
136
137
138
139
140
141 private void checkUnknownAttribute( XmlPullParser parser, String attribute, String tagName, boolean strict )
142 throws XmlPullParserException, IOException
143 {
144
145 if ( strict )
146 {
147 throw new XmlPullParserException( "Unknown attribute '" + attribute + "' for tag '" + tagName + "'", parser, null );
148 }
149 }
150
151
152
153
154
155
156
157
158
159
160 private void checkUnknownElement( XmlPullParser parser, boolean strict )
161 throws XmlPullParserException, IOException
162 {
163 if ( strict )
164 {
165 throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
166 }
167
168 for ( int unrecognizedTagCount = 1; unrecognizedTagCount > 0; )
169 {
170 int eventType = parser.next();
171 if ( eventType == XmlPullParser.START_TAG )
172 {
173 unrecognizedTagCount++;
174 }
175 else if ( eventType == XmlPullParser.END_TAG )
176 {
177 unrecognizedTagCount--;
178 }
179 }
180 }
181
182
183
184
185
186
187 public boolean getAddDefaultEntities()
188 {
189 return addDefaultEntities;
190 }
191
192
193
194
195
196
197
198
199
200
201
202 private boolean getBooleanValue( String s, String attribute, XmlPullParser parser )
203 throws XmlPullParserException
204 {
205 return getBooleanValue( s, attribute, parser, null );
206 }
207
208
209
210
211
212
213
214
215
216
217
218
219 private boolean getBooleanValue( String s, String attribute, XmlPullParser parser, String defaultValue )
220 throws XmlPullParserException
221 {
222 if ( s != null && s.length() != 0 )
223 {
224 return Boolean.valueOf( s ).booleanValue();
225 }
226 if ( defaultValue != null )
227 {
228 return Boolean.valueOf( defaultValue ).booleanValue();
229 }
230 return false;
231 }
232
233
234
235
236
237
238
239
240
241
242
243
244 private byte getByteValue( String s, String attribute, XmlPullParser parser, boolean strict )
245 throws XmlPullParserException
246 {
247 if ( s != null )
248 {
249 try
250 {
251 return Byte.valueOf( s ).byteValue();
252 }
253 catch ( NumberFormatException nfe )
254 {
255 if ( strict )
256 {
257 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a byte", parser, nfe );
258 }
259 }
260 }
261 return 0;
262 }
263
264
265
266
267
268
269
270
271
272
273
274 private char getCharacterValue( String s, String attribute, XmlPullParser parser )
275 throws XmlPullParserException
276 {
277 if ( s != null )
278 {
279 return s.charAt( 0 );
280 }
281 return 0;
282 }
283
284
285
286
287
288
289
290
291
292
293
294 private java.util.Date getDateValue( String s, String attribute, XmlPullParser parser )
295 throws XmlPullParserException
296 {
297 return getDateValue( s, attribute, null, parser );
298 }
299
300
301
302
303
304
305
306
307
308
309
310
311 private java.util.Date getDateValue( String s, String attribute, String dateFormat, XmlPullParser parser )
312 throws XmlPullParserException
313 {
314 if ( s != null )
315 {
316 String effectiveDateFormat = dateFormat;
317 if ( dateFormat == null )
318 {
319 effectiveDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";
320 }
321 if ( "long".equals( effectiveDateFormat ) )
322 {
323 try
324 {
325 return new java.util.Date( Long.parseLong( s ) );
326 }
327 catch ( NumberFormatException e )
328 {
329 throw new XmlPullParserException( e.getMessage(), parser, e );
330 }
331 }
332 else
333 {
334 try
335 {
336 DateFormat dateParser = new java.text.SimpleDateFormat( effectiveDateFormat, java.util.Locale.US );
337 return dateParser.parse( s );
338 }
339 catch ( java.text.ParseException e )
340 {
341 throw new XmlPullParserException( e.getMessage(), parser, e );
342 }
343 }
344 }
345 return null;
346 }
347
348
349
350
351
352
353
354
355
356
357
358
359 private double getDoubleValue( String s, String attribute, XmlPullParser parser, boolean strict )
360 throws XmlPullParserException
361 {
362 if ( s != null )
363 {
364 try
365 {
366 return Double.valueOf( s ).doubleValue();
367 }
368 catch ( NumberFormatException nfe )
369 {
370 if ( strict )
371 {
372 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
373 }
374 }
375 }
376 return 0;
377 }
378
379
380
381
382
383
384
385
386
387
388
389
390 private float getFloatValue( String s, String attribute, XmlPullParser parser, boolean strict )
391 throws XmlPullParserException
392 {
393 if ( s != null )
394 {
395 try
396 {
397 return Float.valueOf( s ).floatValue();
398 }
399 catch ( NumberFormatException nfe )
400 {
401 if ( strict )
402 {
403 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
404 }
405 }
406 }
407 return 0;
408 }
409
410
411
412
413
414
415
416
417
418
419
420
421 private int getIntegerValue( String s, String attribute, XmlPullParser parser, boolean strict )
422 throws XmlPullParserException
423 {
424 if ( s != null )
425 {
426 try
427 {
428 return Integer.valueOf( s ).intValue();
429 }
430 catch ( NumberFormatException nfe )
431 {
432 if ( strict )
433 {
434 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be an integer", parser, nfe );
435 }
436 }
437 }
438 return 0;
439 }
440
441
442
443
444
445
446
447
448
449
450
451
452 private long getLongValue( String s, String attribute, XmlPullParser parser, boolean strict )
453 throws XmlPullParserException
454 {
455 if ( s != null )
456 {
457 try
458 {
459 return Long.valueOf( s ).longValue();
460 }
461 catch ( NumberFormatException nfe )
462 {
463 if ( strict )
464 {
465 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a long integer", parser, nfe );
466 }
467 }
468 }
469 return 0;
470 }
471
472
473
474
475
476
477
478
479
480
481
482
483 private String getRequiredAttributeValue( String s, String attribute, XmlPullParser parser, boolean strict )
484 throws XmlPullParserException
485 {
486 if ( s == null )
487 {
488 if ( strict )
489 {
490 throw new XmlPullParserException( "Missing required value for attribute '" + attribute + "'", parser, null );
491 }
492 }
493 return s;
494 }
495
496
497
498
499
500
501
502
503
504
505
506
507 private short getShortValue( String s, String attribute, XmlPullParser parser, boolean strict )
508 throws XmlPullParserException
509 {
510 if ( s != null )
511 {
512 try
513 {
514 return Short.valueOf( s ).shortValue();
515 }
516 catch ( NumberFormatException nfe )
517 {
518 if ( strict )
519 {
520 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a short integer", parser, nfe );
521 }
522 }
523 }
524 return 0;
525 }
526
527
528
529
530
531
532
533 private String getTrimmedValue( String s )
534 {
535 if ( s != null )
536 {
537 s = s.trim();
538 }
539 return s;
540 }
541
542
543
544
545
546
547
548
549 private String interpolatedTrimmed( String value, String context )
550 {
551 return getTrimmedValue( contentTransformer.transform( value, context ) );
552 }
553
554
555
556
557
558
559
560
561
562
563 private int nextTag( XmlPullParser parser )
564 throws IOException, XmlPullParserException
565 {
566 int eventType = parser.next();
567 if ( eventType == XmlPullParser.TEXT )
568 {
569 eventType = parser.next();
570 }
571 if ( eventType != XmlPullParser.START_TAG && eventType != XmlPullParser.END_TAG )
572 {
573 throw new XmlPullParserException( "expected START_TAG or END_TAG not " + XmlPullParser.TYPES[eventType], parser, null );
574 }
575 return eventType;
576 }
577
578
579
580
581
582
583
584
585
586
587
588 public Assembly read( XmlPullParser parser, boolean strict )
589 throws IOException, XmlPullParserException
590 {
591 Assembly assembly = null;
592 int eventType = parser.getEventType();
593 boolean parsed = false;
594 while ( eventType != XmlPullParser.END_DOCUMENT )
595 {
596 if ( eventType == XmlPullParser.START_TAG )
597 {
598 if ( strict && ! "assembly".equals( parser.getName() ) )
599 {
600 throw new XmlPullParserException( "Expected root element 'assembly' but found '" + parser.getName() + "'", parser, null );
601 }
602 else if ( parsed )
603 {
604
605 throw new XmlPullParserException( "Duplicated tag: 'assembly'", parser, null );
606 }
607 assembly = parseAssembly( parser, strict );
608 assembly.setModelEncoding( parser.getInputEncoding() );
609 parsed = true;
610 }
611 eventType = parser.next();
612 }
613 if ( parsed )
614 {
615 return assembly;
616 }
617 throw new XmlPullParserException( "Expected root element 'assembly' but found no element at all: invalid XML document", parser, null );
618 }
619
620
621
622
623
624
625
626
627
628
629
630 public Assembly read( Reader reader, boolean strict )
631 throws IOException, XmlPullParserException
632 {
633 XmlPullParser parser = addDefaultEntities ? new MXParser(EntityReplacementMap.defaultEntityReplacementMap) : new MXParser( );
634
635 parser.setInput( reader );
636
637
638 return read( parser, strict );
639 }
640
641
642
643
644
645
646
647
648
649
650 public Assembly read( Reader reader )
651 throws IOException, XmlPullParserException
652 {
653 return read( reader, true );
654 }
655
656
657
658
659
660
661
662
663
664
665
666 public Assembly read( InputStream in, boolean strict )
667 throws IOException, XmlPullParserException
668 {
669 return read( new XmlStreamReader( in ), strict );
670 }
671
672
673
674
675
676
677
678
679
680
681 public Assembly read( InputStream in )
682 throws IOException, XmlPullParserException
683 {
684 return read( new XmlStreamReader( in ) );
685 }
686
687
688
689
690
691
692
693
694
695
696
697 private Assembly parseAssembly( XmlPullParser parser, boolean strict )
698 throws IOException, XmlPullParserException
699 {
700 String tagName = parser.getName();
701 Assembly assembly = new Assembly();
702 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
703 {
704 String name = parser.getAttributeName( i );
705 String value = parser.getAttributeValue( i );
706
707 if ( name.indexOf( ':' ) >= 0 )
708 {
709
710 }
711 else if ( "xmlns".equals( name ) )
712 {
713
714 }
715 else
716 {
717 checkUnknownAttribute( parser, name, tagName, strict );
718 }
719 }
720 java.util.Set<String> parsed = new java.util.HashSet<String>();
721 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
722 {
723 if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
724 {
725 assembly.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
726 }
727 else if ( checkFieldWithDuplicate( parser, "formats", null, parsed ) )
728 {
729 java.util.List<String> formats = new java.util.ArrayList<String>();
730 while ( parser.nextTag() == XmlPullParser.START_TAG )
731 {
732 if ( "format".equals( parser.getName() ) )
733 {
734 formats.add( interpolatedTrimmed( parser.nextText(), "formats" ) );
735 }
736 else
737 {
738 checkUnknownElement( parser, strict );
739 }
740 }
741 assembly.setFormats( formats );
742 }
743 else if ( checkFieldWithDuplicate( parser, "includeBaseDirectory", null, parsed ) )
744 {
745 assembly.setIncludeBaseDirectory( getBooleanValue( interpolatedTrimmed( parser.nextText(), "includeBaseDirectory" ), "includeBaseDirectory", parser, "true" ) );
746 }
747 else if ( checkFieldWithDuplicate( parser, "baseDirectory", null, parsed ) )
748 {
749 assembly.setBaseDirectory( interpolatedTrimmed( parser.nextText(), "baseDirectory" ) );
750 }
751 else if ( checkFieldWithDuplicate( parser, "includeSiteDirectory", null, parsed ) )
752 {
753 assembly.setIncludeSiteDirectory( getBooleanValue( interpolatedTrimmed( parser.nextText(), "includeSiteDirectory" ), "includeSiteDirectory", parser, "false" ) );
754 }
755 else if ( checkFieldWithDuplicate( parser, "containerDescriptorHandlers", null, parsed ) )
756 {
757 java.util.List<ContainerDescriptorHandlerConfig> containerDescriptorHandlers = new java.util.ArrayList<ContainerDescriptorHandlerConfig>();
758 while ( parser.nextTag() == XmlPullParser.START_TAG )
759 {
760 if ( "containerDescriptorHandler".equals( parser.getName() ) )
761 {
762 containerDescriptorHandlers.add( parseContainerDescriptorHandlerConfig( parser, strict ) );
763 }
764 else
765 {
766 checkUnknownElement( parser, strict );
767 }
768 }
769 assembly.setContainerDescriptorHandlers( containerDescriptorHandlers );
770 }
771 else if ( checkFieldWithDuplicate( parser, "moduleSets", null, parsed ) )
772 {
773 java.util.List<ModuleSet> moduleSets = new java.util.ArrayList<ModuleSet>();
774 while ( parser.nextTag() == XmlPullParser.START_TAG )
775 {
776 if ( "moduleSet".equals( parser.getName() ) )
777 {
778 moduleSets.add( parseModuleSet( parser, strict ) );
779 }
780 else
781 {
782 checkUnknownElement( parser, strict );
783 }
784 }
785 assembly.setModuleSets( moduleSets );
786 }
787 else if ( checkFieldWithDuplicate( parser, "fileSets", null, parsed ) )
788 {
789 java.util.List<FileSet> fileSets = new java.util.ArrayList<FileSet>();
790 while ( parser.nextTag() == XmlPullParser.START_TAG )
791 {
792 if ( "fileSet".equals( parser.getName() ) )
793 {
794 fileSets.add( parseFileSet( parser, strict ) );
795 }
796 else
797 {
798 checkUnknownElement( parser, strict );
799 }
800 }
801 assembly.setFileSets( fileSets );
802 }
803 else if ( checkFieldWithDuplicate( parser, "files", null, parsed ) )
804 {
805 java.util.List<FileItem> files = new java.util.ArrayList<FileItem>();
806 while ( parser.nextTag() == XmlPullParser.START_TAG )
807 {
808 if ( "file".equals( parser.getName() ) )
809 {
810 files.add( parseFileItem( parser, strict ) );
811 }
812 else
813 {
814 checkUnknownElement( parser, strict );
815 }
816 }
817 assembly.setFiles( files );
818 }
819 else if ( checkFieldWithDuplicate( parser, "dependencySets", null, parsed ) )
820 {
821 java.util.List<DependencySet> dependencySets = new java.util.ArrayList<DependencySet>();
822 while ( parser.nextTag() == XmlPullParser.START_TAG )
823 {
824 if ( "dependencySet".equals( parser.getName() ) )
825 {
826 dependencySets.add( parseDependencySet( parser, strict ) );
827 }
828 else
829 {
830 checkUnknownElement( parser, strict );
831 }
832 }
833 assembly.setDependencySets( dependencySets );
834 }
835 else if ( checkFieldWithDuplicate( parser, "componentDescriptors", null, parsed ) )
836 {
837 java.util.List<String> componentDescriptors = new java.util.ArrayList<String>();
838 while ( parser.nextTag() == XmlPullParser.START_TAG )
839 {
840 if ( "componentDescriptor".equals( parser.getName() ) )
841 {
842 componentDescriptors.add( interpolatedTrimmed( parser.nextText(), "componentDescriptors" ) );
843 }
844 else
845 {
846 checkUnknownElement( parser, strict );
847 }
848 }
849 assembly.setComponentDescriptors( componentDescriptors );
850 }
851 else
852 {
853 checkUnknownElement( parser, strict );
854 }
855 }
856 return assembly;
857 }
858
859
860
861
862
863
864
865
866
867
868
869 private ContainerDescriptorHandlerConfig parseContainerDescriptorHandlerConfig( XmlPullParser parser, boolean strict )
870 throws IOException, XmlPullParserException
871 {
872 String tagName = parser.getName();
873 ContainerDescriptorHandlerConfig containerDescriptorHandlerConfig = new ContainerDescriptorHandlerConfig();
874 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
875 {
876 String name = parser.getAttributeName( i );
877 String value = parser.getAttributeValue( i );
878
879 if ( name.indexOf( ':' ) >= 0 )
880 {
881
882 }
883 else
884 {
885 checkUnknownAttribute( parser, name, tagName, strict );
886 }
887 }
888 java.util.Set<String> parsed = new java.util.HashSet<String>();
889 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
890 {
891 if ( checkFieldWithDuplicate( parser, "handlerName", null, parsed ) )
892 {
893 containerDescriptorHandlerConfig.setHandlerName( interpolatedTrimmed( parser.nextText(), "handlerName" ) );
894 }
895 else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
896 {
897 containerDescriptorHandlerConfig.setConfiguration( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true ) );
898 }
899 else
900 {
901 checkUnknownElement( parser, strict );
902 }
903 }
904 return containerDescriptorHandlerConfig;
905 }
906
907
908
909
910
911
912
913
914
915
916
917 private DependencySet parseDependencySet( XmlPullParser parser, boolean strict )
918 throws IOException, XmlPullParserException
919 {
920 String tagName = parser.getName();
921 DependencySet dependencySet = new DependencySet();
922 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
923 {
924 String name = parser.getAttributeName( i );
925 String value = parser.getAttributeValue( i );
926
927 if ( name.indexOf( ':' ) >= 0 )
928 {
929
930 }
931 else
932 {
933 checkUnknownAttribute( parser, name, tagName, strict );
934 }
935 }
936 java.util.Set<String> parsed = new java.util.HashSet<String>();
937 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
938 {
939 if ( checkFieldWithDuplicate( parser, "outputDirectory", null, parsed ) )
940 {
941 dependencySet.setOutputDirectory( interpolatedTrimmed( parser.nextText(), "outputDirectory" ) );
942 }
943 else if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
944 {
945 java.util.List<String> includes = new java.util.ArrayList<String>();
946 while ( parser.nextTag() == XmlPullParser.START_TAG )
947 {
948 if ( "include".equals( parser.getName() ) )
949 {
950 includes.add( interpolatedTrimmed( parser.nextText(), "includes" ) );
951 }
952 else
953 {
954 checkUnknownElement( parser, strict );
955 }
956 }
957 dependencySet.setIncludes( includes );
958 }
959 else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
960 {
961 java.util.List<String> excludes = new java.util.ArrayList<String>();
962 while ( parser.nextTag() == XmlPullParser.START_TAG )
963 {
964 if ( "exclude".equals( parser.getName() ) )
965 {
966 excludes.add( interpolatedTrimmed( parser.nextText(), "excludes" ) );
967 }
968 else
969 {
970 checkUnknownElement( parser, strict );
971 }
972 }
973 dependencySet.setExcludes( excludes );
974 }
975 else if ( checkFieldWithDuplicate( parser, "fileMode", null, parsed ) )
976 {
977 dependencySet.setFileMode( interpolatedTrimmed( parser.nextText(), "fileMode" ) );
978 }
979 else if ( checkFieldWithDuplicate( parser, "directoryMode", null, parsed ) )
980 {
981 dependencySet.setDirectoryMode( interpolatedTrimmed( parser.nextText(), "directoryMode" ) );
982 }
983 else if ( checkFieldWithDuplicate( parser, "useStrictFiltering", null, parsed ) )
984 {
985 dependencySet.setUseStrictFiltering( getBooleanValue( interpolatedTrimmed( parser.nextText(), "useStrictFiltering" ), "useStrictFiltering", parser, "false" ) );
986 }
987 else if ( checkFieldWithDuplicate( parser, "outputFileNameMapping", null, parsed ) )
988 {
989 dependencySet.setOutputFileNameMapping( interpolatedTrimmed( parser.nextText(), "outputFileNameMapping" ) );
990 }
991 else if ( checkFieldWithDuplicate( parser, "unpack", null, parsed ) )
992 {
993 dependencySet.setUnpack( getBooleanValue( interpolatedTrimmed( parser.nextText(), "unpack" ), "unpack", parser, "false" ) );
994 }
995 else if ( checkFieldWithDuplicate( parser, "unpackOptions", null, parsed ) )
996 {
997 dependencySet.setUnpackOptions( parseUnpackOptions( parser, strict ) );
998 }
999 else if ( checkFieldWithDuplicate( parser, "scope", null, parsed ) )
1000 {
1001 dependencySet.setScope( interpolatedTrimmed( parser.nextText(), "scope" ) );
1002 }
1003 else if ( checkFieldWithDuplicate( parser, "useProjectArtifact", null, parsed ) )
1004 {
1005 dependencySet.setUseProjectArtifact( getBooleanValue( interpolatedTrimmed( parser.nextText(), "useProjectArtifact" ), "useProjectArtifact", parser, "true" ) );
1006 }
1007 else if ( checkFieldWithDuplicate( parser, "useProjectAttachments", null, parsed ) )
1008 {
1009 dependencySet.setUseProjectAttachments( getBooleanValue( interpolatedTrimmed( parser.nextText(), "useProjectAttachments" ), "useProjectAttachments", parser, "false" ) );
1010 }
1011 else if ( checkFieldWithDuplicate( parser, "useTransitiveDependencies", null, parsed ) )
1012 {
1013 dependencySet.setUseTransitiveDependencies( getBooleanValue( interpolatedTrimmed( parser.nextText(), "useTransitiveDependencies" ), "useTransitiveDependencies", parser, "true" ) );
1014 }
1015 else if ( checkFieldWithDuplicate( parser, "useTransitiveFiltering", null, parsed ) )
1016 {
1017 dependencySet.setUseTransitiveFiltering( getBooleanValue( interpolatedTrimmed( parser.nextText(), "useTransitiveFiltering" ), "useTransitiveFiltering", parser, "false" ) );
1018 }
1019 else
1020 {
1021 checkUnknownElement( parser, strict );
1022 }
1023 }
1024 return dependencySet;
1025 }
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037 private FileItem parseFileItem( XmlPullParser parser, boolean strict )
1038 throws IOException, XmlPullParserException
1039 {
1040 String tagName = parser.getName();
1041 FileItem fileItem = new FileItem();
1042 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1043 {
1044 String name = parser.getAttributeName( i );
1045 String value = parser.getAttributeValue( i );
1046
1047 if ( name.indexOf( ':' ) >= 0 )
1048 {
1049
1050 }
1051 else
1052 {
1053 checkUnknownAttribute( parser, name, tagName, strict );
1054 }
1055 }
1056 java.util.Set<String> parsed = new java.util.HashSet<String>();
1057 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1058 {
1059 if ( checkFieldWithDuplicate( parser, "source", null, parsed ) )
1060 {
1061 fileItem.setSource( interpolatedTrimmed( parser.nextText(), "source" ) );
1062 }
1063 else if ( checkFieldWithDuplicate( parser, "sources", null, parsed ) )
1064 {
1065 java.util.List<String> sources = new java.util.ArrayList<String>();
1066 while ( parser.nextTag() == XmlPullParser.START_TAG )
1067 {
1068 if ( "source".equals( parser.getName() ) )
1069 {
1070 sources.add( interpolatedTrimmed( parser.nextText(), "sources" ) );
1071 }
1072 else
1073 {
1074 checkUnknownElement( parser, strict );
1075 }
1076 }
1077 fileItem.setSources( sources );
1078 }
1079 else if ( checkFieldWithDuplicate( parser, "outputDirectory", null, parsed ) )
1080 {
1081 fileItem.setOutputDirectory( interpolatedTrimmed( parser.nextText(), "outputDirectory" ) );
1082 }
1083 else if ( checkFieldWithDuplicate( parser, "destName", null, parsed ) )
1084 {
1085 fileItem.setDestName( interpolatedTrimmed( parser.nextText(), "destName" ) );
1086 }
1087 else if ( checkFieldWithDuplicate( parser, "fileMode", null, parsed ) )
1088 {
1089 fileItem.setFileMode( interpolatedTrimmed( parser.nextText(), "fileMode" ) );
1090 }
1091 else if ( checkFieldWithDuplicate( parser, "lineEnding", null, parsed ) )
1092 {
1093 fileItem.setLineEnding( interpolatedTrimmed( parser.nextText(), "lineEnding" ) );
1094 }
1095 else if ( checkFieldWithDuplicate( parser, "filtered", null, parsed ) )
1096 {
1097 fileItem.setFiltered( getBooleanValue( interpolatedTrimmed( parser.nextText(), "filtered" ), "filtered", parser, "false" ) );
1098 }
1099 else
1100 {
1101 checkUnknownElement( parser, strict );
1102 }
1103 }
1104 return fileItem;
1105 }
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117 private FileSet parseFileSet( XmlPullParser parser, boolean strict )
1118 throws IOException, XmlPullParserException
1119 {
1120 String tagName = parser.getName();
1121 FileSet fileSet = new FileSet();
1122 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1123 {
1124 String name = parser.getAttributeName( i );
1125 String value = parser.getAttributeValue( i );
1126
1127 if ( name.indexOf( ':' ) >= 0 )
1128 {
1129
1130 }
1131 else
1132 {
1133 checkUnknownAttribute( parser, name, tagName, strict );
1134 }
1135 }
1136 java.util.Set<String> parsed = new java.util.HashSet<String>();
1137 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1138 {
1139 if ( checkFieldWithDuplicate( parser, "useDefaultExcludes", null, parsed ) )
1140 {
1141 fileSet.setUseDefaultExcludes( getBooleanValue( interpolatedTrimmed( parser.nextText(), "useDefaultExcludes" ), "useDefaultExcludes", parser, "true" ) );
1142 }
1143 else if ( checkFieldWithDuplicate( parser, "outputDirectory", null, parsed ) )
1144 {
1145 fileSet.setOutputDirectory( interpolatedTrimmed( parser.nextText(), "outputDirectory" ) );
1146 }
1147 else if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
1148 {
1149 java.util.List<String> includes = new java.util.ArrayList<String>();
1150 while ( parser.nextTag() == XmlPullParser.START_TAG )
1151 {
1152 if ( "include".equals( parser.getName() ) )
1153 {
1154 includes.add( interpolatedTrimmed( parser.nextText(), "includes" ) );
1155 }
1156 else
1157 {
1158 checkUnknownElement( parser, strict );
1159 }
1160 }
1161 fileSet.setIncludes( includes );
1162 }
1163 else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
1164 {
1165 java.util.List<String> excludes = new java.util.ArrayList<String>();
1166 while ( parser.nextTag() == XmlPullParser.START_TAG )
1167 {
1168 if ( "exclude".equals( parser.getName() ) )
1169 {
1170 excludes.add( interpolatedTrimmed( parser.nextText(), "excludes" ) );
1171 }
1172 else
1173 {
1174 checkUnknownElement( parser, strict );
1175 }
1176 }
1177 fileSet.setExcludes( excludes );
1178 }
1179 else if ( checkFieldWithDuplicate( parser, "fileMode", null, parsed ) )
1180 {
1181 fileSet.setFileMode( interpolatedTrimmed( parser.nextText(), "fileMode" ) );
1182 }
1183 else if ( checkFieldWithDuplicate( parser, "directoryMode", null, parsed ) )
1184 {
1185 fileSet.setDirectoryMode( interpolatedTrimmed( parser.nextText(), "directoryMode" ) );
1186 }
1187 else if ( checkFieldWithDuplicate( parser, "directory", null, parsed ) )
1188 {
1189 fileSet.setDirectory( interpolatedTrimmed( parser.nextText(), "directory" ) );
1190 }
1191 else if ( checkFieldWithDuplicate( parser, "lineEnding", null, parsed ) )
1192 {
1193 fileSet.setLineEnding( interpolatedTrimmed( parser.nextText(), "lineEnding" ) );
1194 }
1195 else if ( checkFieldWithDuplicate( parser, "filtered", null, parsed ) )
1196 {
1197 fileSet.setFiltered( getBooleanValue( interpolatedTrimmed( parser.nextText(), "filtered" ), "filtered", parser, "false" ) );
1198 }
1199 else if ( checkFieldWithDuplicate( parser, "nonFilteredFileExtensions", null, parsed ) )
1200 {
1201 java.util.List<String> nonFilteredFileExtensions = new java.util.ArrayList<String>();
1202 while ( parser.nextTag() == XmlPullParser.START_TAG )
1203 {
1204 if ( "nonFilteredFileExtension".equals( parser.getName() ) )
1205 {
1206 nonFilteredFileExtensions.add( interpolatedTrimmed( parser.nextText(), "nonFilteredFileExtensions" ) );
1207 }
1208 else
1209 {
1210 checkUnknownElement( parser, strict );
1211 }
1212 }
1213 fileSet.setNonFilteredFileExtensions( nonFilteredFileExtensions );
1214 }
1215 else
1216 {
1217 checkUnknownElement( parser, strict );
1218 }
1219 }
1220 return fileSet;
1221 }
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233 private ModuleBinaries parseModuleBinaries( XmlPullParser parser, boolean strict )
1234 throws IOException, XmlPullParserException
1235 {
1236 String tagName = parser.getName();
1237 ModuleBinaries moduleBinaries = new ModuleBinaries();
1238 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1239 {
1240 String name = parser.getAttributeName( i );
1241 String value = parser.getAttributeValue( i );
1242
1243 if ( name.indexOf( ':' ) >= 0 )
1244 {
1245
1246 }
1247 else
1248 {
1249 checkUnknownAttribute( parser, name, tagName, strict );
1250 }
1251 }
1252 java.util.Set<String> parsed = new java.util.HashSet<String>();
1253 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1254 {
1255 if ( checkFieldWithDuplicate( parser, "outputDirectory", null, parsed ) )
1256 {
1257 moduleBinaries.setOutputDirectory( interpolatedTrimmed( parser.nextText(), "outputDirectory" ) );
1258 }
1259 else if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
1260 {
1261 java.util.List<String> includes = new java.util.ArrayList<String>();
1262 while ( parser.nextTag() == XmlPullParser.START_TAG )
1263 {
1264 if ( "include".equals( parser.getName() ) )
1265 {
1266 includes.add( interpolatedTrimmed( parser.nextText(), "includes" ) );
1267 }
1268 else
1269 {
1270 checkUnknownElement( parser, strict );
1271 }
1272 }
1273 moduleBinaries.setIncludes( includes );
1274 }
1275 else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
1276 {
1277 java.util.List<String> excludes = new java.util.ArrayList<String>();
1278 while ( parser.nextTag() == XmlPullParser.START_TAG )
1279 {
1280 if ( "exclude".equals( parser.getName() ) )
1281 {
1282 excludes.add( interpolatedTrimmed( parser.nextText(), "excludes" ) );
1283 }
1284 else
1285 {
1286 checkUnknownElement( parser, strict );
1287 }
1288 }
1289 moduleBinaries.setExcludes( excludes );
1290 }
1291 else if ( checkFieldWithDuplicate( parser, "fileMode", null, parsed ) )
1292 {
1293 moduleBinaries.setFileMode( interpolatedTrimmed( parser.nextText(), "fileMode" ) );
1294 }
1295 else if ( checkFieldWithDuplicate( parser, "directoryMode", null, parsed ) )
1296 {
1297 moduleBinaries.setDirectoryMode( interpolatedTrimmed( parser.nextText(), "directoryMode" ) );
1298 }
1299 else if ( checkFieldWithDuplicate( parser, "attachmentClassifier", null, parsed ) )
1300 {
1301 moduleBinaries.setAttachmentClassifier( interpolatedTrimmed( parser.nextText(), "attachmentClassifier" ) );
1302 }
1303 else if ( checkFieldWithDuplicate( parser, "includeDependencies", null, parsed ) )
1304 {
1305 moduleBinaries.setIncludeDependencies( getBooleanValue( interpolatedTrimmed( parser.nextText(), "includeDependencies" ), "includeDependencies", parser, "true" ) );
1306 }
1307 else if ( checkFieldWithDuplicate( parser, "dependencySets", null, parsed ) )
1308 {
1309 java.util.List<DependencySet> dependencySets = new java.util.ArrayList<DependencySet>();
1310 while ( parser.nextTag() == XmlPullParser.START_TAG )
1311 {
1312 if ( "dependencySet".equals( parser.getName() ) )
1313 {
1314 dependencySets.add( parseDependencySet( parser, strict ) );
1315 }
1316 else
1317 {
1318 checkUnknownElement( parser, strict );
1319 }
1320 }
1321 moduleBinaries.setDependencySets( dependencySets );
1322 }
1323 else if ( checkFieldWithDuplicate( parser, "unpack", null, parsed ) )
1324 {
1325 moduleBinaries.setUnpack( getBooleanValue( interpolatedTrimmed( parser.nextText(), "unpack" ), "unpack", parser, "true" ) );
1326 }
1327 else if ( checkFieldWithDuplicate( parser, "unpackOptions", null, parsed ) )
1328 {
1329 moduleBinaries.setUnpackOptions( parseUnpackOptions( parser, strict ) );
1330 }
1331 else if ( checkFieldWithDuplicate( parser, "outputFileNameMapping", null, parsed ) )
1332 {
1333 moduleBinaries.setOutputFileNameMapping( interpolatedTrimmed( parser.nextText(), "outputFileNameMapping" ) );
1334 }
1335 else
1336 {
1337 checkUnknownElement( parser, strict );
1338 }
1339 }
1340 return moduleBinaries;
1341 }
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353 private ModuleSet parseModuleSet( XmlPullParser parser, boolean strict )
1354 throws IOException, XmlPullParserException
1355 {
1356 String tagName = parser.getName();
1357 ModuleSet moduleSet = new ModuleSet();
1358 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1359 {
1360 String name = parser.getAttributeName( i );
1361 String value = parser.getAttributeValue( i );
1362
1363 if ( name.indexOf( ':' ) >= 0 )
1364 {
1365
1366 }
1367 else
1368 {
1369 checkUnknownAttribute( parser, name, tagName, strict );
1370 }
1371 }
1372 java.util.Set<String> parsed = new java.util.HashSet<String>();
1373 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1374 {
1375 if ( checkFieldWithDuplicate( parser, "useAllReactorProjects", null, parsed ) )
1376 {
1377 moduleSet.setUseAllReactorProjects( getBooleanValue( interpolatedTrimmed( parser.nextText(), "useAllReactorProjects" ), "useAllReactorProjects", parser, "false" ) );
1378 }
1379 else if ( checkFieldWithDuplicate( parser, "includeSubModules", null, parsed ) )
1380 {
1381 moduleSet.setIncludeSubModules( getBooleanValue( interpolatedTrimmed( parser.nextText(), "includeSubModules" ), "includeSubModules", parser, "true" ) );
1382 }
1383 else if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
1384 {
1385 java.util.List<String> includes = new java.util.ArrayList<String>();
1386 while ( parser.nextTag() == XmlPullParser.START_TAG )
1387 {
1388 if ( "include".equals( parser.getName() ) )
1389 {
1390 includes.add( interpolatedTrimmed( parser.nextText(), "includes" ) );
1391 }
1392 else
1393 {
1394 checkUnknownElement( parser, strict );
1395 }
1396 }
1397 moduleSet.setIncludes( includes );
1398 }
1399 else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
1400 {
1401 java.util.List<String> excludes = new java.util.ArrayList<String>();
1402 while ( parser.nextTag() == XmlPullParser.START_TAG )
1403 {
1404 if ( "exclude".equals( parser.getName() ) )
1405 {
1406 excludes.add( interpolatedTrimmed( parser.nextText(), "excludes" ) );
1407 }
1408 else
1409 {
1410 checkUnknownElement( parser, strict );
1411 }
1412 }
1413 moduleSet.setExcludes( excludes );
1414 }
1415 else if ( checkFieldWithDuplicate( parser, "sources", null, parsed ) )
1416 {
1417 moduleSet.setSources( parseModuleSources( parser, strict ) );
1418 }
1419 else if ( checkFieldWithDuplicate( parser, "binaries", null, parsed ) )
1420 {
1421 moduleSet.setBinaries( parseModuleBinaries( parser, strict ) );
1422 }
1423 else
1424 {
1425 checkUnknownElement( parser, strict );
1426 }
1427 }
1428 return moduleSet;
1429 }
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441 private ModuleSources parseModuleSources( XmlPullParser parser, boolean strict )
1442 throws IOException, XmlPullParserException
1443 {
1444 String tagName = parser.getName();
1445 ModuleSources moduleSources = new ModuleSources();
1446 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1447 {
1448 String name = parser.getAttributeName( i );
1449 String value = parser.getAttributeValue( i );
1450
1451 if ( name.indexOf( ':' ) >= 0 )
1452 {
1453
1454 }
1455 else
1456 {
1457 checkUnknownAttribute( parser, name, tagName, strict );
1458 }
1459 }
1460 java.util.Set<String> parsed = new java.util.HashSet<String>();
1461 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1462 {
1463 if ( checkFieldWithDuplicate( parser, "useDefaultExcludes", null, parsed ) )
1464 {
1465 moduleSources.setUseDefaultExcludes( getBooleanValue( interpolatedTrimmed( parser.nextText(), "useDefaultExcludes" ), "useDefaultExcludes", parser, "true" ) );
1466 }
1467 else if ( checkFieldWithDuplicate( parser, "outputDirectory", null, parsed ) )
1468 {
1469 moduleSources.setOutputDirectory( interpolatedTrimmed( parser.nextText(), "outputDirectory" ) );
1470 }
1471 else if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
1472 {
1473 java.util.List<String> includes = new java.util.ArrayList<String>();
1474 while ( parser.nextTag() == XmlPullParser.START_TAG )
1475 {
1476 if ( "include".equals( parser.getName() ) )
1477 {
1478 includes.add( interpolatedTrimmed( parser.nextText(), "includes" ) );
1479 }
1480 else
1481 {
1482 checkUnknownElement( parser, strict );
1483 }
1484 }
1485 moduleSources.setIncludes( includes );
1486 }
1487 else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
1488 {
1489 java.util.List<String> excludes = new java.util.ArrayList<String>();
1490 while ( parser.nextTag() == XmlPullParser.START_TAG )
1491 {
1492 if ( "exclude".equals( parser.getName() ) )
1493 {
1494 excludes.add( interpolatedTrimmed( parser.nextText(), "excludes" ) );
1495 }
1496 else
1497 {
1498 checkUnknownElement( parser, strict );
1499 }
1500 }
1501 moduleSources.setExcludes( excludes );
1502 }
1503 else if ( checkFieldWithDuplicate( parser, "fileMode", null, parsed ) )
1504 {
1505 moduleSources.setFileMode( interpolatedTrimmed( parser.nextText(), "fileMode" ) );
1506 }
1507 else if ( checkFieldWithDuplicate( parser, "directoryMode", null, parsed ) )
1508 {
1509 moduleSources.setDirectoryMode( interpolatedTrimmed( parser.nextText(), "directoryMode" ) );
1510 }
1511 else if ( checkFieldWithDuplicate( parser, "fileSets", null, parsed ) )
1512 {
1513 java.util.List<FileSet> fileSets = new java.util.ArrayList<FileSet>();
1514 while ( parser.nextTag() == XmlPullParser.START_TAG )
1515 {
1516 if ( "fileSet".equals( parser.getName() ) )
1517 {
1518 fileSets.add( parseFileSet( parser, strict ) );
1519 }
1520 else
1521 {
1522 checkUnknownElement( parser, strict );
1523 }
1524 }
1525 moduleSources.setFileSets( fileSets );
1526 }
1527 else if ( checkFieldWithDuplicate( parser, "includeModuleDirectory", null, parsed ) )
1528 {
1529 moduleSources.setIncludeModuleDirectory( getBooleanValue( interpolatedTrimmed( parser.nextText(), "includeModuleDirectory" ), "includeModuleDirectory", parser, "true" ) );
1530 }
1531 else if ( checkFieldWithDuplicate( parser, "excludeSubModuleDirectories", null, parsed ) )
1532 {
1533 moduleSources.setExcludeSubModuleDirectories( getBooleanValue( interpolatedTrimmed( parser.nextText(), "excludeSubModuleDirectories" ), "excludeSubModuleDirectories", parser, "true" ) );
1534 }
1535 else if ( checkFieldWithDuplicate( parser, "outputDirectoryMapping", null, parsed ) )
1536 {
1537 moduleSources.setOutputDirectoryMapping( interpolatedTrimmed( parser.nextText(), "outputDirectoryMapping" ) );
1538 }
1539 else
1540 {
1541 checkUnknownElement( parser, strict );
1542 }
1543 }
1544 return moduleSources;
1545 }
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557 private UnpackOptions parseUnpackOptions( XmlPullParser parser, boolean strict )
1558 throws IOException, XmlPullParserException
1559 {
1560 String tagName = parser.getName();
1561 UnpackOptions unpackOptions = new UnpackOptions();
1562 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1563 {
1564 String name = parser.getAttributeName( i );
1565 String value = parser.getAttributeValue( i );
1566
1567 if ( name.indexOf( ':' ) >= 0 )
1568 {
1569
1570 }
1571 else
1572 {
1573 checkUnknownAttribute( parser, name, tagName, strict );
1574 }
1575 }
1576 java.util.Set<String> parsed = new java.util.HashSet<String>();
1577 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1578 {
1579 if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
1580 {
1581 java.util.List<String> includes = new java.util.ArrayList<String>();
1582 while ( parser.nextTag() == XmlPullParser.START_TAG )
1583 {
1584 if ( "include".equals( parser.getName() ) )
1585 {
1586 includes.add( interpolatedTrimmed( parser.nextText(), "includes" ) );
1587 }
1588 else
1589 {
1590 checkUnknownElement( parser, strict );
1591 }
1592 }
1593 unpackOptions.setIncludes( includes );
1594 }
1595 else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
1596 {
1597 java.util.List<String> excludes = new java.util.ArrayList<String>();
1598 while ( parser.nextTag() == XmlPullParser.START_TAG )
1599 {
1600 if ( "exclude".equals( parser.getName() ) )
1601 {
1602 excludes.add( interpolatedTrimmed( parser.nextText(), "excludes" ) );
1603 }
1604 else
1605 {
1606 checkUnknownElement( parser, strict );
1607 }
1608 }
1609 unpackOptions.setExcludes( excludes );
1610 }
1611 else if ( checkFieldWithDuplicate( parser, "filtered", null, parsed ) )
1612 {
1613 unpackOptions.setFiltered( getBooleanValue( interpolatedTrimmed( parser.nextText(), "filtered" ), "filtered", parser, "false" ) );
1614 }
1615 else if ( checkFieldWithDuplicate( parser, "nonFilteredFileExtensions", null, parsed ) )
1616 {
1617 java.util.List<String> nonFilteredFileExtensions = new java.util.ArrayList<String>();
1618 while ( parser.nextTag() == XmlPullParser.START_TAG )
1619 {
1620 if ( "nonFilteredFileExtension".equals( parser.getName() ) )
1621 {
1622 nonFilteredFileExtensions.add( interpolatedTrimmed( parser.nextText(), "nonFilteredFileExtensions" ) );
1623 }
1624 else
1625 {
1626 checkUnknownElement( parser, strict );
1627 }
1628 }
1629 unpackOptions.setNonFilteredFileExtensions( nonFilteredFileExtensions );
1630 }
1631 else if ( checkFieldWithDuplicate( parser, "lineEnding", null, parsed ) )
1632 {
1633 unpackOptions.setLineEnding( interpolatedTrimmed( parser.nextText(), "lineEnding" ) );
1634 }
1635 else if ( checkFieldWithDuplicate( parser, "useDefaultExcludes", null, parsed ) )
1636 {
1637 unpackOptions.setUseDefaultExcludes( getBooleanValue( interpolatedTrimmed( parser.nextText(), "useDefaultExcludes" ), "useDefaultExcludes", parser, "true" ) );
1638 }
1639 else if ( checkFieldWithDuplicate( parser, "encoding", null, parsed ) )
1640 {
1641 unpackOptions.setEncoding( interpolatedTrimmed( parser.nextText(), "encoding" ) );
1642 }
1643 else
1644 {
1645 checkUnknownElement( parser, strict );
1646 }
1647 }
1648 return unpackOptions;
1649 }
1650
1651
1652
1653
1654
1655
1656 public void setAddDefaultEntities( boolean addDefaultEntities )
1657 {
1658 this.addDefaultEntities = addDefaultEntities;
1659 }
1660
1661 public static interface ContentTransformer
1662 {
1663
1664
1665
1666
1667
1668
1669
1670 String transform( String source, String fieldName );
1671 }
1672
1673 }