|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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.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. |
| Constructor Summary | |
|---|---|
JdkGlyphFixTextMeasurer(JRCommonText textElement)
Create a text measurer for a text element. |
|
| 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, getTextPropertiesHolder, getTruncateSuffix, initialize, isToTruncateAtChar, 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(JRCommonText textElement)
textElement - the text element| 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 JRTextMeasurermeasure in class TextMeasurerstyledText - 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 | |||||||||