View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 2.0.0,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.doxia.site.decoration.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.doxia.site.decoration.Banner;
17  import org.apache.maven.doxia.site.decoration.Body;
18  import org.apache.maven.doxia.site.decoration.DecorationModel;
19  import org.apache.maven.doxia.site.decoration.LinkItem;
20  import org.apache.maven.doxia.site.decoration.Logo;
21  import org.apache.maven.doxia.site.decoration.Menu;
22  import org.apache.maven.doxia.site.decoration.MenuItem;
23  import org.apache.maven.doxia.site.decoration.PublishDate;
24  import org.apache.maven.doxia.site.decoration.Skin;
25  import org.apache.maven.doxia.site.decoration.Version;
26  import org.codehaus.plexus.util.ReaderFactory;
27  import org.codehaus.plexus.util.xml.pull.EntityReplacementMap;
28  import org.codehaus.plexus.util.xml.pull.MXParser;
29  import org.codehaus.plexus.util.xml.pull.XmlPullParser;
30  import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
31  
32  /**
33   * Class DecorationXpp3Reader.
34   * 
35   * @version $Revision$ $Date$
36   */
37  @SuppressWarnings( "all" )
38  public class DecorationXpp3Reader
39  {
40  
41        //--------------------------/
42       //- Class/Member Variables -/
43      //--------------------------/
44  
45      /**
46       * If set the parser will be loaded with all single characters
47       * from the XHTML specification.
48       * The entities used:
49       * <ul>
50       * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent</li>
51       * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent</li>
52       * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent</li>
53       * </ul>
54       */
55      private boolean addDefaultEntities = true;
56  
57      /**
58       * Field contentTransformer.
59       */
60      public final ContentTransformer contentTransformer;
61  
62  
63        //----------------/
64       //- Constructors -/
65      //----------------/
66  
67      public DecorationXpp3Reader()
68      {
69          this( new ContentTransformer()
70          {
71              public String transform( String source, String fieldName )
72              {
73                  return source;
74              }
75          } );
76      } //-- org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader()
77  
78      public DecorationXpp3Reader(ContentTransformer contentTransformer)
79      {
80          this.contentTransformer = contentTransformer;
81      } //-- org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader(ContentTransformer)
82  
83  
84        //-----------/
85       //- Methods -/
86      //-----------/
87  
88      /**
89       * Method checkFieldWithDuplicate.
90       * 
91       * @param parser a parser object.
92       * @param parsed a parsed object.
93       * @param alias a alias object.
94       * @param tagName a tagName object.
95       * @throws XmlPullParserException XmlPullParserException if
96       * any.
97       * @return boolean
98       */
99      private boolean checkFieldWithDuplicate( XmlPullParser parser, String tagName, String alias, java.util.Set parsed )
100         throws XmlPullParserException
101     {
102         if ( !( parser.getName().equals( tagName ) || parser.getName().equals( alias ) ) )
103         {
104             return false;
105         }
106         if ( !parsed.add( tagName ) )
107         {
108             throw new XmlPullParserException( "Duplicated tag: '" + tagName + "'", parser, null );
109         }
110         return true;
111     } //-- boolean checkFieldWithDuplicate( XmlPullParser, String, String, java.util.Set )
112 
113     /**
114      * Method checkUnknownAttribute.
115      * 
116      * @param parser a parser object.
117      * @param strict a strict object.
118      * @param tagName a tagName object.
119      * @param attribute a attribute object.
120      * @throws XmlPullParserException XmlPullParserException if
121      * any.
122      * @throws IOException IOException if any.
123      */
124     private void checkUnknownAttribute( XmlPullParser parser, String attribute, String tagName, boolean strict )
125         throws XmlPullParserException, IOException
126     {
127         // strictXmlAttributes = true for model: if strict == true, not only elements are checked but attributes too
128         if ( strict )
129         {
130             throw new XmlPullParserException( "Unknown attribute '" + attribute + "' for tag '" + tagName + "'", parser, null );
131         }
132     } //-- void checkUnknownAttribute( XmlPullParser, String, String, boolean )
133 
134     /**
135      * Method checkUnknownElement.
136      * 
137      * @param parser a parser object.
138      * @param strict a strict object.
139      * @throws XmlPullParserException XmlPullParserException if
140      * any.
141      * @throws IOException IOException if any.
142      */
143     private void checkUnknownElement( XmlPullParser parser, boolean strict )
144         throws XmlPullParserException, IOException
145     {
146         if ( strict )
147         {
148             throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
149         }
150 
151         for ( int unrecognizedTagCount = 1; unrecognizedTagCount > 0; )
152         {
153             int eventType = parser.next();
154             if ( eventType == XmlPullParser.START_TAG )
155             {
156                 unrecognizedTagCount++;
157             }
158             else if ( eventType == XmlPullParser.END_TAG )
159             {
160                 unrecognizedTagCount--;
161             }
162         }
163     } //-- void checkUnknownElement( XmlPullParser, boolean )
164 
165     /**
166      * Returns the state of the "add default entities" flag.
167      * 
168      * @return boolean
169      */
170     public boolean getAddDefaultEntities()
171     {
172         return addDefaultEntities;
173     } //-- boolean getAddDefaultEntities()
174 
175     /**
176      * Method getBooleanValue.
177      * 
178      * @param s a s object.
179      * @param parser a parser object.
180      * @param attribute a attribute object.
181      * @throws XmlPullParserException XmlPullParserException if
182      * any.
183      * @return boolean
184      */
185     private boolean getBooleanValue( String s, String attribute, XmlPullParser parser )
186         throws XmlPullParserException
187     {
188         return getBooleanValue( s, attribute, parser, null );
189     } //-- boolean getBooleanValue( String, String, XmlPullParser )
190 
191     /**
192      * Method getBooleanValue.
193      * 
194      * @param s a s object.
195      * @param defaultValue a defaultValue object.
196      * @param parser a parser object.
197      * @param attribute a attribute object.
198      * @throws XmlPullParserException XmlPullParserException if
199      * any.
200      * @return boolean
201      */
202     private boolean getBooleanValue( String s, String attribute, XmlPullParser parser, String defaultValue )
203         throws XmlPullParserException
204     {
205         if ( s != null && s.length() != 0 )
206         {
207             return Boolean.valueOf( s ).booleanValue();
208         }
209         if ( defaultValue != null )
210         {
211             return Boolean.valueOf( defaultValue ).booleanValue();
212         }
213         return false;
214     } //-- boolean getBooleanValue( String, String, XmlPullParser, String )
215 
216     /**
217      * Method getByteValue.
218      * 
219      * @param s a s object.
220      * @param strict a strict object.
221      * @param parser a parser object.
222      * @param attribute a attribute object.
223      * @throws XmlPullParserException XmlPullParserException if
224      * any.
225      * @return byte
226      */
227     private byte getByteValue( String s, String attribute, XmlPullParser parser, boolean strict )
228         throws XmlPullParserException
229     {
230         if ( s != null )
231         {
232             try
233             {
234                 return Byte.valueOf( s ).byteValue();
235             }
236             catch ( NumberFormatException nfe )
237             {
238                 if ( strict )
239                 {
240                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a byte", parser, nfe );
241                 }
242             }
243         }
244         return 0;
245     } //-- byte getByteValue( String, String, XmlPullParser, boolean )
246 
247     /**
248      * Method getCharacterValue.
249      * 
250      * @param s a s object.
251      * @param parser a parser object.
252      * @param attribute a attribute object.
253      * @throws XmlPullParserException XmlPullParserException if
254      * any.
255      * @return char
256      */
257     private char getCharacterValue( String s, String attribute, XmlPullParser parser )
258         throws XmlPullParserException
259     {
260         if ( s != null )
261         {
262             return s.charAt( 0 );
263         }
264         return 0;
265     } //-- char getCharacterValue( String, String, XmlPullParser )
266 
267     /**
268      * Method getDateValue.
269      * 
270      * @param s a s object.
271      * @param parser a parser object.
272      * @param attribute a attribute object.
273      * @throws XmlPullParserException XmlPullParserException if
274      * any.
275      * @return Date
276      */
277     private java.util.Date getDateValue( String s, String attribute, XmlPullParser parser )
278         throws XmlPullParserException
279     {
280         return getDateValue( s, attribute, null, parser );
281     } //-- java.util.Date getDateValue( String, String, XmlPullParser )
282 
283     /**
284      * Method getDateValue.
285      * 
286      * @param s a s object.
287      * @param parser a parser object.
288      * @param dateFormat a dateFormat object.
289      * @param attribute a attribute object.
290      * @throws XmlPullParserException XmlPullParserException if
291      * any.
292      * @return Date
293      */
294     private java.util.Date getDateValue( String s, String attribute, String dateFormat, XmlPullParser parser )
295         throws XmlPullParserException
296     {
297         if ( s != null )
298         {
299             String effectiveDateFormat = dateFormat;
300             if ( dateFormat == null )
301             {
302                 effectiveDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";
303             }
304             if ( "long".equals( effectiveDateFormat ) )
305             {
306                 try
307                 {
308                     return new java.util.Date( Long.parseLong( s ) );
309                 }
310                 catch ( NumberFormatException e )
311                 {
312                     throw new XmlPullParserException( e.getMessage(), parser, e );
313                 }
314             }
315             else
316             {
317                 try
318                 {
319                     DateFormat dateParser = new java.text.SimpleDateFormat( effectiveDateFormat, java.util.Locale.US );
320                     return dateParser.parse( s );
321                 }
322                 catch ( java.text.ParseException e )
323                 {
324                     throw new XmlPullParserException( e.getMessage(), parser, e );
325                 }
326             }
327         }
328         return null;
329     } //-- java.util.Date getDateValue( String, String, String, XmlPullParser )
330 
331     /**
332      * Method getDoubleValue.
333      * 
334      * @param s a s object.
335      * @param strict a strict object.
336      * @param parser a parser object.
337      * @param attribute a attribute object.
338      * @throws XmlPullParserException XmlPullParserException if
339      * any.
340      * @return double
341      */
342     private double getDoubleValue( String s, String attribute, XmlPullParser parser, boolean strict )
343         throws XmlPullParserException
344     {
345         if ( s != null )
346         {
347             try
348             {
349                 return Double.valueOf( s ).doubleValue();
350             }
351             catch ( NumberFormatException nfe )
352             {
353                 if ( strict )
354                 {
355                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
356                 }
357             }
358         }
359         return 0;
360     } //-- double getDoubleValue( String, String, XmlPullParser, boolean )
361 
362     /**
363      * Method getFloatValue.
364      * 
365      * @param s a s object.
366      * @param strict a strict object.
367      * @param parser a parser object.
368      * @param attribute a attribute object.
369      * @throws XmlPullParserException XmlPullParserException if
370      * any.
371      * @return float
372      */
373     private float getFloatValue( String s, String attribute, XmlPullParser parser, boolean strict )
374         throws XmlPullParserException
375     {
376         if ( s != null )
377         {
378             try
379             {
380                 return Float.valueOf( s ).floatValue();
381             }
382             catch ( NumberFormatException nfe )
383             {
384                 if ( strict )
385                 {
386                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
387                 }
388             }
389         }
390         return 0;
391     } //-- float getFloatValue( String, String, XmlPullParser, boolean )
392 
393     /**
394      * Method getIntegerValue.
395      * 
396      * @param s a s object.
397      * @param strict a strict object.
398      * @param parser a parser object.
399      * @param attribute a attribute object.
400      * @throws XmlPullParserException XmlPullParserException if
401      * any.
402      * @return int
403      */
404     private int getIntegerValue( String s, String attribute, XmlPullParser parser, boolean strict )
405         throws XmlPullParserException
406     {
407         if ( s != null )
408         {
409             try
410             {
411                 return Integer.valueOf( s ).intValue();
412             }
413             catch ( NumberFormatException nfe )
414             {
415                 if ( strict )
416                 {
417                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be an integer", parser, nfe );
418                 }
419             }
420         }
421         return 0;
422     } //-- int getIntegerValue( String, String, XmlPullParser, boolean )
423 
424     /**
425      * Method getLongValue.
426      * 
427      * @param s a s object.
428      * @param strict a strict object.
429      * @param parser a parser object.
430      * @param attribute a attribute object.
431      * @throws XmlPullParserException XmlPullParserException if
432      * any.
433      * @return long
434      */
435     private long getLongValue( String s, String attribute, XmlPullParser parser, boolean strict )
436         throws XmlPullParserException
437     {
438         if ( s != null )
439         {
440             try
441             {
442                 return Long.valueOf( s ).longValue();
443             }
444             catch ( NumberFormatException nfe )
445             {
446                 if ( strict )
447                 {
448                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a long integer", parser, nfe );
449                 }
450             }
451         }
452         return 0;
453     } //-- long getLongValue( String, String, XmlPullParser, boolean )
454 
455     /**
456      * Method getRequiredAttributeValue.
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 String
465      */
466     private String getRequiredAttributeValue( String s, String attribute, XmlPullParser parser, boolean strict )
467         throws XmlPullParserException
468     {
469         if ( s == null )
470         {
471             if ( strict )
472             {
473                 throw new XmlPullParserException( "Missing required value for attribute '" + attribute + "'", parser, null );
474             }
475         }
476         return s;
477     } //-- String getRequiredAttributeValue( String, String, XmlPullParser, boolean )
478 
479     /**
480      * Method getShortValue.
481      * 
482      * @param s a s object.
483      * @param strict a strict object.
484      * @param parser a parser object.
485      * @param attribute a attribute object.
486      * @throws XmlPullParserException XmlPullParserException if
487      * any.
488      * @return short
489      */
490     private short getShortValue( String s, String attribute, XmlPullParser parser, boolean strict )
491         throws XmlPullParserException
492     {
493         if ( s != null )
494         {
495             try
496             {
497                 return Short.valueOf( s ).shortValue();
498             }
499             catch ( NumberFormatException nfe )
500             {
501                 if ( strict )
502                 {
503                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a short integer", parser, nfe );
504                 }
505             }
506         }
507         return 0;
508     } //-- short getShortValue( String, String, XmlPullParser, boolean )
509 
510     /**
511      * Method getTrimmedValue.
512      * 
513      * @param s a s object.
514      * @return String
515      */
516     private String getTrimmedValue( String s )
517     {
518         if ( s != null )
519         {
520             s = s.trim();
521         }
522         return s;
523     } //-- String getTrimmedValue( String )
524 
525     /**
526      * Method interpolatedTrimmed.
527      * 
528      * @param value a value object.
529      * @param context a context object.
530      * @return String
531      */
532     private String interpolatedTrimmed( String value, String context )
533     {
534         return getTrimmedValue( contentTransformer.transform( value, context ) );
535     } //-- String interpolatedTrimmed( String, String )
536 
537     /**
538      * Method nextTag.
539      * 
540      * @param parser a parser object.
541      * @throws IOException IOException if any.
542      * @throws XmlPullParserException XmlPullParserException if
543      * any.
544      * @return int
545      */
546     private int nextTag( XmlPullParser parser )
547         throws IOException, XmlPullParserException
548     {
549         int eventType = parser.next();
550         if ( eventType == XmlPullParser.TEXT )
551         {
552             eventType = parser.next();
553         }
554         if ( eventType != XmlPullParser.START_TAG && eventType != XmlPullParser.END_TAG )
555         {
556             throw new XmlPullParserException( "expected START_TAG or END_TAG not " + XmlPullParser.TYPES[eventType], parser, null );
557         }
558         return eventType;
559     } //-- int nextTag( XmlPullParser )
560 
561     /**
562      * @see ReaderFactory#newXmlReader
563      * 
564      * @param reader a reader object.
565      * @param strict a strict object.
566      * @throws IOException IOException if any.
567      * @throws XmlPullParserException XmlPullParserException if
568      * any.
569      * @return DecorationModel
570      */
571     public DecorationModel read( Reader reader, boolean strict )
572         throws IOException, XmlPullParserException
573     {
574         XmlPullParser parser = addDefaultEntities ? new MXParser(EntityReplacementMap.defaultEntityReplacementMap) : new MXParser( );
575 
576         parser.setInput( reader );
577 
578 
579         return read( parser, strict );
580     } //-- DecorationModel read( Reader, boolean )
581 
582     /**
583      * @see ReaderFactory#newXmlReader
584      * 
585      * @param reader a reader object.
586      * @throws IOException IOException if any.
587      * @throws XmlPullParserException XmlPullParserException if
588      * any.
589      * @return DecorationModel
590      */
591     public DecorationModel read( Reader reader )
592         throws IOException, XmlPullParserException
593     {
594         return read( reader, true );
595     } //-- DecorationModel read( Reader )
596 
597     /**
598      * Method read.
599      * 
600      * @param in a in object.
601      * @param strict a strict object.
602      * @throws IOException IOException if any.
603      * @throws XmlPullParserException XmlPullParserException if
604      * any.
605      * @return DecorationModel
606      */
607     public DecorationModel read( InputStream in, boolean strict )
608         throws IOException, XmlPullParserException
609     {
610         return read( ReaderFactory.newXmlReader( in ), strict );
611     } //-- DecorationModel read( InputStream, boolean )
612 
613     /**
614      * Method read.
615      * 
616      * @param in a in object.
617      * @throws IOException IOException if any.
618      * @throws XmlPullParserException XmlPullParserException if
619      * any.
620      * @return DecorationModel
621      */
622     public DecorationModel read( InputStream in )
623         throws IOException, XmlPullParserException
624     {
625         return read( ReaderFactory.newXmlReader( in ) );
626     } //-- DecorationModel read( InputStream )
627 
628     /**
629      * Method parseBanner.
630      * 
631      * @param parser a parser object.
632      * @param strict a strict object.
633      * @throws IOException IOException if any.
634      * @throws XmlPullParserException XmlPullParserException if
635      * any.
636      * @return Banner
637      */
638     private Banner parseBanner( XmlPullParser parser, boolean strict )
639         throws IOException, XmlPullParserException
640     {
641         String tagName = parser.getName();
642         Banner banner = new Banner();
643         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
644         {
645             String name = parser.getAttributeName( i );
646             String value = parser.getAttributeValue( i );
647 
648             if ( name.indexOf( ':' ) >= 0 )
649             {
650                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
651             }
652             else
653             {
654                 checkUnknownAttribute( parser, name, tagName, strict );
655             }
656         }
657         java.util.Set parsed = new java.util.HashSet();
658         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
659         {
660             if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
661             {
662                 banner.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
663             }
664             else if ( checkFieldWithDuplicate( parser, "src", null, parsed ) )
665             {
666                 banner.setSrc( interpolatedTrimmed( parser.nextText(), "src" ) );
667             }
668             else if ( checkFieldWithDuplicate( parser, "alt", null, parsed ) )
669             {
670                 banner.setAlt( interpolatedTrimmed( parser.nextText(), "alt" ) );
671             }
672             else if ( checkFieldWithDuplicate( parser, "href", null, parsed ) )
673             {
674                 banner.setHref( interpolatedTrimmed( parser.nextText(), "href" ) );
675             }
676             else if ( checkFieldWithDuplicate( parser, "border", null, parsed ) )
677             {
678                 banner.setBorder( interpolatedTrimmed( parser.nextText(), "border" ) );
679             }
680             else if ( checkFieldWithDuplicate( parser, "width", null, parsed ) )
681             {
682                 banner.setWidth( interpolatedTrimmed( parser.nextText(), "width" ) );
683             }
684             else if ( checkFieldWithDuplicate( parser, "height", null, parsed ) )
685             {
686                 banner.setHeight( interpolatedTrimmed( parser.nextText(), "height" ) );
687             }
688             else if ( checkFieldWithDuplicate( parser, "title", null, parsed ) )
689             {
690                 banner.setTitle( interpolatedTrimmed( parser.nextText(), "title" ) );
691             }
692             else
693             {
694                 checkUnknownElement( parser, strict );
695             }
696         }
697         return banner;
698     } //-- Banner parseBanner( XmlPullParser, boolean )
699 
700     /**
701      * Method parseBody.
702      * 
703      * @param parser a parser object.
704      * @param strict a strict object.
705      * @throws IOException IOException if any.
706      * @throws XmlPullParserException XmlPullParserException if
707      * any.
708      * @return Body
709      */
710     private Body parseBody( XmlPullParser parser, boolean strict )
711         throws IOException, XmlPullParserException
712     {
713         String tagName = parser.getName();
714         Body body = new Body();
715         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
716         {
717             String name = parser.getAttributeName( i );
718             String value = parser.getAttributeValue( i );
719 
720             if ( name.indexOf( ':' ) >= 0 )
721             {
722                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
723             }
724             else
725             {
726                 checkUnknownAttribute( parser, name, tagName, strict );
727             }
728         }
729         java.util.Set parsed = new java.util.HashSet();
730         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
731         {
732             if ( checkFieldWithDuplicate( parser, "head", null, parsed ) )
733             {
734                 body.setHead( interpolatedTrimmed( parser.nextText(), "head" ) );
735             }
736             else if ( checkFieldWithDuplicate( parser, "links", null, parsed ) )
737             {
738                 java.util.List<LinkItem> links = new java.util.ArrayList<LinkItem>();
739                 body.setLinks( links );
740                 while ( parser.nextTag() == XmlPullParser.START_TAG )
741                 {
742                     if ( "item".equals( parser.getName() ) )
743                     {
744                         links.add( parseLinkItem( parser, strict ) );
745                     }
746                     else
747                     {
748                         checkUnknownElement( parser, strict );
749                     }
750                 }
751             }
752             else if ( checkFieldWithDuplicate( parser, "breadcrumbs", null, parsed ) )
753             {
754                 java.util.List<LinkItem> breadcrumbs = new java.util.ArrayList<LinkItem>();
755                 body.setBreadcrumbs( breadcrumbs );
756                 while ( parser.nextTag() == XmlPullParser.START_TAG )
757                 {
758                     if ( "item".equals( parser.getName() ) )
759                     {
760                         breadcrumbs.add( parseLinkItem( parser, strict ) );
761                     }
762                     else
763                     {
764                         checkUnknownElement( parser, strict );
765                     }
766                 }
767             }
768             else if ( "menu".equals( parser.getName() ) )
769             {
770                 java.util.List<Menu> menus = body.getMenus();
771                 if ( menus == null )
772                 {
773                     menus = new java.util.ArrayList<Menu>();
774                     body.setMenus( menus );
775                 }
776                 menus.add( parseMenu( parser, strict ) );
777             }
778             else if ( checkFieldWithDuplicate( parser, "footer", null, parsed ) )
779             {
780                 body.setFooter( interpolatedTrimmed( parser.nextText(), "footer" ) );
781             }
782             else
783             {
784                 checkUnknownElement( parser, strict );
785             }
786         }
787         return body;
788     } //-- Body parseBody( XmlPullParser, boolean )
789 
790     /**
791      * Method parseDecorationModel.
792      * 
793      * @param parser a parser object.
794      * @param strict a strict object.
795      * @throws IOException IOException if any.
796      * @throws XmlPullParserException XmlPullParserException if
797      * any.
798      * @return DecorationModel
799      */
800     private DecorationModel parseDecorationModel( XmlPullParser parser, boolean strict )
801         throws IOException, XmlPullParserException
802     {
803         String tagName = parser.getName();
804         DecorationModel decorationModel = new DecorationModel();
805         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
806         {
807             String name = parser.getAttributeName( i );
808             String value = parser.getAttributeValue( i );
809 
810             if ( name.indexOf( ':' ) >= 0 )
811             {
812                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
813             }
814             else if ( "xmlns".equals( name ) )
815             {
816                 // ignore xmlns attribute in root class, which is a reserved attribute name
817             }
818             else if ( "name".equals( name ) )
819             {
820                 decorationModel.setName( interpolatedTrimmed( value, "name" ) );
821             }
822             else if ( "combine.self".equals( name ) )
823             {
824                 decorationModel.setCombineSelf( interpolatedTrimmed( value, "combine.self" ) );
825             }
826             else
827             {
828                 checkUnknownAttribute( parser, name, tagName, strict );
829             }
830         }
831         java.util.Set parsed = new java.util.HashSet();
832         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
833         {
834             if ( checkFieldWithDuplicate( parser, "bannerLeft", null, parsed ) )
835             {
836                 decorationModel.setBannerLeft( parseBanner( parser, strict ) );
837             }
838             else if ( checkFieldWithDuplicate( parser, "bannerRight", null, parsed ) )
839             {
840                 decorationModel.setBannerRight( parseBanner( parser, strict ) );
841             }
842             else if ( checkFieldWithDuplicate( parser, "googleAdSenseClient", null, parsed ) )
843             {
844                 decorationModel.setGoogleAdSenseClient( interpolatedTrimmed( parser.nextText(), "googleAdSenseClient" ) );
845             }
846             else if ( checkFieldWithDuplicate( parser, "googleAdSenseSlot", null, parsed ) )
847             {
848                 decorationModel.setGoogleAdSenseSlot( interpolatedTrimmed( parser.nextText(), "googleAdSenseSlot" ) );
849             }
850             else if ( checkFieldWithDuplicate( parser, "googleAnalyticsAccountId", null, parsed ) )
851             {
852                 decorationModel.setGoogleAnalyticsAccountId( interpolatedTrimmed( parser.nextText(), "googleAnalyticsAccountId" ) );
853             }
854             else if ( checkFieldWithDuplicate( parser, "publishDate", null, parsed ) )
855             {
856                 decorationModel.setPublishDate( parsePublishDate( parser, strict ) );
857             }
858             else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
859             {
860                 decorationModel.setVersion( parseVersion( parser, strict ) );
861             }
862             else if ( checkFieldWithDuplicate( parser, "edit", null, parsed ) )
863             {
864                 decorationModel.setEdit( interpolatedTrimmed( parser.nextText(), "edit" ) );
865             }
866             else if ( checkFieldWithDuplicate( parser, "poweredBy", null, parsed ) )
867             {
868                 java.util.List<Logo> poweredBy = new java.util.ArrayList<Logo>();
869                 decorationModel.setPoweredBy( poweredBy );
870                 while ( parser.nextTag() == XmlPullParser.START_TAG )
871                 {
872                     if ( "logo".equals( parser.getName() ) )
873                     {
874                         poweredBy.add( parseLogo( parser, strict ) );
875                     }
876                     else
877                     {
878                         checkUnknownElement( parser, strict );
879                     }
880                 }
881             }
882             else if ( checkFieldWithDuplicate( parser, "skin", null, parsed ) )
883             {
884                 decorationModel.setSkin( parseSkin( parser, strict ) );
885             }
886             else if ( checkFieldWithDuplicate( parser, "body", null, parsed ) )
887             {
888                 decorationModel.setBody( parseBody( parser, strict ) );
889             }
890             else if ( checkFieldWithDuplicate( parser, "custom", null, parsed ) )
891             {
892                 decorationModel.setCustom( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true ) );
893             }
894             else
895             {
896                 checkUnknownElement( parser, strict );
897             }
898         }
899         return decorationModel;
900     } //-- DecorationModel parseDecorationModel( XmlPullParser, boolean )
901 
902     /**
903      * Method parseLinkItem.
904      * 
905      * @param parser a parser object.
906      * @param strict a strict object.
907      * @throws IOException IOException if any.
908      * @throws XmlPullParserException XmlPullParserException if
909      * any.
910      * @return LinkItem
911      */
912     private LinkItem parseLinkItem( XmlPullParser parser, boolean strict )
913         throws IOException, XmlPullParserException
914     {
915         String tagName = parser.getName();
916         LinkItem linkItem = new LinkItem();
917         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
918         {
919             String name = parser.getAttributeName( i );
920             String value = parser.getAttributeValue( i );
921 
922             if ( name.indexOf( ':' ) >= 0 )
923             {
924                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
925             }
926             else if ( "name".equals( name ) )
927             {
928                 linkItem.setName( interpolatedTrimmed( value, "name" ) );
929             }
930             else if ( "href".equals( name ) )
931             {
932                 linkItem.setHref( interpolatedTrimmed( value, "href" ) );
933             }
934             else if ( "img".equals( name ) )
935             {
936                 linkItem.setImg( interpolatedTrimmed( value, "img" ) );
937             }
938             else if ( "position".equals( name ) )
939             {
940                 linkItem.setPosition( interpolatedTrimmed( value, "position" ) );
941             }
942             else if ( "alt".equals( name ) )
943             {
944                 linkItem.setAlt( interpolatedTrimmed( value, "alt" ) );
945             }
946             else if ( "border".equals( name ) )
947             {
948                 linkItem.setBorder( interpolatedTrimmed( value, "border" ) );
949             }
950             else if ( "width".equals( name ) )
951             {
952                 linkItem.setWidth( interpolatedTrimmed( value, "width" ) );
953             }
954             else if ( "height".equals( name ) )
955             {
956                 linkItem.setHeight( interpolatedTrimmed( value, "height" ) );
957             }
958             else if ( "target".equals( name ) )
959             {
960                 linkItem.setTarget( interpolatedTrimmed( value, "target" ) );
961             }
962             else if ( "title".equals( name ) )
963             {
964                 linkItem.setTitle( interpolatedTrimmed( value, "title" ) );
965             }
966             else
967             {
968                 checkUnknownAttribute( parser, name, tagName, strict );
969             }
970         }
971         java.util.Set parsed = new java.util.HashSet();
972         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
973         {
974             checkUnknownElement( parser, strict );
975         }
976         return linkItem;
977     } //-- LinkItem parseLinkItem( XmlPullParser, boolean )
978 
979     /**
980      * Method parseLogo.
981      * 
982      * @param parser a parser object.
983      * @param strict a strict object.
984      * @throws IOException IOException if any.
985      * @throws XmlPullParserException XmlPullParserException if
986      * any.
987      * @return Logo
988      */
989     private Logo parseLogo( XmlPullParser parser, boolean strict )
990         throws IOException, XmlPullParserException
991     {
992         String tagName = parser.getName();
993         Logo logo = new Logo();
994         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
995         {
996             String name = parser.getAttributeName( i );
997             String value = parser.getAttributeValue( i );
998 
999             if ( name.indexOf( ':' ) >= 0 )
1000             {
1001                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1002             }
1003             else if ( "name".equals( name ) )
1004             {
1005                 logo.setName( interpolatedTrimmed( value, "name" ) );
1006             }
1007             else if ( "href".equals( name ) )
1008             {
1009                 logo.setHref( interpolatedTrimmed( value, "href" ) );
1010             }
1011             else if ( "img".equals( name ) )
1012             {
1013                 logo.setImg( interpolatedTrimmed( value, "img" ) );
1014             }
1015             else if ( "position".equals( name ) )
1016             {
1017                 logo.setPosition( interpolatedTrimmed( value, "position" ) );
1018             }
1019             else if ( "alt".equals( name ) )
1020             {
1021                 logo.setAlt( interpolatedTrimmed( value, "alt" ) );
1022             }
1023             else if ( "border".equals( name ) )
1024             {
1025                 logo.setBorder( interpolatedTrimmed( value, "border" ) );
1026             }
1027             else if ( "width".equals( name ) )
1028             {
1029                 logo.setWidth( interpolatedTrimmed( value, "width" ) );
1030             }
1031             else if ( "height".equals( name ) )
1032             {
1033                 logo.setHeight( interpolatedTrimmed( value, "height" ) );
1034             }
1035             else if ( "target".equals( name ) )
1036             {
1037                 logo.setTarget( interpolatedTrimmed( value, "target" ) );
1038             }
1039             else if ( "title".equals( name ) )
1040             {
1041                 logo.setTitle( interpolatedTrimmed( value, "title" ) );
1042             }
1043             else
1044             {
1045                 checkUnknownAttribute( parser, name, tagName, strict );
1046             }
1047         }
1048         java.util.Set parsed = new java.util.HashSet();
1049         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1050         {
1051             checkUnknownElement( parser, strict );
1052         }
1053         return logo;
1054     } //-- Logo parseLogo( XmlPullParser, boolean )
1055 
1056     /**
1057      * Method parseMenu.
1058      * 
1059      * @param parser a parser object.
1060      * @param strict a strict object.
1061      * @throws IOException IOException if any.
1062      * @throws XmlPullParserException XmlPullParserException if
1063      * any.
1064      * @return Menu
1065      */
1066     private Menu parseMenu( XmlPullParser parser, boolean strict )
1067         throws IOException, XmlPullParserException
1068     {
1069         String tagName = parser.getName();
1070         Menu menu = new Menu();
1071         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1072         {
1073             String name = parser.getAttributeName( i );
1074             String value = parser.getAttributeValue( i );
1075 
1076             if ( name.indexOf( ':' ) >= 0 )
1077             {
1078                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1079             }
1080             else if ( "name".equals( name ) )
1081             {
1082                 menu.setName( interpolatedTrimmed( value, "name" ) );
1083             }
1084             else if ( "inherit".equals( name ) )
1085             {
1086                 menu.setInherit( interpolatedTrimmed( value, "inherit" ) );
1087             }
1088             else if ( "inheritAsRef".equals( name ) )
1089             {
1090                 menu.setInheritAsRef( getBooleanValue( interpolatedTrimmed( value, "inheritAsRef" ), "inheritAsRef", parser, "false" ) );
1091             }
1092             else if ( "ref".equals( name ) )
1093             {
1094                 menu.setRef( interpolatedTrimmed( value, "ref" ) );
1095             }
1096             else if ( "img".equals( name ) )
1097             {
1098                 menu.setImg( interpolatedTrimmed( value, "img" ) );
1099             }
1100             else if ( "alt".equals( name ) )
1101             {
1102                 menu.setAlt( interpolatedTrimmed( value, "alt" ) );
1103             }
1104             else if ( "position".equals( name ) )
1105             {
1106                 menu.setPosition( interpolatedTrimmed( value, "position" ) );
1107             }
1108             else if ( "border".equals( name ) )
1109             {
1110                 menu.setBorder( interpolatedTrimmed( value, "border" ) );
1111             }
1112             else if ( "width".equals( name ) )
1113             {
1114                 menu.setWidth( interpolatedTrimmed( value, "width" ) );
1115             }
1116             else if ( "height".equals( name ) )
1117             {
1118                 menu.setHeight( interpolatedTrimmed( value, "height" ) );
1119             }
1120             else if ( "title".equals( name ) )
1121             {
1122                 menu.setTitle( interpolatedTrimmed( value, "title" ) );
1123             }
1124             else
1125             {
1126                 checkUnknownAttribute( parser, name, tagName, strict );
1127             }
1128         }
1129         java.util.Set parsed = new java.util.HashSet();
1130         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1131         {
1132             if ( "item".equals( parser.getName() ) )
1133             {
1134                 java.util.List<MenuItem> items = menu.getItems();
1135                 if ( items == null )
1136                 {
1137                     items = new java.util.ArrayList<MenuItem>();
1138                     menu.setItems( items );
1139                 }
1140                 items.add( parseMenuItem( parser, strict ) );
1141             }
1142             else
1143             {
1144                 checkUnknownElement( parser, strict );
1145             }
1146         }
1147         return menu;
1148     } //-- Menu parseMenu( XmlPullParser, boolean )
1149 
1150     /**
1151      * Method parseMenuItem.
1152      * 
1153      * @param parser a parser object.
1154      * @param strict a strict object.
1155      * @throws IOException IOException if any.
1156      * @throws XmlPullParserException XmlPullParserException if
1157      * any.
1158      * @return MenuItem
1159      */
1160     private MenuItem parseMenuItem( XmlPullParser parser, boolean strict )
1161         throws IOException, XmlPullParserException
1162     {
1163         String tagName = parser.getName();
1164         MenuItem menuItem = new MenuItem();
1165         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1166         {
1167             String name = parser.getAttributeName( i );
1168             String value = parser.getAttributeValue( i );
1169 
1170             if ( name.indexOf( ':' ) >= 0 )
1171             {
1172                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1173             }
1174             else if ( "collapse".equals( name ) )
1175             {
1176                 menuItem.setCollapse( getBooleanValue( interpolatedTrimmed( value, "collapse" ), "collapse", parser, "false" ) );
1177             }
1178             else if ( "ref".equals( name ) )
1179             {
1180                 menuItem.setRef( interpolatedTrimmed( value, "ref" ) );
1181             }
1182             else if ( "name".equals( name ) )
1183             {
1184                 menuItem.setName( interpolatedTrimmed( value, "name" ) );
1185             }
1186             else if ( "href".equals( name ) )
1187             {
1188                 menuItem.setHref( interpolatedTrimmed( value, "href" ) );
1189             }
1190             else if ( "img".equals( name ) )
1191             {
1192                 menuItem.setImg( interpolatedTrimmed( value, "img" ) );
1193             }
1194             else if ( "position".equals( name ) )
1195             {
1196                 menuItem.setPosition( interpolatedTrimmed( value, "position" ) );
1197             }
1198             else if ( "alt".equals( name ) )
1199             {
1200                 menuItem.setAlt( interpolatedTrimmed( value, "alt" ) );
1201             }
1202             else if ( "border".equals( name ) )
1203             {
1204                 menuItem.setBorder( interpolatedTrimmed( value, "border" ) );
1205             }
1206             else if ( "width".equals( name ) )
1207             {
1208                 menuItem.setWidth( interpolatedTrimmed( value, "width" ) );
1209             }
1210             else if ( "height".equals( name ) )
1211             {
1212                 menuItem.setHeight( interpolatedTrimmed( value, "height" ) );
1213             }
1214             else if ( "target".equals( name ) )
1215             {
1216                 menuItem.setTarget( interpolatedTrimmed( value, "target" ) );
1217             }
1218             else if ( "title".equals( name ) )
1219             {
1220                 menuItem.setTitle( interpolatedTrimmed( value, "title" ) );
1221             }
1222             else
1223             {
1224                 checkUnknownAttribute( parser, name, tagName, strict );
1225             }
1226         }
1227         java.util.Set parsed = new java.util.HashSet();
1228         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1229         {
1230             if ( checkFieldWithDuplicate( parser, "description", null, parsed ) )
1231             {
1232                 menuItem.setDescription( interpolatedTrimmed( parser.nextText(), "description" ) );
1233             }
1234             else if ( "item".equals( parser.getName() ) )
1235             {
1236                 java.util.List<MenuItem> items = menuItem.getItems();
1237                 if ( items == null )
1238                 {
1239                     items = new java.util.ArrayList<MenuItem>();
1240                     menuItem.setItems( items );
1241                 }
1242                 items.add( parseMenuItem( parser, strict ) );
1243             }
1244             else
1245             {
1246                 checkUnknownElement( parser, strict );
1247             }
1248         }
1249         return menuItem;
1250     } //-- MenuItem parseMenuItem( XmlPullParser, boolean )
1251 
1252     /**
1253      * Method parsePublishDate.
1254      * 
1255      * @param parser a parser object.
1256      * @param strict a strict object.
1257      * @throws IOException IOException if any.
1258      * @throws XmlPullParserException XmlPullParserException if
1259      * any.
1260      * @return PublishDate
1261      */
1262     private PublishDate parsePublishDate( XmlPullParser parser, boolean strict )
1263         throws IOException, XmlPullParserException
1264     {
1265         String tagName = parser.getName();
1266         PublishDate publishDate = new PublishDate();
1267         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1268         {
1269             String name = parser.getAttributeName( i );
1270             String value = parser.getAttributeValue( i );
1271 
1272             if ( name.indexOf( ':' ) >= 0 )
1273             {
1274                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1275             }
1276             else if ( "position".equals( name ) )
1277             {
1278                 publishDate.setPosition( interpolatedTrimmed( value, "position" ) );
1279             }
1280             else if ( "format".equals( name ) )
1281             {
1282                 publishDate.setFormat( interpolatedTrimmed( value, "format" ) );
1283             }
1284             else
1285             {
1286                 checkUnknownAttribute( parser, name, tagName, strict );
1287             }
1288         }
1289         java.util.Set parsed = new java.util.HashSet();
1290         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1291         {
1292             checkUnknownElement( parser, strict );
1293         }
1294         return publishDate;
1295     } //-- PublishDate parsePublishDate( XmlPullParser, boolean )
1296 
1297     /**
1298      * Method parseSkin.
1299      * 
1300      * @param parser a parser object.
1301      * @param strict a strict object.
1302      * @throws IOException IOException if any.
1303      * @throws XmlPullParserException XmlPullParserException if
1304      * any.
1305      * @return Skin
1306      */
1307     private Skin parseSkin( XmlPullParser parser, boolean strict )
1308         throws IOException, XmlPullParserException
1309     {
1310         String tagName = parser.getName();
1311         Skin skin = new Skin();
1312         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1313         {
1314             String name = parser.getAttributeName( i );
1315             String value = parser.getAttributeValue( i );
1316 
1317             if ( name.indexOf( ':' ) >= 0 )
1318             {
1319                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1320             }
1321             else
1322             {
1323                 checkUnknownAttribute( parser, name, tagName, strict );
1324             }
1325         }
1326         java.util.Set parsed = new java.util.HashSet();
1327         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1328         {
1329             if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
1330             {
1331                 skin.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
1332             }
1333             else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
1334             {
1335                 skin.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) );
1336             }
1337             else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
1338             {
1339                 skin.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
1340             }
1341             else
1342             {
1343                 checkUnknownElement( parser, strict );
1344             }
1345         }
1346         return skin;
1347     } //-- Skin parseSkin( XmlPullParser, boolean )
1348 
1349     /**
1350      * Method parseVersion.
1351      * 
1352      * @param parser a parser object.
1353      * @param strict a strict object.
1354      * @throws IOException IOException if any.
1355      * @throws XmlPullParserException XmlPullParserException if
1356      * any.
1357      * @return Version
1358      */
1359     private Version parseVersion( XmlPullParser parser, boolean strict )
1360         throws IOException, XmlPullParserException
1361     {
1362         String tagName = parser.getName();
1363         Version version = new Version();
1364         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1365         {
1366             String name = parser.getAttributeName( i );
1367             String value = parser.getAttributeValue( i );
1368 
1369             if ( name.indexOf( ':' ) >= 0 )
1370             {
1371                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1372             }
1373             else if ( "position".equals( name ) )
1374             {
1375                 version.setPosition( interpolatedTrimmed( value, "position" ) );
1376             }
1377             else
1378             {
1379                 checkUnknownAttribute( parser, name, tagName, strict );
1380             }
1381         }
1382         java.util.Set parsed = new java.util.HashSet();
1383         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1384         {
1385             checkUnknownElement( parser, strict );
1386         }
1387         return version;
1388     } //-- Version parseVersion( XmlPullParser, boolean )
1389 
1390     /**
1391      * Method read.
1392      * 
1393      * @param parser a parser object.
1394      * @param strict a strict object.
1395      * @throws IOException IOException if any.
1396      * @throws XmlPullParserException XmlPullParserException if
1397      * any.
1398      * @return DecorationModel
1399      */
1400     private DecorationModel read( XmlPullParser parser, boolean strict )
1401         throws IOException, XmlPullParserException
1402     {
1403         DecorationModel decorationModel = null;
1404         int eventType = parser.getEventType();
1405         boolean parsed = false;
1406         while ( eventType != XmlPullParser.END_DOCUMENT )
1407         {
1408             if ( eventType == XmlPullParser.START_TAG )
1409             {
1410                 if ( strict && ! "project".equals( parser.getName() ) )
1411                 {
1412                     throw new XmlPullParserException( "Expected root element 'project' but found '" + parser.getName() + "'", parser, null );
1413                 }
1414                 else if ( parsed )
1415                 {
1416                     // fallback, already expected a XmlPullParserException due to invalid XML
1417                     throw new XmlPullParserException( "Duplicated tag: 'project'", parser, null );
1418                 }
1419                 decorationModel = parseDecorationModel( parser, strict );
1420                 decorationModel.setModelEncoding( parser.getInputEncoding() );
1421                 parsed = true;
1422             }
1423             eventType = parser.next();
1424         }
1425         if ( parsed )
1426         {
1427             return decorationModel;
1428         }
1429         throw new XmlPullParserException( "Expected root element 'project' but found no element at all: invalid XML document", parser, null );
1430     } //-- DecorationModel read( XmlPullParser, boolean )
1431 
1432     /**
1433      * Sets the state of the "add default entities" flag.
1434      * 
1435      * @param addDefaultEntities a addDefaultEntities object.
1436      */
1437     public void setAddDefaultEntities( boolean addDefaultEntities )
1438     {
1439         this.addDefaultEntities = addDefaultEntities;
1440     } //-- void setAddDefaultEntities( boolean )
1441 
1442     public static interface ContentTransformer
1443 {
1444     /**
1445      * Interpolate the value read from the xpp3 document
1446      * @param source The source value
1447      * @param fieldName A description of the field being interpolated. The implementation may use this to
1448      *                           log stuff.
1449      * @return The interpolated value.
1450      */
1451     String transform( String source, String fieldName );
1452 }
1453 
1454 }