Package rife.cmf

Class ContentInfo

All Implemented Interfaces:
Cloneable, Constrained, ConstrainedPropertyListener, Validated
Direct Known Subclasses:
DatabaseContentInfo

public class ContentInfo extends Validation
This class represents all the information that is stored in the backend about a certain Content instance.

The setters of this class are only present to make it possible for the back-ends to automatically populate the information.

Since:
1.0
  • Constructor Details

    • ContentInfo

      public ContentInfo()
      Instantiates a new ContentInfo instance.
  • Method Details

    • activateValidation

      public void activateValidation()
      Description copied from class: Validation
      This method is called at least once and maximum once when any method related to Validated rules, subjects and group or Constrained properties are used.

      By overriding this method, you can thus isolate all the validation setup code and don't enforce a performance penalty at each object construction when doing it in the default constructor.

      Overrides:
      activateValidation in class Validation
    • setPath

      public void setPath(String path)
      Sets the path of the stored Content instance.

      The path has to be unique and will be used to retrieve this particular Content.

      Parameters:
      path - the absolute and unique path
      Since:
      1.0
      See Also:
    • getPath

      public String getPath()
      Retrieves the path of the stored Content instance.
      Returns:
      the Content's path
      Since:
      1.0
      See Also:
    • getOptimalPath

      public String getOptimalPath()
      Retrieves the path of the stored Content instance in the most optimal form for usage in the cmf.
      Returns:
      the Content's most optimal path
      Since:
      1.0
      See Also:
    • setVersion

      public void setVersion(int version)
      Sets the version of the stored Content instance.

      Version numbers are unique and should be increased successively when the data on a certain Content is updated.

      The path and the version together identify exactly one particular Content with one particular data.

      Parameters:
      version - the version as a unique integer
      Since:
      1.0
      See Also:
    • getVersion

      public int getVersion()
      Retrieves the version of the stored Content instance.
      Returns:
      the Content's version
      Since:
      1.0
      See Also:
    • setMimeType

      public void setMimeType(String mimeType)
      Sets the mime type of the stored Content instance.
      Parameters:
      mimeType - the String that identifies the mime type
      Since:
      1.0
      See Also:
    • getMimeType

      public String getMimeType()
      Retrieves the mime type of the stored Content instance.
      Returns:
      the Content's mime type textual identifier
      Since:
      1.0
      See Also:
    • setFragment

      public void setFragment(boolean fragment)
      Sets whether the stored Content instance is a fragment or not.
      Parameters:
      fragment - true if it's a fragment; or

      false otherwise

      Since:
      1.0
      See Also:
    • isFragment

      public boolean isFragment()
      Retrieves whether the stored Content instance is a fragment or not.
      Returns:
      true if it's a fragment; or

      false otherwise

      Since:
      1.0
      See Also:
    • setName

      public void setName(String name)
      Sets the name of the stored Content instance.
      Parameters:
      name - the name
      Since:
      1.0
      See Also:
    • getName

      public String getName()
      Retrieves the name of the stored Content instance.
      Returns:
      null if the stored Content instance has no name; or

      the name of the content

      Since:
      1.0
      See Also:
    • hasName

      public boolean hasName()
      Indicates whether the stored Content instance has a name.
      Returns:
      true if it has a name; or

      false otherwise

      Since:
      1.0
      See Also:
    • setCreated

      public void setCreated(Timestamp created)
      Sets the moment when the Content instance was stored.
      Parameters:
      created - the moment of creation
      Since:
      1.0
      See Also:
    • getCreated

      public Timestamp getCreated()
      Retrieves the moment when the Content instance was stored.
      Returns:
      the moment of creation
      Since:
      1.0
      See Also:
    • setAttributes

      public void setAttributes(Map<String,String> attributes)
      Sets the attributes map of the stored Content instance.
      Parameters:
      attributes - the attributes map with String keys and value.
      Since:
      1.0
      See Also:
    • getAttributes

      public Map<String,String> getAttributes()
      Retrieves the attributes map of the stored Content instance.
      Returns:
      the attributes map
      Since:
      1.0
      See Also:
    • hasAttributes

      public boolean hasAttributes()
      Indicates whether named content attributes are present.
      Returns:
      true if named content attributes are present; or

      false otherwise

      Since:
      1.0
      See Also:
    • hasAttribute

      public boolean hasAttribute(String name)
      Indicates whether a specific named content attribute is present.
      Parameters:
      name - the name of the attribute
      Returns:
      true if the name content attribute is present; or

      false otherwise

      Since:
      1.0
      See Also:
    • getAttribute

      public String getAttribute(String name)
      Retrieves the value of a named content attribute.
      Parameters:
      name - the name of the attribute
      Returns:
      the value of the named content attribute; or

      null if no such attribute could be found

      Since:
      1.0
      See Also:
    • setSize

      public void setSize(int size)
      Sets the size of the stored Content instance.
      Parameters:
      size - the size of the content data
      Since:
      1.0
      See Also:
    • getSize

      public int getSize()
      Retrieves the size of the stored Content instance.
      Returns:
      the Content's size
      Since:
      1.0
      See Also:
    • getFormattedSize

      public String getFormattedSize()
      Retrieves the size of the stored Content instance as a formatted string.
      Returns:
      the Content's formatted size
      Since:
      1.0
      See Also:
    • setProperties

      public void setProperties(Map<String,String> properties)
      Sets the content data properties of the stored Content instance.
      Parameters:
      properties - the content data properties
      Since:
      1.0
      See Also:
    • hasProperties

      public boolean hasProperties()
      Indicates whether content data properties are present for the stored Content instance.
      Returns:
      true if properties are present; or

      false otherwise

      Since:
      1.0
      See Also:
    • hasProperty

      public boolean hasProperty(String name)
      Indicates whether a specific named content property is present.
      Parameters:
      name - the name of the property
      Returns:
      true if the name content property is present; or

      false otherwise

      Since:
      1.0
      See Also:
    • getProperty

      public String getProperty(String name)
      Retrieves the value of a named content property.
      Parameters:
      name - the name of the property
      Returns:
      the value of the named content property; or

      null if no such property could be found

      Since:
      1.0
      See Also:
    • getProperties

      public Map<String,String> getProperties()
      Retrieves the content data properties of the stored Content instance.
      Returns:
      the content data properties; or

      null if no content data properties are present

      Since:
      1.0
      See Also: