org.squashtest.tm.domain.project
Class GenericLibrary<NODE extends LibraryNode>

java.lang.Object
  extended by org.squashtest.tm.domain.project.GenericLibrary<NODE>
Type Parameters:
NODE - The type of nodes this library contains.
All Implemented Interfaces:
AttachmentHolder, Identified, Library<NODE>, NodeContainer<NODE>, PluginReferencer, ProjectResource<GenericProject>, SelfClassAware
Direct Known Subclasses:
CampaignLibrary, RequirementLibrary, TestCaseLibrary

@MappedSuperclass
public abstract class GenericLibrary<NODE extends LibraryNode>
extends Object
implements Library<NODE>

Abstract superclass of Library implementations based on generics.

Author:
Gregory Fouquet

Constructor Summary
GenericLibrary()
           
 
Method Summary
 void addContent(NODE node)
          Adds new content to this container.
 AttachmentList getAttachmentList()
          Should return the container for this object's attachments.
 List<String> getContentNames()
           
 Library<?> getLibrary()
           
 boolean isContentNameAvailable(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.squashtest.tm.domain.library.Library
notifyAssociatedWithProject
 
Methods inherited from interface org.squashtest.tm.domain.project.ProjectResource
getProject
 
Methods inherited from interface org.squashtest.tm.domain.SelfClassAware
getClassName, getClassSimpleName
 
Methods inherited from interface org.squashtest.tm.domain.library.NodeContainer
accept, getContent, getOrderedContent, getProject, hasContent, removeContent
 
Methods inherited from interface org.squashtest.tm.domain.Identified
getId
 
Methods inherited from interface org.squashtest.tm.domain.library.PluginReferencer
disablePlugin, enablePlugin, getEnabledPlugins, isPluginEnabled
 

Constructor Detail

GenericLibrary

public GenericLibrary()
Method Detail

isContentNameAvailable

public boolean isContentNameAvailable(String name)
Specified by:
isContentNameAvailable in interface NodeContainer<NODE extends LibraryNode>

addContent

public void addContent(@NotNull
                       NODE node)
                throws UnsupportedOperationException
Description copied from interface: NodeContainer
Adds new content to this container. Should refuse to add null content, should refuse to add content with duplicate name.

Specified by:
addContent in interface NodeContainer<NODE extends LibraryNode>
Throws:
UnsupportedOperationException - when trying to add a node to a project template.

getLibrary

public Library<?> getLibrary()
Specified by:
getLibrary in interface ProjectResource<GenericProject>

getContentNames

public List<String> getContentNames()
Specified by:
getContentNames in interface NodeContainer<NODE extends LibraryNode>

getAttachmentList

public AttachmentList getAttachmentList()
Description copied from interface: AttachmentHolder
Should return the container for this object's attachments. Should never return null.

Specified by:
getAttachmentList in interface AttachmentHolder
Returns:
the AttachmentList of this object.


Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.