public interface Marshal
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType()
Returns the content type of the marshaled data.
|
int |
getPriorityLevel()
Returns the priority level of the marshal.
|
java.lang.String |
marshal(java.io.InputStream inputStream,
int probeSize)
Analyzes the specified stream to determine if it contains the content associated with this
Marshal . |
java.lang.String |
marshal(android.net.Uri uri)
Analyzes the data at the specified
Uri to determine if it contains the content
associated with this Marshal . |
java.lang.String getContentType()
java.lang.String marshal(java.io.InputStream inputStream, int probeSize) throws java.io.IOException
Marshal
. If the stream does contain compatible content, the MIME type of the
stream is returned, otherwise null
is returned.
Only the number of bytes specified by probeSize
may be read from the stream
during analysis.
inputStream
- A data streamprobeSize
- The number of bytes that may be read from the streamnull
otherwise.java.io.IOException
- If an IO error occurs while reading data from the streamjava.lang.String marshal(android.net.Uri uri) throws java.io.IOException
Uri
to determine if it contains the content
associated with this Marshal
. If the Uri
does contain compatible
content, the MIME type of the Uri
is returned, otherwise null
is
returned.uri
- A URInull
otherwise.java.io.IOException
- If an IO error occurs while reading data from the URIint getPriorityLevel()
MarshalManager
prior to marshals with lower priority levels.
The recommendation is that the priority level should increase when the content is
identifiable through an increase in specificity for the data stream. For example, a
Marshal
that detects a stream as XML should return a priority level of
0
. A Marshal
that detects CoT should return a level of
1
and a Marshal
that detects KML should return a level of
1
as both are direct derivatives of XML. A Marshal
that detects a
specific type of CoT should return a level of 2
to ensure it gets invoked prior
to a generic CoT Marshal
.