Interface IContentTypeSettings

All Known Subinterfaces:
IContentType

public interface IContentTypeSettings
Gives access to the user settings for a content type.

This interface is not intended to be implemented by clients.

Since:
3.1
See Also:
Restriction:
This interface is not intended to be implemented by clients.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    File spec type constant, indicating a file extension specification.
    static final int
    File spec type constant, indicating a file name specification.
    static final int
    File spec type constant, indicating a file pattern specification
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addFileSpec(String fileSpec, int type)
    Adds a user-defined file specification to the corresponding content type.
    Returns the default charset for the corresponding content type if it has been set, or null otherwise.
    getFileSpecs(int type)
    Returns the file specifications for the corresponding content type.
    Returns the corresponding content type's unique identifier.
    boolean
     
    void
    removeFileSpec(String fileSpec, int type)
    Removes a user-defined file specification from the corresponding content type.
    void
    Sets the default charset for the corresponding content type.
  • Field Details

    • FILE_EXTENSION_SPEC

      static final int FILE_EXTENSION_SPEC
      File spec type constant, indicating a file extension specification.
      See Also:
    • FILE_NAME_SPEC

      static final int FILE_NAME_SPEC
      File spec type constant, indicating a file name specification.
      See Also:
    • FILE_PATTERN_SPEC

      static final int FILE_PATTERN_SPEC
      File spec type constant, indicating a file pattern specification
      Since:
      3.7
      See Also:
  • Method Details

    • addFileSpec

      void addFileSpec(String fileSpec, int type) throws CoreException
      Adds a user-defined file specification to the corresponding content type. Has no effect if the given file specification is already defined.
      Parameters:
      fileSpec - the file specification
      type - the type of the file specification. One of FILE_NAME_SPEC, FILE_EXTENSION_SPEC, FILE_PATTERN_SPEC.
      Throws:
      IllegalArgumentException - if the type bit mask is incorrect
      CoreException - if this method fails. Reasons include:
      • An error occurred persisting this setting.
      See Also:
    • getDefaultCharset

      String getDefaultCharset()
      Returns the default charset for the corresponding content type if it has been set, or null otherwise.
      Returns:
      the default charset, or null
    • getFileSpecs

      String[] getFileSpecs(int type)
      Returns the file specifications for the corresponding content type. The type mask is a bit-wise or of file specification type constants indicating the file specification types of interest.
      Parameters:
      type - a bit-wise or of file specification type constants. Valid flags are one of FILE_EXTENSION_SPEC or FILE_NAME_SPEC
      Returns:
      the file specification
      See Also:
    • getId

      String getId()
      Returns the corresponding content type's unique identifier. Each content type has an identifier by which they can be retrieved from the content type catalog.
      Returns:
      the content type unique identifier
    • removeFileSpec

      void removeFileSpec(String fileSpec, int type) throws CoreException
      Removes a user-defined file specification from the corresponding content type. Has no effect if the given file specification was not defined by the user.
      Parameters:
      fileSpec - the file specification
      type - the type of the file specification. One of FILE_NAME_SPEC, FILE_EXTENSION_SPEC.
      Throws:
      IllegalArgumentException - if the type bit mask is incorrect
      CoreException - if this method fails. Reasons include:
      • An error occurred persisting this setting.
      See Also:
    • setDefaultCharset

      void setDefaultCharset(String userCharset) throws CoreException
      Sets the default charset for the corresponding content type. If null is provided, restores the pre-defined default charset.
      Parameters:
      userCharset - the new charset for the content type, or null
      Throws:
      CoreException - if this method fails. Reasons include:
      • An error occurred persisting this setting.
    • isUserDefined

      boolean isUserDefined()
      Returns:
      whether the content-type was defined via user action, using IContentTypeManager.addContentType(String, String, IContentType)
      Since:
      3.6