Package net.anotheria.anodoc.service
Class AbstractModuleFactory
- java.lang.Object
-
- net.anotheria.anodoc.service.AbstractModuleFactory
-
- All Implemented Interfaces:
java.io.Serializable,IModuleFactory
public abstract class AbstractModuleFactory extends java.lang.Object implements IModuleFactory, java.io.Serializable
Base imlementation of IModuleFactory interface which only demands createModule method.- Version:
- $Id: $Id
- Author:
- another
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractModuleFactory()Constructor for AbstractModuleFactory.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description DocumentcreateDocument(java.lang.String id)Creates a new Document with given name.DocumentcreateDocument(java.lang.String name, java.lang.String typeIdentifier)Creates a new Document with given name and a type identifier.DocumentcreateDocument(java.lang.String name, DataHolder context)Creates a new Document from a name and a context (like list).<D extends Document>
DocumentList<D>createDocumentList(java.lang.String name)Creates a new DocumentList with given name and without a context.<D extends Document>
DocumentList<D>createDocumentList(java.lang.String name, DataHolder context)Creates a new DocumentList with given name and context.ModulecreateModule(java.lang.String ownerId, java.lang.String copyId)Creates a new Module Instance for given owner and copy ids.protected org.slf4j.LoggergetLog()Getter for the fieldlog.abstract ModulerecreateModule(java.lang.String ownerId, java.lang.String copyId)Recreates a Module.
-
-
-
Method Detail
-
getLog
protected org.slf4j.Logger getLog()
Getter for the field
log.- Returns:
- a
Loggerobject.
-
createDocument
public Document createDocument(java.lang.String name, DataHolder context)
Creates a new Document from a name and a context (like list). If this function is not overwritten, it call createDocument(name).- Specified by:
createDocumentin interfaceIModuleFactory- Parameters:
name- aStringobject.context- aDataHolderobject.- Returns:
- new Document
-
createDocument
public Document createDocument(java.lang.String name, java.lang.String typeIdentifier)
Creates a new Document with given name and a type identifier. Creates a new Document from a name and a typeidentifier. If this function is not overwritten, it call createDocument(name).- Specified by:
createDocumentin interfaceIModuleFactory- Parameters:
name- aStringobject.typeIdentifier- aStringobject.- Returns:
- new Document
-
createDocument
public Document createDocument(java.lang.String id)
Creates a new Document with given name. Creates and returns a new Document. This method should be overwritten by the extending class, since usage of Document directly in your modell is not fitting in the concept of ano-doc.- Specified by:
createDocumentin interfaceIModuleFactory- Parameters:
id- aStringobject.- Returns:
- a
Documentobject.
-
createDocumentList
public <D extends Document> DocumentList<D> createDocumentList(java.lang.String name, DataHolder context)
Creates a new DocumentList with given name and context. Creates and returns a DocumentList.- Specified by:
createDocumentListin interfaceIModuleFactory- Parameters:
name- aStringobject.context- aDataHolderobject.- Returns:
- a
DocumentListobject.
-
createDocumentList
public <D extends Document> DocumentList<D> createDocumentList(java.lang.String name)
Creates a new DocumentList with given name and without a context. Normally you don't need this method, since list is seldom overwritten. Creates and returns a DocumentList.- Specified by:
createDocumentListin interfaceIModuleFactory- Parameters:
name- aStringobject.- Returns:
- a
DocumentListobject.
-
createModule
public final Module createModule(java.lang.String ownerId, java.lang.String copyId)
Creates a new Module Instance for given owner and copy ids.- Specified by:
createModulein interfaceIModuleFactory- Parameters:
ownerId- aStringobject.copyId- aStringobject.- Returns:
- a
Moduleobject.
-
recreateModule
public abstract Module recreateModule(java.lang.String ownerId, java.lang.String copyId)
Recreates a Module. This method is called by the AbstractModuleFactory in the createModule method. It sets the proper owner and copy ids in the newly created Module instance, so the extending class doesn't need to do it itself.- Parameters:
ownerId- aStringobject.copyId- aStringobject.- Returns:
- recreated module
-
-