1 /*
2  * JasperReports - Free Java Reporting Library.
3  * Copyright (C) 2001 - 2019 TIBCO Software Inc. All rights reserved.
4  * http://www.jaspersoft.com
5  *
6  * Unless you have purchased a commercial license agreement from Jaspersoft,
7  * the following license terms apply:
8  *
9  * This program is part of JasperReports.
10  *
11  * JasperReports is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * JasperReports is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with JasperReports. If not, see <http://www.gnu.org/licenses/>.
23  */

24 package net.sf.jasperreports.engine.fill;
25
26 import java.awt.Color;
27 import java.io.IOException;
28 import java.io.ObjectInputStream;
29
30 import net.sf.jasperreports.engine.JRCommonText;
31 import net.sf.jasperreports.engine.JRConstants;
32 import net.sf.jasperreports.engine.JRDefaultStyleProvider;
33 import net.sf.jasperreports.engine.JRFont;
34 import net.sf.jasperreports.engine.JRHyperlinkHelper;
35 import net.sf.jasperreports.engine.JRLineBox;
36 import net.sf.jasperreports.engine.JROrigin;
37 import net.sf.jasperreports.engine.JRParagraph;
38 import net.sf.jasperreports.engine.JRStaticText;
39 import net.sf.jasperreports.engine.JRStyle;
40 import net.sf.jasperreports.engine.JRTextAlignment;
41 import net.sf.jasperreports.engine.JRTextElement;
42 import net.sf.jasperreports.engine.JRTextField;
43 import net.sf.jasperreports.engine.base.JRBaseLineBox;
44 import net.sf.jasperreports.engine.base.JRBaseParagraph;
45 import net.sf.jasperreports.engine.type.HorizontalTextAlignEnum;
46 import net.sf.jasperreports.engine.type.HyperlinkTargetEnum;
47 import net.sf.jasperreports.engine.type.HyperlinkTypeEnum;
48 import net.sf.jasperreports.engine.type.LineSpacingEnum;
49 import net.sf.jasperreports.engine.type.ModeEnum;
50 import net.sf.jasperreports.engine.type.RotationEnum;
51 import net.sf.jasperreports.engine.type.VerticalTextAlignEnum;
52 import net.sf.jasperreports.engine.util.ObjectUtils;
53
54
55 /**
56  * Text element information shared by multiple print text objects.
57  * 
58  * @author Teodor Danciu (teodord@users.sourceforge.net)
59  * @see JRTemplatePrintText
60  */

61 public class JRTemplateText extends JRTemplateElement implements JRTextAlignment, JRFont, JRCommonText, TextFormat
62 {
63
64
65     /**
66      *
67      */

68     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
69
70     /**
71      *
72      */

73     private HorizontalTextAlignEnum horizontalTextAlign;
74     private VerticalTextAlignEnum verticalTextAlign;
75     private RotationEnum rotationValue;
76     private String markup;
77     private String linkType;
78     private String linkTarget;
79
80     /**
81      *
82      */

83     protected JRLineBox lineBox;
84     protected JRParagraph paragraph;
85
86     protected String fontName;
87     protected Boolean isBold;
88     protected Boolean isItalic;
89     protected Boolean isUnderline;
90     protected Boolean isStrikeThrough;
91     protected Float fontsize;
92     protected String pdfFontName;
93     protected String pdfEncoding;
94     protected Boolean isPdfEmbedded;
95     protected String valueClassName;
96     protected String pattern;
97     protected String formatFactoryClass;
98     protected String localeCode;
99     protected String timeZoneId;
100     
101     
102     /**
103      *
104      */

105     protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRStaticText staticText)
106     {
107         super(origin, defaultStyleProvider);
108         
109         setStaticText(staticText);
110     }
111
112     /**
113      *
114      */

115     protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRTextField textField)
116     {
117         super(origin, defaultStyleProvider);
118         
119         setTextField(textField);
120     }
121
122
123     /**
124      * Creates a template text.
125      * 
126      * @param origin the origin of the elements that will use this template
127      * @param defaultStyleProvider the default style provider to use for
128      * this template
129      */

