org.qedeq.kernel.bo.service.basis
Class QedeqVoBuilder

java.lang.Object
  extended by org.qedeq.kernel.bo.service.basis.QedeqVoBuilder

public class QedeqVoBuilder
extends java.lang.Object

TODO 20110125 m31: why do we need this builder? To make copies. Why don't we take the original? At least use director pattern or transfer creation methods into BOs or use visitor pattern! We have lots of duplicate code here!

An builder for creating QedeqVos. This builder takes something that implements the QEDEQ interfaces (beginning with (@link org.qedeq.kernel.base.module.Qedeq} and makes copies that are out of the package org.qedeq.kernel.dto.*. Only elements that are not null are copied.

Author:
Michael Meyling

Constructor Summary
protected QedeqVoBuilder(ModuleAddress address)
          Constructor.
 
Method Summary
protected  QedeqVo create(Qedeq original)
          Create out of an Qedeq instance.
static QedeqVo createQedeq(ModuleAddress address, Qedeq original)
          Create QedeqVo out of an Qedeq instance.
protected  ModuleContext getCurrentContext()
          Get current context within original.
protected  Qedeq getQedeqOriginal()
          Get original QEDEQ module.
protected  void setLocationWithinModule(java.lang.String locationWithinModule)
          Set location information where are we within the original module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QedeqVoBuilder

protected QedeqVoBuilder(ModuleAddress address)
Constructor.

Parameters:
address - QEDEQ address.
Method Detail

createQedeq

public static QedeqVo createQedeq(ModuleAddress address,
                                  Qedeq original)
                           throws ModuleDataException
Create QedeqVo out of an Qedeq instance. The resulting object has no references to the original Qedeq instance.

During the creation process the caller must assert that no modifications are made to the Qedeq instance including its referenced objects.

Parameters:
address - Module address.
original - Basic QEDEQ module object.
Returns:
Created copy object.
Throws:
ModuleDataException - Invalid data found.

create

protected final QedeqVo create(Qedeq original)
                        throws IllegalModuleDataException
Create out of an Qedeq instance. During that procedure some basic checking is done. E.g. the uniqueness of entries is tested. The resulting business object has no references to the original Qedeq instance.

During the creation process the caller must assert that no modifications are made to the Qedeq instance including its referenced objects.

Parameters:
original - Basic QEDEQ module object.
Returns:
Copied QEDEQ object.
Throws:
IllegalModuleDataException - Basic semantic error occurred.

setLocationWithinModule

protected void setLocationWithinModule(java.lang.String locationWithinModule)
Set location information where are we within the original module.

Parameters:
locationWithinModule - Location within module.

getCurrentContext

protected final ModuleContext getCurrentContext()
Get current context within original.

Returns:
Current context.

getQedeqOriginal

protected final Qedeq getQedeqOriginal()
Get original QEDEQ module.

Returns:
Original QEDEQ module.


Copyright © 2014. All Rights Reserved.