public abstract class AbstractCotEventImporter extends AbstractImporter implements CotEventImporter
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<java.lang.String> |
crcBlacklist |
protected java.util.Set<java.lang.String> |
supportedMimeTypes |
static java.lang.String |
TAG |
contentType
Modifier | Constructor and Description |
---|---|
protected |
AbstractCotEventImporter(android.content.Context context,
java.lang.String contentType) |
Modifier and Type | Method and Description |
---|---|
protected void |
crcDetails(CotDetail root,
java.util.zip.CRC32 crc)
Generate a CRC32 for a CoT details node
|
java.util.Set<java.lang.String> |
getSupportedMIMETypes()
Returns the set of mime types supported by this importer.
|
abstract CommsMapComponent.ImportResult |
importData(CotEvent cot,
android.os.Bundle bundle) |
static CommsMapComponent.ImportResult |
importData(Importer importer,
CotEvent event,
android.os.Bundle bundle) |
CommsMapComponent.ImportResult |
importData(java.io.InputStream source,
java.lang.String mime,
android.os.Bundle bundle)
The method used to import the data
|
CommsMapComponent.ImportResult |
importData(android.net.Uri uri,
java.lang.String mime,
android.os.Bundle bundle)
The method used to import the data
|
protected abstract CommsMapComponent.ImportResult |
importNonCotData(java.io.InputStream source,
java.lang.String mime) |
protected int |
parseColor(java.lang.String value,
int defaultColor)
Convert a string to a color (exception color)
String may be in hex format or the color name (i.e.
|
protected double |
parseDouble(java.lang.String value,
double defaultVal)
Convert a string to a double (exceptions caught)
|
protected int |
parseInt(java.lang.String value,
int defaultVal)
Convert a string to an integer (exceptions caught)
|
deleteData, getContentType, importUriAsStream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deleteData, getContentType
public static final java.lang.String TAG
protected final java.util.Set<java.lang.String> supportedMimeTypes
protected final java.util.Set<java.lang.String> crcBlacklist
protected AbstractCotEventImporter(android.content.Context context, java.lang.String contentType)
public abstract CommsMapComponent.ImportResult importData(CotEvent cot, android.os.Bundle bundle)
importData
in interface CotEventImporter
protected abstract CommsMapComponent.ImportResult importNonCotData(java.io.InputStream source, java.lang.String mime) throws java.io.IOException
java.io.IOException
public java.util.Set<java.lang.String> getSupportedMIMETypes()
Importer
getSupportedMIMETypes
in interface Importer
public CommsMapComponent.ImportResult importData(java.io.InputStream source, java.lang.String mime, android.os.Bundle bundle) throws java.io.IOException
Importer
importData
in interface Importer
source
- the input stream to use when importingmime
- the mime type for the input streambundle
- the bundle that would have additional information concerning
the importjava.io.IOException
- if there is an error during importpublic CommsMapComponent.ImportResult importData(android.net.Uri uri, java.lang.String mime, android.os.Bundle bundle) throws java.io.IOException
Importer
importData
in interface Importer
uri
- the uri to use when importingmime
- the mime type for the input streambundle
- the bundle that would have additional information concerning
the importjava.io.IOException
- if there is an error during importpublic static CommsMapComponent.ImportResult importData(Importer importer, CotEvent event, android.os.Bundle bundle) throws java.io.IOException
java.io.IOException
protected double parseDouble(java.lang.String value, double defaultVal)
value
- String valuedefaultVal
- Default value if conversion failsprotected int parseInt(java.lang.String value, int defaultVal)
value
- String valuedefaultVal
- Default value if conversion failsprotected int parseColor(java.lang.String value, int defaultColor)
value
- String valuedefaultColor
- Default color if conversion failsprotected void crcDetails(CotDetail root, java.util.zip.CRC32 crc)
root
- Root detail nodecrc
- CRC32 instance