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