wt.ixb.publicforhandlers
Class ClassExporterImporterTemplateGeneral

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter
Direct Known Subclasses:
ClassExporterImporterTemplate, ExpImpForIBADefinition, ExpImpForUnits

public abstract class ClassExporterImporterTemplateGeneral
extends Object
implements ClassExporterImporter

General template for class handlers which defines trivial implementation.
It defines some abstract methods that individual class handlers must implement.

Supported API: true

Extendable: false


Field Summary
private static String CLASSNAME
           
protected static String CONFLICT_RESOURCE
           
private static String RESOURCE
           
 
Constructor Summary
ClassExporterImporterTemplateGeneral()
           
 
Method Summary
 void checkConflicts(IxbElement elem, Importer importer)
          Checks conflicts that can arise while import process.
abstract  void exportObject(Object ob, Exporter exporter)
          Exports the specified object in context given by parameter exporter.
 void finalizeCheckConflicts(Importer importer)
          Called in the end of conflict check process.
 void finalizeExport(Exporter exporter)
          This method is called in the end of the whole export process to execute any additional export process finalization.
 void finalizeImport(Importer importer)
          Called in the end of the whole ipport process to execute any import process finalization.
 int getAdditionalImportPriority(IxbElement fileXML)
          Return the additional import priority based on the XML file, supplemented to getImportPriority().
abstract  int getImportPriority()
          Return the import priority of the object type represented by this import handler.
 String getObjectDisplayID(IxbElement elem, Importer importer)
          Return the localized identity of the element that will be used in import operation.
abstract  Object importElement(IxbElement elem, Importer importer)
          Imports XML element in context given by importer parameter.
 void outputLog(Object ob, Importer importer)
          Output log for imported object.
 void prepareForCheckConflicts(Importer importer)
          Called in the beginning of conflict check process prior to the real import or preview.
 void prepareForImport(Importer importer)
          Called in the end of conflict check process and prior to the realimport process.
 void previewElement(IxbElement elem, Importer importer)
          Preview XML element in context given by importer parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

CONFLICT_RESOURCE

protected static final String CONFLICT_RESOURCE
See Also:
Constant Field Values
Constructor Detail

ClassExporterImporterTemplateGeneral

public ClassExporterImporterTemplateGeneral()
Method Detail

exportObject

public abstract void exportObject(Object ob,
                                  Exporter exporter)
                           throws WTException
Exports the specified object in context given by parameter exporter.

Supported API: true

Specified by:
exportObject in interface ClassExporter
Parameters:
ob - The object to be exported.
exporter - The Exporter instance that represents the context of the export operation.
Throws:
WTException

importElement

public abstract Object importElement(IxbElement elem,
                                     Importer importer)
                              throws WTException
Imports XML element in context given by importer parameter. Returns the imported object.

Supported API: true

Specified by:
importElement in interface ElementImporter
Parameters:
elem - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Returns:
Object
Throws:
WTException

getImportPriority

public abstract int getImportPriority()
                               throws WTException
Return the import priority of the object type represented by this import handler.
Import priority defines the order in which objects will be imported. This method does not carry parameters in the signature. The return value can not be negative. Those XML files will have a higher import priority for smaller returned values.

Supported API: true

Specified by:
getImportPriority in interface ElementImporter
Returns:
int
Throws:
WTException

finalizeExport

public void finalizeExport(Exporter exporter)
                    throws WTException
This method is called in the end of the whole export process to execute any additional export process finalization.

Supported API: true

Specified by:
finalizeExport in interface ClassExporter
Parameters:
exporter - Exports the specified object in context given by parameter exporter.
Throws:
WTException

prepareForCheckConflicts

public void prepareForCheckConflicts(Importer importer)
                              throws WTException
Called in the beginning of conflict check process prior to the real import or preview.

Supported API: true

Specified by:
prepareForCheckConflicts in interface ElementImporter
Parameters:
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

checkConflicts

public void checkConflicts(IxbElement elem,
                           Importer importer)
                    throws WTException
Checks conflicts that can arise while import process.

Supported API: true

Specified by:
checkConflicts in interface ElementImporter
Parameters:
elem - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

finalizeCheckConflicts

public void finalizeCheckConflicts(Importer importer)
                            throws WTException
Called in the end of conflict check process.

Supported API: true

Specified by:
finalizeCheckConflicts in interface ElementImporter
Parameters:
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

prepareForImport

public void prepareForImport(Importer importer)
                      throws WTException
Called in the end of conflict check process and prior to the realimport process.

Supported API: true

Specified by:
prepareForImport in interface ElementImporter
Parameters:
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

getAdditionalImportPriority

public int getAdditionalImportPriority(IxbElement fileXML)
                                throws WTException
Return the additional import priority based on the XML file, supplemented to getImportPriority().
The returned number defines the order in which XML file will be imported if getImportPriority() returns the same value. In general, if getImportPriority() returns a smaller value, it will have a higher import priority; for the XML files with the same value of getImportPriority(), the one with a smaller value from this method will have a higher import priority.The returned value must be at least 0.

Supported API: true

Specified by:
getAdditionalImportPriority in interface ElementImporter
Parameters:
fileXML -
Returns:
int
Throws:
WTException

finalizeImport

public void finalizeImport(Importer importer)
                    throws WTException
Called in the end of the whole ipport process to execute any import process finalization.

Supported API: true

Specified by:
finalizeImport in interface ElementImporter
Parameters:
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

previewElement

public void previewElement(IxbElement elem,
                           Importer importer)
                    throws WTException
Preview XML element in context given by importer parameter. Usually it will check conflicts without performing real import.

Supported API: true

Specified by:
previewElement in interface ElementImporter
Parameters:
elem - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

getObjectDisplayID

public String getObjectDisplayID(IxbElement elem,
                                 Importer importer)
                          throws WTException
Return the localized identity of the element that will be used in import operation. This is mostly for localized log purpose.

Supported API: true

Specified by:
getObjectDisplayID in interface ElementImporter
Parameters:
elem - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Returns:
String
Throws:
WTException

outputLog

public void outputLog(Object ob,
                      Importer importer)
               throws WTException
Output log for imported object.

Supported API: true

Specified by:
outputLog in interface ElementImporter
Parameters:
ob - he object for the log. It can be a new imported object or an existing one in the datastore.
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException