ezvcard.io.text
Interface VCardRawReader.VCardDataStreamListener

Enclosing class:
VCardRawReader

public static interface VCardRawReader.VCardDataStreamListener

Handles the vCard data as it is read off the data stream. Each one of this interface's methods may throw a VCardRawReader.StopReadingException at any time to force the parser to stop reading from the data stream. This will cause the reader to return from the VCardRawReader.start(ezvcard.io.text.VCardRawReader.VCardDataStreamListener) method. To continue reading from the data stream, simply call the VCardRawReader.start(ezvcard.io.text.VCardRawReader.VCardDataStreamListener) method again.

Author:
Michael Angstadt

Method Summary
 void beginComponent(String name)
          Called when a component begins (when a "BEGIN:NAME" property is reached).
 void endComponent(String name)
          Called when a component ends (when a "END:NAME" property is reached).
 void invalidLine(String line)
          Called when a line cannot be parsed.
 void invalidVersion(String version)
          Called when an invalid VERSION property is encountered.
 void readProperty(String group, String name, VCardParameters parameters, String value)
          Called when a property is read.
 void readVersion(VCardVersion version)
          Called when the vCard's VERSION property is read.
 

Method Detail

beginComponent

void beginComponent(String name)
Called when a component begins (when a "BEGIN:NAME" property is reached).

Parameters:
name - the component name (e.g. "VCARD")
Throws:
VCardRawReader.StopReadingException - to force the reader to stop reading from the data stream

readProperty

void readProperty(String group,
                  String name,
                  VCardParameters parameters,
                  String value)
Called when a property is read.

Parameters:
group - the group name or null if no group was defined
name - the property name (e.g. "VERSION")
parameters - the parameters
value - the property value
Throws:
VCardRawReader.StopReadingException - to force the reader to stop reading from the data stream

readVersion

void readVersion(VCardVersion version)
Called when the vCard's VERSION property is read.

Parameters:
version - the version that was read

endComponent

void endComponent(String name)
Called when a component ends (when a "END:NAME" property is reached).

Parameters:
name - the component name (e.g. "VCARD")
Throws:
VCardRawReader.StopReadingException - to force the reader to stop reading from the data stream

invalidLine

void invalidLine(String line)
Called when a line cannot be parsed.

Parameters:
line - the unparseable line
Throws:
VCardRawReader.StopReadingException - to force the reader to stop reading from the data stream

invalidVersion

void invalidVersion(String version)
Called when an invalid VERSION property is encountered.

Parameters:
version - the invalid version


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.