org.pentaho.reporting.libraries.repository
Interface ContentEntity

All Known Subinterfaces:
ContentItem, ContentLocation
All Known Implementing Classes:
DummyContentItem, DummyContentLocation, EmailContentItem, EmailContentLocation, FileContentEntity, FileContentItem, FileContentLocation, StreamContentItem, StreamContentLocation, ZipContentItem, ZipContentItem, ZipContentLocation, ZipContentLocation, ZipReadContentItem, ZipReadContentLocation

public interface ContentEntity

A content entity is the base interface for both data items and directory items.

Author:
Thomas Morgner

Method Summary
 boolean delete()
          Attempts to delete the entity.
 java.lang.Object getAttribute(java.lang.String domain, java.lang.String key)
          Returns a attribute value for the given domain (namespace) and attribute-name.
 java.lang.Object getContentId()
          Returns a unique identifier.
 java.lang.String getName()
          Returns the name of the entry.
 ContentLocation getParent()
          Returns a reference to the parent location.
 Repository getRepository()
          Returns the current repository, to which tis entity belongs.
 boolean setAttribute(java.lang.String domain, java.lang.String key, java.lang.Object value)
          Updates the attribute value for the given attribute domain and name.
 

Method Detail

getName

java.lang.String getName()
Returns the name of the entry.

Returns:
the name, never null.

getContentId

java.lang.Object getContentId()
Returns a unique identifier. This can be canonical filename or a database key. It must be guaranteed that within the same repository the key will be unique.

Returns:
the unique content ID.

getAttribute

java.lang.Object getAttribute(java.lang.String domain,
                              java.lang.String key)
Returns a attribute value for the given domain (namespace) and attribute-name. Some generic attribute domains and names are defined as constants in the LibRepositoryBoot class.

Parameters:
domain - the attribute domain.
key - the name of the attribute.
Returns:
the value or null, if the content-entity does not have a value for this attribute.

setAttribute

boolean setAttribute(java.lang.String domain,
                     java.lang.String key,
                     java.lang.Object value)
Updates the attribute value for the given attribute domain and name. If the element is not writable or the attribute could not be updated for any other reason, the method will return false. This method only returns true, if the attribute has been updated successfully.

Parameters:
domain - the attribute domain.
key - the attribute name
value - the new attribute value.
Returns:
true, if the update was successful, false otherwise.

getParent

ContentLocation getParent()
Returns a reference to the parent location. If this entity represents the root directory, this method will return null.

Returns:
the parent or null, if this is the root-directory.

getRepository

Repository getRepository()
Returns the current repository, to which tis entity belongs.

Returns:
the repository.

delete

boolean delete()
Attempts to delete the entity. After an entity has been deleted, any call to any of the methods of the entity may produce undefined results.

Returns:
true, if the entity was deleted and detached from the repository, false otherwise.