NASA World Wind

gov.nasa.worldwind.util.xml
Class XMLParserNotification

java.lang.Object
  extended by java.util.EventObject
      extended by java.beans.PropertyChangeEvent
          extended by gov.nasa.worldwind.util.xml.XMLParserNotification
All Implemented Interfaces:
Serializable

public class XMLParserNotification
extends 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.

See Also:
XMLEventParserContext.setNotificationListener(XMLParserNotificationListener), XMLParserNotificationListener, Serialized Form

Field Summary
protected  XMLEvent event
          The XMLEvent associated with the notification, if any.
protected  Exception exception
          For exception notifications, the exception that occurred.
static String EXCEPTION
          A notification type indicating that an exception occurred during parsing.
protected  String message
          The message sent from the object sending the notification.
protected  Object notificationSource
          The object initiating the notification.
protected  String notificationType
          Indicates the cause of the notification.
static String UNRECOGNIZED
          A notification type indicating that a parser encounter an element it did not recognize.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
XMLParserNotification(Object source, String notificationType, XMLEvent event, String msg, Object oldValue, Object newValue)
          Construct a notification object.
 
Method Summary
 XMLEvent getEvent()
          Return the event associated with the notification, if any.
 Exception getException()
          Return the exception associated with an exception notification.
 String getMessage()
          The message associated with the exception, suitable for writing to a log.
 String getNotificationType()
          The notification type.
 Object getSource()
          Return the object initiating the notification.
 void setSource(Object notificationSource)
          Respecifies the notification source.
 String toString()
           
 
Methods inherited from class java.beans.PropertyChangeEvent
getNewValue, getOldValue, getPropagationId, getPropertyName, setPropagationId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

event

protected final XMLEvent event
The XMLEvent associated with the notification, if any.


exception

protected Exception exception
For exception notifications, the exception that occurred.


EXCEPTION

public static final String EXCEPTION
A notification type indicating that an exception occurred during parsing.

See Also:
Constant Field Values

message

protected final String message
The message sent from the object sending the notification.


notificationSource

protected Object notificationSource
The object initiating the notification.


notificationType

protected final String notificationType
Indicates the cause of the notification.


UNRECOGNIZED

public static final String UNRECOGNIZED
A notification type indicating that a parser encounter an element it did not recognize.

See Also:
Constant Field Values
Constructor Detail

XMLParserNotification

public XMLParserNotification(Object source,
                             String notificationType,
                             XMLEvent event,
                             String msg,
                             Object oldValue,
                             Object newValue)
Construct a notification object.

Parameters:
source - the object initiating the notification.
notificationType - the notification type, such as EXCEPTION or UNRECOGNIZED.
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 XMLEvent getEvent()
Return the event associated with the notification, if any.

Returns:
the event associated with the exception.

getException

public Exception getException()
Return the exception associated with an exception notification.

Returns:
the associated exception, or null if this is not an exception notification.

getMessage

public String getMessage()
The message associated with the exception, suitable for writing to a log.

Returns:
the message associated with the exception.

getNotificationType

public String getNotificationType()
The notification type.

Returns:
the notification type.
See Also:
EXCEPTION, UNRECOGNIZED

getSource

public Object getSource()
Return the object initiating the notification.

Overrides:
getSource in class EventObject
Returns:
the object initiating the exception.

setSource

public void setSource(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 String toString()
Overrides:
toString in class EventObject

NASA World Wind