130     public JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
131     {
132         super(origin, defaultStyleProvider);
133         
134         lineBox = new JRBaseLineBox(this);
135         paragraph = new JRBaseParagraph(this);
136     }
137     
138     /**
139      *
140      */

141     protected void setStaticText(JRStaticText staticText)
142     {
143         setTextElement(staticText);
144     }
145
146     /**
147      *
148      */

149     protected void setTextField(JRTextField textField)
150     {
151         setTextElement(textField);
152
153         setLinkType(textField.getLinkType());
154         setLinkTarget(textField.getLinkTarget());
155     }
156
157     /**
158      *
159      */

160     protected void setTextElement(JRTextElement textElement)
161     {
162         super.setElement(textElement);
163         
164         fontName = textElement.getOwnFontName();
165         isBold = textElement.isOwnBold();
166         isItalic = textElement.isOwnItalic();
167         isUnderline = textElement.isOwnUnderline();
168         isStrikeThrough = textElement.isOwnStrikeThrough();
169         fontsize = textElement.getOwnFontsize();
170         pdfFontName = textElement.getOwnPdfFontName();
171         pdfEncoding = textElement.getOwnPdfEncoding();
172         isPdfEmbedded = textElement.isOwnPdfEmbedded();
173
174         horizontalTextAlign = textElement.getOwnHorizontalTextAlign();
175         verticalTextAlign = textElement.getOwnVerticalTextAlign();
176         rotationValue = textElement.getOwnRotationValue();
177         markup = textElement.getOwnMarkup();
178     }
179
180     public void setTextFormat(TextFormat textFormat)
181     {
182         if (textFormat != null)
183         {
184             setValueClassName(textFormat.getValueClassName());
185             setPattern(textFormat.getPattern());
186             setFormatFactoryClass(textFormat.getFormatFactoryClass());
187             setLocaleCode(textFormat.getLocaleCode());
188             setTimeZoneId(textFormat.getTimeZoneId());
189         }
190     }
191
192     /**
193      * Copies box attributes.
194      * 
195      * @param box the object to copy attributes from
196      */

197     public void copyLineBox(JRLineBox box)
198     {
199         lineBox = box.clone(this);
200     }
201
202     /**
203      * Copies paragraph attributes.
204      * 
205      * @param prg the object to copy attributes from
206      */

207     public void copyParagraph(JRParagraph prg)
208     {
209         paragraph = prg.clone(this);
210     }
211
212     
213     @Override
214     public ModeEnum getModeValue()
215     {
216         return getStyleResolver().getMode(this, ModeEnum.TRANSPARENT);
217     }
218         
219     @Override
220     public HorizontalTextAlignEnum getHorizontalTextAlign()
221     {
222         return getStyleResolver().getHorizontalTextAlign(this);
223     }
224         
225     @Override
226     public HorizontalTextAlignEnum getOwnHorizontalTextAlign()
227     {
228         return horizontalTextAlign;
229     }
230         
231     @Override
232     public void setHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign)
233     {
234         this.horizontalTextAlign = horizontalTextAlign;
235     }
236
237     @Override
238     public VerticalTextAlignEnum getVerticalTextAlign()
239     {
240         return getStyleResolver().getVerticalTextAlign(this);
241     }
242         
243     @Override
244     public VerticalTextAlignEnum getOwnVerticalTextAlign()
245     {
246         return verticalTextAlign;
247     }
248         
249     @Override
250     public void setVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign)
251     {
252         this.verticalTextAlign = verticalTextAlign;
253     }
254
255     @Override
256     public RotationEnum getRotationValue()
257     {
258         return getStyleResolver().getRotationValue(this);
259     }
260
261     @Override
262     public RotationEnum getOwnRotationValue()
263     {
264         return this.rotationValue;
265     }
266
267     /**
268      * Sets the text rotation.
269      * 
270      * @param rotationValue one of
271      *     <ul>
272      *         <li>{@link RotationEnum#NONE}</li>
273      *         <li>{@link RotationEnum#LEFT}</li>
274      *         <li>{@link RotationEnum#RIGHT}</li>
275      *         <li>{@link RotationEnum#UPSIDE_DOWN}</li>
276      *     </ul>
277      * values, or <code>null</code> if this template
278      * should not specify a rotation attribute of its own
279      */

