|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PackageInstance
Interface implemented by programs that share data with other programs and that want to register for downloaded content based on mime type.
Method Summary | |
---|---|
void |
createPage(Object data,
List metadata,
PageChangeListener listener)
Create a page with the given data, typically called when downloaded web content matches a specified mimeType in a package's ppld file. |
List |
findPages(String type,
String expression)
Return the set of objects described by the type and expression. |
List |
getTypes()
List the types of pages the program supports (eg artist/song/album for Music Library). |
Method Detail |
---|
List getTypes()
List findPages(String type, String expression)
Implementations should always return copies of objects so that the caller can't accidentally corrupt the original data.
Example:
In Music Library, expression
is an XPath fragment to select
JDOM Element
s on the page described by type
,
and the function returns a list of JDOM Element
s.
type
- Type of page to search for. Must be one of the values
returned by PackageInstance.getTypes()
.expression
- Expression to narrow down searches; format is
program-specific.
void createPage(Object data, List metadata, PageChangeListener listener) throws Exception
data
, File and InputStream will be most common.
Additional information can be added to metadata
, which is a
list of NameValue objects.
Example:
In Music Library, data
is a File
to be added
to the library.
data
- Data to create the page with.metadata
- NameValue
pairs providing additional
information about data
, such as referrer URL.listener
- The listener that should be notified when the pageCreation
finishes or an error occurs
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |