Package org.jmol.adapter.readers.xml
Class XmlReader
java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.xml.XmlReader
- All Implemented Interfaces:
GenericLineReader
- Direct Known Subclasses:
XmlArgusReader
,XmlCdxReader
,XmlChem3dReader
,XmlCmlReader
,XmlMagResReader
,XmlOdysseyReader
,XmlQEReader
,XmlVaspReader
,XmlXsdReader
A generic XML reader template -- by itself, does nothing.
The actual readers are XmlCmlReader, XmlMolproReader (which is an extension
of XmlCmlReader), XmlChem3dReader, and XmlOdysseyReader.
XmlReader takes all XML streams, whether from a file reader or from DOM.
This class functions as a resolver, since it: (1) identifying the specific
strain of XML to be handled, and (2) passing the responsibility on to the
correct format-specific XML readers. There are parallel entry points and
handler methods for reader and DOM. Each format-specific XML reader then
assigns its own handler to manage the parsing of elements.
In addition, this class handles generic XML tag parsing.
XmlHandler extends DefaultHandler is the generic interface to both reader and
DOM element parsing.
XmlCmlReader extends XmlReader
XmlMolproReader extends XmlCmlReader. If you feel like expanding on that,
feel free.
XmlChem3dReader extends XmlReader. That one is simple; no need to expand on
it at this time.
XmlOdysseyReader extends XmlReader. That one is simple; no need to expand on
it at this time.
Note that the tag processing routines are shared between SAX and DOM
processors. This means that attributes must be transformed from either
Attributes (SAX) or JSObjects (DOM) to Hashtable name:value pairs. This is
taken care of in JmolXmlHandler for all readers.
TODO 27/8/06:
Several aspects of CifReader are NOT YET implemented here. These include
loading a specific model when there are several, applying the symmetry, and
loading fractional coordinates. [DONE for CML reader 2/2007 RMH]
Test files:
molpro: vib.xml odyssey: water.xodydata cml: a wide variety of files in
data-files.
-Bob Hanson
-
Field Summary
FieldsFields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addedData, addedDataKey, addVibrations, allow_a_len_1, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, baseBondIndex, binaryDoc, bsFilter, bsModels, calculationType, CELL_TYPE_CONVENTIONAL, CELL_TYPE_PRIMITIVE, CELL_TYPE_SUPER, cellSlop, centroidPacked, checkNearAtoms, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCentroidUnitCell, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterAllHetero, filterCased, filteredPrecision, filterHetero, floatifyJavaDouble, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, is2D, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isSUPERCELL, isTrajectory, latticeCells, latticeScaling, latticeType, line, lowPrecision, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noHydrogens, noMinimize, noPack, optimize2D, out, paramsCentroid, paramsLattice, precision, prevline, primitiveToCrystal, ptLine, ptSupercell, reader, readerName, requiresBSFilter, reverseModels, rotateHexCell, sgName, slabXY, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, ucItems, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
protected void
optional reader-specific method run first.void
protected void
processDOM
(Object DOMNode) protected void
processStartElement
(String localName, String nodeName) protected void
processXml
(XmlReader parent, Object saxReader) protected void
processXml2
(XmlReader parent, Object saxReader) protected void
setKeepChars
(boolean TF) Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, applySymTrajASCR, checkAndRemoveFilterKey, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLine, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, discardPreviousAtoms, doGetModel, doGetVibration, doPreSymmetry, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassSymmetry, fixDoubleA, fixFloatA, fixFloatPt, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFilterWithCase, getFortranFormatLengths, getInterface, getPackingRangeValue, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parsePrecision, parseToken, parseTokenNext, parseTokenRange, parseTokenStr, processBinaryDocument, rd, read3Vectors, readDataObject, readLines, readNextLine, rejectAtomName, RL, set2D, setAtomCoord, setAtomCoordScaled, setAtomCoordTokens, setAtomCoordXYZ, setChainID, setElementAndIsotope, setFilter, setFilterAtomTypeStr, setFractionalCoordinates, setIsPDB, setLoadNote, setModelPDB, setPrecision, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR
-
Field Details
-
atom
-
bond
-
parent
-
atts
-
keepChars
protected boolean keepChars -
chars
-
-
Constructor Details
-
XmlReader
public XmlReader()
-
-
Method Details
-
initializeReader
- Overrides:
initializeReader
in classAtomSetCollectionReader
- Throws:
Exception
-
processXml
- Parameters:
parent
-saxReader
-- Throws:
Exception
-
processXml2
- Throws:
Exception
-
applySymmetryAndSetTrajectory
public void applySymmetryAndSetTrajectory()- Overrides:
applySymmetryAndSetTrajectory
in classAtomSetCollectionReader
-
processDOM
- Overrides:
processDOM
in classAtomSetCollectionReader
-
processStartElement
- Parameters:
localName
-nodeName
- TODO
-
setKeepChars
protected void setKeepChars(boolean TF) -
endDocument
public void endDocument() -
finalizeSubclassReader
Description copied from class:AtomSetCollectionReader
optional reader-specific method run first.- Overrides:
finalizeSubclassReader
in classAtomSetCollectionReader
- Throws:
Exception
-