280     @Override
281     public void setRotation(RotationEnum rotationValue)
282     {
283         this.rotationValue = rotationValue;
284     }
285
286     @Override
287     public String getMarkup()
288     {
289         return getStyleResolver().getMarkup(this);
290     }
291         
292     @Override
293     public String getOwnMarkup()
294     {
295         return markup;
296     }
297
298     /**
299      * Sets the text markup attribute.
300      * 
301      * @param markup the markup attribute
302      * @see #getMarkup()
303      */

304     @Override
305     public void setMarkup(String markup)
306     {
307         this.markup = markup;
308     }
309     
310     @Override
311     public JRLineBox getLineBox()
312     {
313         return lineBox;
314     }
315         
316     @Override
317     public JRParagraph getParagraph()
318     {
319         return paragraph;
320     }
321         
322     /**
323      * @deprecated
324      */

325     public JRFont getFont()
326     {
327         return this;
328     }
329
330     
331     /**
332      * Retrieves the hyperlink type for the element.
333      * <p>
334      * The actual hyperlink type is determined by {@link #getLinkType() getLinkType()}.
335      * This method can is used to determine whether the hyperlink type is one of the
336      * built-in types or a custom type. 
337 O     * When hyperlink is of custom type, {@link HyperlinkTypeEnum#CUSTOM CUSTOM} is returned.
338      * </p>
339      * @return one of the hyperlink type constants
340      * @see #getLinkType()
341      */

342     public HyperlinkTypeEnum getHyperlinkTypeValue()
343     {
344         return JRHyperlinkHelper.getHyperlinkTypeValue(getLinkType());
345     }
346
347     /**
348      * @deprecated
349      */

350     public byte getHyperlinkTarget()
351     {
352         return getHyperlinkTargetValue().getValue();
353     }
354     
355     /**
356      * Retrieves the hyperlink target name for the element.
357      * <p>
358      * The actual hyperlink target name is determined by {@link #getLinkTarget() getLinkTarget()}.
359      * This method is used to determine whether the hyperlink target name is one of the
360      * built-in names or a custom one. 
361      * When hyperlink target has a custom name, {@link HyperlinkTargetEnum#CUSTOM CUSTOM} is returned.
362      * </p>
363      * @return one of the hyperlink target name constants
364      * @see #getLinkTarget()
365      */

366     public HyperlinkTargetEnum getHyperlinkTargetValue()
367     {
368         return JRHyperlinkHelper.getHyperlinkTargetValue(getLinkTarget());
369     }
370     
371     @Override
372     public String getFontName()
373     {
374         return getStyleResolver().getFontName(this);
375     }
376
377     @Override
378     public String getOwnFontName()
379     {
380         return fontName;
381     }
382
383     @Override
384     public void setFontName(String fontName)
385     {
386         this.fontName = fontName;
387     }
388
389
390     @Override
391     public boolean isBold()
392     {
393         return getStyleResolver().isBold(this);
394     }
395
396     @Override
397     public Boolean isOwnBold()
398     {
399         return isBold;
400     }
401
402     /**
403      * @deprecated Replaced by {@link #setBold(Boolean)}.
404      */

405     @Override
406     public void setBold(boolean isBold)
407     {
408         setBold((Boolean)isBold);
409     }
410
411     /**
412      * Alternative setBold method which allows also to reset
413      * the "own" isBold property.
414      */

415     @Override
416     public void setBold(Boolean isBold)
417     {
418         this.isBold = isBold;
419     }
420
421
422     @Override
423     public boolean isItalic()
424     {
425         return getStyleResolver().isItalic(this);
426     }
427
428     @Override
429     public Boolean isOwnItalic()
430     {
431         return isItalic;
432     }
433
434     /**
435      * @deprecated Replaced by {@link #setItalic(Boolean)}.
436      */

437     @Override
438     public void setItalic(boolean isItalic)
439     {
440         setItalic((Boolean)isItalic);
441     }
442
443     /**
444      * Alternative setItalic method which allows also to reset
445      * the "own" isItalic property.
446      */

