View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.10.0,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.codehaus.modello.test.features.io.dom4j;
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.net.URL;
16  import java.text.DateFormat;
17  import java.text.ParsePosition;
18  import java.util.Date;
19  import java.util.Iterator;
20  import java.util.Locale;
21  import org.codehaus.modello.test.features.Action;
22  import org.codehaus.modello.test.features.AnnotationTest;
23  import org.codehaus.modello.test.features.ArrayFeatures;
24  import org.codehaus.modello.test.features.AssociationFeatures;
25  import org.codehaus.modello.test.features.BaseClass;
26  import org.codehaus.modello.test.features.BidiInList;
27  import org.codehaus.modello.test.features.BidiInSet;
28  import org.codehaus.modello.test.features.Bidirectional;
29  import org.codehaus.modello.test.features.ContentTest;
30  import org.codehaus.modello.test.features.DueTo;
31  import org.codehaus.modello.test.features.Features;
32  import org.codehaus.modello.test.features.File;
33  import org.codehaus.modello.test.features.InterfacesFeature;
34  import org.codehaus.modello.test.features.JavaFeatures;
35  import org.codehaus.modello.test.features.NodeItem;
36  import org.codehaus.modello.test.features.Reference;
37  import org.codehaus.modello.test.features.SimpleInterface;
38  import org.codehaus.modello.test.features.SimpleTypes;
39  import org.codehaus.modello.test.features.SubClassLevel1;
40  import org.codehaus.modello.test.features.SubClassLevel2;
41  import org.codehaus.modello.test.features.SubClassLevel3;
42  import org.codehaus.modello.test.features.SubInterface;
43  import org.codehaus.modello.test.features.SuperThing;
44  import org.codehaus.modello.test.features.Thing;
45  import org.codehaus.modello.test.features.Thingy;
46  import org.codehaus.modello.test.features.XdocFeatures;
47  import org.codehaus.modello.test.features.XmlAttributes;
48  import org.codehaus.modello.test.features.XmlContent;
49  import org.codehaus.modello.test.features.XmlContentLong;
50  import org.codehaus.modello.test.features.XmlContentLongWithAttributes;
51  import org.codehaus.modello.test.features.XmlFeatures;
52  import org.codehaus.modello.test.features.XmlFieldsOrder;
53  import org.codehaus.modello.test.features.XmlFieldsOrderParent;
54  import org.codehaus.modello.test.features.XmlFieldsOrderParent2;
55  import org.codehaus.modello.test.features.XmlTransientFields;
56  import org.codehaus.modello.test.features.XsdFeatures;
57  import org.codehaus.modello.test.features.other.PackageNameFeature;
58  import org.codehaus.modello.test.features.other.SubInterfaceInPackage;
59  import org.codehaus.plexus.util.xml.Xpp3Dom;
60  import org.dom4j.Attribute;
61  import org.dom4j.Document;
62  import org.dom4j.DocumentException;
63  import org.dom4j.Element;
64  import org.dom4j.Node;
65  import org.dom4j.io.SAXReader;
66  
67  /**
68   * Class ModelloFeaturesTestDom4jReader.
69   * 
70   * @version $Revision$ $Date$
71   */
72  @SuppressWarnings( "all" )
73  public class ModelloFeaturesTestDom4jReader
74  {
75  
76        //-----------/
77       //- Methods -/
78      //-----------/
79  
80      /**
81       * Method checkFieldWithDuplicate.
82       * 
83       * @param element
84       * @param parsed
85       * @param alias
86       * @param tagName
87       * @throws DocumentException
88       * @return boolean
89       */
90      private boolean checkFieldWithDuplicate( Element element, String tagName, String alias, java.util.Set parsed )
91          throws DocumentException
92      {
93          if ( !( element.getName().equals( tagName ) || element.getName().equals( alias ) ) )
94          {
95              return false;
96          }
97          if ( !parsed.add( tagName ) )
98          {
99              throw new DocumentException( "Duplicated tag: '" + tagName + "'" );
100         }
101         return true;
102     } //-- boolean checkFieldWithDuplicate( Element, String, String, java.util.Set )
103 
104     /**
105      * Method checkUnknownElement.
106      * 
107      * @param element
108      * @param strict
109      * @throws DocumentException
110      */
111     private void checkUnknownElement( Element element, boolean strict )
112         throws DocumentException
113     {
114         if ( strict )
115         {
116             throw new DocumentException( "Unrecognised tag: '" + element.getName() + "'" );
117         }
118     } //-- void checkUnknownElement( Element, boolean )
119 
120     /**
121      * Method getBooleanValue.
122      * 
123      * @param s
124      * @param attribute
125      * @return boolean
126      */
127     private boolean getBooleanValue( String s, String attribute )
128     {
129         if ( s != null )
130         {
131             return Boolean.valueOf( s ).booleanValue();
132         }
133         return false;
134     } //-- boolean getBooleanValue( String, String )
135 
136     /**
137      * Method getByteValue.
138      * 
139      * @param s
140      * @param strict
141      * @param attribute
142      * @throws DocumentException
143      * @return byte
144      */
145     private byte getByteValue( String s, String attribute, boolean strict )
146         throws DocumentException
147     {
148         if ( s != null )
149         {
150             try
151             {
152                 return Byte.valueOf( s ).byteValue();
153             }
154             catch ( NumberFormatException nfe )
155             {
156                 if ( strict )
157                 {
158                     throw new DocumentException( "Unable to parse element '" + attribute + "', must be a byte", nfe );
159                 }
160             }
161         }
162         return 0;
163     } //-- byte getByteValue( String, String, boolean )
164 
165     /**
166      * Method getCharacterValue.
167      * 
168      * @param s
169      * @param attribute
170      * @return char
171      */
172     private char getCharacterValue( String s, String attribute )
173     {
174         if ( s != null )
175         {
176             return s.charAt( 0 );
177         }
178         return 0;
179     } //-- char getCharacterValue( String, String )
180 
181     /**
182      * Method getDateValue.
183      * 
184      * @param s
185      * @param dateFormat
186      * @param attribute
187      * @throws DocumentException
188      * @return Date
189      */
190     private java.util.Date getDateValue( String s, String attribute, String dateFormat )
191         throws DocumentException
192     {
193         if ( s != null )
194         {
195             String effectiveDateFormat = dateFormat;
196             if ( dateFormat == null )
197             {
198                 effectiveDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";
199             }
200             if ( "long".equals( effectiveDateFormat ) )
201             {
202                 try
203                 {
204                     return new java.util.Date( Long.parseLong( s ) );
205                 }
206                 catch ( NumberFormatException e )
207                 {
208                     throw new DocumentException( e.getMessage(), e );
209                 }
210             }
211             else
212             {
213                 try
214                 {
215                     DateFormat dateParser = new java.text.SimpleDateFormat( effectiveDateFormat, java.util.Locale.US );
216                     return dateParser.parse( s );
217                 }
218                 catch ( java.text.ParseException e )
219                 {
220                     throw new DocumentException( e.getMessage(), e );
221                 }
222             }
223         }
224         return null;
225     } //-- java.util.Date getDateValue( String, String, String )
226 
227     /**
228      * Method getDoubleValue.
229      * 
230      * @param s
231      * @param strict
232      * @param attribute
233      * @throws DocumentException
234      * @return double
235      */
236     private double getDoubleValue( String s, String attribute, boolean strict )
237         throws DocumentException
238     {
239         if ( s != null )
240         {
241             try
242             {
243                 return Double.valueOf( s ).doubleValue();
244             }
245             catch ( NumberFormatException nfe )
246             {
247                 if ( strict )
248                 {
249                     throw new DocumentException( "Unable to parse element '" + attribute + "', must be a floating point number", nfe );
250                 }
251             }
252         }
253         return 0;
254     } //-- double getDoubleValue( String, String, boolean )
255 
256     /**
257      * Method getFloatValue.
258      * 
259      * @param s
260      * @param strict
261      * @param attribute
262      * @throws DocumentException
263      * @return float
264      */
265     private float getFloatValue( String s, String attribute, boolean strict )
266         throws DocumentException
267     {
268         if ( s != null )
269         {
270             try
271             {
272                 return Float.valueOf( s ).floatValue();
273             }
274             catch ( NumberFormatException nfe )
275             {
276                 if ( strict )
277                 {
278                     throw new DocumentException( "Unable to parse element '" + attribute + "', must be a floating point number", nfe );
279                 }
280             }
281         }
282         return 0;
283     } //-- float getFloatValue( String, String, boolean )
284 
285     /**
286      * Method getIntegerValue.
287      * 
288      * @param s
289      * @param strict
290      * @param attribute
291      * @throws DocumentException
292      * @return int
293      */
294     private int getIntegerValue( String s, String attribute, boolean strict )
295         throws DocumentException
296     {
297         if ( s != null )
298         {
299             try
300             {
301                 return Integer.valueOf( s ).intValue();
302             }
303             catch ( NumberFormatException nfe )
304             {
305                 if ( strict )
306                 {
307                     throw new DocumentException( "Unable to parse element '" + attribute + "', must be an integer", nfe );
308                 }
309             }
310         }
311         return 0;
312     } //-- int getIntegerValue( String, String, boolean )
313 
314     /**
315      * Method getLongValue.
316      * 
317      * @param s
318      * @param strict
319      * @param attribute
320      * @throws DocumentException
321      * @return long
322      */
323     private long getLongValue( String s, String attribute, boolean strict )
324         throws DocumentException
325     {
326         if ( s != null )
327         {
328             try
329             {
330                 return Long.valueOf( s ).longValue();
331             }
332             catch ( NumberFormatException nfe )
333             {
334                 if ( strict )
335                 {
336                     throw new DocumentException( "Unable to parse element '" + attribute + "', must be a long integer", nfe );
337                 }
338             }
339         }
340         return 0;
341     } //-- long getLongValue( String, String, boolean )
342 
343     /**
344      * Method getShortValue.
345      * 
346      * @param s
347      * @param strict
348      * @param attribute
349      * @throws DocumentException
350      * @return short
351      */
352     private short getShortValue( String s, String attribute, boolean strict )
353         throws DocumentException
354     {
355         if ( s != null )
356         {
357             try
358             {
359                 return Short.valueOf( s ).shortValue();
360             }
361             catch ( NumberFormatException nfe )
362             {
363                 if ( strict )
364                 {
365                     throw new DocumentException( "Unable to parse element '" + attribute + "', must be a short integer", nfe );
366                 }
367             }
368         }
369         return 0;
370     } //-- short getShortValue( String, String, boolean )
371 
372     /**
373      * Method getTrimmedValue.
374      * 
375      * @param s
376      * @return String
377      */
378     private String getTrimmedValue( String s )
379     {
380         if ( s != null )
381         {
382             s = s.trim();
383         }
384         return s;
385     } //-- String getTrimmedValue( String )
386 
387     /**
388      * Method parseAction.
389      * 
390      * @param tagName
391      * @param strict
392      * @param element
393      * @throws IOException
394      * @throws DocumentException
395      * @return Action
396      */
397     private Action parseAction( String tagName, Element element, boolean strict )
398         throws IOException, DocumentException
399     {
400         Actiono/test/features/Action.html#Action">Action action = new Action();
401         if ( element.attributeValue( "dev" ) != null  )
402         {
403             action.setDev( getTrimmedValue( element.attributeValue( "dev" ) ) );
404         }
405         action.setAction( getTrimmedValue( element.getText() ) );
406         return action;
407     } //-- Action parseAction( String, Element, boolean )
408 
409     /**
410      * Method parseAnnotationTest.
411      * 
412      * @param tagName
413      * @param strict
414      * @param element
415      * @throws IOException
416      * @throws DocumentException
417      * @return AnnotationTest
418      */
419     private AnnotationTest parseAnnotationTest( String tagName, Element element, boolean strict )
420         throws IOException, DocumentException
421     {
422         AnnotationTestAnnotationTest.html#AnnotationTest">AnnotationTest annotationTest = new AnnotationTest();
423         java.util.Set parsed = new java.util.HashSet();
424         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
425         {
426             Node node = (Node) i.next();
427             if ( node.getNodeType() == Node.ELEMENT_NODE )
428             {
429                 Element childElement = (Element) node;
430                 if ( checkFieldWithDuplicate( childElement, "anyField", null, parsed ) )
431                 {
432                     annotationTest.setAnyField( getTrimmedValue( childElement.getText() ) );
433                 }
434                 else
435                 {
436                     checkUnknownElement( childElement, strict );
437                 }
438             }
439         }
440         return annotationTest;
441     } //-- AnnotationTest parseAnnotationTest( String, Element, boolean )
442 
443     /**
444      * Method parseArrayFeatures.
445      * 
446      * @param tagName
447      * @param strict
448      * @param element
449      * @throws IOException
450      * @throws DocumentException
451      * @return ArrayFeatures
452      */
453     private ArrayFeatures parseArrayFeatures( String tagName, Element element, boolean strict )
454         throws IOException, DocumentException
455     {
456         ArrayFeaturess/ArrayFeatures.html#ArrayFeatures">ArrayFeatures arrayFeatures = new ArrayFeatures();
457         java.util.Set parsed = new java.util.HashSet();
458         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
459         {
460             Node node = (Node) i.next();
461             if ( node.getNodeType() == Node.ELEMENT_NODE )
462             {
463                 Element childElement = (Element) node;
464                 checkUnknownElement( childElement, strict );
465             }
466         }
467         return arrayFeatures;
468     } //-- ArrayFeatures parseArrayFeatures( String, Element, boolean )
469 
470     /**
471      * Method parseAssociationFeatures.
472      * 
473      * @param tagName
474      * @param strict
475      * @param element
476      * @throws IOException
477      * @throws DocumentException
478      * @return AssociationFeatures
479      */
480     private AssociationFeatures parseAssociationFeatures( String tagName, Element element, boolean strict )
481         throws IOException, DocumentException
482     {
483         AssociationFeaturesnFeatures.html#AssociationFeatures">AssociationFeatures associationFeatures = new AssociationFeatures();
484         java.util.Set parsed = new java.util.HashSet();
485         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
486         {
487             Node node = (Node) i.next();
488             if ( node.getNodeType() == Node.ELEMENT_NODE )
489             {
490                 Element childElement = (Element) node;
491                 if ( checkFieldWithDuplicate( childElement, "listReferences", null, parsed ) )
492                 {
493                     java.util.List listReferences = new java.util.ArrayList/*<Reference>*/();
494                     associationFeatures.setListReferences( listReferences );
495                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
496                     {
497                         Node n = (Node) j.next();
498                         if ( n.getNodeType() == Node.ELEMENT_NODE )
499                         {
500                             Element listElement = (Element) n;
501                             if ( "listReference".equals( listElement.getName() ) )
502                             {
503                                 listReferences.add( parseReference( "listReference", listElement, strict ) );
504                             }
505                             else
506                             {
507                             }
508                         }
509                     }
510                 }
511                 else if ( checkFieldWithDuplicate( childElement, "setReferences", null, parsed ) )
512                 {
513                     java.util.Set setReferences = new java.util.HashSet/*<Reference>*/();
514                     associationFeatures.setSetReferences( setReferences );
515                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
516                     {
517                         Node n = (Node) j.next();
518                         if ( n.getNodeType() == Node.ELEMENT_NODE )
519                         {
520                             Element listElement = (Element) n;
521                             if ( "setReference".equals( listElement.getName() ) )
522                             {
523                                 setReferences.add( parseReference( "setReference", listElement, strict ) );
524                             }
525                             else
526                             {
527                             }
528                         }
529                     }
530                 }
531                 else if ( checkFieldWithDuplicate( childElement, "listStrings", null, parsed ) )
532                 {
533                     java.util.List listStrings = new java.util.ArrayList/*<String>*/();
534                     associationFeatures.setListStrings( listStrings );
535                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
536                     {
537                         Node n = (Node) j.next();
538                         if ( n.getNodeType() == Node.ELEMENT_NODE )
539                         {
540                             Element listElement = (Element) n;
541                             if ( "listString".equals( listElement.getName() ) )
542                             {
543                                 listStrings.add( getTrimmedValue( listElement.getText() ) );
544                             }
545                             else
546                             {
547                             }
548                         }
549                     }
550                 }
551                 else if ( checkFieldWithDuplicate( childElement, "setStrings", null, parsed ) )
552                 {
553                     java.util.Set setStrings = new java.util.HashSet/*<String>*/();
554                     associationFeatures.setSetStrings( setStrings );
555                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
556                     {
557                         Node n = (Node) j.next();
558                         if ( n.getNodeType() == Node.ELEMENT_NODE )
559                         {
560                             Element listElement = (Element) n;
561                             if ( "setString".equals( listElement.getName() ) )
562                             {
563                                 setStrings.add( getTrimmedValue( listElement.getText() ) );
564                             }
565                             else
566                             {
567                             }
568                         }
569                     }
570                 }
571                 else if ( checkFieldWithDuplicate( childElement, "properties", null, parsed ) )
572                 {
573                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
574                     {
575                         Node n = (Node) j.next();
576                         if ( n.getNodeType() == Node.ELEMENT_NODE )
577                         {
578                             Element listElement = (Element) n;
579                             String key = listElement.getName();
580                             String value = listElement.getText().trim();
581                             associationFeatures.addProperty( key, value );
582                         }
583                     }
584                 }
585                 else if ( checkFieldWithDuplicate( childElement, "bidi", null, parsed ) )
586                 {
587                     associationFeatures.setBidi( parseBidirectional( "bidi", childElement, strict ) );
588                 }
589                 else if ( checkFieldWithDuplicate( childElement, "listOfBidis", null, parsed ) )
590                 {
591                     java.util.List listOfBidis = new java.util.ArrayList/*<BidiInList>*/();
592                     associationFeatures.setListOfBidis( listOfBidis );
593                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
594                     {
595                         Node n = (Node) j.next();
596                         if ( n.getNodeType() == Node.ELEMENT_NODE )
597                         {
598                             Element listElement = (Element) n;
599                             if ( "listOfBidi".equals( listElement.getName() ) )
600                             {
601                                 listOfBidis.add( parseBidiInList( "listOfBidi", listElement, strict ) );
602                             }
603                             else
604                             {
605                             }
606                         }
607                     }
608                 }
609                 else if ( checkFieldWithDuplicate( childElement, "setOfBidis", null, parsed ) )
610                 {
611                     java.util.Set setOfBidis = new java.util.HashSet/*<BidiInSet>*/();
612                     associationFeatures.setSetOfBidis( setOfBidis );
613                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
614                     {
615                         Node n = (Node) j.next();
616                         if ( n.getNodeType() == Node.ELEMENT_NODE )
617                         {
618                             Element listElement = (Element) n;
619                             if ( "setOfBidi".equals( listElement.getName() ) )
620                             {
621                                 setOfBidis.add( parseBidiInSet( "setOfBidi", listElement, strict ) );
622                             }
623                             else
624                             {
625                             }
626                         }
627                     }
628                 }
629                 else
630                 {
631                     checkUnknownElement( childElement, strict );
632                 }
633             }
634         }
635         return associationFeatures;
636     } //-- AssociationFeatures parseAssociationFeatures( String, Element, boolean )
637 
638     /**
639      * Method parseBaseClass.
640      * 
641      * @param tagName
642      * @param strict
643      * @param element
644      * @throws IOException
645      * @throws DocumentException
646      * @return BaseClass
647      */
648     private BaseClass parseBaseClass( String tagName, Element element, boolean strict )
649         throws IOException, DocumentException
650     {
651         BaseClass/features/BaseClass.html#BaseClass">BaseClass baseClass = new BaseClass();
652         if ( element.attributeValue( "baseAttribute" ) != null  )
653         {
654             baseClass.setBaseAttribute( getIntegerValue( getTrimmedValue( element.attributeValue( "baseAttribute" ) ), "baseAttribute", strict ) );
655         }
656         java.util.Set parsed = new java.util.HashSet();
657         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
658         {
659             Node node = (Node) i.next();
660             if ( node.getNodeType() == Node.ELEMENT_NODE )
661             {
662                 Element childElement = (Element) node;
663                 if ( checkFieldWithDuplicate( childElement, "baseElement", null, parsed ) )
664                 {
665                     baseClass.setBaseElement( getIntegerValue( getTrimmedValue( childElement.getText() ), "baseElement", strict ) );
666                 }
667                 else
668                 {
669                     checkUnknownElement( childElement, strict );
670                 }
671             }
672         }
673         return baseClass;
674     } //-- BaseClass parseBaseClass( String, Element, boolean )
675 
676     /**
677      * Method parseBidiInList.
678      * 
679      * @param tagName
680      * @param strict
681      * @param element
682      * @throws IOException
683      * @throws DocumentException
684      * @return BidiInList
685      */
686     private BidiInList parseBidiInList( String tagName, Element element, boolean strict )
687         throws IOException, DocumentException
688     {
689         BidiInListeatures/BidiInList.html#BidiInList">BidiInList bidiInList = new BidiInList();
690         java.util.Set parsed = new java.util.HashSet();
691         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
692         {
693             Node node = (Node) i.next();
694             if ( node.getNodeType() == Node.ELEMENT_NODE )
695             {
696                 Element childElement = (Element) node;
697                 if ( checkFieldWithDuplicate( childElement, "parent", null, parsed ) )
698                 {
699                     bidiInList.setParent( parseAssociationFeatures( "parent", childElement, strict ) );
700                 }
701                 else
702                 {
703                     checkUnknownElement( childElement, strict );
704                 }
705             }
706         }
707         return bidiInList;
708     } //-- BidiInList parseBidiInList( String, Element, boolean )
709 
710     /**
711      * Method parseBidiInSet.
712      * 
713      * @param tagName
714      * @param strict
715      * @param element
716      * @throws IOException
717      * @throws DocumentException
718      * @return BidiInSet
719      */
720     private BidiInSet parseBidiInSet( String tagName, Element element, boolean strict )
721         throws IOException, DocumentException
722     {
723         BidiInSet/features/BidiInSet.html#BidiInSet">BidiInSet bidiInSet = new BidiInSet();
724         java.util.Set parsed = new java.util.HashSet();
725         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
726         {
727             Node node = (Node) i.next();
728             if ( node.getNodeType() == Node.ELEMENT_NODE )
729             {
730                 Element childElement = (Element) node;
731                 if ( checkFieldWithDuplicate( childElement, "parent", null, parsed ) )
732                 {
733                     bidiInSet.setParent( parseAssociationFeatures( "parent", childElement, strict ) );
734                 }
735                 else
736                 {
737                     checkUnknownElement( childElement, strict );
738                 }
739             }
740         }
741         return bidiInSet;
742     } //-- BidiInSet parseBidiInSet( String, Element, boolean )
743 
744     /**
745      * Method parseBidirectional.
746      * 
747      * @param tagName
748      * @param strict
749      * @param element
750      * @throws IOException
751      * @throws DocumentException
752      * @return Bidirectional
753      */
754     private Bidirectional parseBidirectional( String tagName, Element element, boolean strict )
755         throws IOException, DocumentException
756     {
757         Bidirectionals/Bidirectional.html#Bidirectional">Bidirectional bidirectional = new Bidirectional();
758         java.util.Set parsed = new java.util.HashSet();
759         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
760         {
761             Node node = (Node) i.next();
762             if ( node.getNodeType() == Node.ELEMENT_NODE )
763             {
764                 Element childElement = (Element) node;
765                 if ( checkFieldWithDuplicate( childElement, "parent", null, parsed ) )
766                 {
767                     bidirectional.setParent( parseAssociationFeatures( "parent", childElement, strict ) );
768                 }
769                 else
770                 {
771                     checkUnknownElement( childElement, strict );
772                 }
773             }
774         }
775         return bidirectional;
776     } //-- Bidirectional parseBidirectional( String, Element, boolean )
777 
778     /**
779      * Method parseContentTest.
780      * 
781      * @param tagName
782      * @param strict
783      * @param element
784      * @throws IOException
785      * @throws DocumentException
786      * @return ContentTest
787      */
788     private ContentTest parseContentTest( String tagName, Element element, boolean strict )
789         throws IOException, DocumentException
790     {
791         ContentTesttures/ContentTest.html#ContentTest">ContentTest contentTest = new ContentTest();
792         if ( element.attributeValue( "attr" ) != null  )
793         {
794             contentTest.setAttr( getTrimmedValue( element.attributeValue( "attr" ) ) );
795         }
796         if ( element.attributeValue( "attr2" ) != null  )
797         {
798             contentTest.setAttr2( getIntegerValue( getTrimmedValue( element.attributeValue( "attr2" ) ), "attr2", strict ) );
799         }
800         contentTest.setContent( getTrimmedValue( element.getText() ) );
801         return contentTest;
802     } //-- ContentTest parseContentTest( String, Element, boolean )
803 
804     /**
805      * Method parseDueTo.
806      * 
807      * @param tagName
808      * @param strict
809      * @param element
810      * @throws IOException
811      * @throws DocumentException
812      * @return DueTo
813      */
814     private DueTo parseDueTo( String tagName, Element element, boolean strict )
815         throws IOException, DocumentException
816     {
817         DueTollo/test/features/DueTo.html#DueTo">DueTo dueTo = new DueTo();
818         if ( element.attributeValue( "name" ) != null  )
819         {
820             dueTo.setName( getTrimmedValue( element.attributeValue( "name" ) ) );
821         }
822         if ( element.attributeValue( "email" ) != null  )
823         {
824             dueTo.setEmail( getTrimmedValue( element.attributeValue( "email" ) ) );
825         }
826         java.util.Set parsed = new java.util.HashSet();
827         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
828         {
829             Node node = (Node) i.next();
830             if ( node.getNodeType() == Node.ELEMENT_NODE )
831             {
832                 Element childElement = (Element) node;
833                 checkUnknownElement( childElement, strict );
834             }
835         }
836         return dueTo;
837     } //-- DueTo parseDueTo( String, Element, boolean )
838 
839     /**
840      * Method parseFeatures.
841      * 
842      * @param tagName
843      * @param strict
844      * @param element
845      * @throws IOException
846      * @throws DocumentException
847      * @return Features
848      */
849     private Features parseFeatures( String tagName, Element element, boolean strict )
850         throws IOException, DocumentException
851     {
852         Featuresst/features/Features.html#Features">Features features = new Features();
853         if ( strict )
854         {
855             if ( !element.getName().equals( tagName ) )
856             {
857                 throw new DocumentException( "Error parsing model: root element tag is '" + element.getName() + "' instead of '" + tagName + "'" );
858             }
859         }
860         java.util.Set parsed = new java.util.HashSet();
861         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
862         {
863             Node node = (Node) i.next();
864             if ( node.getNodeType() == Node.ELEMENT_NODE )
865             {
866                 Element childElement = (Element) node;
867                 if ( checkFieldWithDuplicate( childElement, "versionField", null, parsed ) )
868                 {
869                     features.setVersionField( getTrimmedValue( childElement.getText() ) );
870                 }
871                 else if ( checkFieldWithDuplicate( childElement, "comment", null, parsed ) )
872                 {
873                     features.setComment( getTrimmedValue( childElement.getText() ) );
874                 }
875                 else if ( checkFieldWithDuplicate( childElement, "description", null, parsed ) )
876                 {
877                     features.setDescription( getTrimmedValue( childElement.getText() ) );
878                 }
879                 else if ( checkFieldWithDuplicate( childElement, "required", null, parsed ) )
880                 {
881                     features.setRequired( getTrimmedValue( childElement.getText() ) );
882                 }
883                 else if ( checkFieldWithDuplicate( childElement, "identifier", null, parsed ) )
884                 {
885                     features.setIdentifier( getTrimmedValue( childElement.getText() ) );
886                 }
887                 else if ( checkFieldWithDuplicate( childElement, "identifierPart2", null, parsed ) )
888                 {
889                     features.setIdentifierPart2( parseReference( "identifierPart2", childElement, strict ) );
890                 }
891                 else if ( checkFieldWithDuplicate( childElement, "simpleTypes", null, parsed ) )
892                 {
893                     features.setSimpleTypes( parseSimpleTypes( "simpleTypes", childElement, strict ) );
894                 }
895                 else if ( checkFieldWithDuplicate( childElement, "defaultValues", null, parsed ) )
896                 {
897                     features.setDefaultValues( parseSimpleTypes( "defaultValues", childElement, strict ) );
898                 }
899                 else if ( checkFieldWithDuplicate( childElement, "arrays", null, parsed ) )
900                 {
901                     features.setArrays( parseArrayFeatures( "arrays", childElement, strict ) );
902                 }
903                 else if ( checkFieldWithDuplicate( childElement, "associationFeatures", null, parsed ) )
904                 {
905                     features.setAssociationFeatures( parseAssociationFeatures( "associationFeatures", childElement, strict ) );
906                 }
907                 else if ( checkFieldWithDuplicate( childElement, "javaFeatures", null, parsed ) )
908                 {
909                     features.setJavaFeatures( parseJavaFeatures( "javaFeatures", childElement, strict ) );
910                 }
911                 else if ( checkFieldWithDuplicate( childElement, "xmlFeatures", null, parsed ) )
912                 {
913                     features.setXmlFeatures( parseXmlFeatures( "xmlFeatures", childElement, strict ) );
914                 }
915                 else if ( checkFieldWithDuplicate( childElement, "xdocFeatures", null, parsed ) )
916                 {
917                     features.setXdocFeatures( parseXdocFeatures( "xdocFeatures", childElement, strict ) );
918                 }
919                 else if ( checkFieldWithDuplicate( childElement, "node", null, parsed ) )
920                 {
921                     features.setNode( parseNodeItem( "node", childElement, strict ) );
922                 }
923                 else if ( checkFieldWithDuplicate( childElement, "cloneable", null, parsed ) )
924                 {
925                     features.setCloneable( parseThing( "cloneable", childElement, strict ) );
926                 }
927                 else if ( checkFieldWithDuplicate( childElement, "file", null, parsed ) )
928                 {
929                     features.setFile( parseFile( "file", childElement, strict ) );
930                 }
931                 else if ( checkFieldWithDuplicate( childElement, "action", null, parsed ) )
932                 {
933                     features.setAction( parseAction( "action", childElement, strict ) );
934                 }
935                 else
936                 {
937                     checkUnknownElement( childElement, strict );
938                 }
939             }
940         }
941         return features;
942     } //-- Features parseFeatures( String, Element, boolean )
943 
944     /**
945      * Method parseFile.
946      * 
947      * @param tagName
948      * @param strict
949      * @param element
950      * @throws IOException
951      * @throws DocumentException
952      * @return File
953      */
954     private File parseFile( String tagName, Element element, boolean strict )
955         throws IOException, DocumentException
956     {
957         Filedello/test/features/File.html#File">File file = new File();
958         java.util.Set parsed = new java.util.HashSet();
959         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
960         {
961             Node node = (Node) i.next();
962             if ( node.getNodeType() == Node.ELEMENT_NODE )
963             {
964                 Element childElement = (Element) node;
965                 if ( checkFieldWithDuplicate( childElement, "file", null, parsed ) )
966                 {
967                     file.setFile( getTrimmedValue( childElement.getText() ) );
968                 }
969                 else
970                 {
971                     checkUnknownElement( childElement, strict );
972                 }
973             }
974         }
975         return file;
976     } //-- File parseFile( String, Element, boolean )
977 
978     /**
979      * Method parseInterfacesFeature.
980      * 
981      * @param tagName
982      * @param strict
983      * @param element
984      * @throws IOException
985      * @throws DocumentException
986      * @return InterfacesFeature
987      */
988     private InterfacesFeature parseInterfacesFeature( String tagName, Element element, boolean strict )
989         throws IOException, DocumentException
990     {
991         InterfacesFeatureacesFeature.html#InterfacesFeature">InterfacesFeature interfacesFeature = new InterfacesFeature();
992         java.util.Set parsed = new java.util.HashSet();
993         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
994         {
995             Node node = (Node) i.next();
996             if ( node.getNodeType() == Node.ELEMENT_NODE )
997             {
998                 Element childElement = (Element) node;
999                 if ( checkFieldWithDuplicate( childElement, "id", null, parsed ) )
1000                 {
1001                     interfacesFeature.setId( getTrimmedValue( childElement.getText() ) );
1002                 }
1003                 else
1004                 {
1005                     checkUnknownElement( childElement, strict );
1006                 }
1007             }
1008         }
1009         return interfacesFeature;
1010     } //-- InterfacesFeature parseInterfacesFeature( String, Element, boolean )
1011 
1012     /**
1013      * Method parseJavaFeatures.
1014      * 
1015      * @param tagName
1016      * @param strict
1017      * @param element
1018      * @throws IOException
1019      * @throws DocumentException
1020      * @return JavaFeatures
1021      */
1022     private JavaFeatures parseJavaFeatures( String tagName, Element element, boolean strict )
1023         throws IOException, DocumentException
1024     {
1025         JavaFeaturesres/JavaFeatures.html#JavaFeatures">JavaFeatures javaFeatures = new JavaFeatures();
1026         java.util.Set parsed = new java.util.HashSet();
1027         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1028         {
1029             Node node = (Node) i.next();
1030             if ( node.getNodeType() == Node.ELEMENT_NODE )
1031             {
1032                 Element childElement = (Element) node;
1033                 if ( checkFieldWithDuplicate( childElement, "interfaces", null, parsed ) )
1034                 {
1035                     javaFeatures.setInterfaces( parseInterfacesFeature( "interfaces", childElement, strict ) );
1036                 }
1037                 else if ( checkFieldWithDuplicate( childElement, "packageName", null, parsed ) )
1038                 {
1039                     javaFeatures.setPackageName( parsePackageNameFeature( "packageName", childElement, strict ) );
1040                 }
1041                 else if ( checkFieldWithDuplicate( childElement, "base", null, parsed ) )
1042                 {
1043                     javaFeatures.setBase( parseBaseClass( "base", childElement, strict ) );
1044                 }
1045                 else if ( checkFieldWithDuplicate( childElement, "subClass", null, parsed ) )
1046                 {
1047                     javaFeatures.setSubClass( parseSubClassLevel1( "subClass", childElement, strict ) );
1048                 }
1049                 else if ( checkFieldWithDuplicate( childElement, "subClass2", null, parsed ) )
1050                 {
1051                     javaFeatures.setSubClass2( parseSubClassLevel2( "subClass2", childElement, strict ) );
1052                 }
1053                 else if ( checkFieldWithDuplicate( childElement, "subClass3", null, parsed ) )
1054                 {
1055                     javaFeatures.setSubClass3( parseSubClassLevel3( "subClass3", childElement, strict ) );
1056                 }
1057                 else if ( checkFieldWithDuplicate( childElement, "annotation", null, parsed ) )
1058                 {
1059                     javaFeatures.setAnnotation( parseAnnotationTest( "annotation", childElement, strict ) );
1060                 }
1061                 else
1062                 {
1063                     checkUnknownElement( childElement, strict );
1064                 }
1065             }
1066         }
1067         return javaFeatures;
1068     } //-- JavaFeatures parseJavaFeatures( String, Element, boolean )
1069 
1070     /**
1071      * Method parseNodeItem.
1072      * 
1073      * @param tagName
1074      * @param strict
1075      * @param element
1076      * @throws IOException
1077      * @throws DocumentException
1078      * @return NodeItem
1079      */
1080     private NodeItem parseNodeItem( String tagName, Element element, boolean strict )
1081         throws IOException, DocumentException
1082     {
1083         NodeItemst/features/NodeItem.html#NodeItem">NodeItem nodeItem = new NodeItem();
1084         java.util.Set parsed = new java.util.HashSet();
1085         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1086         {
1087             Node node = (Node) i.next();
1088             if ( node.getNodeType() == Node.ELEMENT_NODE )
1089             {
1090                 Element childElement = (Element) node;
1091                 if ( checkFieldWithDuplicate( childElement, "value", null, parsed ) )
1092                 {
1093                     nodeItem.setValue( getTrimmedValue( childElement.getText() ) );
1094                 }
1095                 else if ( checkFieldWithDuplicate( childElement, "child", null, parsed ) )
1096                 {
1097                     nodeItem.setChild( parseNodeItem( "child", childElement, strict ) );
1098                 }
1099                 else
1100                 {
1101                     checkUnknownElement( childElement, strict );
1102                 }
1103             }
1104         }
1105         return nodeItem;
1106     } //-- NodeItem parseNodeItem( String, Element, boolean )
1107 
1108     /**
1109      * Method parsePackageNameFeature.
1110      * 
1111      * @param tagName
1112      * @param strict
1113      * @param element
1114      * @throws IOException
1115      * @throws DocumentException
1116      * @return PackageNameFeature
1117      */
1118     private PackageNameFeature parsePackageNameFeature( String tagName, Element element, boolean strict )
1119         throws IOException, DocumentException
1120     {
1121         PackageNameFeatureckageNameFeature.html#PackageNameFeature">PackageNameFeature packageNameFeature = new PackageNameFeature();
1122         java.util.Set parsed = new java.util.HashSet();
1123         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1124         {
1125             Node node = (Node) i.next();
1126             if ( node.getNodeType() == Node.ELEMENT_NODE )
1127             {
1128                 Element childElement = (Element) node;
1129                 if ( checkFieldWithDuplicate( childElement, "reference", null, parsed ) )
1130                 {
1131                     packageNameFeature.setReference( parseReference( "reference", childElement, strict ) );
1132                 }
1133                 else
1134                 {
1135                     checkUnknownElement( childElement, strict );
1136                 }
1137             }
1138         }
1139         return packageNameFeature;
1140     } //-- PackageNameFeature parsePackageNameFeature( String, Element, boolean )
1141 
1142     /**
1143      * Method parseReference.
1144      * 
1145      * @param tagName
1146      * @param strict
1147      * @param element
1148      * @throws IOException
1149      * @throws DocumentException
1150      * @return Reference
1151      */
1152     private Reference parseReference( String tagName, Element element, boolean strict )
1153         throws IOException, DocumentException
1154     {
1155         Reference/features/Reference.html#Reference">Reference reference = new Reference();
1156         java.util.Set parsed = new java.util.HashSet();
1157         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1158         {
1159             Node node = (Node) i.next();
1160             if ( node.getNodeType() == Node.ELEMENT_NODE )
1161             {
1162                 Element childElement = (Element) node;
1163                 if ( checkFieldWithDuplicate( childElement, "id", "key", parsed ) )
1164                 {
1165                     reference.setId( getTrimmedValue( childElement.getText() ) );
1166                 }
1167                 else
1168                 {
1169                     checkUnknownElement( childElement, strict );
1170                 }
1171             }
1172         }
1173         return reference;
1174     } //-- Reference parseReference( String, Element, boolean )
1175 
1176     /**
1177      * Method parseSimpleTypes.
1178      * 
1179      * @param tagName
1180      * @param strict
1181      * @param element
1182      * @throws IOException
1183      * @throws DocumentException
1184      * @return SimpleTypes
1185      */
1186     private SimpleTypes parseSimpleTypes( String tagName, Element element, boolean strict )
1187         throws IOException, DocumentException
1188     {
1189         SimpleTypestures/SimpleTypes.html#SimpleTypes">SimpleTypes simpleTypes = new SimpleTypes();
1190         java.util.Set parsed = new java.util.HashSet();
1191         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1192         {
1193             Node node = (Node) i.next();
1194             if ( node.getNodeType() == Node.ELEMENT_NODE )
1195             {
1196                 Element childElement = (Element) node;
1197                 if ( checkFieldWithDuplicate( childElement, "primitiveBoolean", null, parsed ) )
1198                 {
1199                     simpleTypes.setPrimitiveBoolean( getBooleanValue( getTrimmedValue( childElement.getText() ), "primitiveBoolean" ) );
1200                 }
1201                 else if ( checkFieldWithDuplicate( childElement, "primitiveChar", null, parsed ) )
1202                 {
1203                     simpleTypes.setPrimitiveChar( getCharacterValue( getTrimmedValue( childElement.getText() ), "primitiveChar" ) );
1204                 }
1205                 else if ( checkFieldWithDuplicate( childElement, "primitiveByte", null, parsed ) )
1206                 {
1207                     simpleTypes.setPrimitiveByte( getByteValue( getTrimmedValue( childElement.getText() ), "primitiveByte", strict ) );
1208                 }
1209                 else if ( checkFieldWithDuplicate( childElement, "primitiveShort", null, parsed ) )
1210                 {
1211                     simpleTypes.setPrimitiveShort( getShortValue( getTrimmedValue( childElement.getText() ), "primitiveShort", strict ) );
1212                 }
1213                 else if ( checkFieldWithDuplicate( childElement, "primitiveInt", null, parsed ) )
1214                 {
1215                     simpleTypes.setPrimitiveInt( getIntegerValue( getTrimmedValue( childElement.getText() ), "primitiveInt", strict ) );
1216                 }
1217                 else if ( checkFieldWithDuplicate( childElement, "primitiveLong", null, parsed ) )
1218                 {
1219                     simpleTypes.setPrimitiveLong( getLongValue( getTrimmedValue( childElement.getText() ), "primitiveLong", strict ) );
1220                 }
1221                 else if ( checkFieldWithDuplicate( childElement, "primitiveFloat", null, parsed ) )
1222                 {
1223                     simpleTypes.setPrimitiveFloat( getFloatValue( getTrimmedValue( childElement.getText() ), "primitiveFloat", strict ) );
1224                 }
1225                 else if ( checkFieldWithDuplicate( childElement, "primitiveDouble", null, parsed ) )
1226                 {
1227                     simpleTypes.setPrimitiveDouble( getDoubleValue( getTrimmedValue( childElement.getText() ), "primitiveDouble", strict ) );
1228                 }
1229                 else if ( checkFieldWithDuplicate( childElement, "objectString", null, parsed ) )
1230                 {
1231                     simpleTypes.setObjectString( getTrimmedValue( childElement.getText() ) );
1232                 }
1233                 else if ( checkFieldWithDuplicate( childElement, "objectDate", null, parsed ) )
1234                 {
1235                     String dateFormat = null;
1236                     simpleTypes.setObjectDate( getDateValue( getTrimmedValue( childElement.getText() ), "objectDate", dateFormat ) );
1237                 }
1238                 else if ( checkFieldWithDuplicate( childElement, "primitiveBooleanNoDefault", null, parsed ) )
1239                 {
1240                     simpleTypes.setPrimitiveBooleanNoDefault( getBooleanValue( getTrimmedValue( childElement.getText() ), "primitiveBooleanNoDefault" ) );
1241                 }
1242                 else if ( checkFieldWithDuplicate( childElement, "primitiveCharNoDefault", null, parsed ) )
1243                 {
1244                     simpleTypes.setPrimitiveCharNoDefault( getCharacterValue( getTrimmedValue( childElement.getText() ), "primitiveCharNoDefault" ) );
1245                 }
1246                 else if ( checkFieldWithDuplicate( childElement, "primitiveByteNoDefault", null, parsed ) )
1247                 {
1248                     simpleTypes.setPrimitiveByteNoDefault( getByteValue( getTrimmedValue( childElement.getText() ), "primitiveByteNoDefault", strict ) );
1249                 }
1250                 else if ( checkFieldWithDuplicate( childElement, "primitiveShortNoDefault", null, parsed ) )
1251                 {
1252                     simpleTypes.setPrimitiveShortNoDefault( getShortValue( getTrimmedValue( childElement.getText() ), "primitiveShortNoDefault", strict ) );
1253                 }
1254                 else if ( checkFieldWithDuplicate( childElement, "primitiveIntNoDefault", null, parsed ) )
1255                 {
1256                     simpleTypes.setPrimitiveIntNoDefault( getIntegerValue( getTrimmedValue( childElement.getText() ), "primitiveIntNoDefault", strict ) );
1257                 }
1258                 else if ( checkFieldWithDuplicate( childElement, "primitiveLongNoDefault", null, parsed ) )
1259                 {
1260                     simpleTypes.setPrimitiveLongNoDefault( getLongValue( getTrimmedValue( childElement.getText() ), "primitiveLongNoDefault", strict ) );
1261                 }
1262                 else if ( checkFieldWithDuplicate( childElement, "primitiveFloatNoDefault", null, parsed ) )
1263                 {
1264                     simpleTypes.setPrimitiveFloatNoDefault( getFloatValue( getTrimmedValue( childElement.getText() ), "primitiveFloatNoDefault", strict ) );
1265                 }
1266                 else if ( checkFieldWithDuplicate( childElement, "primitiveDoubleNoDefault", null, parsed ) )
1267                 {
1268                     simpleTypes.setPrimitiveDoubleNoDefault( getDoubleValue( getTrimmedValue( childElement.getText() ), "primitiveDoubleNoDefault", strict ) );
1269                 }
1270                 else if ( checkFieldWithDuplicate( childElement, "objectStringNoDefault", null, parsed ) )
1271                 {
1272                     simpleTypes.setObjectStringNoDefault( getTrimmedValue( childElement.getText() ) );
1273                 }
1274                 else if ( checkFieldWithDuplicate( childElement, "objectDateNoDefault", null, parsed ) )
1275                 {
1276                     String dateFormat = null;
1277                     simpleTypes.setObjectDateNoDefault( getDateValue( getTrimmedValue( childElement.getText() ), "objectDateNoDefault", dateFormat ) );
1278                 }
1279                 else if ( checkFieldWithDuplicate( childElement, "dom", null, parsed ) )
1280                 {
1281                     simpleTypes.setDom( writeElementToXpp3Dom( childElement ) );
1282                 }
1283                 else if ( checkFieldWithDuplicate( childElement, "content", null, parsed ) )
1284                 {
1285                     simpleTypes.setContent( parseContentTest( "content", childElement, strict ) );
1286                 }
1287                 else
1288                 {
1289                     checkUnknownElement( childElement, strict );
1290                 }
1291             }
1292         }
1293         return simpleTypes;
1294     } //-- SimpleTypes parseSimpleTypes( String, Element, boolean )
1295 
1296     /**
1297      * Method parseSubClassLevel1.
1298      * 
1299      * @param tagName
1300      * @param strict
1301      * @param element
1302      * @throws IOException
1303      * @throws DocumentException
1304      * @return SubClassLevel1
1305      */
1306     private SubClassLevel1 parseSubClassLevel1( String tagName, Element element, boolean strict )
1307         throws IOException, DocumentException
1308     {
1309         SubClassLevel1SubClassLevel1.html#SubClassLevel1">SubClassLevel1 subClassLevel1 = new SubClassLevel1();
1310         if ( element.attributeValue( "subAttribute1" ) != null  )
1311         {
1312             subClassLevel1.setSubAttribute1( getLongValue( getTrimmedValue( element.attributeValue( "subAttribute1" ) ), "subAttribute1", strict ) );
1313         }
1314         if ( element.attributeValue( "baseAttribute" ) != null  )
1315         {
1316             subClassLevel1.setBaseAttribute( getIntegerValue( getTrimmedValue( element.attributeValue( "baseAttribute" ) ), "baseAttribute", strict ) );
1317         }
1318         java.util.Set parsed = new java.util.HashSet();
1319         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1320         {
1321             Node node = (Node) i.next();
1322             if ( node.getNodeType() == Node.ELEMENT_NODE )
1323             {
1324                 Element childElement = (Element) node;
1325                 if ( checkFieldWithDuplicate( childElement, "subElement1", null, parsed ) )
1326                 {
1327                     subClassLevel1.setSubElement1( getLongValue( getTrimmedValue( childElement.getText() ), "subElement1", strict ) );
1328                 }
1329                 else if ( checkFieldWithDuplicate( childElement, "baseElement", null, parsed ) )
1330                 {
1331                     subClassLevel1.setBaseElement( getIntegerValue( getTrimmedValue( childElement.getText() ), "baseElement", strict ) );
1332                 }
1333                 else
1334                 {
1335                     checkUnknownElement( childElement, strict );
1336                 }
1337             }
1338         }
1339         return subClassLevel1;
1340     } //-- SubClassLevel1 parseSubClassLevel1( String, Element, boolean )
1341 
1342     /**
1343      * Method parseSubClassLevel2.
1344      * 
1345      * @param tagName
1346      * @param strict
1347      * @param element
1348      * @throws IOException
1349      * @throws DocumentException
1350      * @return SubClassLevel2
1351      */
1352     private SubClassLevel2 parseSubClassLevel2( String tagName, Element element, boolean strict )
1353         throws IOException, DocumentException
1354     {
1355         SubClassLevel2SubClassLevel2.html#SubClassLevel2">SubClassLevel2 subClassLevel2 = new SubClassLevel2();
1356         if ( element.attributeValue( "subAttribute2" ) != null  )
1357         {
1358             subClassLevel2.setSubAttribute2( getFloatValue( getTrimmedValue( element.attributeValue( "subAttribute2" ) ), "subAttribute2", strict ) );
1359         }
1360         if ( element.attributeValue( "subAttribute1" ) != null  )
1361         {
1362             subClassLevel2.setSubAttribute1( getLongValue( getTrimmedValue( element.attributeValue( "subAttribute1" ) ), "subAttribute1", strict ) );
1363         }
1364         if ( element.attributeValue( "baseAttribute" ) != null  )
1365         {
1366             subClassLevel2.setBaseAttribute( getIntegerValue( getTrimmedValue( element.attributeValue( "baseAttribute" ) ), "baseAttribute", strict ) );
1367         }
1368         java.util.Set parsed = new java.util.HashSet();
1369         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1370         {
1371             Node node = (Node) i.next();
1372             if ( node.getNodeType() == Node.ELEMENT_NODE )
1373             {
1374                 Element childElement = (Element) node;
1375                 if ( checkFieldWithDuplicate( childElement, "subElement2", null, parsed ) )
1376                 {
1377                     subClassLevel2.setSubElement2( getFloatValue( getTrimmedValue( childElement.getText() ), "subElement2", strict ) );
1378                 }
1379                 else if ( checkFieldWithDuplicate( childElement, "subElement1", null, parsed ) )
1380                 {
1381                     subClassLevel2.setSubElement1( getLongValue( getTrimmedValue( childElement.getText() ), "subElement1", strict ) );
1382                 }
1383                 else if ( checkFieldWithDuplicate( childElement, "baseElement", null, parsed ) )
1384                 {
1385                     subClassLevel2.setBaseElement( getIntegerValue( getTrimmedValue( childElement.getText() ), "baseElement", strict ) );
1386                 }
1387                 else
1388                 {
1389                     checkUnknownElement( childElement, strict );
1390                 }
1391             }
1392         }
1393         return subClassLevel2;
1394     } //-- SubClassLevel2 parseSubClassLevel2( String, Element, boolean )
1395 
1396     /**
1397      * Method parseSubClassLevel3.
1398      * 
1399      * @param tagName
1400      * @param strict
1401      * @param element
1402      * @throws IOException
1403      * @throws DocumentException
1404      * @return SubClassLevel3
1405      */
1406     private SubClassLevel3 parseSubClassLevel3( String tagName, Element element, boolean strict )
1407         throws IOException, DocumentException
1408     {
1409         SubClassLevel3SubClassLevel3.html#SubClassLevel3">SubClassLevel3 subClassLevel3 = new SubClassLevel3();
1410         if ( element.attributeValue( "subAttribute3" ) != null  )
1411         {
1412             subClassLevel3.setSubAttribute3( getDoubleValue( getTrimmedValue( element.attributeValue( "subAttribute3" ) ), "subAttribute3", strict ) );
1413         }
1414         if ( element.attributeValue( "subAttribute2" ) != null  )
1415         {
1416             subClassLevel3.setSubAttribute2( getFloatValue( getTrimmedValue( element.attributeValue( "subAttribute2" ) ), "subAttribute2", strict ) );
1417         }
1418         if ( element.attributeValue( "subAttribute1" ) != null  )
1419         {
1420             subClassLevel3.setSubAttribute1( getLongValue( getTrimmedValue( element.attributeValue( "subAttribute1" ) ), "subAttribute1", strict ) );
1421         }
1422         if ( element.attributeValue( "baseAttribute" ) != null  )
1423         {
1424             subClassLevel3.setBaseAttribute( getIntegerValue( getTrimmedValue( element.attributeValue( "baseAttribute" ) ), "baseAttribute", strict ) );
1425         }
1426         java.util.Set parsed = new java.util.HashSet();
1427         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1428         {
1429             Node node = (Node) i.next();
1430             if ( node.getNodeType() == Node.ELEMENT_NODE )
1431             {
1432                 Element childElement = (Element) node;
1433                 if ( checkFieldWithDuplicate( childElement, "subElement3", null, parsed ) )
1434                 {
1435                     subClassLevel3.setSubElement3( getDoubleValue( getTrimmedValue( childElement.getText() ), "subElement3", strict ) );
1436                 }
1437                 else if ( checkFieldWithDuplicate( childElement, "subElement2", null, parsed ) )
1438                 {
1439                     subClassLevel3.setSubElement2( getFloatValue( getTrimmedValue( childElement.getText() ), "subElement2", strict ) );
1440                 }
1441                 else if ( checkFieldWithDuplicate( childElement, "subElement1", null, parsed ) )
1442                 {
1443                     subClassLevel3.setSubElement1( getLongValue( getTrimmedValue( childElement.getText() ), "subElement1", strict ) );
1444                 }
1445                 else if ( checkFieldWithDuplicate( childElement, "baseElement", null, parsed ) )
1446                 {
1447                     subClassLevel3.setBaseElement( getIntegerValue( getTrimmedValue( childElement.getText() ), "baseElement", strict ) );
1448                 }
1449                 else
1450                 {
1451                     checkUnknownElement( childElement, strict );
1452                 }
1453             }
1454         }
1455         return subClassLevel3;
1456     } //-- SubClassLevel3 parseSubClassLevel3( String, Element, boolean )
1457 
1458     /**
1459      * Method parseSuperThing.
1460      * 
1461      * @param tagName
1462      * @param strict
1463      * @param element
1464      * @throws IOException
1465      * @throws DocumentException
1466      * @return SuperThing
1467      */
1468     private SuperThing parseSuperThing( String tagName, Element element, boolean strict )
1469         throws IOException, DocumentException
1470     {
1471         SuperThingeatures/SuperThing.html#SuperThing">SuperThing superThing = new SuperThing();
1472         java.util.Set parsed = new java.util.HashSet();
1473         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1474         {
1475             Node node = (Node) i.next();
1476             if ( node.getNodeType() == Node.ELEMENT_NODE )
1477             {
1478                 Element childElement = (Element) node;
1479                 checkUnknownElement( childElement, strict );
1480             }
1481         }
1482         return superThing;
1483     } //-- SuperThing parseSuperThing( String, Element, boolean )
1484 
1485     /**
1486      * Method parseThing.
1487      * 
1488      * @param tagName
1489      * @param strict
1490      * @param element
1491      * @throws IOException
1492      * @throws DocumentException
1493      * @return Thing
1494      */
1495     private Thing parseThing( String tagName, Element element, boolean strict )
1496         throws IOException, DocumentException
1497     {
1498         Thingllo/test/features/Thing.html#Thing">Thing thing = new Thing();
1499         java.util.Set parsed = new java.util.HashSet();
1500         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1501         {
1502             Node node = (Node) i.next();
1503             if ( node.getNodeType() == Node.ELEMENT_NODE )
1504             {
1505                 Element childElement = (Element) node;
1506                 if ( checkFieldWithDuplicate( childElement, "someBoolean", null, parsed ) )
1507                 {
1508                     thing.setSomeBoolean( getBooleanValue( getTrimmedValue( childElement.getText() ), "someBoolean" ) );
1509                 }
1510                 else if ( checkFieldWithDuplicate( childElement, "someChar", null, parsed ) )
1511                 {
1512                     thing.setSomeChar( getCharacterValue( getTrimmedValue( childElement.getText() ), "someChar" ) );
1513                 }
1514                 else if ( checkFieldWithDuplicate( childElement, "someByte", null, parsed ) )
1515                 {
1516                     thing.setSomeByte( getByteValue( getTrimmedValue( childElement.getText() ), "someByte", strict ) );
1517                 }
1518                 else if ( checkFieldWithDuplicate( childElement, "someShort", null, parsed ) )
1519                 {
1520                     thing.setSomeShort( getShortValue( getTrimmedValue( childElement.getText() ), "someShort", strict ) );
1521                 }
1522                 else if ( checkFieldWithDuplicate( childElement, "someInt", null, parsed ) )
1523                 {
1524                     thing.setSomeInt( getIntegerValue( getTrimmedValue( childElement.getText() ), "someInt", strict ) );
1525                 }
1526                 else if ( checkFieldWithDuplicate( childElement, "someLong", null, parsed ) )
1527                 {
1528                     thing.setSomeLong( getLongValue( getTrimmedValue( childElement.getText() ), "someLong", strict ) );
1529                 }
1530                 else if ( checkFieldWithDuplicate( childElement, "someFloat", null, parsed ) )
1531                 {
1532                     thing.setSomeFloat( getFloatValue( getTrimmedValue( childElement.getText() ), "someFloat", strict ) );
1533                 }
1534                 else if ( checkFieldWithDuplicate( childElement, "someDouble", null, parsed ) )
1535                 {
1536                     thing.setSomeDouble( getDoubleValue( getTrimmedValue( childElement.getText() ), "someDouble", strict ) );
1537                 }
1538                 else if ( checkFieldWithDuplicate( childElement, "someString", null, parsed ) )
1539                 {
1540                     thing.setSomeString( getTrimmedValue( childElement.getText() ) );
1541                 }
1542                 else if ( checkFieldWithDuplicate( childElement, "someDate", null, parsed ) )
1543                 {
1544                     String dateFormat = null;
1545                     thing.setSomeDate( getDateValue( getTrimmedValue( childElement.getText() ), "someDate", dateFormat ) );
1546                 }
1547                 else if ( checkFieldWithDuplicate( childElement, "someDom", null, parsed ) )
1548                 {
1549                     thing.setSomeDom( writeElementToXpp3Dom( childElement ) );
1550                 }
1551                 else if ( checkFieldWithDuplicate( childElement, "someProperties", null, parsed ) )
1552                 {
1553                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
1554                     {
1555                         Node n = (Node) j.next();
1556                         if ( n.getNodeType() == Node.ELEMENT_NODE )
1557                         {
1558                             Element listElement = (Element) n;
1559                             String key = listElement.getName();
1560                             String value = listElement.getText().trim();
1561                             thing.addSomeProperty( key, value );
1562                         }
1563                     }
1564                 }
1565                 else if ( checkFieldWithDuplicate( childElement, "someStringList", null, parsed ) )
1566                 {
1567                     java.util.List someStringList = new java.util.ArrayList/*<String>*/();
1568                     thing.setSomeStringList( someStringList );
1569                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
1570                     {
1571                         Node n = (Node) j.next();
1572                         if ( n.getNodeType() == Node.ELEMENT_NODE )
1573                         {
1574                             Element listElement = (Element) n;
1575                             if ( "someStringList".equals( listElement.getName() ) )
1576                             {
1577                                 someStringList.add( getTrimmedValue( listElement.getText() ) );
1578                             }
1579                             else
1580                             {
1581                             }
1582                         }
1583                     }
1584                 }
1585                 else if ( checkFieldWithDuplicate( childElement, "someStringSet", null, parsed ) )
1586                 {
1587                     java.util.Set someStringSet = new java.util.HashSet/*<String>*/();
1588                     thing.setSomeStringSet( someStringSet );
1589                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
1590                     {
1591                         Node n = (Node) j.next();
1592                         if ( n.getNodeType() == Node.ELEMENT_NODE )
1593                         {
1594                             Element listElement = (Element) n;
1595                             if ( "someStringSet".equals( listElement.getName() ) )
1596                             {
1597                                 someStringSet.add( getTrimmedValue( listElement.getText() ) );
1598                             }
1599                             else
1600                             {
1601                             }
1602                         }
1603                     }
1604                 }
1605                 else if ( checkFieldWithDuplicate( childElement, "deepThingy", null, parsed ) )
1606                 {
1607                     thing.setDeepThingy( parseThingy( "deepThingy", childElement, strict ) );
1608                 }
1609                 else if ( checkFieldWithDuplicate( childElement, "deepThingyList", null, parsed ) )
1610                 {
1611                     java.util.List deepThingyList = new java.util.ArrayList/*<Thingy>*/();
1612                     thing.setDeepThingyList( deepThingyList );
1613                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
1614                     {
1615                         Node n = (Node) j.next();
1616                         if ( n.getNodeType() == Node.ELEMENT_NODE )
1617                         {
1618                             Element listElement = (Element) n;
1619                             if ( "deepThingyList".equals( listElement.getName() ) )
1620                             {
1621                                 deepThingyList.add( parseThingy( "deepThingyList", listElement, strict ) );
1622                             }
1623                             else
1624                             {
1625                             }
1626                         }
1627                     }
1628                 }
1629                 else if ( checkFieldWithDuplicate( childElement, "deepThingySet", null, parsed ) )
1630                 {
1631                     java.util.Set deepThingySet = new java.util.HashSet/*<Thingy>*/();
1632                     thing.setDeepThingySet( deepThingySet );
1633                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
1634                     {
1635                         Node n = (Node) j.next();
1636                         if ( n.getNodeType() == Node.ELEMENT_NODE )
1637                         {
1638                             Element listElement = (Element) n;
1639                             if ( "deepThingySet".equals( listElement.getName() ) )
1640                             {
1641                                 deepThingySet.add( parseThingy( "deepThingySet", listElement, strict ) );
1642                             }
1643                             else
1644                             {
1645                             }
1646                         }
1647                     }
1648                 }
1649                 else if ( checkFieldWithDuplicate( childElement, "shallowThingy", null, parsed ) )
1650                 {
1651                     thing.setShallowThingy( parseThingy( "shallowThingy", childElement, strict ) );
1652                 }
1653                 else if ( checkFieldWithDuplicate( childElement, "shallowThingyList", null, parsed ) )
1654                 {
1655                     java.util.List shallowThingyList = new java.util.ArrayList/*<Thingy>*/();
1656                     thing.setShallowThingyList( shallowThingyList );
1657                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
1658                     {
1659                         Node n = (Node) j.next();
1660                         if ( n.getNodeType() == Node.ELEMENT_NODE )
1661                         {
1662                             Element listElement = (Element) n;
1663                             if ( "shallowThingyList".equals( listElement.getName() ) )
1664                             {
1665                                 shallowThingyList.add( parseThingy( "shallowThingyList", listElement, strict ) );
1666                             }
1667                             else
1668                             {
1669                             }
1670                         }
1671                     }
1672                 }
1673                 else if ( checkFieldWithDuplicate( childElement, "shallowThingySet", null, parsed ) )
1674                 {
1675                     java.util.Set shallowThingySet = new java.util.HashSet/*<Thingy>*/();
1676                     thing.setShallowThingySet( shallowThingySet );
1677                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
1678                     {
1679                         Node n = (Node) j.next();
1680                         if ( n.getNodeType() == Node.ELEMENT_NODE )
1681                         {
1682                             Element listElement = (Element) n;
1683                             if ( "shallowThingySet".equals( listElement.getName() ) )
1684                             {
1685                                 shallowThingySet.add( parseThingy( "shallowThingySet", listElement, strict ) );
1686                             }
1687                             else
1688                             {
1689                             }
1690                         }
1691                     }
1692                 }
1693                 else
1694                 {
1695                     checkUnknownElement( childElement, strict );
1696                 }
1697             }
1698         }
1699         return thing;
1700     } //-- Thing parseThing( String, Element, boolean )
1701 
1702     /**
1703      * Method parseThingy.
1704      * 
1705      * @param tagName
1706      * @param strict
1707      * @param element
1708      * @throws IOException
1709      * @throws DocumentException
1710      * @return Thingy
1711      */
1712     private Thingy parseThingy( String tagName, Element element, boolean strict )
1713         throws IOException, DocumentException
1714     {
1715         Thingyo/test/features/Thingy.html#Thingy">Thingy thingy = new Thingy();
1716         thingy.setSomeContent( getTrimmedValue( element.getText() ) );
1717         return thingy;
1718     } //-- Thingy parseThingy( String, Element, boolean )
1719 
1720     /**
1721      * Method parseXdocFeatures.
1722      * 
1723      * @param tagName
1724      * @param strict
1725      * @param element
1726      * @throws IOException
1727      * @throws DocumentException
1728      * @return XdocFeatures
1729      */
1730     private XdocFeatures parseXdocFeatures( String tagName, Element element, boolean strict )
1731         throws IOException, DocumentException
1732     {
1733         XdocFeaturesres/XdocFeatures.html#XdocFeatures">XdocFeatures xdocFeatures = new XdocFeatures();
1734         java.util.Set parsed = new java.util.HashSet();
1735         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1736         {
1737             Node node = (Node) i.next();
1738             if ( node.getNodeType() == Node.ELEMENT_NODE )
1739             {
1740                 Element childElement = (Element) node;
1741                 if ( checkFieldWithDuplicate( childElement, "field", null, parsed ) )
1742                 {
1743                     xdocFeatures.setField( getTrimmedValue( childElement.getText() ) );
1744                 }
1745                 else if ( checkFieldWithDuplicate( childElement, "xdocSeparatorNone", null, parsed ) )
1746                 {
1747                     xdocFeatures.setXdocSeparatorNone( getTrimmedValue( childElement.getText() ) );
1748                 }
1749                 else if ( checkFieldWithDuplicate( childElement, "xdocSeparatorBlank", null, parsed ) )
1750                 {
1751                     xdocFeatures.setXdocSeparatorBlank( getTrimmedValue( childElement.getText() ) );
1752                 }
1753                 else
1754                 {
1755                     checkUnknownElement( childElement, strict );
1756                 }
1757             }
1758         }
1759         return xdocFeatures;
1760     } //-- XdocFeatures parseXdocFeatures( String, Element, boolean )
1761 
1762     /**
1763      * Method parseXmlAttributes.
1764      * 
1765      * @param tagName
1766      * @param strict
1767      * @param element
1768      * @throws IOException
1769      * @throws DocumentException
1770      * @return XmlAttributes
1771      */
1772     private XmlAttributes parseXmlAttributes( String tagName, Element element, boolean strict )
1773         throws IOException, DocumentException
1774     {
1775         XmlAttributess/XmlAttributes.html#XmlAttributes">XmlAttributes xmlAttributes = new XmlAttributes();
1776         if ( element.attributeValue( "primitiveBoolean" ) != null  )
1777         {
1778             xmlAttributes.setPrimitiveBoolean( getBooleanValue( getTrimmedValue( element.attributeValue( "primitiveBoolean" ) ), "primitiveBoolean" ) );
1779         }
1780         if ( element.attributeValue( "primitiveChar" ) != null  )
1781         {
1782             xmlAttributes.setPrimitiveChar( getCharacterValue( getTrimmedValue( element.attributeValue( "primitiveChar" ) ), "primitiveChar" ) );
1783         }
1784         if ( element.attributeValue( "primitiveByte" ) != null  )
1785         {
1786             xmlAttributes.setPrimitiveByte( getByteValue( getTrimmedValue( element.attributeValue( "primitiveByte" ) ), "primitiveByte", strict ) );
1787         }
1788         if ( element.attributeValue( "primitiveShort" ) != null  )
1789         {
1790             xmlAttributes.setPrimitiveShort( getShortValue( getTrimmedValue( element.attributeValue( "primitiveShort" ) ), "primitiveShort", strict ) );
1791         }
1792         if ( element.attributeValue( "primitiveInt" ) != null  )
1793         {
1794             xmlAttributes.setPrimitiveInt( getIntegerValue( getTrimmedValue( element.attributeValue( "primitiveInt" ) ), "primitiveInt", strict ) );
1795         }
1796         if ( element.attributeValue( "primitiveLong" ) != null  )
1797         {
1798             xmlAttributes.setPrimitiveLong( getLongValue( getTrimmedValue( element.attributeValue( "primitiveLong" ) ), "primitiveLong", strict ) );
1799         }
1800         if ( element.attributeValue( "primitiveFloat" ) != null  )
1801         {
1802             xmlAttributes.setPrimitiveFloat( getFloatValue( getTrimmedValue( element.attributeValue( "primitiveFloat" ) ), "primitiveFloat", strict ) );
1803         }
1804         if ( element.attributeValue( "primitiveDouble" ) != null  )
1805         {
1806             xmlAttributes.setPrimitiveDouble( getDoubleValue( getTrimmedValue( element.attributeValue( "primitiveDouble" ) ), "primitiveDouble", strict ) );
1807         }
1808         if ( element.attributeValue( "objectString" ) != null  )
1809         {
1810             xmlAttributes.setObjectString( getTrimmedValue( element.attributeValue( "objectString" ) ) );
1811         }
1812         if ( element.attributeValue( "objectDate" ) != null  )
1813         {
1814             String dateFormat = null;
1815             xmlAttributes.setObjectDate( getDateValue( getTrimmedValue( element.attributeValue( "objectDate" ) ), "objectDate", dateFormat ) );
1816         }
1817         if ( element.attributeValue( "tag-name" ) != null  )
1818         {
1819             xmlAttributes.setAttribute( getTrimmedValue( element.attributeValue( "tag-name" ) ) );
1820         }
1821         java.util.Set parsed = new java.util.HashSet();
1822         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1823         {
1824             Node node = (Node) i.next();
1825             if ( node.getNodeType() == Node.ELEMENT_NODE )
1826             {
1827                 Element childElement = (Element) node;
1828                 checkUnknownElement( childElement, strict );
1829             }
1830         }
1831         return xmlAttributes;
1832     } //-- XmlAttributes parseXmlAttributes( String, Element, boolean )
1833 
1834     /**
1835      * Method parseXmlContent.
1836      * 
1837      * @param tagName
1838      * @param strict
1839      * @param element
1840      * @throws IOException
1841      * @throws DocumentException
1842      * @return XmlContent
1843      */
1844     private XmlContent parseXmlContent( String tagName, Element element, boolean strict )
1845         throws IOException, DocumentException
1846     {
1847         XmlContenteatures/XmlContent.html#XmlContent">XmlContent xmlContent = new XmlContent();
1848         java.util.Set parsed = new java.util.HashSet();
1849         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1850         {
1851             Node node = (Node) i.next();
1852             if ( node.getNodeType() == Node.ELEMENT_NODE )
1853             {
1854                 Element childElement = (Element) node;
1855                 if ( checkFieldWithDuplicate( childElement, "content.long", null, parsed ) )
1856                 {
1857                     xmlContent.setLongContent( parseXmlContentLong( "content.long", childElement, strict ) );
1858                 }
1859                 else if ( checkFieldWithDuplicate( childElement, "content.long-with-attributes", null, parsed ) )
1860                 {
1861                     xmlContent.setLongContentWithAttributes( parseXmlContentLongWithAttributes( "content.long-with-attributes", childElement, strict ) );
1862                 }
1863                 else
1864                 {
1865                     checkUnknownElement( childElement, strict );
1866                 }
1867             }
1868         }
1869         return xmlContent;
1870     } //-- XmlContent parseXmlContent( String, Element, boolean )
1871 
1872     /**
1873      * Method parseXmlContentLong.
1874      * 
1875      * @param tagName
1876      * @param strict
1877      * @param element
1878      * @throws IOException
1879      * @throws DocumentException
1880      * @return XmlContentLong
1881      */
1882     private XmlContentLong parseXmlContentLong( String tagName, Element element, boolean strict )
1883         throws IOException, DocumentException
1884     {
1885         XmlContentLongXmlContentLong.html#XmlContentLong">XmlContentLong xmlContentLong = new XmlContentLong();
1886         xmlContentLong.setContent( getLongValue( getTrimmedValue( element.getText() ), "content", strict ) );
1887         return xmlContentLong;
1888     } //-- XmlContentLong parseXmlContentLong( String, Element, boolean )
1889 
1890     /**
1891      * Method parseXmlContentLongWithAttributes.
1892      * 
1893      * @param tagName
1894      * @param strict
1895      * @param element
1896      * @throws IOException
1897      * @throws DocumentException
1898      * @return XmlContentLongWithAttributes
1899      */
1900     private XmlContentLongWithAttributes parseXmlContentLongWithAttributes( String tagName, Element element, boolean strict )
1901         throws IOException, DocumentException
1902     {
1903         XmlContentLongWithAttributes.html#XmlContentLongWithAttributes">XmlContentLongWithAttributes xmlContentLongWithAttributes = new XmlContentLongWithAttributes();
1904         if ( element.attributeValue( "attr" ) != null  )
1905         {
1906             xmlContentLongWithAttributes.setAttr( getTrimmedValue( element.attributeValue( "attr" ) ) );
1907         }
1908         if ( element.attributeValue( "attr2" ) != null  )
1909         {
1910             xmlContentLongWithAttributes.setAttr2( getIntegerValue( getTrimmedValue( element.attributeValue( "attr2" ) ), "attr2", strict ) );
1911         }
1912         xmlContentLongWithAttributes.setContent( getLongValue( getTrimmedValue( element.getText() ), "content", strict ) );
1913         return xmlContentLongWithAttributes;
1914     } //-- XmlContentLongWithAttributes parseXmlContentLongWithAttributes( String, Element, boolean )
1915 
1916     /**
1917      * Method parseXmlFeatures.
1918      * 
1919      * @param tagName
1920      * @param strict
1921      * @param element
1922      * @throws IOException
1923      * @throws DocumentException
1924      * @return XmlFeatures
1925      */
1926     private XmlFeatures parseXmlFeatures( String tagName, Element element, boolean strict )
1927         throws IOException, DocumentException
1928     {
1929         XmlFeaturestures/XmlFeatures.html#XmlFeatures">XmlFeatures xmlFeatures = new XmlFeatures();
1930         if ( element.attributeValue( "tag-name.attribute" ) != null  )
1931         {
1932             xmlFeatures.setFieldNameAttribute( getTrimmedValue( element.attributeValue( "tag-name.attribute" ) ) );
1933         }
1934         java.util.Set parsed = new java.util.HashSet();
1935         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
1936         {
1937             Node node = (Node) i.next();
1938             if ( node.getNodeType() == Node.ELEMENT_NODE )
1939             {
1940                 Element childElement = (Element) node;
1941                 if ( checkFieldWithDuplicate( childElement, "attributes", null, parsed ) )
1942                 {
1943                     xmlFeatures.setAttributes( parseXmlAttributes( "attributes", childElement, strict ) );
1944                 }
1945                 else if ( checkFieldWithDuplicate( childElement, "attributesDefault", null, parsed ) )
1946                 {
1947                     xmlFeatures.setAttributesDefault( parseXmlAttributes( "attributesDefault", childElement, strict ) );
1948                 }
1949                 else if ( checkFieldWithDuplicate( childElement, "content", null, parsed ) )
1950                 {
1951                     xmlFeatures.setContent( parseXmlContent( "content", childElement, strict ) );
1952                 }
1953                 else if ( checkFieldWithDuplicate( childElement, "fieldTrim", null, parsed ) )
1954                 {
1955                     xmlFeatures.setFieldTrim( getTrimmedValue( childElement.getText() ) );
1956                 }
1957                 else if ( checkFieldWithDuplicate( childElement, "fieldNoTrim", null, parsed ) )
1958                 {
1959                     xmlFeatures.setFieldNoTrim( childElement.getText() );
1960                 }
1961                 else if ( checkFieldWithDuplicate( childElement, "dom", null, parsed ) )
1962                 {
1963                     xmlFeatures.setDom( writeElementToXpp3Dom( childElement ) );
1964                 }
1965                 else if ( checkFieldWithDuplicate( childElement, "domNoTrim", null, parsed ) )
1966                 {
1967                     xmlFeatures.setDomNoTrim( writeElementToXpp3Dom( childElement ) );
1968                 }
1969                 else if ( checkFieldWithDuplicate( childElement, "tag-name", null, parsed ) )
1970                 {
1971                     xmlFeatures.setFieldName( getTrimmedValue( childElement.getText() ) );
1972                 }
1973                 else if ( checkFieldWithDuplicate( childElement, "dateXmlFormat", null, parsed ) )
1974                 {
1975                     String dateFormat = "yyyy-MM-dd'T'HH:mm:ss";
1976                     xmlFeatures.setDateXmlFormat( getDateValue( getTrimmedValue( childElement.getText() ), "dateXmlFormat", dateFormat ) );
1977                 }
1978                 else if ( checkFieldWithDuplicate( childElement, "dateLong", null, parsed ) )
1979                 {
1980                     String dateFormat = "long";
1981                     xmlFeatures.setDateLong( getDateValue( getTrimmedValue( childElement.getText() ), "dateLong", dateFormat ) );
1982                 }
1983                 else if ( "xmlItemsStyleFlat".equals( childElement.getName() ) )
1984                 {
1985                     Element listElement = childElement;
1986                     java.util.List xmlItemsStyleFlats = xmlFeatures.getXmlItemsStyleFlats();
1987                     if ( xmlItemsStyleFlats == null )
1988                     {
1989                         xmlItemsStyleFlats = new java.util.ArrayList/*<Reference>*/();
1990                         xmlFeatures.setXmlItemsStyleFlats( xmlItemsStyleFlats );
1991                     }
1992                     xmlItemsStyleFlats.add( parseReference( "xmlItemsStyleFlat", listElement, strict ) );
1993                 }
1994                 else if ( checkFieldWithDuplicate( childElement, "xmlAssociationTagNames", null, parsed ) )
1995                 {
1996                     java.util.List xmlAssociationTagNames = new java.util.ArrayList/*<Reference>*/();
1997                     xmlFeatures.setXmlAssociationTagNames( xmlAssociationTagNames );
1998                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
1999                     {
2000                         Node n = (Node) j.next();
2001                         if ( n.getNodeType() == Node.ELEMENT_NODE )
2002                         {
2003                             Element listElement = (Element) n;
2004                             if ( "association.tag-name".equals( listElement.getName() ) )
2005                             {
2006                                 xmlAssociationTagNames.add( parseReference( "association.tag-name", listElement, strict ) );
2007                             }
2008                             else
2009                             {
2010                             }
2011                         }
2012                     }
2013                 }
2014                 else if ( checkFieldWithDuplicate( childElement, "field.tag-names", null, parsed ) )
2015                 {
2016                     java.util.List xmlTagNameAssociation = new java.util.ArrayList/*<Reference>*/();
2017                     xmlFeatures.setXmlTagNameAssociation( xmlTagNameAssociation );
2018                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
2019                     {
2020                         Node n = (Node) j.next();
2021                         if ( n.getNodeType() == Node.ELEMENT_NODE )
2022                         {
2023                             Element listElement = (Element) n;
2024                             if ( "field.tag-name".equals( listElement.getName() ) )
2025                             {
2026                                 xmlTagNameAssociation.add( parseReference( "field.tag-name", listElement, strict ) );
2027                             }
2028                             else
2029                             {
2030                             }
2031                         }
2032                     }
2033                 }
2034                 else if ( checkFieldWithDuplicate( childElement, "field.tag-name", null, parsed ) )
2035                 {
2036                     java.util.List xmlTagNameAssociationTagNames = new java.util.ArrayList/*<Reference>*/();
2037                     xmlFeatures.setXmlTagNameAssociationTagNames( xmlTagNameAssociationTagNames );
2038                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
2039                     {
2040                         Node n = (Node) j.next();
2041                         if ( n.getNodeType() == Node.ELEMENT_NODE )
2042                         {
2043                             Element listElement = (Element) n;
2044                             if ( "association.tag-name".equals( listElement.getName() ) )
2045                             {
2046                                 xmlTagNameAssociationTagNames.add( parseReference( "association.tag-name", listElement, strict ) );
2047                             }
2048                             else
2049                             {
2050                             }
2051                         }
2052                     }
2053                 }
2054                 else if ( "association.tag-name".equals( childElement.getName() ) )
2055                 {
2056                     Element listElement = childElement;
2057                     java.util.List xmlFlatAssociationTagNames = xmlFeatures.getXmlFlatAssociationTagNames();
2058                     if ( xmlFlatAssociationTagNames == null )
2059                     {
2060                         xmlFlatAssociationTagNames = new java.util.ArrayList/*<Reference>*/();
2061                         xmlFeatures.setXmlFlatAssociationTagNames( xmlFlatAssociationTagNames );
2062                     }
2063                     xmlFlatAssociationTagNames.add( parseReference( "association.tag-name", listElement, strict ) );
2064                 }
2065                 else if ( checkFieldWithDuplicate( childElement, "explodeProperties", null, parsed ) )
2066                 {
2067                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
2068                     {
2069                         Node n = (Node) j.next();
2070                         if ( n.getNodeType() == Node.ELEMENT_NODE )
2071                         {
2072                             Element listElement = (Element) n;
2073                             if ( "explodeProperty".equals( listElement.getName() ) )
2074                             {
2075                                 String key = null;
2076                                 String value = null;
2077                                 //explode mode.
2078                                 for ( Iterator k = listElement.nodeIterator(); k.hasNext(); )
2079                                 {
2080                                     Node nd = (Node) k.next();
2081                                     if ( nd.getNodeType() == Node.ELEMENT_NODE )
2082                                     {
2083                                         Element propertyElement = (Element) nd;
2084                                         if ( "key".equals( propertyElement.getName() ) )
2085                                         {
2086                                             key = propertyElement.getText();
2087                                         }
2088                                         else if ( "value".equals( propertyElement.getName() ) )
2089                                         {
2090                                             value = propertyElement.getText().trim();
2091                                         }
2092                                         else
2093                                         {
2094                                         }
2095                                     }
2096                                 }
2097                                 xmlFeatures.addExplodeProperty( key, value );
2098                             }
2099                         }
2100                     }
2101                 }
2102                 else if ( checkFieldWithDuplicate( childElement, "inlineProperties", null, parsed ) )
2103                 {
2104                     for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
2105                     {
2106                         Node n = (Node) j.next();
2107                         if ( n.getNodeType() == Node.ELEMENT_NODE )
2108                         {
2109                             Element listElement = (Element) n;
2110                             String key = listElement.getName();
2111                             String value = listElement.getText().trim();
2112                             xmlFeatures.addInlineProperty( key, value );
2113                         }
2114                     }
2115                 }
2116                 else if ( checkFieldWithDuplicate( childElement, "xmlTransientFields", null, parsed ) )
2117                 {
2118                     xmlFeatures.setXmlTransientFields( parseXmlTransientFields( "xmlTransientFields", childElement, strict ) );
2119                 }
2120                 else if ( checkFieldWithDuplicate( childElement, "xmlFieldsOrder", null, parsed ) )
2121                 {
2122                     xmlFeatures.setXmlFieldsOrder( parseXmlFieldsOrder( "xmlFieldsOrder", childElement, strict ) );
2123                 }
2124                 else if ( checkFieldWithDuplicate( childElement, "xsdFeatures", null, parsed ) )
2125                 {
2126                     xmlFeatures.setXsdFeatures( parseXsdFeatures( "xsdFeatures", childElement, strict ) );
2127                 }
2128                 else
2129                 {
2130                     checkUnknownElement( childElement, strict );
2131                 }
2132             }
2133         }
2134         return xmlFeatures;
2135     } //-- XmlFeatures parseXmlFeatures( String, Element, boolean )
2136 
2137     /**
2138      * Method parseXmlFieldsOrder.
2139      * 
2140      * @param tagName
2141      * @param strict
2142      * @param element
2143      * @throws IOException
2144      * @throws DocumentException
2145      * @return XmlFieldsOrder
2146      */
2147     private XmlFieldsOrder parseXmlFieldsOrder( String tagName, Element element, boolean strict )
2148         throws IOException, DocumentException
2149     {
2150         XmlFieldsOrderXmlFieldsOrder.html#XmlFieldsOrder">XmlFieldsOrder xmlFieldsOrder = new XmlFieldsOrder();
2151         java.util.Set parsed = new java.util.HashSet();
2152         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
2153         {
2154             Node node = (Node) i.next();
2155             if ( node.getNodeType() == Node.ELEMENT_NODE )
2156             {
2157                 Element childElement = (Element) node;
2158                 if ( checkFieldWithDuplicate( childElement, "field1", null, parsed ) )
2159                 {
2160                     xmlFieldsOrder.setField1( getTrimmedValue( childElement.getText() ) );
2161                 }
2162                 else if ( checkFieldWithDuplicate( childElement, "field-2", null, parsed ) )
2163                 {
2164                     xmlFieldsOrder.setField( getTrimmedValue( childElement.getText() ) );
2165                 }
2166                 else if ( checkFieldWithDuplicate( childElement, "field3", null, parsed ) )
2167                 {
2168                     xmlFieldsOrder.setField3( getTrimmedValue( childElement.getText() ) );
2169                 }
2170                 else if ( checkFieldWithDuplicate( childElement, "field4", null, parsed ) )
2171                 {
2172                     xmlFieldsOrder.setField4( getTrimmedValue( childElement.getText() ) );
2173                 }
2174                 else if ( checkFieldWithDuplicate( childElement, "field5", null, parsed ) )
2175                 {
2176                     xmlFieldsOrder.setField5( getTrimmedValue( childElement.getText() ) );
2177                 }
2178                 else if ( checkFieldWithDuplicate( childElement, "field6", null, parsed ) )
2179                 {
2180                     xmlFieldsOrder.setField6( getTrimmedValue( childElement.getText() ) );
2181                 }
2182                 else if ( checkFieldWithDuplicate( childElement, "field7", null, parsed ) )
2183                 {
2184                     xmlFieldsOrder.setField7( getTrimmedValue( childElement.getText() ) );
2185                 }
2186                 else
2187                 {
2188                     checkUnknownElement( childElement, strict );
2189                 }
2190             }
2191         }
2192         return xmlFieldsOrder;
2193     } //-- XmlFieldsOrder parseXmlFieldsOrder( String, Element, boolean )
2194 
2195     /**
2196      * Method parseXmlFieldsOrderParent.
2197      * 
2198      * @param tagName
2199      * @param strict
2200      * @param element
2201      * @throws IOException
2202      * @throws DocumentException
2203      * @return XmlFieldsOrderParent
2204      */
2205     private XmlFieldsOrderParent parseXmlFieldsOrderParent( String tagName, Element element, boolean strict )
2206         throws IOException, DocumentException
2207     {
2208         XmlFieldsOrderParenterParent.html#XmlFieldsOrderParent">XmlFieldsOrderParent xmlFieldsOrderParent = new XmlFieldsOrderParent();
2209         java.util.Set parsed = new java.util.HashSet();
2210         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
2211         {
2212             Node node = (Node) i.next();
2213             if ( node.getNodeType() == Node.ELEMENT_NODE )
2214             {
2215                 Element childElement = (Element) node;
2216                 if ( checkFieldWithDuplicate( childElement, "field-2", null, parsed ) )
2217                 {
2218                     xmlFieldsOrderParent.setField( getTrimmedValue( childElement.getText() ) );
2219                 }
2220                 else if ( checkFieldWithDuplicate( childElement, "field4", null, parsed ) )
2221                 {
2222                     xmlFieldsOrderParent.setField4( getTrimmedValue( childElement.getText() ) );
2223                 }
2224                 else if ( checkFieldWithDuplicate( childElement, "field5", null, parsed ) )
2225                 {
2226                     xmlFieldsOrderParent.setField5( getTrimmedValue( childElement.getText() ) );
2227                 }
2228                 else if ( checkFieldWithDuplicate( childElement, "field7", null, parsed ) )
2229                 {
2230                     xmlFieldsOrderParent.setField7( getTrimmedValue( childElement.getText() ) );
2231                 }
2232                 else
2233                 {
2234                     checkUnknownElement( childElement, strict );
2235                 }
2236             }
2237         }
2238         return xmlFieldsOrderParent;
2239     } //-- XmlFieldsOrderParent parseXmlFieldsOrderParent( String, Element, boolean )
2240 
2241     /**
2242      * Method parseXmlFieldsOrderParent2.
2243      * 
2244      * @param tagName
2245      * @param strict
2246      * @param element
2247      * @throws IOException
2248      * @throws DocumentException
2249      * @return XmlFieldsOrderParent2
2250      */
2251     private XmlFieldsOrderParent2 parseXmlFieldsOrderParent2( String tagName, Element element, boolean strict )
2252         throws IOException, DocumentException
2253     {
2254         XmlFieldsOrderParent2Parent2.html#XmlFieldsOrderParent2">XmlFieldsOrderParent2 xmlFieldsOrderParent2 = new XmlFieldsOrderParent2();
2255         java.util.Set parsed = new java.util.HashSet();
2256         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
2257         {
2258             Node node = (Node) i.next();
2259             if ( node.getNodeType() == Node.ELEMENT_NODE )
2260             {
2261                 Element childElement = (Element) node;
2262                 if ( checkFieldWithDuplicate( childElement, "field-2", null, parsed ) )
2263                 {
2264                     xmlFieldsOrderParent2.setField( getTrimmedValue( childElement.getText() ) );
2265                 }
2266                 else
2267                 {
2268                     checkUnknownElement( childElement, strict );
2269                 }
2270             }
2271         }
2272         return xmlFieldsOrderParent2;
2273     } //-- XmlFieldsOrderParent2 parseXmlFieldsOrderParent2( String, Element, boolean )
2274 
2275     /**
2276      * Method parseXmlTransientFields.
2277      * 
2278      * @param tagName
2279      * @param strict
2280      * @param element
2281      * @throws IOException
2282      * @throws DocumentException
2283      * @return XmlTransientFields
2284      */
2285     private XmlTransientFields parseXmlTransientFields( String tagName, Element element, boolean strict )
2286         throws IOException, DocumentException
2287     {
2288         XmlTransientFieldsientFields.html#XmlTransientFields">XmlTransientFields xmlTransientFields = new XmlTransientFields();
2289         java.util.Set parsed = new java.util.HashSet();
2290         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
2291         {
2292             Node node = (Node) i.next();
2293             if ( node.getNodeType() == Node.ELEMENT_NODE )
2294             {
2295                 Element childElement = (Element) node;
2296                 if ( checkFieldWithDuplicate( childElement, "persistentField", null, parsed ) )
2297                 {
2298                     xmlTransientFields.setPersistentField( getTrimmedValue( childElement.getText() ) );
2299                 }
2300                 else
2301                 {
2302                     checkUnknownElement( childElement, strict );
2303                 }
2304             }
2305         }
2306         return xmlTransientFields;
2307     } //-- XmlTransientFields parseXmlTransientFields( String, Element, boolean )
2308 
2309     /**
2310      * Method parseXsdFeatures.
2311      * 
2312      * @param tagName
2313      * @param strict
2314      * @param element
2315      * @throws IOException
2316      * @throws DocumentException
2317      * @return XsdFeatures
2318      */
2319     private XsdFeatures parseXsdFeatures( String tagName, Element element, boolean strict )
2320         throws IOException, DocumentException
2321     {
2322         XsdFeaturestures/XsdFeatures.html#XsdFeatures">XsdFeatures xsdFeatures = new XsdFeatures();
2323         if ( element.attributeValue( "attribute" ) != null  )
2324         {
2325             xsdFeatures.setAttribute( getTrimmedValue( element.attributeValue( "attribute" ) ) );
2326         }
2327         java.util.Set parsed = new java.util.HashSet();
2328         for ( Iterator i = element.nodeIterator(); i.hasNext(); )
2329         {
2330             Node node = (Node) i.next();
2331             if ( node.getNodeType() == Node.ELEMENT_NODE )
2332             {
2333                 Element childElement = (Element) node;
2334                 checkUnknownElement( childElement, strict );
2335             }
2336         }
2337         return xsdFeatures;
2338     } //-- XsdFeatures parseXsdFeatures( String, Element, boolean )
2339 
2340     /**
2341      * Method read.
2342      * 
2343      * @param reader
2344      * @param strict
2345      * @throws IOException
2346      * @throws DocumentException
2347      * @return Features
2348      */
2349     public Features read( Reader reader, boolean strict )
2350         throws IOException, DocumentException
2351     {
2352         SAXReader parser = new SAXReader();
2353         Document document = parser.read( reader );
2354         return read( document, strict );
2355     } //-- Features read( Reader, boolean )
2356 
2357     /**
2358      * Method read.
2359      * 
2360      * @param reader
2361      * @throws IOException
2362      * @throws DocumentException
2363      * @return Features
2364      */
2365     public Features read( Reader reader )
2366         throws IOException, DocumentException
2367     {
2368         return read( reader, true );
2369     } //-- Features read( Reader )
2370 
2371     /**
2372      * Method read.
2373      * 
2374      * @param stream
2375      * @param strict
2376      * @throws IOException
2377      * @throws DocumentException
2378      * @return Features
2379      */
2380     public Features read( InputStream stream, boolean strict )
2381         throws IOException, DocumentException
2382     {
2383         SAXReader parser = new SAXReader();
2384         Document document = parser.read( stream );
2385         return read( document, strict );
2386     } //-- Features read( InputStream, boolean )
2387 
2388     /**
2389      * Method read.
2390      * 
2391      * @param stream
2392      * @throws IOException
2393      * @throws DocumentException
2394      * @return Features
2395      */
2396     public Features read( InputStream stream )
2397         throws IOException, DocumentException
2398     {
2399         return read( stream, true );
2400     } //-- Features read( InputStream )
2401 
2402     /**
2403      * Method read.
2404      * 
2405      * @param url
2406      * @param strict
2407      * @throws IOException
2408      * @throws DocumentException
2409      * @return Features
2410      */
2411     public Features read( URL url, boolean strict )
2412         throws IOException, DocumentException
2413     {
2414         SAXReader parser = new SAXReader();
2415         Document document = parser.read( url );
2416         return read( document, strict );
2417     } //-- Features read( URL, boolean )
2418 
2419     /**
2420      * Method read.
2421      * 
2422      * @param url
2423      * @throws IOException
2424      * @throws DocumentException
2425      * @return Features
2426      */
2427     public Features read( URL url )
2428         throws IOException, DocumentException
2429     {
2430         return read( url, true );
2431     } //-- Features read( URL )
2432 
2433     /**
2434      * Method read.
2435      * 
2436      * @param document
2437      * @param strict
2438      * @throws IOException
2439      * @throws DocumentException
2440      * @return Features
2441      */
2442     private Features read( Document document, boolean strict )
2443         throws IOException, DocumentException
2444     {
2445         String encoding = document.getXMLEncoding();
2446         Features features = parseFeatures( "features-demo", document.getRootElement(), strict );
2447         features.setModelEncoding( encoding );
2448         return features;
2449     } //-- Features read( Document, boolean )
2450 
2451     /**
2452      * Method writeElementToXpp3Dom.
2453      * 
2454      * @param element
2455      * @return Xpp3Dom
2456      */
2457     private Xpp3Dom writeElementToXpp3Dom( Element element )
2458     {
2459         Xpp3Dom xpp3Dom = new Xpp3Dom( element.getName() );
2460         if ( element.elements().isEmpty() && element.getText() != null )
2461         {
2462             xpp3Dom.setValue( element.getText() );
2463         }
2464         for ( Iterator i = element.attributeIterator(); i.hasNext(); )
2465         {
2466             Attribute attribute = (Attribute) i.next();
2467             xpp3Dom.setAttribute( attribute.getName(), attribute.getValue() );
2468         }
2469         for ( Iterator i = element.elementIterator(); i.hasNext(); )
2470         {
2471             Element child = (Element) i.next();
2472             xpp3Dom.addChild( writeElementToXpp3Dom( child ) );
2473         }
2474         return xpp3Dom;
2475     } //-- Xpp3Dom writeElementToXpp3Dom( Element )
2476 
2477 }