Class ContentInfo
- All Implemented Interfaces:
Cloneable
,Constrained
,ConstrainedPropertyListener
,Validated
- Direct Known Subclasses:
DatabaseContentInfo
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getAttribute
(String name) Retrieves the value of a named content attribute.Retrieves the attributes map of the storedContent
instance.Retrieves the moment when theContent
instance was stored.Retrieves the size of the storedContent
instance as a formatted string.Retrieves the mime type of the storedContent
instance.getName()
Retrieves the name of the storedContent
instance.Retrieves the path of the storedContent
instance in the most optimal form for usage in the cmf.getPath()
Retrieves the path of the storedContent
instance.Retrieves the content data properties of the storedContent
instance.getProperty
(String name) Retrieves the value of a named content property.int
getSize()
Retrieves the size of the storedContent
instance.int
Retrieves the version of the storedContent
instance.boolean
hasAttribute
(String name) Indicates whether a specific named content attribute is present.boolean
Indicates whether named content attributes are present.boolean
hasName()
Indicates whether the storedContent
instance has a name.boolean
Indicates whether content data properties are present for the storedContent
instance.boolean
hasProperty
(String name) Indicates whether a specific named content property is present.boolean
Retrieves whether the storedContent
instance is a fragment or not.void
setAttributes
(Map<String, String> attributes) Sets the attributes map of the storedContent
instance.void
setCreated
(Timestamp created) Sets the moment when theContent
instance was stored.void
setFragment
(boolean fragment) Sets whether the storedContent
instance is a fragment or not.void
setMimeType
(String mimeType) Sets the mime type of the storedContent
instance.void
Sets the name of the storedContent
instance.void
Sets the path of the storedContent
instance.void
setProperties
(Map<String, String> properties) Sets the content data properties of the storedContent
instance.void
setSize
(int size) Sets the size of the storedContent
instance.void
setVersion
(int version) Sets the version of the storedContent
instance.Methods inherited from class rife.validation.Validation
addConstrainedPropertyRules, addConstraint, addConstraint, addGroup, addRule, addValidationError, clone, constraintSet, countValidationErrors, focusGroup, generateConstrainedPropertyRules, getConstrainedBean, getConstrainedProperties, getConstrainedProperty, getErrorIndication, getGroup, getGroups, getLoadingErrors, getRules, getValidatedSubjects, getValidationErrors, hasPropertyConstraint, isSubjectValid, limitSubjectErrors, makeErrorValid, makeSubjectValid, provideValidatedBean, replaceValidationErrors, resetGroup, resetValidation, retrieveValidatedBean, unlimitSubjectErrors, validate, validate, validateGroup, validateGroup
-
Constructor Details
-
ContentInfo
public ContentInfo()Instantiates a newContentInfo
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 classValidation
-
setPath
Sets the path of the storedContent
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
Retrieves the path of the storedContent
instance.- Returns:
- the
Content
's path - Since:
- 1.0
- See Also:
-
getOptimalPath
Retrieves the path of the storedContent
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 storedContent
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 storedContent
instance.- Returns:
- the
Content
's version - Since:
- 1.0
- See Also:
-
setMimeType
Sets the mime type of the storedContent
instance.- Parameters:
mimeType
- theString
that identifies the mime type- Since:
- 1.0
- See Also:
-
getMimeType
Retrieves the mime type of the storedContent
instance.- Returns:
- the
Content
's mime type textual identifier - Since:
- 1.0
- See Also:
-
setFragment
public void setFragment(boolean fragment) Sets whether the storedContent
instance is a fragment or not.- Parameters:
fragment
-true
if it's a fragment; orfalse
otherwise- Since:
- 1.0
- See Also:
-
isFragment
public boolean isFragment()Retrieves whether the storedContent
instance is a fragment or not.- Returns:
true
if it's a fragment; orfalse
otherwise- Since:
- 1.0
- See Also:
-
setName
Sets the name of the storedContent
instance. -
getName
Retrieves the name of the storedContent
instance.- Returns:
null
if the storedContent
instance has no name; orthe name of the content
- Since:
- 1.0
- See Also:
-
hasName
public boolean hasName()Indicates whether the storedContent
instance has a name.- Returns:
true
if it has a name; orfalse
otherwise- Since:
- 1.0
- See Also:
-
setCreated
Sets the moment when theContent
instance was stored.- Parameters:
created
- the moment of creation- Since:
- 1.0
- See Also:
-
getCreated
Retrieves the moment when theContent
instance was stored.- Returns:
- the moment of creation
- Since:
- 1.0
- See Also:
-
setAttributes
Sets the attributes map of the storedContent
instance.- Parameters:
attributes
- the attributes map withString
keys and value.- Since:
- 1.0
- See Also:
-
getAttributes
Retrieves the attributes map of the storedContent
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; orfalse
otherwise- Since:
- 1.0
- See Also:
-
hasAttribute
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; orfalse
otherwise- Since:
- 1.0
- See Also:
-
getAttribute
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 storedContent
instance.- Parameters:
size
- the size of the content data- Since:
- 1.0
- See Also:
-
getSize
public int getSize()Retrieves the size of the storedContent
instance.- Returns:
- the
Content
's size - Since:
- 1.0
- See Also:
-
getFormattedSize
Retrieves the size of the storedContent
instance as a formatted string.- Returns:
- the
Content
's formatted size - Since:
- 1.0
- See Also:
-
setProperties
Sets the content data properties of the storedContent
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 storedContent
instance.- Returns:
true
if properties are present; orfalse
otherwise- Since:
- 1.0
- See Also:
-
hasProperty
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; orfalse
otherwise- Since:
- 1.0
- See Also:
-
getProperty
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
Retrieves the content data properties of the storedContent
instance.- Returns:
- the content data properties; or
null
if no content data properties are present - Since:
- 1.0
- See Also:
-