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:
javajs.api.GenericLineReader
- Direct Known Subclasses:
XmlArgusReader,XmlChem3dReader,XmlChemDrawReader,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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Atomprivate Object[]protected Bondprotected javajs.util.SBprivate Object[]protected booleanprivate XmlReaderFields 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, centroidPacked, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCentroidUnitCell, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterAllHetero, filterCased, filterHetero, fixJavaFloat, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, is2D, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isTrajectory, latticeCells, latticeScaling, latticeType, line, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noHydrogens, noPack, optimize2D, out, packingError, paramsCentroid, paramsLattice, 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(package private) ObjectcreateDomNodeJS(String id, Object data) totally untested, probably uselessvoidprotected voidoptional reader-specific method run first.private Stringprivate voidgetDOMAttributesA(Object[] attributes) voidprivate ObjectjsObjectGetMember(Object[] jsObject, String name) private StringparseXML()protected voidprocessDOM(Object DOMNode) (package private) voidprocessEndElement(String localName) protected voidprocessStartElement(String localName, String nodeName) protected voidprocessXml(XmlReader parent, Object saxReader) protected voidprocessXml2(XmlReader parent, Object saxReader) private StringselectReaderAndGo(Object saxReader) protected voidsetKeepChars(boolean TF) private voidsetMyError(String err) private voidMethods 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, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFilterWithCase, getFortranFormatLengths, getInterface, getNewSymmetry, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, 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, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR
-
Field Details
-
atom
-
bond
-
parent
-
atts
-
thisReader
-
keepChars
protected boolean keepChars -
chars
protected javajs.util.SB chars -
domObj
-
attribs
-
-
Constructor Details
-
XmlReader
public XmlReader()
-
-
Method Details
-
initializeReader
- Overrides:
initializeReaderin classAtomSetCollectionReader- Throws:
Exception
-
setMyError
-
parseXML
-
selectReaderAndGo
-
processXml
- Parameters:
parent-saxReader-- Throws:
Exception
-
processXml2
- Throws:
Exception
-
createDomNodeJS
totally untested, probably useless- Parameters:
id-data-- Returns:
- dom object
-
applySymmetryAndSetTrajectory
public void applySymmetryAndSetTrajectory()- Overrides:
applySymmetryAndSetTrajectoryin classAtomSetCollectionReader
-
processDOM
- Overrides:
processDOMin classAtomSetCollectionReader
-
processStartElement
- Parameters:
localName-nodeName- TODO
-
setKeepChars
protected void setKeepChars(boolean TF) -
processEndElement
- Parameters:
localName-
-
walkDOMTree
private void walkDOMTree() -
fixLocal
-
getDOMAttributesA
-
jsObjectGetMember
- Parameters:
jsObject-name-- Returns:
- an object
-
endDocument
public void endDocument() -
finalizeSubclassReader
Description copied from class:AtomSetCollectionReaderoptional reader-specific method run first.- Overrides:
finalizeSubclassReaderin classAtomSetCollectionReader- Throws:
Exception
-