447     @Override
448     public void setItalic(Boolean isItalic)
449     {
450         this.isItalic = isItalic;
451     }
452
453     @Override
454     public boolean isUnderline()
455     {
456         return getStyleResolver().isUnderline(this);
457     }
458
459     @Override
460     public Boolean isOwnUnderline()
461     {
462         return isUnderline;
463     }
464
465     /**
466      * @deprecated Replaced by {@link #setUnderline(Boolean)}.
467      */

468     @Override
469     public void setUnderline(boolean isUnderline)
470     {
471         setUnderline((Boolean)isUnderline);
472     }
473
474     /**
475      * Alternative setUnderline method which allows also to reset
476      * the "own" isUnderline property.
477      */

478     @Override
479     public void setUnderline(Boolean isUnderline)
480     {
481         this.isUnderline = isUnderline;
482     }
483
484     @Override
485     public boolean isStrikeThrough()
486     {
487         return getStyleResolver().isStrikeThrough(this);
488     }
489
490     @Override
491     public Boolean isOwnStrikeThrough()
492     {
493         return isStrikeThrough;
494     }
495
496     /**
497      * @deprecated Replaced by {@link #setStrikeThrough(Boolean)}.
498      */

499     @Override
500     public void setStrikeThrough(boolean isStrikeThrough)
501     {
502         setStrikeThrough((Boolean)isStrikeThrough);
503     }
504
505     /**
506      * Alternative setStrikeThrough method which allows also to reset
507      * the "own" isStrikeThrough property.
508      */

509     @Override
510     public void setStrikeThrough(Boolean isStrikeThrough)
511     {
512         this.isStrikeThrough = isStrikeThrough;
513     }
514
515     @Override
516     public float getFontsize()
517     {
518         return getStyleResolver().getFontsize(this);
519     }
520
521     @Override
522     public Float getOwnFontsize()
523     {
524         return fontsize;
525     }
526
527     /**
528      * Method which allows also to reset the "own" size property.
529      */

530     @Override
531     public void setFontSize(Float fontSize)
532     {
533         this.fontsize = fontSize;
534     }
535
536     @Override
537     public String getPdfFontName()
538     {
539         return getStyleResolver().getPdfFontName(this);
540     }
541
542     @Override
543     public String getOwnPdfFontName()
544     {
545         return pdfFontName;
546     }
547
548     @Override
549     public void setPdfFontName(String pdfFontName)
550     {
551         this.pdfFontName = pdfFontName;
552     }
553
554
555     @Override
556     public String getPdfEncoding()
557     {
558         return getStyleResolver().getPdfEncoding(this);
559     }
560
561     @Override
562     public String getOwnPdfEncoding()
563     {
564         return pdfEncoding;
565     }
566
567     @Override
568     public void setPdfEncoding(String pdfEncoding)
569     {
570         this.pdfEncoding = pdfEncoding;
571     }
572
573
574     @Override
575     public boolean isPdfEmbedded()
576     {
577         return getStyleResolver().isPdfEmbedded(this);
578     }
579
580     @Override
581     public Boolean isOwnPdfEmbedded()
582     {
583         return isPdfEmbedded;
584     }
585
586     /**
587      * @deprecated Replaced by {@link #setPdfEmbedded(Boolean)}.
588      */

589     @Override
590     public void setPdfEmbedded(boolean isPdfEmbedded)
591     {
592         setPdfEmbedded((Boolean)isPdfEmbedded);
593     }
594
595     /**
596      * Alternative setPdfEmbedded method which allows also to reset
597      * the "own" isPdfEmbedded property.
598      */

