Package gov.nasa.worldwind.util.xml
Class XMLParserNotification
- java.lang.Object
-
- java.util.EventObject
-
- java.beans.PropertyChangeEvent
-
- gov.nasa.worldwind.util.xml.XMLParserNotification
-
- All Implemented Interfaces:
java.io.Serializable
public class XMLParserNotification extends java.beans.PropertyChangeEvent
This class identifies the type and data content of notifications from parsers and parser contexts. Notifications are sent to inform of important occurrences that occur during parsing, such as exceptions and unrecognized element types.
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.xml.stream.events.XMLEvent
event
TheXMLEvent
associated with the notification, if any.protected java.lang.Exception
exception
For exception notifications, the exception that occurred.static java.lang.String
EXCEPTION
A notification type indicating that an exception occurred during parsing.protected java.lang.String
message
The message sent from the object sending the notification.protected java.lang.Object
notificationSource
The object initiating the notification.protected java.lang.String
notificationType
Indicates the cause of the notification.static java.lang.String
UNRECOGNIZED
A notification type indicating that a parser encounter an element it did not recognize.
-
Constructor Summary
Constructors Constructor Description XMLParserNotification(java.lang.Object source, java.lang.String notificationType, javax.xml.stream.events.XMLEvent event, java.lang.String msg, java.lang.Object oldValue, java.lang.Object newValue)
Construct a notification object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.xml.stream.events.XMLEvent
getEvent()
Return the event associated with the notification, if any.java.lang.Exception
getException()
Return the exception associated with an exception notification.java.lang.String
getMessage()
The message associated with the exception, suitable for writing to a log.java.lang.String
getNotificationType()
The notification type.java.lang.Object
getSource()
Return the object initiating the notification.void
setSource(java.lang.Object notificationSource)
Respecifies the notification source.java.lang.String
toString()
-
-
-
Field Detail
-
EXCEPTION
public static final java.lang.String EXCEPTION
A notification type indicating that an exception occurred during parsing.- See Also:
- Constant Field Values
-
UNRECOGNIZED
public static final java.lang.String UNRECOGNIZED
A notification type indicating that a parser encounter an element it did not recognize.- See Also:
- Constant Field Values
-
notificationType
protected final java.lang.String notificationType
Indicates the cause of the notification.
-
message
protected final java.lang.String message
The message sent from the object sending the notification.
-
event
protected final javax.xml.stream.events.XMLEvent event
TheXMLEvent
associated with the notification, if any.
-
exception
protected java.lang.Exception exception
For exception notifications, the exception that occurred.
-
notificationSource
protected java.lang.Object notificationSource
The object initiating the notification.
-
-
Constructor Detail
-
XMLParserNotification
public XMLParserNotification(java.lang.Object source, java.lang.String notificationType, javax.xml.stream.events.XMLEvent event, java.lang.String msg, java.lang.Object oldValue, java.lang.Object newValue)
Construct a notification object.- Parameters:
source
- the object initiating the notification.notificationType
- the notification type, such asEXCEPTION
orUNRECOGNIZED
.event
- if an event is associated with the notification, that event. May be null.msg
- a message from the notification source suitable for logging.oldValue
- any old value associated with the notification. Not typically used.newValue
- any new value associated with the notification. if this is an exception notification, the exception that occurred is passed via this parameter. May be null.
-
-
Method Detail
-
getEvent
public javax.xml.stream.events.XMLEvent getEvent()
Return the event associated with the notification, if any.- Returns:
- the event associated with the exception.
-
getMessage
public java.lang.String getMessage()
The message associated with the exception, suitable for writing to a log.- Returns:
- the message associated with the exception.
-
getNotificationType
public java.lang.String getNotificationType()
The notification type.- Returns:
- the notification type.
- See Also:
EXCEPTION
,UNRECOGNIZED
-
getException
public java.lang.Exception getException()
Return the exception associated with an exception notification.- Returns:
- the associated exception, or null if this is not an exception notification.
-
getSource
public java.lang.Object getSource()
Return the object initiating the notification.- Overrides:
getSource
in classjava.util.EventObject
- Returns:
- the object initiating the exception.
-
setSource
public void setSource(java.lang.Object notificationSource)
Respecifies the notification source. Used to forward the notification so that it appears to be from the new source.- Parameters:
notificationSource
- the source to assign the exception.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.beans.PropertyChangeEvent
-
-