public class AbstractXSLProcessingStage.StatusInfoAppendingErrorListener extends Object implements ErrorListener
Transformer ErrorListener that sets an ErrorStatus or WarningStatus on its
Item depending on the TransformerException message. If the message begins with
"[ERROR]" the remainder of the error message is used as the message for the added
ErrorStatus. If the message begins with "[WARN]" the remainder of the error message is used
as the message for the added WarningStatus. If the message begins with "[INFO]" the
remainder of the error message is used as the message for the added InfoStatus. If the message does not
begin with either prefix the exception is re-thrown to be handed by the Transformer.
This listener works well in conjunction with <xsl:message>| Modifier and Type | Field and Description |
|---|---|
static String |
ERROR_PREFIX
Prefix used by messages that result in an
ErrorStatus. |
static String |
INFO_PREFIX
Prefix used by messages that result in an
InfoStatus. |
private Item<?> |
item
Item to which the status info will be appended.
|
static String |
WARN_PREFIX
Prefix used by messages that result in an
WarningStatus. |
| Constructor and Description |
|---|
AbstractXSLProcessingStage.StatusInfoAppendingErrorListener(Item<?> receivingItem)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
error(TransformerException e) |
void |
fatalError(TransformerException e) |
private void |
parseAndAppendStatusInfo(TransformerException e)
Parses the error message and appends the appropriate status info to the Item.
|
void |
warning(TransformerException e) |
public static final String ERROR_PREFIX
ErrorStatus.public static final String WARN_PREFIX
WarningStatus.public static final String INFO_PREFIX
InfoStatus.private Item<?> item
public void error(@Nonnull TransformerException e) throws TransformerException
error in interface ErrorListenerTransformerExceptionpublic void fatalError(@Nonnull TransformerException e) throws TransformerException
fatalError in interface ErrorListenerTransformerExceptionpublic void warning(@Nonnull TransformerException e) throws TransformerException
warning in interface ErrorListenerTransformerExceptionprivate void parseAndAppendStatusInfo(@Nonnull TransformerException e) throws TransformerException
e - the error to parseTransformerException - thrown if the error does not contain the appropriate message prefixCopyright © 1999–2016. All rights reserved.