IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class DataExternalizer

java.lang.Object
  extended by com.ibm.btt.base.Externalizer
      extended by com.ibm.btt.base.DataExternalizer
All Implemented Interfaces:
Cache

public class DataExternalizer
extends Externalizer

The DataExternalizer class reads data elements. The definition file must be specified in the btt.xml file in the path settings.files.data section. The tags must be defined in the settings.tags.data section.


Field Summary
 
Fields inherited from class com.ibm.btt.base.Externalizer
numberOfObjects, tagClassTable, tagInputStream, TYPE_CONTEXT, TYPE_DATA, TYPE_FORMAT, TYPE_OPERATION, TYPE_PROCESSOR, TYPE_SERVICE, TYPE_SETTINGS, TYPE_TYPE, TYPE_UNKNOWN, TYPE_VIEW
 
Constructor Summary
DataExternalizer()
          This constructor creates a DataExternalizer object.
DataExternalizer(java.lang.String option, java.io.BufferedInputStream aIniStream, java.lang.String kind)
          This constructor creates a new instance of the DataExternalizer class.
DataExternalizer(java.lang.String option, java.lang.String pathAndFile, java.lang.String kind)
          This constructor creates a new instance of the DataExternalizer class.
DataExternalizer(java.net.URL aURL, java.lang.String kind)
          This constructor initializes an externalizer.
 
Method Summary
 java.lang.Object convertTagToObject(Tag aTag)
          Converts a tag to an Object.
protected  Externalizer createNewExternalizer()
          Returns a new externalizer for the generic data file.
 void end()
          Releases resources from this Externalizer.
static void linkRefData(Tag parentTag, Tag grandParentTag, int parentRefTagIndex)
          Deprecated. Replaced by linkRefData(Tag, Tag, int, TagInputStream)
static void linkRefData(Tag parentTag, Tag grandParentTag, int parentRefTagIndex, TagInputStream aTagInputStream)
          Replaces the parentTag (refData tag) with its corresponding real tag located at the TagInputStream passed by parameter.
static void linkReferences(Tag grandParentTag, Tag parentTag, int parentRefTagIndex)
          Alters the tag structure of the tagInputStream for DSEDATA by linking all references to their real tags.
protected static void linkReferences(Tag grandParentTag, Tag parentTag, int parentRefTagIndex, TagInputStream aTagInputStream)
          Alters the tag structure of the grandParentTag by linking all references to their real tags.
static Tag overrideTagAttributes(Tag childTag, Vector subTags)
          Overrides a given tag with the attributes specified as param subtags in the given list of subtags.
 void reset()
          Sets a new data externalizer to DataElement.
 void reset(java.util.Enumeration listTagId)
          Resets the definition of the tag whose tag id appears in the listTagId.
 void reset(java.lang.String tagId)
          Resets the definition of the tag with id tagId.
protected  void reset(java.lang.String tagId, TagInputStream aTagInputStream)
          Resets the definition of the data entity with an id equal to tagId.
 void resetShareDescriptors()
          Resets the shareDataDescriptors flag defined in the btt.xml file.
 
Methods inherited from class com.ibm.btt.base.Externalizer
addEntryInTagClassTable, clearCacheTable, getCachePolicyToApply, getCacheTable, getClasses, getFromCacheTable, getNumberOfObjects, getObjectsMaxNum, getObjectsPerTypeMaxNum, getObjectTypesMaxNum, getTagClassTable, getTagInputStream, getTagOutputStream, isCachingEnabled, isRunTime, putIntoCacheTable, readObject, readObject, readTag, rebuildCacheTable, setCachingEnabled, setNumberOfObjects, setObjectsMaxNum, setObjectsPerTypeMaxNum, setObjectTypesMaxNum, setRunTime, setTagClassTable, setTagInputStream, tagList, tagWithId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataExternalizer

public DataExternalizer()
This constructor creates a DataExternalizer object.


DataExternalizer

public DataExternalizer(java.lang.String option,
                        java.io.BufferedInputStream aIniStream,
                        java.lang.String kind)
                 throws java.io.IOException
This constructor creates a new instance of the DataExternalizer class. Option can be Memory or File.Memory means that all tags are stored in memory. This is recommended with small files. File means that the file is read every time you need a tag. This is recommended with large files.

Parameters:
option - java.lang.String - Must be Memory or File
aIniStream - java.io.BufferedInputStream
kind -
Throws:
java.io.IOException

DataExternalizer

public DataExternalizer(java.lang.String option,
                        java.lang.String pathAndFile,
                        java.lang.String kind)
                 throws java.io.IOException
This constructor creates a new instance of the DataExternalizer class. Option can be Memory or File. Memory means that all tags are stored in memory. This is recommended with small files. File means that the file is read every time you need a tag. This is recommended with large files.

Parameters:
option - java.lang.String - Must be Memory or File
pathAndFile - java.lang.String
kind -
Throws:
java.io.IOException

DataExternalizer

public DataExternalizer(java.net.URL aURL,
                        java.lang.String kind)
                 throws java.io.IOException
This constructor initializes an externalizer. The URL is where the definition file is.

Throws:
java.io.IOException
Method Detail

convertTagToObject

public java.lang.Object convertTagToObject(Tag aTag)
                                    throws java.io.IOException
Converts a tag to an Object. This method is needed to create an instance of the class with the same name as the supplied tag. Note: to work properly the class providing the instance must have a constructor with no arguements.

Overrides:
convertTagToObject in class Externalizer
Parameters:
aTag - Tag
Returns:
Object
Throws:
java.io.IOException

createNewExternalizer

