KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > catcode > odf > OpenDocumentMetadata


1 /*
2     OpenDocumentMetadata is an Object representing the metadata in an
3     OpenDocument file.
4
5     Copyright (C) 2005 J. David Eisenberg
6
7     This library is free software; you can redistribute it and/or
8     modify it under the terms of the GNU Lesser General Public
9     License as published by the Free Software Foundation; either
10     version 2.1 of the License, or (at your option) any later version.
11
12     This library is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15     Lesser General Public License for more details.
16
17     You should have received a copy of the GNU Lesser General Public
18     License along with this library; if not, write to the Free Software
19     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20     
21     Author: J. David Eisenberg
22     Contact: catcode@catcode.com
23
24 */

25 package com.catcode.odf;
26
27 import java.lang.reflect.Field JavaDoc;
28 import java.lang.reflect.Modifier JavaDoc;
29
30 import java.text.DateFormat JavaDoc;
31 import java.text.ParseException JavaDoc;
32 import java.text.SimpleDateFormat JavaDoc;
33
34 import java.util.Date JavaDoc;
35 import java.util.GregorianCalendar JavaDoc;
36 import java.util.Hashtable JavaDoc;
37
38 /**
39  * OpenDocumentMetadata describes the content of an
40  * OASIS Open Document Format meta-information file.
41  *
42  * The declarations of the fields in this class closely
43  * mirror the element and attribute names in the meta.xml
44  * file. For example, the <code>printedBy</code> field
45  * contains the information that comes from the
46  * <code>&lt;meta:printed-by&gt;</code> element. This
47  * is no accident--it allows code that analyzes a
48  * meta.xml file to use reflection to call the methods
49  * for setting the fields in this class.
50  *
51  * @author J. David Eisenberg
52  * @version 0.2, 2005-10-30
53 */

