Interface ElementTemplate

  • All Superinterfaces:
    Adaptable

    public interface ElementTemplate
    extends Adaptable

    Implementations of this interface allow to access an element template through a well-defined API, without needing to care about the underlying content structure.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @NotNull DataType getDataType()
      Gets the data type of the element.
      @Nullable java.lang.String getDefaultContent()
      Gets the content type of the default content.
      @Nullable java.lang.String getInitialContentType()
      Gets the initial MIME type of the variation.
      java.util.Map<java.lang.String,​java.lang.Object> getMetaData()
      Returns a Map with metadata of an Element.
      java.lang.String getName()
      Gets the (technical) name of the represented content element.
      java.lang.String getTitle()
      Gets the (human-readable) title of the represented content element.
    • Method Detail

      • getName

        java.lang.String getName()
        Gets the (technical) name of the represented content element.
        Returns:
        The name
      • getTitle

        java.lang.String getTitle()
        Gets the (human-readable) title of the represented content element.
        Returns:
        The title
      • getDataType

        @NotNull
        @NotNull DataType getDataType()
        Gets the data type of the element.
        Returns:
        the data type of the element
        Since:
        1.1
      • getInitialContentType

        @Nullable
        @Nullable java.lang.String getInitialContentType()
        Gets the initial MIME type of the variation.

        This method must return a MIME type that is actually supported by the implementation.

        Returns:
        The initial MIME type
      • getDefaultContent

        @Nullable
        @Nullable java.lang.String getDefaultContent()

        Gets the content type of the default content.

        If this method returns null, the implementation should consider this as "undefined" rather than "empty". In such cases, it's the implementation's duty to provide a sensible default content. Could (for example) be an empty string for plain text content or <p>&nbsp;</p> for HTML content.

        Returns:
        The default content; if null, a sensible default content has to be provided by the implementation
      • getMetaData

        java.util.Map<java.lang.String,​java.lang.Object> getMetaData()

        Returns a Map with metadata of an Element.

        The method is used to return metadata information associated with Data Types from a Content Fragment Model.

        Example: used to return the Fragment Template referenced by a Fragment Reference data type.

        Returns:
        A Map with metadata information of an Element Template, or an empty Map in case the Element Template has no extra information.