com.spss.psapi.core

Interface ContentProvider



  • public interface ContentProvider
    Stores and retrieves content for an application. Content is identified using tags defined by the application. It is the application's responsibility to ensure that tags are unique, and a class-like naming schme is recommended, e.g. x.y.z....
    Since:
    PSAPI 13.0
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Object getContent(java.lang.String tag)
      Returns the content identified by the specified tag or null if the tag is unknown to this provider.
      byte[] getContentAsBinary(java.lang.String tag)
      Returns the binary content identified by the specified tag or null if the tag is unknown to this provider or the content does not have binary format.
      java.lang.String getContentAsUTF8(java.lang.String tag)
      Returns the string content identified by the specified tag or null if the tag is unknown to this provider or the content does not have string format.
      ContentFormat getContentFormat(java.lang.String tag)
      Returns the format of the content identfied by the specified tag or null if the tag is unknown to this provider.
      java.util.Iterator getContentTagIterator()
      Returns an iterator over the content tags known to this provider.
      boolean isContentCurrent(java.lang.String tag)
      Returns true if the specified content is considered current (up-to-date) with respect to its context, e.g. its containing stream.
      void putContent(java.lang.String tag, ContentFormat format, java.lang.Object content)
      Stores content in this provider with the specified tag and format.
      void putContentAsBinary(java.lang.String tag, byte[] content)
      Stores binary content in this provider under the specified tag.
      void putContentAsUTF8(java.lang.String tag, java.lang.String content)
      Stores string content in this provider under the specified tag.
      void removeContent(java.lang.String tag)
      Removes any content stored by this provider under the specified tag.
    • Method Detail

      • getContentTagIterator

        java.util.Iterator getContentTagIterator()
        Returns an iterator over the content tags known to this provider.
        Returns:
        an iterator over the content tags
      • getContentFormat

        ContentFormat getContentFormat(java.lang.String tag)
        Returns the format of the content identfied by the specified tag or null if the tag is unknown to this provider. The format determines the content type.
        Parameters:
        tag - the content tag
        Returns:
        the corresponding content format
      • getContent

        java.lang.Object getContent(java.lang.String tag)
        Returns the content identified by the specified tag or null if the tag is unknown to this provider. The type of the result is determined by the content format.
        Parameters:
        tag - the content tag
        Returns:
        the corresponding content
      • getContentAsUTF8

        java.lang.String getContentAsUTF8(java.lang.String tag)
        Returns the string content identified by the specified tag or null if the tag is unknown to this provider or the content does not have string format.
        Parameters:
        tag - the content tag
        Returns:
        the corresponding string content
      • getContentAsBinary

        byte[] getContentAsBinary(java.lang.String tag)
        Returns the binary content identified by the specified tag or null if the tag is unknown to this provider or the content does not have binary format.
        Parameters:
        tag - the content tag
        Returns:
        the corresponding binary content
      • putContent

        void putContent(java.lang.String tag,
                      ContentFormat format,
                      java.lang.Object content)
        Stores content in this provider with the specified tag and format. The content must not be null and its type must be compatible with the format. Any existing content with the same tag is replaced.
        Parameters:
        tag - the content tag
        format - the content format
        content - the content
      • putContentAsUTF8

        void putContentAsUTF8(java.lang.String tag,
                            java.lang.String content)
        Stores string content in this provider under the specified tag. The content must not be null.
        Parameters:
        tag - the content tag
        content - the content
      • putContentAsBinary

        void putContentAsBinary(java.lang.String tag,
                              byte[] content)
        Stores binary content in this provider under the specified tag. The content must not be null.
        Parameters:
        tag - the content tag
        content - the content
      • removeContent

        void removeContent(java.lang.String tag)
        Removes any content stored by this provider under the specified tag.
        Parameters:
        tag - the content tag
      • isContentCurrent

        boolean isContentCurrent(java.lang.String tag)
        Returns true if the specified content is considered current (up-to-date) with respect to its context, e.g. its containing stream. Returns false if the content tag is unknown to this provider, or as a hint that the content may be stale.
        Parameters:
        tag - the content tag
        Returns:
        true if the content is considered to be up to date

(C) Copyright IBM Corp. 1994, 2015. All Rights Reserved.