Package gov.nih.mipav.model.file
Class FileXML
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileXML
- Direct Known Subclasses:
FileDataProvenance,FileImageXML,FilePolylineVOIXML,FileSurfaceGiftiXML,FileSurfaceRefXML,FileSurfaceVTKXML,FileSurfaceXML,FileVOI
Abstract base class for reading/writing .XML file headers. The XML reader uses any schema (.XSD) file, pased into the
readHeader function, for parsing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassClass used to store an xml tag's attribute (name and value) -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BufferedWriterBuffered writer for writing to XML fileprotected StringDirectory of XML file on disk.protected FileInfoXMLthe file info storing xml specific information, abstract base class of FileInfoImageXML or FileInfoSurfaceXML:protected StringName of the XML header file on disk.protected DefaultHandlerDOCUMENT ME!protected static final StringMipav header string (for top of xml header).protected ProgressBarInterfaceprogress bar implementation (either through a JProgressBar or JPanel) passed in for reading/saving file.protected static final StringTAB string.protected inttab level counter for writing xml header.protected static final StringXML schema string.protected static final StringXML encoding string.protected static final StringXML header string.Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidSimple function to write an xml formatted closed tag including the tag value.final voidclosedTag(String tag, String val, Vector<FileXML.XMLAttributes> attr) Writes a closed tag (tag, end tag) with the addition of attributes (name="value") from within a Vector (can do any number of XMLAttributes ...class included below)final voidclosedTag(String tag, Vector<FileXML.XMLAttributes> attr) Writes a closed tag where no value is specified, only attributes.voidfinalize()Prepares class for cleanup.final voidSimple function to write an xml formatted open ended tag (value not included).readHeader(String headerFileName, String headerDir, String kFileXSD) readHeader parses the input XML file based on the input XSD file, kFileXSD:voidsetPBar(ProgressBarInterface pBar) Sets the progress bar to be used for loading/saving image (JProgressBar or JPanel).Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, floatToBytes, getBufferDouble, getBufferFloat, getBufferInt, getBufferLong, getBufferShort, getBufferUShort, getDataType, getDouble, getFloat, getInt, getLong, getProgressChangeListeners, getRaFile, getSignedShort, getString, getUInt, getUnsignedByte, getUnsignedShort, intToBytes, isBigEndian, isProgressBarVisible, linkProgress, longToBytes, readDouble, readFloat, readInt, readLong, readShort, readString, readUnsignedShort, removeProgressChangeListener, setBigEndian, setBufferFloat, setBufferInt, setBufferLong, setBufferShort, setBufferString, setDataType, setEndianess, shortToBytes, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writeShort
-
Field Details
-
TAB
TAB string.- See Also:
-
W3C_XML_SCHEMA
XML schema string.- See Also:
-
XML_ENCODING
XML encoding string.- See Also:
-
XML_HEADER
XML header string.- See Also:
-
MIPAV_HEADER
Mipav header string (for top of xml header).- See Also:
-
fileDir
Directory of XML file on disk. -
fileInfo
the file info storing xml specific information, abstract base class of FileInfoImageXML or FileInfoSurfaceXML: -
fileName
Name of the XML header file on disk. -
m_kHandler
DOCUMENT ME! -
pInterface
progress bar implementation (either through a JProgressBar or JPanel) passed in for reading/saving file. -
tabLevel
protected int tabLeveltab level counter for writing xml header. -
bw
Buffered writer for writing to XML file
-
-
Constructor Details
-
FileXML
Constructs new file object.- Parameters:
fName- File name.fDir- File directory.
-
-
Method Details
-
finalize
public void finalize()Prepares class for cleanup. -
openTag
Simple function to write an xml formatted open ended tag (value not included).- Parameters:
tag- tag namestart- is this a start or end tagbw- writer to use
-
readHeader
readHeader parses the input XML file based on the input XSD file, kFileXSD:- Parameters:
headerFileName- DOCUMENT ME!headerDir- DOCUMENT ME!kFileXSD- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
setPBar
Sets the progress bar to be used for loading/saving image (JProgressBar or JPanel).- Parameters:
pBar- ProgressBarInterface
-
closedTag
Simple function to write an xml formatted closed tag including the tag value.- Parameters:
tag- tag nameval- tag valuebw- write to use
-
closedTag
Writes a closed tag (tag, end tag) with the addition of attributes (name="value") from within a Vector (can do any number of XMLAttributes ...class included below)- Parameters:
tag- the tag nameval- the tag's valueattr- vector of XMLAttributes
-
closedTag
Writes a closed tag where no value is specified, only attributes.
-