org.sakaiproject.entitybroker.entityprovider.extension
Class BrowseEntity

java.lang.Object
  extended by org.sakaiproject.entitybroker.entityprovider.extension.BrowseEntity

public class BrowseEntity
extends Object

This is an object to hold data about a browseable entity type

Author:
Aaron Zeckoski (azeckoski @ gmail.com)

Nested Class Summary
static class BrowseEntity.PrefixComparator
           
static class BrowseEntity.TitleComparator
           
 
Constructor Summary
BrowseEntity(String prefix)
          Minimal constructor
BrowseEntity(String prefix, String title, String description)
          Constructor for types with no children or access provider
BrowseEntity(String prefix, String title, String description, String[] nestedPrefixes, String[] entityViewKeys)
          Constructor for complete types with most optional information, all optionals can be null
 
Method Summary
 void addEntityViewKeys(String entityViewKey)
          Adds a view key which is known to be supported by this entity types access provider
 void addNestedPrefix(String prefix)
          Adds a nested prefix which is a child of this entity type
 boolean equals(Object obj)
           
 String getDescription()
           
 List<String> getEntityAccessViews()
          Get the list of entity access views (e.g.
 List<String> getNestedPrefixes()
          Gets all the nested children prefixes for this entity type (if there are any)
 String getParentPrefix()
           
 String getPrefix()
           
 String getTitle()
           
 int hashCode()
           
 void setEntityViewKeys(String[] entityViewKeys)
           
 void setNestedPrefixes(String[] nestedPrefixes)
           
 void setParentPrefix(String parentPrefix)
           
 void setTitleDesc(String title, String description)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BrowseEntity

public BrowseEntity(String prefix)
Minimal constructor

Parameters:
prefix - an entity prefix

BrowseEntity

public BrowseEntity(String prefix,
                    String title,
                    String description)
Constructor for types with no children or access provider

Parameters:
prefix - an entity prefix
title - a display title
description - (optional) display description

BrowseEntity

public BrowseEntity(String prefix,
                    String title,
                    String description,
                    String[] nestedPrefixes,
                    String[] entityViewKeys)
Constructor for complete types with most optional information, all optionals can be null

Parameters:
prefix - an entity prefix
title - a display title
description - (optional) display description
nestedPrefixes - (optional) the list of nested (children) prefixes
entityViewKeys - (optional) the list of handled views for the access provider
Method Detail

setTitleDesc

public void setTitleDesc(String title,
                         String description)

setNestedPrefixes

public void setNestedPrefixes(String[] nestedPrefixes)

setEntityViewKeys

public void setEntityViewKeys(String[] entityViewKeys)

addNestedPrefix

public void addNestedPrefix(String prefix)
Adds a nested prefix which is a child of this entity type

Parameters:
prefix - an entity prefix

addEntityViewKeys

public void addEntityViewKeys(String entityViewKey)
Adds a view key which is known to be supported by this entity types access provider

Parameters:
entityViewKey - an entity view key (e.g. EntityView.VIEW_NEW)

setParentPrefix

public void setParentPrefix(String parentPrefix)

getPrefix

public String getPrefix()
Returns:
the entity prefix for this browseable entity type

getTitle

public String getTitle()
Returns:
the display title for this entity type (will not be null, may just be the prefix)

getDescription

public String getDescription()
Returns:
the optional description of this type of entity (may be null)

getParentPrefix

public String getParentPrefix()
Returns:
the prefix for the parent entity type for this type of entity OR null if this is a root type

getNestedPrefixes

public List<String> getNestedPrefixes()
Gets all the nested children prefixes for this entity type (if there are any)

Returns:
the list of nested (children) prefixes for this entity type OR null if there are none (will not be empty list)

getEntityAccessViews

public List<String> getEntityAccessViews()
Get the list of entity access views (e.g. EntityView.VIEW_NEW) that are known to be handled by this entity type

Returns:
the list of view keys OR empty if none handled OR null if the handled views are unknown

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2012 Sakai Project. All Rights Reserved.