View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   //  Generated by Modello Velocity from reader.vm
3   //  template, any modifications will be overwritten.
4   // ==============================================================
5   package org.apache.maven.toolchain.v4;
6   
7   import java.io.IOException;
8   import java.io.InputStream;
9   import java.io.Reader;
10  import java.text.DateFormat;
11  import java.util.ArrayList;
12  import java.util.Date;
13  import java.util.HashMap;
14  import java.util.HashSet;
15  import java.util.LinkedHashMap;
16  import java.util.List;
17  import java.util.Map;
18  import java.util.Properties;
19  import java.util.Set;
20  import org.apache.maven.api.annotations.Generated;
21  import org.apache.maven.internal.xml.XmlNodeBuilder;
22  import org.apache.maven.api.toolchain.TrackableBase;
23  import org.apache.maven.api.toolchain.PersistedToolchains;
24  import org.apache.maven.api.toolchain.ToolchainModel;
25  import org.codehaus.plexus.util.ReaderFactory;
26  import org.codehaus.plexus.util.xml.pull.EntityReplacementMap;
27  import org.codehaus.plexus.util.xml.pull.MXParser;
28  import org.codehaus.plexus.util.xml.pull.XmlPullParser;
29  import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
30  
31  @Generated
32  public class MavenToolchainsXpp3Reader
33  {
34      private boolean addDefaultEntities = true;
35  
36      private final ContentTransformer contentTransformer;
37  
38      public MavenToolchainsXpp3Reader()
39      {
40          this( ( s, f ) -> s );
41      }
42  
43      public MavenToolchainsXpp3Reader( ContentTransformer contentTransformer )
44      {
45          this.contentTransformer = contentTransformer;
46      }
47  
48      /**
49       * Method checkFieldWithDuplicate.
50       *
51       * @param parser a parser object.
52       * @param parsed a parsed object.
53       * @param alias a alias object.
54       * @param tagName a tagName object.
55       * @throws XmlPullParserException XmlPullParserException if
56       * any.
57       * @return boolean
58       */
59      private boolean checkFieldWithDuplicate( XmlPullParser parser, String tagName, String alias, Set<String> parsed )
60          throws XmlPullParserException
61      {
62          if ( !( parser.getName().equals( tagName ) || parser.getName().equals( alias ) ) )
63          {
64              return false;
65          }
66          if ( !parsed.add( tagName ) )
67          {
68              throw new XmlPullParserException( "Duplicated tag: '" + tagName + "'", parser, null );
69          }
70          return true;
71      } //-- boolean checkFieldWithDuplicate( XmlPullParser, String, String, Set<String> )
72  
73      /**
74       * Method checkUnknownAttribute.
75       *
76       * @param parser a parser object.
77       * @param strict a strict object.
78       * @param tagName a tagName object.
79       * @param attribute a attribute object.
80       * @throws XmlPullParserException XmlPullParserException if
81       * any.
82       * @throws IOException IOException if any.
83       */
84      private void checkUnknownAttribute( XmlPullParser parser, String attribute, String tagName, boolean strict )
85          throws XmlPullParserException, IOException
86      {
87          // strictXmlAttributes = true for model: if strict == true, not only elements are checked but attributes too
88          if ( strict )
89          {
90              throw new XmlPullParserException( "Unknown attribute '" + attribute + "' for tag '" + tagName + "'", parser, null );
91          }
92      } //-- void checkUnknownAttribute( XmlPullParser, String, String, boolean )
93  
94      /**
95       * Method checkUnknownElement.
96       *
97       * @param parser a parser object.
98       * @param strict a strict object.
99       * @throws XmlPullParserException XmlPullParserException if
100      * any.
101      * @throws IOException IOException if any.
102      */
103     private void checkUnknownElement( XmlPullParser parser, boolean strict )
104         throws XmlPullParserException, IOException
105     {
106         if ( strict )
107         {
108             throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
109         }
110 
111         for ( int unrecognizedTagCount = 1; unrecognizedTagCount > 0; )
112         {
113             int eventType = parser.next();
114             if ( eventType == XmlPullParser.START_TAG )
115             {
116                 unrecognizedTagCount++;
117             }
118             else if ( eventType == XmlPullParser.END_TAG )
119             {
120                 unrecognizedTagCount--;
121             }
122         }
123     } //-- void checkUnknownElement( XmlPullParser, boolean )
124 
125     /**
126      * Returns the state of the "add default entities" flag.
127      *
128      * @return boolean
129      */
130     public boolean getAddDefaultEntities()
131     {
132         return addDefaultEntities;
133     } //-- boolean getAddDefaultEntities()
134 
135     /**
136      * Method getBooleanValue.
137      *
138      * @param s a s object.
139      * @param parser a parser object.
140      * @param attribute a attribute object.
141      * @throws XmlPullParserException XmlPullParserException if
142      * any.
143      * @return boolean
144      */
145     private boolean getBooleanValue( String s, String attribute, XmlPullParser parser )
146         throws XmlPullParserException
147     {
148         return getBooleanValue( s, attribute, parser, null );
149     } //-- boolean getBooleanValue( String, String, XmlPullParser )
150 
151     /**
152      * Method getBooleanValue.
153      *
154      * @param s a s object.
155      * @param defaultValue a defaultValue object.
156      * @param parser a parser object.
157      * @param attribute a attribute object.
158      * @throws XmlPullParserException XmlPullParserException if
159      * any.
160      * @return boolean
161      */
162     private boolean getBooleanValue( String s, String attribute, XmlPullParser parser, String defaultValue )
163         throws XmlPullParserException
164     {
165         if ( s != null && s.length() != 0 )
166         {
167             return Boolean.valueOf( s ).booleanValue();
168         }
169         if ( defaultValue != null )
170         {
171             return Boolean.valueOf( defaultValue ).booleanValue();
172         }
173         return false;
174     } //-- boolean getBooleanValue( String, String, XmlPullParser, String )
175 
176     /**
177      * Method getByteValue.
178      *
179      * @param s a s object.
180      * @param strict a strict object.
181      * @param parser a parser object.
182      * @param attribute a attribute object.
183      * @throws XmlPullParserException XmlPullParserException if
184      * any.
185      * @return byte
186      */
187     private byte getByteValue( String s, String attribute, XmlPullParser parser, boolean strict )
188         throws XmlPullParserException
189     {
190         if ( s != null )
191         {
192             try
193             {
194                 return Byte.valueOf( s ).byteValue();
195             }
196             catch ( NumberFormatException nfe )
197             {
198                 if ( strict )
199                 {
200                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a byte", parser, nfe );
201                 }
202             }
203         }
204         return 0;
205     } //-- byte getByteValue( String, String, XmlPullParser, boolean )
206 
207     /**
208      * Method getCharacterValue.
209      *
210      * @param s a s object.
211      * @param parser a parser object.
212      * @param attribute a attribute object.
213      * @throws XmlPullParserException XmlPullParserException if
214      * any.
215      * @return char
216      */
217     private char getCharacterValue( String s, String attribute, XmlPullParser parser )
218         throws XmlPullParserException
219     {
220         if ( s != null )
221         {
222             return s.charAt( 0 );
223         }
224         return 0;
225     } //-- char getCharacterValue( String, String, XmlPullParser )
226 
227     /**
228      * Method getDateValue.
229      *
230      * @param s a s object.
231      * @param parser a parser object.
232      * @param attribute a attribute object.
233      * @throws XmlPullParserException XmlPullParserException if
234      * any.
235      * @return Date
236      */
237     private Date getDateValue( String s, String attribute, XmlPullParser parser )
238         throws XmlPullParserException
239     {
240         return getDateValue( s, attribute, null, parser );
241     } //-- Date getDateValue( String, String, XmlPullParser )
242 
243     /**
244      * Method getDateValue.
245      *
246      * @param s a s object.
247      * @param parser a parser object.
248      * @param dateFormat a dateFormat object.
249      * @param attribute a attribute object.
250      * @throws XmlPullParserException XmlPullParserException if
251      * any.
252      * @return Date
253      */
254     private Date getDateValue( String s, String attribute, String dateFormat, XmlPullParser parser )
255         throws XmlPullParserException
256     {
257         if ( s != null )
258         {
259             String effectiveDateFormat = dateFormat;
260             if ( dateFormat == null )
261             {
262                 effectiveDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";
263             }
264             if ( "long".equals( effectiveDateFormat ) )
265             {
266                 try
267                 {
268                     return new java.util.Date( Long.parseLong( s ) );
269                 }
270                 catch ( NumberFormatException e )
271                 {
272                     throw new XmlPullParserException( e.getMessage(), parser, e );
273                 }
274             }
275             else
276             {
277                 try
278                 {
279                     DateFormat dateParser = new java.text.SimpleDateFormat( effectiveDateFormat, java.util.Locale.US );
280                     return dateParser.parse( s );
281                 }
282                 catch ( java.text.ParseException e )
283                 {
284                     throw new XmlPullParserException( e.getMessage(), parser, e );
285                 }
286             }
287         }
288         return null;
289     } //-- Date getDateValue( String, String, String, XmlPullParser )
290 
291     /**
292      * Method getDoubleValue.
293      *
294      * @param s a s object.
295      * @param strict a strict object.
296      * @param parser a parser object.
297      * @param attribute a attribute object.
298      * @throws XmlPullParserException XmlPullParserException if
299      * any.
300      * @return double
301      */
302     private double getDoubleValue( String s, String attribute, XmlPullParser parser, boolean strict )
303         throws XmlPullParserException
304     {
305         if ( s != null )
306         {
307             try
308             {
309                 return Double.valueOf( s ).doubleValue();
310             }
311             catch ( NumberFormatException nfe )
312             {
313                 if ( strict )
314                 {
315                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
316                 }
317             }
318         }
319         return 0;
320     } //-- double getDoubleValue( String, String, XmlPullParser, boolean )
321 
322     /**
323      * Method getFloatValue.
324      *
325      * @param s a s object.
326      * @param strict a strict object.
327      * @param parser a parser object.
328      * @param attribute a attribute object.
329      * @throws XmlPullParserException XmlPullParserException if
330      * any.
331      * @return float
332      */
333     private float getFloatValue( String s, String attribute, XmlPullParser parser, boolean strict )
334         throws XmlPullParserException
335     {
336         if ( s != null )
337         {
338             try
339             {
340                 return Float.valueOf( s ).floatValue();
341             }
342             catch ( NumberFormatException nfe )
343             {
344                 if ( strict )
345                 {
346                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
347                 }
348             }
349         }
350         return 0;
351     } //-- float getFloatValue( String, String, XmlPullParser, boolean )
352 
353     /**
354      * Method getIntegerValue.
355      *
356      * @param s a s object.
357      * @param parser a parser object.
358      * @param attribute a attribute object.
359      * @throws XmlPullParserException XmlPullParserException if
360      * any.
361      * @return int
362      */
363     private int getIntegerValue( String s, String attribute, XmlPullParser parser, boolean strict )
364         throws XmlPullParserException
365     {
366         return getIntegerValue( s, attribute, parser, strict, 0 );
367     } //-- int getBooleanValue( String, String, XmlPullParser )
368 
369     /**
370      * Method getIntegerValue.
371      *
372      * @param s a s object.
373      * @param strict a strict object.
374      * @param parser a parser object.
375      * @param attribute a attribute object.
376      * @throws XmlPullParserException XmlPullParserException if
377      * any.
378      * @return int
379      */
380     private int getIntegerValue( String s, String attribute, XmlPullParser parser, boolean strict, int defaultValue )
381         throws XmlPullParserException
382     {
383         if ( s != null )
384         {
385             try
386             {
387                 return Integer.valueOf( s ).intValue();
388             }
389             catch ( NumberFormatException nfe )
390             {
391                 if ( strict )
392                 {
393                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be an integer", parser, nfe );
394                 }
395             }
396         }
397         return defaultValue;
398     } //-- int getIntegerValue( String, String, XmlPullParser, boolean, int )
399 
400     /**
401      * Method getLongValue.
402      *
403      * @param s a s object.
404      * @param strict a strict object.
405      * @param parser a parser object.
406      * @param attribute a attribute object.
407      * @throws XmlPullParserException XmlPullParserException if
408      * any.
409      * @return long
410      */
411     private long getLongValue( String s, String attribute, XmlPullParser parser, boolean strict )
412         throws XmlPullParserException
413     {
414         if ( s != null )
415         {
416             try
417             {
418                 return Long.valueOf( s ).longValue();
419             }
420             catch ( NumberFormatException nfe )
421             {
422                 if ( strict )
423                 {
424                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a long integer", parser, nfe );
425                 }
426             }
427         }
428         return 0;
429     } //-- long getLongValue( String, String, XmlPullParser, boolean )
430 
431     /**
432      * Method getRequiredAttributeValue.
433      *
434      * @param s a s object.
435      * @param strict a strict object.
436      * @param parser a parser object.
437      * @param attribute a attribute object.
438      * @throws XmlPullParserException XmlPullParserException if
439      * any.
440      * @return String
441      */
442     private String getRequiredAttributeValue( String s, String attribute, XmlPullParser parser, boolean strict )
443         throws XmlPullParserException
444     {
445         if ( s == null )
446         {
447             if ( strict )
448             {
449                 throw new XmlPullParserException( "Missing required value for attribute '" + attribute + "'", parser, null );
450             }
451         }
452         return s;
453     } //-- String getRequiredAttributeValue( String, String, XmlPullParser, boolean )
454 
455     /**
456      * Method getShortValue.
457      *
458      * @param s a s object.
459      * @param strict a strict object.
460      * @param parser a parser object.
461      * @param attribute a attribute object.
462      * @throws XmlPullParserException XmlPullParserException if
463      * any.
464      * @return short
465      */
466     private short getShortValue( String s, String attribute, XmlPullParser parser, boolean strict )
467         throws XmlPullParserException
468     {
469         if ( s != null )
470         {
471             try
472             {
473                 return Short.valueOf( s ).shortValue();
474             }
475             catch ( NumberFormatException nfe )
476             {
477                 if ( strict )
478                 {
479                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a short integer", parser, nfe );
480                 }
481             }
482         }
483         return 0;
484     } //-- short getShortValue( String, String, XmlPullParser, boolean )
485 
486     /**
487      * Method getTrimmedValue.
488      *
489      * @param s a s object.
490      * @return String
491      */
492     private String getTrimmedValue( String s )
493     {
494         if ( s != null )
495         {
496             s = s.trim();
497         }
498         return s;
499     } //-- String getTrimmedValue( String )
500 
501     /**
502      * Method interpolatedTrimmed.
503      *
504      * @param value a value object.
505      * @param context a context object.
506      * @return String
507      */
508     private String interpolatedTrimmed( String value, String context )
509     {
510         return getTrimmedValue( contentTransformer.transform( value, context ) );
511     } //-- String interpolatedTrimmed( String, String )
512 
513     /**
514      * Method nextTag.
515      *
516      * @param parser a parser object.
517      * @throws IOException IOException if any.
518      * @throws XmlPullParserException XmlPullParserException if
519      * any.
520      * @return int
521      */
522     private int nextTag( XmlPullParser parser )
523         throws IOException, XmlPullParserException
524     {
525         int eventType = parser.next();
526         if ( eventType == XmlPullParser.TEXT )
527         {
528             eventType = parser.next();
529         }
530         if ( eventType != XmlPullParser.START_TAG && eventType != XmlPullParser.END_TAG )
531         {
532             throw new XmlPullParserException( "expected START_TAG or END_TAG not " + XmlPullParser.TYPES[eventType], parser, null );
533         }
534         return eventType;
535     } //-- int nextTag( XmlPullParser )
536 
537     /**
538      * @see ReaderFactory#newXmlReader
539      *
540      * @param reader a reader object.
541      * @param strict a strict object.
542      * @throws IOException IOException if any.
543      * @throws XmlPullParserException XmlPullParserException if
544      * any.
545      * @return PersistedToolchains
546      */
547     public PersistedToolchains read( Reader reader, boolean strict )
548         throws IOException, XmlPullParserException
549     {
550         XmlPullParser parser = addDefaultEntities ? new MXParser(EntityReplacementMap.defaultEntityReplacementMap) : new MXParser( );
551 
552         parser.setInput( reader );
553 
554 
555         return read( parser, strict );
556     } //-- PersistedToolchains read( Reader, boolean )
557 
558     /**
559      * @see ReaderFactory#newXmlReader
560      *
561      * @param reader a reader object.
562      * @throws IOException IOException if any.
563      * @throws XmlPullParserException XmlPullParserException if
564      * any.
565      * @return PersistedToolchains
566      */
567     public PersistedToolchains read( Reader reader )
568         throws IOException, XmlPullParserException
569     {
570         return read( reader, true );
571     } //-- PersistedToolchains read( Reader )
572 
573     /**
574      * Method read.
575      *
576      * @param in a in object.
577      * @param strict a strict object.
578      * @throws IOException IOException if any.
579      * @throws XmlPullParserException XmlPullParserException if
580      * any.
581      * @return PersistedToolchains
582      */
583     public PersistedToolchains read( InputStream in, boolean strict )
584         throws IOException, XmlPullParserException
585     {
586         return read( ReaderFactory.newXmlReader( in ), strict );
587     } //-- PersistedToolchains read( InputStream, boolean )
588 
589     /**
590      * Method read.
591      *
592      * @param in a in object.
593      * @throws IOException IOException if any.
594      * @throws XmlPullParserException XmlPullParserException if
595      * any.
596      * @return PersistedToolchains
597      */
598     public PersistedToolchains read( InputStream in )
599         throws IOException, XmlPullParserException
600     {
601         return read( ReaderFactory.newXmlReader( in ) );
602     } //-- PersistedToolchains read( InputStream )
603 
604     /**
605      * Method read.
606      *
607      * @param parser a parser object.
608      * @param strict a strict object.
609      * @throws IOException IOException if any.
610      * @throws XmlPullParserException XmlPullParserException if
611      * any.
612      * @return PersistedToolchains
613      */
614     public PersistedToolchains read( XmlPullParser parser, boolean strict )
615         throws IOException, XmlPullParserException
616     {
617         PersistedToolchains persistedToolchains = null;
618         int eventType = parser.getEventType();
619         boolean parsed = false;
620         while ( eventType != XmlPullParser.END_DOCUMENT )
621         {
622             if ( eventType == XmlPullParser.START_TAG )
623             {
624                 if ( strict && ! "toolchains".equals( parser.getName() ) )
625                 {
626                     throw new XmlPullParserException( "Expected root element 'toolchains' but found '" + parser.getName() + "'", parser, null );
627                 }
628                 else if ( parsed )
629                 {
630                     // fallback, already expected a XmlPullParserException due to invalid XML
631                     throw new XmlPullParserException( "Duplicated tag: 'toolchains'", parser, null );
632                 }
633                 persistedToolchains = parsePersistedToolchains( parser, strict );
634                 parsed = true;
635             }
636             eventType = parser.next();
637         }
638         if ( parsed )
639         {
640             return persistedToolchains;
641         }
642         throw new XmlPullParserException( "Expected root element 'toolchains' but found no element at all: invalid XML document", parser, null );
643     } //-- PersistedToolchains read( XmlPullParser, boolean )
644 
645     private TrackableBase parseTrackableBase( XmlPullParser parser, boolean strict )
646         throws IOException, XmlPullParserException
647     {
648         String tagName = parser.getName();
649         TrackableBase.Builder trackableBase = TrackableBase.newBuilder( true );
650         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
651         {
652             String name = parser.getAttributeName( i );
653             String value = parser.getAttributeValue( i );
654             if ( name.indexOf( ':' ) >= 0 )
655             {
656                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
657             }
658             else
659             {
660                 checkUnknownAttribute( parser, name, tagName, strict );
661             }
662         }
663         Set<String> parsed = new HashSet<>();
664         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
665         {
666             String childName = checkDuplicate( parser.getName(), parser, parsed );
667             switch ( childName )
668             {
669                 default:
670                 {
671                     checkUnknownElement( parser, strict );
672                     break;
673                 }
674             }
675         }
676         return trackableBase.build();
677     }
678 
679     private PersistedToolchains parsePersistedToolchains( XmlPullParser parser, boolean strict )
680         throws IOException, XmlPullParserException
681     {
682         String tagName = parser.getName();
683         PersistedToolchains.Builder persistedToolchains = PersistedToolchains.newBuilder( true );
684         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
685         {
686             String name = parser.getAttributeName( i );
687             String value = parser.getAttributeValue( i );
688             if ( name.indexOf( ':' ) >= 0 )
689             {
690                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
691             }
692             else if ( "xmlns".equals( name ) )
693             {
694                 // ignore xmlns attribute in root class, which is a reserved attribute name
695             }
696             else
697             {
698                 checkUnknownAttribute( parser, name, tagName, strict );
699             }
700         }
701         Set<String> parsed = new HashSet<>();
702         List<ToolchainModel> toolchains = new ArrayList<>();
703         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
704         {
705             String childName = checkDuplicate( parser.getName(), parser, parsed );
706             switch ( childName )
707             {
708                 case "toolchain":
709                 {
710                     toolchains.add( parseToolchainModel( parser, strict ) );
711                     break;
712                 }
713                 default:
714                 {
715                     checkUnknownElement( parser, strict );
716                     break;
717                 }
718             }
719         }
720         persistedToolchains.toolchains( toolchains );
721         persistedToolchains.modelEncoding( parser.getInputEncoding() );
722         return persistedToolchains.build();
723     }
724 
725     private ToolchainModel parseToolchainModel( XmlPullParser parser, boolean strict )
726         throws IOException, XmlPullParserException
727     {
728         String tagName = parser.getName();
729         ToolchainModel.Builder toolchainModel = ToolchainModel.newBuilder( true );
730         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
731         {
732             String name = parser.getAttributeName( i );
733             String value = parser.getAttributeValue( i );
734             if ( name.indexOf( ':' ) >= 0 )
735             {
736                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
737             }
738             else
739             {
740                 checkUnknownAttribute( parser, name, tagName, strict );
741             }
742         }
743         Set<String> parsed = new HashSet<>();
744         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
745         {
746             String childName = checkDuplicate( parser.getName(), parser, parsed );
747             switch ( childName )
748             {
749                 case "type":
750                 {
751                     toolchainModel.type( interpolatedTrimmed( parser.nextText(), "type" ) );
752                     break;
753                 }
754                 case "provides":
755                 {
756                     Map<String, String> provides = new LinkedHashMap<>();
757                     while ( parser.nextTag() == XmlPullParser.START_TAG )
758                     {
759                         String key = parser.getName();
760                         String value = parser.nextText().trim();
761                         provides.put( key, value );
762                     }
763                     toolchainModel.provides( provides );
764                     break;
765                 }
766                 case "configuration":
767                 {
768                     toolchainModel.configuration( XmlNodeBuilder.build( parser, true ) );
769                     break;
770                 }
771                 default:
772                 {
773                     checkUnknownElement( parser, strict );
774                     break;
775                 }
776             }
777         }
778         return toolchainModel.build();
779     }
780 
781 
782     private String checkDuplicate( String tagName, XmlPullParser parser, Set<String> parsed )
783         throws XmlPullParserException
784     {
785         switch ( tagName )
786         {
787             case "toolchain":
788                 break;
789             default:
790                 if ( !parsed.add( tagName ) )
791                 {
792                     throw new XmlPullParserException( "Duplicated tag: '" + tagName + "'", parser, null );
793                 }
794         }
795         return tagName;
796     }
797 
798     /**
799      * Sets the state of the "add default entities" flag.
800      *
801      * @param addDefaultEntities a addDefaultEntities object.
802      */
803     public void setAddDefaultEntities( boolean addDefaultEntities )
804     {
805         this.addDefaultEntities = addDefaultEntities;
806     } //-- void setAddDefaultEntities( boolean )
807 
808     public static interface ContentTransformer
809     {
810         /**
811          * Interpolate the value read from the xpp3 document
812          * @param source The source value
813          * @param fieldName A description of the field being interpolated. The implementation may use this to
814          *                           log stuff.
815          * @return The interpolated value.
816          */
817         String transform( String source, String fieldName );
818     }
819 
820 }