Interface FormatConversionSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface FormatConversionSession extends OsidSession

This session defines methods to convert text formats.

  • Method Details

    • getSourceFormatType

      Type getSourceFormatType()
      Gets the source format type used in this session.
      Returns:
      the source text format type
      Compliance:
      mandatory - This method must be implemented.
    • getTargetFormatType

      Type getTargetFormatType()
      Gets the target format type used in this session.
      Returns:
      the target text format type
      Compliance:
      mandatory - This method must be implemented.
    • canConvertFormats

      boolean canConvertFormats()
      Tests if this user can perform text format. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations.
      Returns:
      false if conversion methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • convertFormat

      Converts a format.
      Parameters:
      sourceText - the string to convert
      Returns:
      the resulting string
      Throws:
      InvalidArgumentException - sourceText not of source format
      NullArgumentException - sourceText is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • convertFormats

      String[] convertFormats(String[] sourceTexts) throws OperationFailedException, PermissionDeniedException
      Converts formats.
      Parameters:
      sourceTexts - the strings to convert
      Returns:
      the resulting strings
      Throws:
      InvalidArgumentException - a sourceText not of source format
      NullArgumentException - sourceTexts is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.