599     @Override
600     public void setPdfEmbedded(Boolean isPdfEmbedded)
601     {
602         this.isPdfEmbedded = isPdfEmbedded;
603     }
604
605     @Override
606     public JRStyle getStyle()
607     {
608         return parentStyle;
609     }
610
611     
612     @Override
613     public String getPattern()
614     {
615         return pattern;
616     }
617
618     
619     public void setPattern(String pattern)
620     {
621         this.pattern = pattern;
622     }
623
624     
625     @Override
626     public String getValueClassName()
627     {
628         return valueClassName;
629     }
630
631     
632     public void setValueClassName(String valueClassName)
633     {
634         this.valueClassName = valueClassName;
635     }
636
637     
638     @Override
639     public String getFormatFactoryClass()
640     {
641         return formatFactoryClass;
642     }
643
644     
645     public void setFormatFactoryClass(String formatFactoryClass)
646     {
647         this.formatFactoryClass = formatFactoryClass;
648     }
649
650     
651     @Override
652     public String getLocaleCode()
653     {
654         return localeCode;
655     }
656
657     
658     public void setLocaleCode(String localeCode)
659     {
660         this.localeCode = localeCode;
661     }
662
663     
664     @Override
665     public String getTimeZoneId()
666     {
667         return timeZoneId;
668     }
669
670     
671     public void setTimeZoneId(String timeZoneId)
672     {
673         this.timeZoneId = timeZoneId;
674     }
675
676     
677     /**
678      * Returns the hyperlink type.
679      * <p>
680      * The type can be one of the built-in types
681      * (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage),
682      * or can be an arbitrary type.
683      * </p>
684      * @return the hyperlink type
685      */

686     public String getLinkType()
687     {
688         return linkType;
689     }
690
691
692     /**
693      * Sets the hyperlink type.
694      * <p>
695      * The type can be one of the built-in types
696      * (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage),
697      * or can be an arbitrary type.
698      * </p>
699      * @param linkType the hyperlink type
700      */

701     public void setLinkType(String linkType)
702     {
703         this.linkType = linkType;
704     }
705     
706     /**
707      *
708      */

709     protected void setLinkTarget(String linkTarget)
710     {
711         this.linkTarget = linkTarget;
712     }
713
714     
715     /**
716      * Returns the hyperlink target name.
717      * <p>
718      * The target name can be one of the built-in names
719      * (Self, Blank, Top, Parent),
720      * or can be an arbitrary name.
721      * </p>
722      * @return the hyperlink type
723      */

724     public String getLinkTarget()
725     {
726         return linkTarget;
727     }
728
729
730     @Override
731     public Color getDefaultLineColor() 
732     {
733         return getForecolor();
734     }
735     
736
737     /*
738      * These fields are only for serialization backward compatibility.
739      */

740     private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID; //NOPMD
741     /**
742      * @deprecated
743      */

744     private Byte horizontalAlignment;
745     /**
746      * @deprecated
747      */

748     private Byte verticalAlignment;
749     /**
750      * @deprecated
751      */

752     private net.sf.jasperreports.engine.type.HorizontalAlignEnum horizontalAlignmentValue;
753     /**
754      * @deprecated
755      */

756     private net.sf.jasperreports.engine.type.VerticalAlignEnum verticalAlignmentValue;
757     /**
758      * @deprecated
759      */

760     private Byte rotation;
761     /**
762      * @deprecated
763      */

764     private Byte lineSpacing;
765     /**
766      * @deprecated
767      */

768     private LineSpacingEnum lineSpacingValue;
769     /**
770      * @deprecated
771      */

772     private Boolean isStyledText;
773     /**
774      * @deprecated
775      */

776     private byte hyperlinkType;
777     /**
778      * @deprecated
779      */

780     private byte hyperlinkTarget;
781     /**
782      * @deprecated
783      */

