com.spss.psapi.core

Interface ContentContainer

  • All Known Subinterfaces:
    DocumentContainer, ModelContainer, RowSetContainer


    public interface ContentContainer
    Defines the functionality associated with a content container. A content container is used to hold objects (typically generated as a result of executing a stream) which are stored as part of a node or output object.
    Since:
    PSAPI 2.0
    Version:
    1.0
    Author:
    Julian Clinton
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Object getContent()
      Returns the content.
      byte[] getContentAsBinary()
      Returns the binary content if the content format is ContentFormat.BINARY or null otherwise.
      java.lang.String getContentAsUTF8()
      Returns the UTF8 content if the content format is ContentFormat.UTF8 or null otherwise.
      ContentFormat getContentFormat()
      Returns the format used to store the component's content.
      java.lang.String getName()
      Returns the name of this container.
      java.lang.String getTypeID()
      Returns the ID of the container type declaration.
      boolean isEmpty()
      Returns true iff this container is empty i.e. has no content associated with it.
      void readContainer(java.io.InputStream inputStream, ContentFormat contentFormat)
      Reads the container from the specified input stream.
      void writeContainer(java.io.OutputStream outputStream)
      Writes the container to the specified output stream.
    • Method Detail

      • getName

        java.lang.String getName()
        Returns the name of this container.
        Returns:
        the container name
      • getTypeID

        java.lang.String getTypeID()
        Returns the ID of the container type declaration. For CLEF containers, this is is the type specified in the extension specification file.
        Returns:
        the type ID
      • getContentFormat

        ContentFormat getContentFormat()
        Returns the format used to store the component's content. An empty container will return null.
        Returns:
        the format used to store the component's content or null.
      • getContent

        java.lang.Object getContent()
        Returns the content. The return value will either be a string if the content format is ContentFormat.UTF8 or a byte array if the content format is ContentFormat.BINARY. An empty container will return null.
        Returns:
        the content or null
        See Also:
        getContentFormat(), getContentAsUTF8(), getContentAsBinary(), isEmpty()
      • isEmpty

        boolean isEmpty()
        Returns true iff this container is empty i.e. has no content associated with it.
        Returns:
        true iff this container is empty
        Since:
        PSAPI 17.0
      • writeContainer

        void writeContainer(java.io.OutputStream outputStream)
                            throws java.io.IOException
        Writes the container to the specified output stream.
        Parameters:
        outputStream - the output stream
        Throws:
        java.io.IOException - if the implementing code throws an IOException
        Since:
        PSAPI 17.0
        See Also:
        isEmpty()
      • readContainer

        void readContainer(java.io.InputStream inputStream,
                         ContentFormat contentFormat)
                           throws java.io.IOException
        Reads the container from the specified input stream. The input stream is read as a byte array. If the content format is ContentFormat.BINARY then the byte array is stored as-is. If the content format is ContentFormat.UTF8 then the byte array is encoded as a UTF-8 string.
        Parameters:
        outputStream - the output stream
        contentFormat - the content format to be used for storing the input
        Throws:
        java.io.IOException - if the implementing code throws an IOException
        Since:
        PSAPI 17.0
        See Also:
        isEmpty()

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