Last update: 2011-06-23

org.proteios.io.mzdata
Class MzDataImpDataBlock

java.lang.Object
  extended by org.proteios.io.mzdata.MzDataImpCommon
      extended by org.proteios.io.mzdata.MzDataImpCommonDc
          extended by org.proteios.io.mzdata.MzDataImpCommonAnnotation
              extended by org.proteios.io.mzdata.MzDataImpCommonPeakList
                  extended by org.proteios.io.mzdata.MzDataImpDataBlock

public class MzDataImpDataBlock
extends MzDataImpCommonPeakList

This class processes a "data" XML block in an mzData file. An mzData file contains information on a mass spectrometry experiment. The mzData file is first vaildated against the XML Schema Definition file mzdata.xsd. If the file is valid, its content is parsed and selected information stored in Proteios. The mzData file is parsed using cursor-based XML stream parsing. The StAX (Stream API for XML) parser finds start and stop (end) tags, which are then processed. Element attributes are located in the start tag, and elements of simple types are stored directly after the start tag is read. For more complex elements, values of attributes and sub-elements are collected in temporary variables, until the end tag is reached, and the colelcted contents are stored. Example: XML tag tagData At start tag: Method thisTagElementStart() stores attribute values. Between tags: tagData is stored in temporary StringBuffer. At end tag: Method thisTagItem() processes collected data. Tag data may be exchanged for a start/end tag pair, etc.

Version:
2.0
Author:
Olle
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Field Summary
 
Fields inherited from class org.proteios.io.mzdata.MzDataImpCommonDc
anna, dc, factory
 
Fields inherited from class org.proteios.io.mzdata.MzDataImpCommon
log
 
Constructor Summary
MzDataImpDataBlock(SessionControl sc)
          Default constructor.
 
Method Summary
 void blockEnd(javax.xml.stream.XMLStreamReader parser)
          Processes end of XML block processed by this class.
 void blockStart(javax.xml.stream.XMLStreamReader parser)
          Processes start of XML block processed by this class.
 List<Double> dataItem(boolean doublePrecision, boolean bigEndian, String dataBase64Raw)
          Creates a data item.
 int getDataLength()
          Get the dataLength.
 List<Double> getDecodedBase64List()
          Get the decodedBase64List.
 String getEndian()
          Get the endian.
 String getPrecision()
          Get the precision.
 boolean isBigEndian()
          Get the bigEndian.
 boolean isDoublePrecision()
          Get the doublePrecision.
 void setDataLength(int dataLength)
          Set the dataLength.
 void setDecodedBase64List(List<Double> decodedBase64List)
          Set the decodedBase64List.
 void setEndian(String endian)
          Set the endian.
 void setPrecision(String precision)
          Set the precision.
 
Methods inherited from class org.proteios.io.mzdata.MzDataImpCommonPeakList
getPeakList, parse, setPeakList
 
Methods inherited from class org.proteios.io.mzdata.MzDataImpCommonAnnotation
fetchCvLookupAnnotation, fetchCvLookupAnnotationList, fetchCvParamAnnotation, fetchCvParamAnnotationList, fetchUserParamAnnotation, fetchUserParamAnnotationList, storeAnnotation, storeCvLookupAnnotation, storeCvParamAnnotation, storeUserParamAnnotation
 
Methods inherited from class org.proteios.io.mzdata.MzDataImpCommonDc
enableDbControl, enableDbControl, getDbControl, getSessionControl, setDbControl
 
Methods inherited from class org.proteios.io.mzdata.MzDataImpCommon
getBlockTagName, getTempStrBuf, parse, processCData, processCharacters, processInternalEndElement, processInternalStartElement, setBlockTagName, setTempStrBuf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MzDataImpDataBlock

public MzDataImpDataBlock(SessionControl sc)
Default constructor.

Method Detail

getPrecision

public String getPrecision()
Get the precision.

Returns:
precision String the precision

setPrecision

public void setPrecision(String precision)
Set the precision.

Parameters:
precision - String the precision to set.

getEndian

public String getEndian()
Get the endian.

Returns:
endian String the endian

setEndian

public void setEndian(String endian)
Set the endian.

Parameters:
endian - String the endian to set.

getDataLength

public int getDataLength()
Get the dataLength.

Returns:
dataLength int the dataLength

setDataLength

public void setDataLength(int dataLength)
Set the dataLength.

Parameters:
dataLength - int the dataLength to set.

getDecodedBase64List

public List<Double> getDecodedBase64List()
Get the decodedBase64List.

Returns:
decodedBase64List List the decodedBase64List

setDecodedBase64List

public void setDecodedBase64List(List<Double> decodedBase64List)
Set the decodedBase64List.

Parameters:
decodedBase64List - List the decodedBase64List to set.

isDoublePrecision

public boolean isDoublePrecision()
Get the doublePrecision.

Returns:
doublePrecision boolean doublePrecision based on String precision

isBigEndian

public boolean isBigEndian()
Get the bigEndian.

Returns:
bigEndian boolean bigEndian based on String endian

blockStart

public void blockStart(javax.xml.stream.XMLStreamReader parser)
                throws javax.xml.stream.XMLStreamException
Processes start of XML block processed by this class. Extracts data from attributes.

Overrides:
blockStart in class MzDataImpCommon
Parameters:
parser - XMLStreamReader instance.
Throws:
javax.xml.stream.XMLStreamException - If there is an XML Stream related error

blockEnd

public void blockEnd(javax.xml.stream.XMLStreamReader parser)
              throws javax.xml.stream.XMLStreamException
Processes end of XML block processed by this class. Extracts data in block. This method should be overirdden by the daughter class if it needs to process the XML end element of the block.

Overrides:
blockEnd in class MzDataImpCommon
Parameters:
parser - XMLStreamReader instance.
Throws:
javax.xml.stream.XMLStreamException - If there is an XML Stream related error

dataItem

public List<Double> dataItem(boolean doublePrecision,
                             boolean bigEndian,
                             String dataBase64Raw)
Creates a data item.

Parameters:
doublePrecision - boolean precision = 64: true, precision = 32: false
bigEndian - boolean big endian: true; little endian: false
dataBase64Raw - String with Base64-coded data block
Returns:
decodedBase64 List with decoded data

Last update: 2011-06-23