com.adobe.cq.dam.cfm.ElementTemplate Maven / Gradle / Ivy
Show all versions of aem-sdk-api Show documentation
/*
* ADOBE CONFIDENTIAL
*
* Copyright 2015 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
*/
package com.adobe.cq.dam.cfm;
import aQute.bnd.annotation.ProviderType;
import org.apache.sling.api.adapter.Adaptable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
/**
* Implementations of this interface allow to access an element template through a
* well-defined API, without needing to care about the underlying content structure.
*/
@ProviderType
public interface ElementTemplate extends Adaptable {
/**
* Gets the (technical) name of the represented content element.
*
* @return The name
*/
String getName();
/**
* Gets the (human-readable) title of the represented content element.
*
* @return The title
*/
String getTitle();
/**
* Gets the data type of the element.
*
* @return the data type of the element
* @since 1.1
*/
@NotNull
DataType getDataType();
/**
* Gets the initial MIME type of the variation.
*
* This method must return a MIME type that is actually supported by the
* implementation.
*
* @return The initial MIME type
*/
@Nullable
String getInitialContentType();
/**
* 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> </p>
for HTML content.
*
* @return The default content; if null, a sensible default content has to be provided
* by the implementation
*/
@Nullable
String getDefaultContent();
/**
* 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.
*
* @return A Map with metadata information of an Element Template, or an empty
* Map in case the Element Template has no extra information.
*/
Map getMetaData();
}