54
55 public class OpenDocumentMetadata
56 {
57     private String JavaDoc generator; // meta:generator
58
private String JavaDoc title; // dc:title
59
private String JavaDoc description; // dc:description
60
private String JavaDoc subject; // dc:subject
61
private String JavaDoc keyword; // meta:keyword
62
private String JavaDoc initialCreator; // meta:initial-creator
63
private String JavaDoc creator; // dc:creator
64
private String JavaDoc printedBy; // meta:printed-by
65
private Date JavaDoc creationDate; // meta:creation-date
66
private Date JavaDoc date; // dc:date;
67
private Date JavaDoc printDate; // meta:print-date
68
private String JavaDoc language; // dc:language;
69
private Integer JavaDoc editingCycles; // meta:editing-cycles
70
private Duration editingDuration; // meta:editing-duration
71

72     // attributes from <meta:document-statistic>
73
private Integer JavaDoc pageCount; // meta:page-count
74
private Integer JavaDoc tableCount; // meta:table-count
75
private Integer JavaDoc drawCount; // meta:draw-count
76
private Integer JavaDoc imageCount; // meta:image-count
77
private Integer JavaDoc oleObjectCount; // meta:ole-object-count
78
private Integer JavaDoc paragraphCount; // meta:paragraph-count
79
private Integer JavaDoc wordCount; // meta:word-count
80
private Integer JavaDoc characterCount; // meta:character-count
81
private Integer JavaDoc frameCount; // meta:frame-count
82
private Integer JavaDoc sentenceCount; // meta:sentence-count
83
private Integer JavaDoc syllableCount; // meta:syllable-count
84
private Integer JavaDoc nonWhitespaceCharacterCount;
85         // meta:non-whitespace-character-count
86
private Integer JavaDoc rowCount; // meta:row-count
87
private Integer JavaDoc cellCount; // meta:cell-count
88
private Integer JavaDoc objectCount; // meta:object-count
89

90     private static final SimpleDateFormat JavaDoc isoDate = new
91             SimpleDateFormat JavaDoc("yyyy-MM-dd'T'HH:mm:ss");
92
93     protected Hashtable JavaDoc userDefined = new Hashtable JavaDoc(10);
94
95     /**
96      * Return the generator meta information.
97      *
98      * @return the generator.
99      */

100     public String JavaDoc getGenerator()
101     {
102         return this.generator;
103     }
104
105     /**
106      * Set the information corresponding to
107      * <code>&lt;meta:generator&gt;</code> to given value.
108      *
109      * @param generator the generator.
110      */

111     public void setGenerator(String JavaDoc generator)
112     {
113         this.generator = generator;
114     }
115
116     /**
117      * Return the document title.
118      *
119      * @return the title.
120      */

121     public String JavaDoc getTitle()
122     {
123         return this.title;
124     }
125
126     /**
127      * Set the information corresponding to
128      * <code>&lt;dc:title&gt;</code> to given value.
129      *
130      * @param title the title.
131      */

132     public void setTitle(String JavaDoc title)
133     {
134         this.title = title;
135     }
136
137     /**
138      * Return the document description.
139      *
140      * @return the description.
141      */

142     public String JavaDoc getDescription()
143     {
144         return this.description;
145     }
146
147     /**
148      * Set the information corresponding to
149      * <code>&lt;dc:description&gt;</code> to given value.
150      *
151      * @param description the description.
152      */

153     public void setDescription(String JavaDoc description)
154     {
155         this.description = description;
156     }
157
158     /**
159      * Return the document subject.
160      *
161      * @return the subject.
162      */

163     public String JavaDoc getSubject()
164     {
165         return this.subject;
166     }
167
168     /**
169      * Set the information corresponding to
170      * <code>&lt;dc:subject&gt;</code> to given value.
171      *
172      * @param subject the subject.
173      */

174     public void setSubject(String JavaDoc subject)
175     {
176         this.subject = subject;
177     }
178
179     /**
180      * Return the list of keywords for this document.
181      *
182      * @return a string of keyword information.
183      */

184     public String JavaDoc getKeyword()
185     {
186         return this.keyword;
187     }
188
189     /**
190      * Set the information corresponding to
191      * <code>&lt;meta:keyword&gt;</code> to given value.
192      *
193      * @param keyword the keyword.
194      */

195     public void setKeyword(String JavaDoc keyword)
196     {
197         this.keyword = keyword;
198     }
199
200     /**
201      * Return the document's initial creator.
202      *
203      * @return the creator.
204      */

205     public String JavaDoc getInitialCreator()
206     {
207         return this.initialCreator;
208     }
209
210     /**
211      * Set the information corresponding to
212      * <code>&lt;meta:initial-creator&gt;</code> to given value.
213      *
214      * @param initialCreator the initial creator.
215      */

216     public void setInitialCreator(String JavaDoc initialCreator)
217     {
218         this.initialCreator = initialCreator;
219     }
220
221     /**
222      * Return the last editor of the document.
223      *
224      * @return the last editor.
225      */

226     public String JavaDoc getCreator()
227     {
228         return this.creator;
229     }
230
231     /**
232      * Set the information corresponding to
233      * <code>&lt;dc:creator&gt;</code> to given value.
234      * This is actually the last person to edit the document.
235      *
236      * @param creator the last editor.
237      */

238     public void setCreator(String JavaDoc creator)
239     {
240         this.creator = creator;
241     }
242
243     /**
244      * Return the last person to print the document.
245      *
246      * @return the subject.
247      */

248     public String JavaDoc getPrintedBy()
249     {
250         return this.printedBy;
251     }
252
253     /**
254      * Set the information corresponding to
255      * <code>&lt;meta:printed-by&gt;</code> to given value.
256      *
257      * @param printedBy the last person to print document.
258      */

259     public void setPrintedBy(String JavaDoc printedBy)
260     {
261         this.printedBy = printedBy;
262     }
263
264     /**
265      * Return the document's creation date and time.
266      * In the XML, date and time are in the format
267      * <code>YYYY-MM-DDThh:mm:ss</code>.
268      * @return the creation date and time.
269      */

270     public Date JavaDoc getCreationDate()
271     {
272         return this.creationDate;
273     }
274
275     /**
276      * Set the information corresponding to
277      * <code>&lt;meta:creation-date&gt;</code> to given value.
278      *
279      * @param creationDate the creationDate.
280      */

281     public void setCreationDate(Date JavaDoc creationDate)
282     {
283         this.creationDate = creationDate;
284     }
285
286     /**
287      * Set the information corresponding to
288      * <code>&lt;meta:creation-date&gt;</code> to given value.
289      *
290      * @param strCreationDate the creation date
291      * in the form <code>yyyy-mm-ddTHH:mm:ss</code>.
292      */

293     public void setCreationDate( String JavaDoc strCreationDate )
294     {
295         try
296         {
297             creationDate = isoDate.parse( strCreationDate );
298         }
299         catch (ParseException JavaDoc e)
300         {
301             creationDate = null;
302         }
303     }
304
305     /**
306      * Return the document's last edit date and time.
307      * In the XML, date and time are in the format
308      * <code>YYYY-MM-DDThh:mm:ss</code>.
309      * @return the date and time of last edit.
310      */

311     public Date JavaDoc getDate()
312     {
313         return this.date;
314     }
315
316     /**
317      * Set the information corresponding to
318      * <code>&lt;dc:date&gt;</code> (the last editing date) to given value.
319      *
320      * @param date the last date document was edited.
321      */

322     public void setDate(Date JavaDoc date)
323     {
324         this.date = date;
325     }
326
327     /**
328      * Set the information corresponding to
329      * <code>&lt;dc:date&gt;</code> (the last editing date) to given value.
330      *
331      * @param strDate the last editing date
332      * in form <code>yyyy-mm-ddTHH:mm:ss</code>.
333      */

334     public void setDate(String JavaDoc strDate )
335     {
336         try
337         {
338             date = isoDate.parse( strDate );
339         }
340         catch (ParseException JavaDoc e)
341         {
342             date = null;
343         }
344     }
345
346     /**
347      * Return the date and time the document was last printed.
348      * In the XML, date and time are in the format
349      * <code>YYYY-MM-DDThh:mm:ss</code>.
350      * @return the last print date and time.
351      */

352     public Date JavaDoc getPrintDate()
353     {
354         return this.printDate;
355     }
356
357     /**
358      * Set the information corresponding to
359      * <code>&lt;meta:print-date&gt;</code> to given value.
360      *
361      * @param printDate the last editing date.
362      */

363     public void setPrintDate(Date JavaDoc printDate)
364     {
365         this.printDate = printDate;
366     }
367
368     /**
369      * Set the information corresponding to
370      * <code>&lt;meta:print-date&gt;</code> to given value.
371      *
372      * @param strPrintDate the last printed date
373      * in form <code>yyyy-mm-ddTHH:mm:ss</code>.
374      */

375     public void setPrintDate( String JavaDoc strPrintDate )
376     {
377         try
378         {
379             printDate = isoDate.parse( strPrintDate );
380         }
381         catch (ParseException JavaDoc e)
382         {
383             printDate = null;
384         }
385     }
386
387     /**
388      * Return the document's language.
389      * The language consists of a two or three letter Language Code
390      * taken from the ISO 639 standard optionally followed by a
391      * hyphen (-) and a two-letter Country Code taken from the
392      * ISO 3166 standard.
393      *
394      * @return the language.
395      */

396     public String JavaDoc getLanguage()
397     {
398         return this.language;
399     }
400
401     /**
402      * Set the information corresponding to
403      * <code>&lt;dc:language&gt;</code> to given value.
404      *
405      * @param language the language as a two-letter code, optionally followed by
406      * hyphen and two-letter country code.
407      */

408     public void setLanguage(String JavaDoc language)
409     {
410         this.language = language;
411     }
412
413     /**
414      * Return the number of editing cycles for this document.
415      *
416      * @return the number of editing cycles.
417      */

418     public int getEditingCycles()
419     {
420         return this.editingCycles.intValue();
421     }
422
423     /**
424      * Set the information corresponding to
425      * <code>&lt;meta:editing-cycles&gt;</code> to given value.
426      *
427      * @param editingCycles the number of editing cycles.
428      */

429     public void setEditingCycles(int editingCycles)
430     {
431         this.editingCycles = new Integer JavaDoc(editingCycles);
432     }
433
434     /**
435      * Set the information corresponding to
436      * <code>&lt;meta:editing-cycles&gt;</code> to given value.
437      *
438      * @param strEditingCycles the number of editing cycles.
439      */

440     public void setEditingCycles(String JavaDoc strEditingCycles)
441     {
442         this.editingCycles = new Integer JavaDoc( strEditingCycles );
443     }
444
445     /**
446      * Return the total time spent editing the document.
447      * In the XML, duration is in the form
448      * <code>PnYnMnDTnHnMnS</code>.
449      * @return the creation date and time.
450      */

451     public Duration getEditingDuration()
452     {
453         return this.editingDuration;
454     }
455
456     /**
457      * Set the information corresponding to
458      * <code>&lt;meta:editing-duration&gt;</code> to given value.
459      *
460      * @param editingDuration the total editing time.
461      */

462     public void setEditingDuration(Duration editingDuration)
463     {
464         this.editingDuration = editingDuration;
465     }
466
467     /**
468      * Set the information corresponding to
469      * <code>&lt;meta:editing-duration&gt;</code> to given value.
470      *
471      * @param strEditingDuration the total editing time
472      * in the form <code>PnYnMnDTnHnMnS</code>.
473      */

474     public void setEditingDuration(String JavaDoc strEditingDuration)
475     {
476         this.editingDuration = Duration.parseDuration( strEditingDuration );
477     }
478
479     /**
480      * Return the total number of pages in the document.
481      *
482      * @return the number of pages.
483      */

484     public int getPageCount()
485     {
486         return this.pageCount.intValue();
487     }
488
489     /**
490      * Set the information corresponding to
491      * <code>meta:page-count</code> to given value.
492      *
493      * @param pageCount the total number of pages.
494      */

495     public void setPageCount(int pageCount)
496     {
497         this.pageCount = new Integer JavaDoc(pageCount);
498     }
499
500     /**
501      * Return the total number of tables in this text or spreadsheet document.
502      *
503      * @return the number of tables.
504      */

505     public int getTableCount()
506     {
507         return this.tableCount.intValue();
508     }
509
510     /**
511      * Set the information corresponding to
512      * <code>meta:table-count</code> to given value.
513      *
514      * @param tableCount the total number of tables.
515      */

516     public void setTableCount(int tableCount)
517     {
518         this.tableCount = new Integer JavaDoc(tableCount);
519     }
520
521     /**
522      * Return the total number of drawings in the document.
523      *
524      * @return the number of drawings.
525      */

526     public int getDrawCount()
527     {
528         return this.drawCount.intValue();
529     }
530
531     /**
532      * Set the information corresponding to
533      * <code>meta:draw-count</code> to given value.
534      *
535      * @param drawCount the total number of drawings.
536      */

537     public void setDrawCount(int drawCount)
538     {
539         this.drawCount = new Integer JavaDoc(drawCount);
540     }
541
542     /**
543      * Return the total number of images in the document.
544      *
545      * @return the number of images.
546      */

547     public int getImageCount()
548     {
549         return this.imageCount.intValue();
550     }
551
552     /**
553      * Set the information corresponding to
554      * <code>meta:image-count</code> to given value.
555      *
556      * @param imageCount the total number of images.
557      */

558     public void setImageCount(int imageCount)
559     {
560         this.imageCount = new Integer JavaDoc(imageCount);
561     }
562
563     /**
564      * Return the total number of OLE objects in the document.
565      *
566      * @return the number of OLE objects.
567      */

568     public int getOleObjectCount()
569     {
570         return this.oleObjectCount.intValue();
571     }
572
573     /**
574      * Set the information corresponding to
575      * <code>meta:ole-object-count</code> to given value.
576      *
577      * @param oleObjectCount the total number of OLE objects.
578      */

579     public void setOleObjectCount(int oleObjectCount)
580     {
581         this.oleObjectCount = new Integer JavaDoc(oleObjectCount);
582     }
583
584     /**
585      * Return the total number of paragraphs in the document.
586      *
587      * @return the number of paragraphs.
588      */

589     public int getParagraphCount()
590     {
591         return this.paragraphCount.intValue();
592     }
593
594     /**
595      * Set the information corresponding to
596      * <code>meta:paragraph-count</code> to given value.
597      *
598      * @param paragraphCount the total number of paragraphs.
599      */

600     public void setParagraphCount(int paragraphCount)
601     {
602         this.paragraphCount = new Integer JavaDoc(paragraphCount);
603     }
604
605     /**
606      * Return the total number of words in the document.
607      *
608      * @return the number of words.
609      */

610     public int getWordCount()
611     {
612         return this.wordCount.intValue();
613     }
614
615     /**
616      * Set the information corresponding to
617      * <code>&lt;meta:wod-count&gt;</code> to given value.
618      *
619      * @param wordCount the total number of words.
620      */

621     public void setWordCount(int wordCount)
622     {
623         this.wordCount = new Integer JavaDoc(wordCount);
624     }
625
626     /**
627      * Return the total number of characters in the document.
628      *
629      * @return the number of images.
630      */

631     public int getCharacterCount()
632     {
633         return this.characterCount.intValue();
634     }
635
636     /**
637      * Set the information corresponding to
638      * <code>&lt;meta:character-count&gt;</code> to given value.
639      *
640      * @param characterCount the total number of characters.
641      */

642     public void setCharacterCount(int characterCount)
643     {
644         this.characterCount = new Integer JavaDoc(characterCount);
645     }
646
647     /**
648      * Return the total number of frames in the document.
649      *
650      * @return the number of frames.
651      */

652     public int getFrameCount()
653     {
654         return this.frameCount.intValue();
655     }
656
657     /**
658      * Set the information corresponding to
659      * <code>&lt;meta:frame-count&gt;</code> to given value.
660      *
661      * @param frameCount the total number of frames.
662      */

663     public void setFrameCount(int frameCount)
664     {
665         this.frameCount = new Integer JavaDoc(frameCount);
666     }
667
668     /**
669      * Return the total number of sentences in the document.
670      *
671      * @return the number of sentences.
672      */

673     public int getSentenceCount()
674     {
675         return this.sentenceCount.intValue();
676     }
677
678     /**
679      * Set the information corresponding to
680      * <code>&lt;meta:sentence-count&gt;</code> to given value.
681      *
682      * @param sentenceCount the total number of sentences.
683      */

684     public void setSentenceCount(int sentenceCount)
685     {
686         this.sentenceCount = new Integer JavaDoc(sentenceCount);
687     }
688
689     /**
690      * Return the total number of syllables in the document.
691      *
692      * @return the number of syllables.
693      */

694     public int getSyllableCount()
695     {
696         return this.syllableCount.intValue();
697     }
698
699     /**
700      * Set the information corresponding to
701      * <code>&lt;meta:syllable-count&gt;</code> to given value.
702      *
703      * @param syllableCount the total number of syllables.
704      */

705     public void setSyllableCount(int syllableCount)
706     {
707         this.syllableCount = new Integer JavaDoc(syllableCount);
708     }
709
710     /**
711      * Return the total number of non-whitespace characters in the document.
712      *
713      * @return the number of non-whitespace characters.
714      */

715     public int getNonWhitespaceCharacterCount()
716     {
717         return this.nonWhitespaceCharacterCount.intValue();
718     }
719
720     /**
721      * Set the information corresponding to
722      * <code>&lt;meta:non-whitespace-character-count&gt;</code> to given value.
723      *
724      * @param nonWhitespaceCharacterCount the total number of non-whitespace
725      * characters.
726      */

727     public void setNonWhitespaceCharacterCount(int nonWhitespaceCharacterCount)
728     {
729         this.nonWhitespaceCharacterCount = new Integer JavaDoc(
730             nonWhitespaceCharacterCount);
731     }
732
733     /**
734      * Return the total number of rows in the document.
735      * This applies to text documents, strangely, not spreadsheets.
736      *
737      * @return the number of images.
738      */

739     public int getRowCount()
740     {
741         return this.rowCount.intValue();
742     }
743
744     /**
745      * Set the information corresponding to
746      * <code>&lt;meta:row-count&gt;</code> to given value.
747      *
748      * @param rowCount the total number of rows.
749      */

750     public void setRowCount(int rowCount)
751     {
752         this.rowCount = new Integer JavaDoc(rowCount);
753     }
754
755     /**
756      * Return the total number of cells in this spreadsheet document.
757      *
758      * @return the number of cells.
759      */

760     public int getCellCount()
761     {
762         return this.cellCount.intValue();
763     }
764
765     /**
766      * Set the information corresponding to
767      * <code>&lt;meta:cell-count&gt;</code> to given value.
768      *
769      * @param cellCount the total number of cells.
770      */

771     public void setCellCount(int cellCount)
772     {
773         this.cellCount = new Integer JavaDoc(cellCount);
774     }
775
776     /**
777      * Return the total number of graphic objects in this spreadsheet
778      * or graphics document.
779      *
780      * @return the number of graphic objects.
781      */

782     public int getObjectCount()
783     {
784         return this.objectCount.intValue();
785     }
786
787     /**
788      * Set the information corresponding to
789      * <code>&lt;meta:object-count&gt;</code> to given value.
790      *
791      * @param objectCount the total number of graphic objects.
792      */

793     public void setObjectCount(int objectCount)
794     {
795         this.objectCount = new Integer JavaDoc(objectCount);
796     }
797
798     /**
799      * Return the user-defined meta information.
800      *
801      * The hashtable key is a String giving the name of this
802      * user-defined information; the value is an Object which can either be
803      * Double, Date (for date), Duration (for time)
804      * Boolean, or String.
805      *
806      * @return the user-defined information.
807      */

808     public Hashtable JavaDoc getUserDefined()
809     {
810         return this.userDefined;
811     }
812
813     /**
814      * Set the information corresponding to all
815      * <code>&lt;meta:user-defined&gt;</code> elements.
816      *
817      * @param userDefined all user-defined meta-information.
818      */

819     public void setUserDefined(Hashtable JavaDoc userDefined)
820     {
821         this.userDefined = userDefined;
822     }
823     
824     /**
825      * Set user-defined info for given name to an integer value.
826      *
827      * @param name the name for this user-defined info
828      * @param value the integer value
829      */

830     public void setUserDefined( String JavaDoc name, int value )
831     {
832         userDefined.put( name, new Double JavaDoc( value ) );
833     }
834     
835     /**
836      * Set user-defined info for given name to a double value.
837      *
838      * @param name the name for this user-defined info
839      * @param value the double value
840      */

841     public void setUserDefined( String JavaDoc name, double value )
842     {
843         userDefined.put( name, new Double JavaDoc( value ) );
844     }
845
846     /**
847      * Set user-defined info for given name to a boolean value.
848      *
849      * @param name the name for this user-defined info
850      * @param value the boolean value
851      */

852     public void setUserDefined( String JavaDoc name, boolean value )
853     {
854         userDefined.put( name, new Boolean JavaDoc( value ) );
855     }
856
857     /**
858      * Set user-defined info for given name to an Object value.
859      * This is the catch-all that handles Dates, Durations,
860      * and true Double, Boolean, and String.
861      *
862      * @param name the name for this user-defined info
863      * @param value the object value
864      */

865     public void setUserDefined( String JavaDoc name, Object JavaDoc value )
866     {
867         userDefined.put( name, value );
868     }
869
870     /**
871      * Returns an Object for a field by name.
872      *
873      * @return the field value for the given name, null if no such field.
874      */

875     public Object JavaDoc getFieldByName( String JavaDoc fieldName )
876     {
877         Field JavaDoc theField;
878         Object JavaDoc result = null;
879         try
880         {
881             theField = OpenDocumentMetadata.class.getDeclaredField( fieldName );
882             result = theField.get(this);
883         }
884         catch (Exception JavaDoc e)
885         {
886             // do nothing; result is already null
887
}
888         return result;
889     }
890     
891     /**
892      * Returns a string representation of this
893      * <code>OpenDocumentMetadata</code>.
894      * This method is intended to be used only for debugging purposes.
895      * It lists all the non-static fields of the object in the order
896      * returned by <code>getDeclaredFields()</code>,
897      * with their values converted via <code>toString()</code>.
898      * @return a string representation of
899      * this <code>OpenDocumentMetadata</code>.
900      */

901     public String JavaDoc toString()
902     {
903         Field JavaDoc[] field = OpenDocumentMetadata.class.getDeclaredFields();
904         int i;
905         String JavaDoc result ="";
906         String JavaDoc oneField;
907         
908         for (i=0; i < field.length; i++)
909         {
910             if (!Modifier.isStatic(field[i].getModifiers()) )
911             {
912                 try
913                 {
914                     if (field[i].get(this) != null)
915                     {
916                         oneField = field[i].get(this).toString();
917                     }
918                     else
919                     {
920                         oneField = "null";
921                     }
922                 }
923                 catch (IllegalAccessException JavaDoc e)
924                 {
925                     oneField = "**cannot access**";
926                 }
927                 result += field[i].getName() + ": " +
928                     oneField + "\n";
929             }
930         }
931         return result;
932     }
933
934 }
935
936
Popular Tags