Interface ContentDomain<T>
-
- Type Parameters:
T
- The actual domain type the implementor wants to provide.
public interface ContentDomain<T>
Contract of a Content Domain.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
entityToId(T entity)
Converts the given entity to its domain ID.String
getContentType()
Returns the content type that can be created from this content domain.Class<T>
getDefaultDomainType()
Returns the default domain type.String
getDomainPrefix()
Gets the domain prefix for the domain.Set<Class<?>>
getDomainTypes()
Gets all the domain types for this ContentDomain.String
getLargeIcon()
Gets the large icon of the ContentDomain.ContentDomain<?>
getMaster()
Returns the master content domain.String
getName(Locale locale)
Gets the name of the ContentDomain in the specifiedLanguage
.String[]
getPermissions()
Gets the permissions associated with this content domains.String
getSmallIcon()
Gets the small icon of the ContentDomain.T
idToEntity(String id)
Converts the given ID to an instance of the domain type.boolean
isArticle()
Returns whether this is an article.boolean
isDocument()
Returns whether this is a document which can be created.boolean
isMultiple()
Returns whether multiple items can be created.
-
-
-
Method Detail
-
getName
String getName(Locale locale)
Gets the name of the ContentDomain in the specifiedLanguage
.- Parameters:
locale
- theLocale
- Returns:
- the name, may be
null
-
getSmallIcon
String getSmallIcon()
Gets the small icon of the ContentDomain.- Returns:
- the small icon, may be
null
-
getLargeIcon
String getLargeIcon()
Gets the large icon of the ContentDomain.- Returns:
- the large icon, may be
null
-
getContentType
String getContentType()
Returns the content type that can be created from this content domain.- Returns:
- the content type that can be created from this content domain
-
getMaster
ContentDomain<?> getMaster()
Returns the master content domain.- Returns:
- the master content domain.
-
isDocument
boolean isDocument()
Returns whether this is a document which can be created.- Returns:
- whether this is a document which can be created
-
isMultiple
boolean isMultiple()
Returns whether multiple items can be created.- Returns:
- whether multiple items can be created
-
isArticle
boolean isArticle()
Returns whether this is an article.- Returns:
- whether this is an article
-
getPermissions
String[] getPermissions()
Gets the permissions associated with this content domains.- Returns:
- the array of permissions, may be
null
-
getDefaultDomainType
Class<T> getDefaultDomainType()
Returns the default domain type.- Returns:
- Domain type.
-
getDomainTypes
Set<Class<?>> getDomainTypes()
Gets all the domain types for this ContentDomain.- Returns:
- the domain types
-
getDomainPrefix
String getDomainPrefix()
Gets the domain prefix for the domain.- Returns:
- the domain prefix, may not be
null
.
-
idToEntity
T idToEntity(String id) throws ContentDomainException
Converts the given ID to an instance of the domain type. If the given ID is unknownnull
is returned.- Parameters:
id
- Domain identifier.- Returns:
- Domain instance, or
null
if no instance exist for the given ID. - Throws:
ContentDomainException
- In case the id cannot be resolved to an entity in an exceptional situation.
-
entityToId
String entityToId(T entity) throws ContentDomainException
Converts the given entity to its domain ID.- Parameters:
entity
- Domain instance.- Returns:
- Domain identifier.
- Throws:
ContentDomainException
- In case the id cannot be resolved to an entity in an exceptional situation.
-
-