|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jasperreports.engine.fill.TextMeasurer net.sf.jasperreports.engine.util.JdkGlyphFixTextMeasurer
public class JdkGlyphFixTextMeasurer
A text measurer implementation that extends
the default text measurer
and adds a workaround for
Sun JDK bug 6367148/
6611637.
The workaround consists of simply reattempting the text measuring when
a java.lang.NullPointer
exception is thrown from
sun.font.GlyphLayout
.
JdkGlyphFixTextMeasurerFactory
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.fill.TextMeasurer |
---|
TextMeasurer.FontInfo, TextMeasurer.FontKey, TextMeasurer.TextMeasuredState |
Field Summary | |
---|---|
static int |
DEFAULT_ATTEMPT_SLEEP
The default between attempts sleep time. |
static int |
DEFAULT_ATTEMPTS
The default attempt count. |
protected static java.lang.String |
JDK_EXCEPTION_CLASS_PREFIX
|
static java.lang.String |
PROPERTY_ATTEMPT_SLEEP
A property that specifies the number of milliseconds to sleep between measuring reattempts. |
static java.lang.String |
PROPERTY_ATTEMPTS
A property that specifies the number of times the measurer should attempt to measure a single text element before giving up. |
static java.lang.String |
PROPERTY_CATCH_EMPTY_STACKTRACE
Whether java.lang.NullPointer exceptions with empty stacktraces
should be caught. |
Fields inherited from class net.sf.jasperreports.engine.fill.TextMeasurer |
---|
jasperReportsContext, leftPadding, maxHeight, measuredState, prevMeasuredState, PROPERTY_MEASURE_SIMPLE_TEXTS, rightPadding, textElement, width |
Constructor Summary | |
---|---|
JdkGlyphFixTextMeasurer(JasperReportsContext jasperReportsContext,
JRCommonText textElement)
Create a text measurer for a text element. |
|
JdkGlyphFixTextMeasurer(JRCommonText textElement)
Deprecated. Replaced by JdkGlyphFixTextMeasurer(JasperReportsContext, JRCommonText) . |
Method Summary | |
---|---|
protected boolean |
isJdkGlyphError(java.lang.NullPointerException e)
|
JRMeasuredText |
measure(JRStyledText styledText,
int remainingTextStart,
int availableStretchHeight,
boolean canOverflow)
Calls super.measure , catches
sun.font.GlyphLayout NPEs and reattempts the call. |
Methods inherited from class net.sf.jasperreports.engine.fill.TextMeasurer |
---|
appendTruncateSuffix, getFontRenderContext, getTextPropertiesHolder, getTruncateSuffix, hasParagraphIndents, initialize, isLeftToRight, isToTruncateAtChar, measureSimpleText, processLastTruncatedRow, renderNextLine, renderParagraph, setAttributes, setAttributes, truncateLastLineAtChar |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String JDK_EXCEPTION_CLASS_PREFIX
public static final int DEFAULT_ATTEMPTS
public static final int DEFAULT_ATTEMPT_SLEEP
public static final java.lang.String PROPERTY_ATTEMPTS
DEFAULT_ATTEMPTS
,
Constant Field Valuespublic static final java.lang.String PROPERTY_ATTEMPT_SLEEP
DEFAULT_ATTEMPT_SLEEP
,
Constant Field Valuespublic static final java.lang.String PROPERTY_CATCH_EMPTY_STACKTRACE
java.lang.NullPointer
exceptions with empty stacktraces
should be caught.
This is useful when running on a Sun server JVM (java -server), which might omit
exception stacktraces in some cases.
Constructor Detail |
---|
public JdkGlyphFixTextMeasurer(JasperReportsContext jasperReportsContext, JRCommonText textElement)
textElement
- the text elementpublic JdkGlyphFixTextMeasurer(JRCommonText textElement)
JdkGlyphFixTextMeasurer(JasperReportsContext, JRCommonText)
.
Method Detail |
---|
public JRMeasuredText measure(JRStyledText styledText, int remainingTextStart, int availableStretchHeight, boolean canOverflow)
super.measure
, catches
sun.font.GlyphLayout
NPEs and reattempts the call.
measure
in interface JRTextMeasurer
measure
in class TextMeasurer
styledText
- the full textremainingTextStart
- the start index of the remaining textavailableStretchHeight
- the available stretch heightcanOverflow
- whether the text element is able to overflow
protected boolean isJdkGlyphError(java.lang.NullPointerException e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |