com.atlassian.confluence.core
Class AbstractLabelableEntityObject

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.confluence.core.ConfluenceEntityObject
          extended by com.atlassian.confluence.core.AbstractVersionedEntityObject
              extended by com.atlassian.confluence.core.AbstractLabelableEntityObject
All Implemented Interfaces:
Versioned, EditableLabelable, Labelable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Attachment, ContentEntityObject, PageTemplate

public abstract class AbstractLabelableEntityObject
extends AbstractVersionedEntityObject
implements EditableLabelable

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
INITIAL_VERSION
 
Constructor Summary
AbstractLabelableEntityObject()
           
 
Method Summary
 void addLabelling(Labelling content)
           
 java.lang.Object clone()
           
 java.util.List<Label> getGlobalLabels(com.atlassian.user.User user)
          List the labels on this content that are global labels
 int getLabelCount()
          Get the number of labels that are associated with this object.
 java.util.List<Labelling> getLabellings()
           
 java.util.List<Label> getLabels()
          Retrieve the labels that are associated with this object.
 java.util.List<Label> getLabelsForDisplay(com.atlassian.user.User user)
          List the labels on this content that are visible to a particular user, and should be shown in a list of labels.
 LabelUtil getLabelUtil()
          Deprecated. since 5.2. Use LabelUtil directly.
 java.util.List<Label> getPersonalLabels(com.atlassian.user.User user)
          List the labels on this content that are personal labels for a particular user
 java.util.List<Label> getTeamLabels(com.atlassian.user.User user)
          List the labels on this content that are team labels for a particular user
 java.util.List<Label> getVisibleLabels(com.atlassian.user.User user)
          List the labels on this content that are visible to a particular user
 boolean isFavourite(ConfluenceUser user)
          Is this object marked as somebody's favourite?
 boolean isFavourite(com.atlassian.user.User user)
          Deprecated. 
 void removeLabelling(Labelling labelling)
           
protected  void setLabellings(java.util.List<Labelling> labellings)
           
 
Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
convertToHistoricalVersion, getLatestVersion, getOriginalVersion, getVersion, isLatestVersion, isNew, setOriginalVersion, setVersion
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierName
 
Methods inherited from class com.atlassian.core.bean.EntityObject
equals, getCreationDate, getCurrentDate, getId, getLastModificationDate, hashCode, setClock, setCreationDate, setId, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.labels.EditableLabelable
getId, getTitle, isPersistent
 

Constructor Detail

AbstractLabelableEntityObject

public AbstractLabelableEntityObject()
Method Detail

getLabels

public java.util.List<Label> getLabels()
Description copied from interface: Labelable
Retrieve the labels that are associated with this object.

Specified by:
getLabels in interface Labelable
Returns:
a list of label instances.

getLabelCount

public int getLabelCount()
Description copied from interface: Labelable
Get the number of labels that are associated with this object.

Specified by:
getLabelCount in interface Labelable
Returns:
the number of labels associated with this object.

isFavourite

public boolean isFavourite(ConfluenceUser user)
Description copied from interface: Labelable
Is this object marked as somebody's favourite?

Specified by:
isFavourite in interface Labelable
Parameters:
user - the user who is being checked against. If user is null this method must always return false (anonymous users can not mark anything as a favourite, obviously)
Returns:
true if the labelable object is a 'favourite' of a given user, false otherwise

isFavourite

@Deprecated
public boolean isFavourite(com.atlassian.user.User user)
Deprecated. 

Specified by:
isFavourite in interface Labelable

getVisibleLabels

public java.util.List<Label> getVisibleLabels(com.atlassian.user.User user)
List the labels on this content that are visible to a particular user

Parameters:
user - the user
Returns:
the labels on this content visible to that user

getPersonalLabels

public java.util.List<Label> getPersonalLabels(com.atlassian.user.User user)
List the labels on this content that are personal labels for a particular user

Parameters:
user - the user
Returns:
the personal labels on this content visible to the user

getGlobalLabels

public java.util.List<Label> getGlobalLabels(com.atlassian.user.User user)
List the labels on this content that are global labels

Parameters:
user - the user
Returns:
the global labels on this content visible to the user

getTeamLabels

public java.util.List<Label> getTeamLabels(com.atlassian.user.User user)
List the labels on this content that are team labels for a particular user

Parameters:
user - the user
Returns:
the team labels on this content visible to the user

getLabelsForDisplay

public java.util.List<Label> getLabelsForDisplay(com.atlassian.user.User user)
List the labels on this content that are visible to a particular user, and should be shown in a list of labels. This is like {code}getVisibleLabels{code} except that it also filters out special labels like favourites

Parameters:
user - the user
Returns:
the labels on this content visible to that user

getLabelUtil

@Deprecated
public LabelUtil getLabelUtil()
Deprecated. since 5.2. Use LabelUtil directly.


setLabellings

protected void setLabellings(java.util.List<Labelling> labellings)

getLabellings

public java.util.List<Labelling> getLabellings()
Specified by:
getLabellings in interface EditableLabelable

addLabelling

public void addLabelling(Labelling content)
Specified by:
addLabelling in interface EditableLabelable

removeLabelling

public void removeLabelling(Labelling labelling)
Specified by:
removeLabelling in interface EditableLabelable

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class com.atlassian.core.bean.EntityObject
Throws:
java.lang.CloneNotSupportedException


Copyright © 2003-2014 Atlassian. All Rights Reserved.