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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis 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 storedContentinstance.Retrieves the moment when theContentinstance was stored.Retrieves the size of the storedContentinstance as a formatted string.Retrieves the mime type of the storedContentinstance.getName()Retrieves the name of the storedContentinstance.Retrieves the path of the storedContentinstance in the most optimal form for usage in the cmf.getPath()Retrieves the path of the storedContentinstance.Retrieves the content data properties of the storedContentinstance.getProperty(String name) Retrieves the value of a named content property.intgetSize()Retrieves the size of the storedContentinstance.intRetrieves the version of the storedContentinstance.booleanhasAttribute(String name) Indicates whether a specific named content attribute is present.booleanIndicates whether named content attributes are present.booleanhasName()Indicates whether the storedContentinstance has a name.booleanIndicates whether content data properties are present for the storedContentinstance.booleanhasProperty(String name) Indicates whether a specific named content property is present.booleanRetrieves whether the storedContentinstance is a fragment or not.voidsetAttributes(Map<String, String> attributes) Sets the attributes map of the storedContentinstance.voidsetCreated(Timestamp created) Sets the moment when theContentinstance was stored.voidsetFragment(boolean fragment) Sets whether the storedContentinstance is a fragment or not.voidsetMimeType(String mimeType) Sets the mime type of the storedContentinstance.voidSets the name of the storedContentinstance.voidSets the path of the storedContentinstance.voidsetProperties(Map<String, String> properties) Sets the content data properties of the storedContentinstance.voidsetSize(int size) Sets the size of the storedContentinstance.voidsetVersion(int version) Sets the version of the storedContentinstance.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 newContentInfoinstance.
-
-
Method Details
-
activateValidation
public void activateValidation()Description copied from class:ValidationThis 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:
activateValidationin classValidation
-
setPath
Sets the path of the storedContentinstance.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 storedContentinstance.- Returns:
- the
Content's path - Since:
- 1.0
- See Also:
-
getOptimalPath
Retrieves the path of the storedContentinstance 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 storedContentinstance.Version numbers are unique and should be increased successively when the data on a certain
Contentis updated.The path and the version together identify exactly one particular
Contentwith 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 storedContentinstance.- Returns:
- the
Content's version - Since:
- 1.0
- See Also:
-
setMimeType
Sets the mime type of the storedContentinstance.- Parameters:
mimeType- theStringthat identifies the mime type- Since:
- 1.0
- See Also:
-
getMimeType
Retrieves the mime type of the storedContentinstance.- Returns:
- the
Content's mime type textual identifier - Since:
- 1.0
- See Also:
-
setFragment
public void setFragment(boolean fragment) Sets whether the storedContentinstance is a fragment or not.- Parameters:
fragment-trueif it's a fragment; orfalseotherwise- Since:
- 1.0
- See Also:
-
isFragment
public boolean isFragment()Retrieves whether the storedContentinstance is a fragment or not.- Returns:
trueif it's a fragment; orfalseotherwise- Since:
- 1.0
- See Also:
-
setName
Sets the name of the storedContentinstance. -
getName
Retrieves the name of the storedContentinstance.- Returns:
nullif the storedContentinstance has no name; orthe name of the content
- Since:
- 1.0
- See Also:
-
hasName
public boolean hasName()Indicates whether the storedContentinstance has a name.- Returns:
trueif it has a name; orfalseotherwise- Since:
- 1.0
- See Also:
-
setCreated
Sets the moment when theContentinstance was stored.- Parameters:
created- the moment of creation- Since:
- 1.0
- See Also:
-
getCreated
Retrieves the moment when theContentinstance was stored.- Returns:
- the moment of creation
- Since:
- 1.0
- See Also:
-
setAttributes
Sets the attributes map of the storedContentinstance.- Parameters:
attributes- the attributes map withStringkeys and value.- Since:
- 1.0
- See Also:
-
getAttributes
Retrieves the attributes map of the storedContentinstance.- Returns:
- the attributes map
- Since:
- 1.0
- See Also:
-
hasAttributes
public boolean hasAttributes()Indicates whether named content attributes are present.- Returns:
trueif named content attributes are present; orfalseotherwise- Since:
- 1.0
- See Also:
-
hasAttribute
Indicates whether a specific named content attribute is present.- Parameters:
name- the name of the attribute- Returns:
trueif the name content attribute is present; orfalseotherwise- 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
nullif no such attribute could be found - Since:
- 1.0
- See Also:
-
setSize
public void setSize(int size) Sets the size of the storedContentinstance.- Parameters:
size- the size of the content data- Since:
- 1.0
- See Also:
-
getSize
public int getSize()Retrieves the size of the storedContentinstance.- Returns:
- the
Content's size - Since:
- 1.0
- See Also:
-
getFormattedSize
Retrieves the size of the storedContentinstance as a formatted string.- Returns:
- the
Content's formatted size - Since:
- 1.0
- See Also:
-
setProperties
Sets the content data properties of the storedContentinstance.- Parameters:
properties- the content data properties- Since:
- 1.0
- See Also:
-
hasProperties
public boolean hasProperties()Indicates whether content data properties are present for the storedContentinstance.- Returns:
trueif properties are present; orfalseotherwise- Since:
- 1.0
- See Also:
-
hasProperty
Indicates whether a specific named content property is present.- Parameters:
name- the name of the property- Returns:
trueif the name content property is present; orfalseotherwise- 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
nullif no such property could be found - Since:
- 1.0
- See Also:
-
getProperties
Retrieves the content data properties of the storedContentinstance.- Returns:
- the content data properties; or
nullif no content data properties are present - Since:
- 1.0
- See Also:
-