784     private Integer fontSize;
785     
786     @SuppressWarnings("deprecation")
787     private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
788     {
789         in.defaultReadObject();
790
791         if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
792         {
793             horizontalAlignmentValue = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getByValue(horizontalAlignment);
794             verticalAlignmentValue = net.sf.jasperreports.engine.type.VerticalAlignEnum.getByValue(verticalAlignment);
795             rotationValue = RotationEnum.getByValue(rotation);
796             lineSpacingValue = LineSpacingEnum.getByValue(lineSpacing);
797
798             horizontalAlignment = null;
799             verticalAlignment = null;
800             rotation = null;
801             lineSpacing = null;
802         }
803
804         if (isStyledText != null)
805         {
806             markup = isStyledText ? JRCommonText.MARKUP_STYLED_TEXT : JRCommonText.MARKUP_NONE;
807             isStyledText = null;
808         }
809
810         if (linkType == null)
811         {
812              linkType = JRHyperlinkHelper.getLinkType(HyperlinkTypeEnum.getByValue(hyperlinkType));
813         }
814
815         if (linkTarget == null)
816         {
817              linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget));
818         }
819
820         if (paragraph == null)
821         {
822             paragraph = new JRBaseParagraph(this);
823             paragraph.setLineSpacing(lineSpacingValue);
824             lineSpacingValue = null;
825         }
826
827         if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_5_5_2)
828         {
829             fontsize = fontSize == null ? null : fontSize.floatValue();
830
831             fontSize = null;
832         }
833
834         if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2)
835         {
836             horizontalTextAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalTextAlignEnum(horizontalAlignmentValue);
837             verticalTextAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalTextAlignEnum(verticalAlignmentValue);
838
839             horizontalAlignmentValue = null;
840             verticalAlignmentValue = null;
841         }
842     }
843
844     @Override
845     public int getHashCode()
846     {
847         ObjectUtils.HashCode hash = ObjectUtils.hash();
848         addTemplateHash(hash);
849         hash.add(horizontalTextAlign);
850         hash.add(verticalTextAlign);
851         hash.add(rotationValue);
852         hash.add(markup);
853         hash.add(linkType);
854         hash.add(linkTarget);
855         hash.addIdentical(lineBox);
856         hash.addIdentical(paragraph);
857         hash.add(fontName);
858         hash.add(isBold);
859         hash.add(isItalic);
860         hash.add(isUnderline);
861         hash.add(isStrikeThrough);
862         hash.add(fontsize);
863         hash.add(pdfFontName);
864         hash.add(pdfEncoding);
865         hash.add(isPdfEmbedded);
866         hash.add(valueClassName);
867         hash.add(pattern);
868         hash.add(formatFactoryClass);
869         hash.add(localeCode);
870         hash.add(timeZoneId);
871         return hash.getHashCode();
872     }
873
874     @Override
875     public boolean isIdentical(Object object)
876     {
877         if (this == object)
878         {
879             return true;
880         }
881         
882         if (!(object instanceof JRTemplateText))
883         {
884             return false;
885         }
886         
887         JRTemplateText template = (JRTemplateText) object;
888         return templateIdentical(template)
889                 && ObjectUtils.equals(horizontalTextAlign, template.horizontalTextAlign)
890                 && ObjectUtils.equals(verticalTextAlign, template.verticalTextAlign)
891                 && ObjectUtils.equals(rotationValue, template.rotationValue)
892                 && ObjectUtils.equals(markup, template.markup)
893                 && ObjectUtils.equals(linkType, template.linkType)
894                 && ObjectUtils.equals(linkTarget, template.linkTarget)
895                 && ObjectUtils.identical(lineBox, template.lineBox)
896                 && ObjectUtils.identical(paragraph, template.paragraph)
897                 && ObjectUtils.equals(fontName, template.fontName)
898                 && ObjectUtils.equals(isBold, template.isBold)
899                 && ObjectUtils.equals(isItalic, template.isItalic)
900                 && ObjectUtils.equals(isUnderline, template.isUnderline)
901                 && ObjectUtils.equals(isStrikeThrough, template.isStrikeThrough)
902                 && ObjectUtils.equals(fontsize, template.fontsize)
903                 && ObjectUtils.equals(pdfFontName, template.pdfFontName)
904                 && ObjectUtils.equals(pdfEncoding, template.pdfEncoding)
905                 && ObjectUtils.equals(isPdfEmbedded, template.isPdfEmbedded)
906                 && ObjectUtils.equals(valueClassName, template.valueClassName)
907                 && ObjectUtils.equals(pattern, template.pattern)
908                 && ObjectUtils.equals(formatFactoryClass, template.formatFactoryClass)
909                 && ObjectUtils.equals(localeCode, template.localeCode)
910                 && ObjectUtils.equals(timeZoneId, template.timeZoneId);
911     }
912 }
913