protected Externalizer createNewExternalizer()
                                      throws java.io.IOException,
                                             DSEObjectNotFoundException
Returns a new externalizer for the generic data file.

Returns:
com.ibm.btt.base.Externalizer
Throws:
java.io.IOException
DSEObjectNotFoundException

end

public void end()
Releases resources from this Externalizer.

Specified by:
end in class Externalizer

linkRefData

public static void linkRefData(Tag parentTag,
                               Tag grandParentTag,
                               int parentRefTagIndex)
                        throws java.io.IOException,
                               DSEObjectNotFoundException
Deprecated. Replaced by linkRefData(Tag, Tag, int, TagInputStream)

This method replaces parentTag (refData tag) with its corresponding real tag.

Throws:
java.io.IOException
DSEObjectNotFoundException

linkRefData

public static void linkRefData(Tag parentTag,
                               Tag grandParentTag,
                               int parentRefTagIndex,
                               TagInputStream aTagInputStream)
                        throws java.io.IOException,
                               DSEObjectNotFoundException
Replaces the parentTag (refData tag) with its corresponding real tag located at the TagInputStream passed by parameter.

Throws:
java.io.IOException
DSEObjectNotFoundException

linkReferences

public static void linkReferences(Tag grandParentTag,
                                  Tag parentTag,
                                  int parentRefTagIndex)
                           throws java.io.IOException,
                                  DSEObjectNotFoundException
Alters the tag structure of the tagInputStream for DSEDATA by linking all references to their real tags. This method replaces all refData tags from DSEDATA with their corresponding real tags. The grandParentTag has the parentTag as one of its subtags.

Parameters:
grandParentTag - com.ibm.btt.base.Tag
parentTag - com.ibm.btt.base.Tag - The tag that is currently being checked for references
parentRefTagIndex - int - The index of the parentTag in the subtags vector of grandParentTag
Throws:
java.io.IOException
DSEObjectNotFoundException

linkReferences

protected static void linkReferences(Tag grandParentTag,
                                     Tag parentTag,
                                     int parentRefTagIndex,
                                     TagInputStream aTagInputStream)
                              throws java.io.IOException,
                                     DSEObjectNotFoundException
Alters the tag structure of the grandParentTag by linking all references to their real tags. This method replaces all refData tags with their corresponding real tags located at the TagInputStream passed by parameter. The grandParentTag has the parentTag as one of its subtags.

Parameters:
grandParentTag - com.ibm.btt.base.Tag
parentTag - com.ibm.btt.base.Tag - The tag that is currently being checked for references
parentRefTagIndex - int - The index of the parentTag in the subtags vector of grandParentTag
aTagInputStream - com.ibm.btt.base.TagInputStream - The input stream in which references are searched
Throws:
java.io.IOException
DSEObjectNotFoundException

overrideTagAttributes

public static Tag overrideTagAttributes(Tag childTag,
                                        Vector subTags)
Overrides a given tag with the attributes specified as param subtags in the given list of subtags.

Parameters:
childTag - com.ibm.btt.base.Tag
subTags - com.ibm.btt.base.Vector
Returns:
com.ibm.btt.base.Tag

reset

public void reset()
           throws java.io.IOException,
                  DSEObjectNotFoundException
Sets a new data externalizer to DataElement.

Throws:
java.io.IOException
DSEObjectNotFoundException

reset

public void reset(java.lang.String tagId)
           throws java.io.IOException,
                  DSEObjectNotFoundException
Resets the definition of the tag with id tagId. The new definition is read and its references solved from the file associated with this externalizer. If the tag doesn't exist in the file but exists in memory then memory definition is deleted. If the tag doesn't exist neither in the file nor in memory then an exception is thrown. If the tag exists in the file but doesn't exist in memory then the new definition is added to memory. If the tag exists both in the file and in memory then the memory definition is updated with the file definition.

Parameters:
tagId - java.lang.String The id of the tag to reset
Throws:
java.io.IOException
DSEObjectNotFoundException

reset

protected void reset(java.lang.String tagId,
                     TagInputStream aTagInputStream)
              throws java.io.IOException
Resets the definition of the data entity with an id equal to tagId. The new definition is obtained from the TagInputStream passed as a parameter. If the tag doesn't exist in the TagInputStream, but exists in memory, this method deletes the memory definition. If the tag doesn't exist in the TagInputStream or in memory, this method throws an exception. If the tag exists in the TagInputStream, but doesn't exist in memory, this method adds the new definition to memory. If the tag exists both in the TagInputStream and in memory, this method updates the memory definition with the TagInputStream definition.

Parameters:
tagId - java.lang.String
aTagInputStream - com.ibm.btt.base.TagInputStream
Throws:
java.io.IOException

reset

public void reset(java.util.Enumeration listTagId)
           throws java.io.IOException,
                  DSEObjectNotFoundException
Resets the definition of the tag whose tag id appears in the listTagId. The new definition is read and its references solved from the file associated with this externalizer. If the tag doesn't exist in the TagInputStream, but exists in memory, this method deletes the memory definition. If the tag doesn't exist in the TagInputStream or in memory, this method throws an exception. If the tag exists in the TagInputStream, but doesn't exist in memory, this method adds the new definition to memory. If the tag exists both in the TagInputStream and in memory, this method updates the memory definition with the TagInputStream definition.

Parameters:
listTagId - java.util.Enumeration
Throws:
java.io.IOException
DSEObjectNotFoundException

resetShareDescriptors

public void resetShareDescriptors()
Resets the shareDataDescriptors flag defined in the btt.xml file.


IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011