# Class XmlCmlReader

java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.xml.XmlReader
org.jmol.adapter.readers.xml.XmlCmlReader

All Implemented Interfaces:
  `GenericLineReader`

Direct Known Subclasses:
  `XmlMOReader, XmlNmrmlReader`

public class XmlCmlReader extends XmlReader
A CML2 Reader - If passed a bufferedReader (from a file or inline string), we generate a SAX parser and use callbacks to construct an AtomSetCollection. If passed a JSObject (from LiveConnect) we treat it as a JS DOM tree, and walk the tree, (using the same processing as the SAX parser) to construct the AtomSetCollection. symmetry added by Bob Hanson: setSpaceGroupName() setUnitCellItem() setFractionalCoordinates() setAtomCoord() applySymmetryAndSetTrajectory() "isotope" added 4/6/2009 Bob Hanson

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static final int`
`ASSOCIATION`
state constants
`protected static final int`
`CML`
state constants
`protected static final int`
`CRYSTAL`
state constants
`protected static final int`
`CRYSTAL_SCALAR`
state constants
`protected static final int`
`CRYSTAL_SYMMETRY`
state constants
`protected static final int`
`CRYSTAL_SYMMETRY_TRANSFORM3`
state constants
`protected Map<String,Object>`
`htModelAtomMap`
`protected static final int`
`LATTICE_VECTOR`
state constants
`protected static final int`
`MODULE`
state constants
`protected static final int`
`MOLECULE`
state constants
`protected static final int`
`MOLECULE_ATOM`
state constants
`protected static final int`
`MOLECULE_ATOM_ARRAY`
state constants
`protected static final int`
`MOLECULE_ATOM_BUILTIN`
state constants
`protected static final int`
`MOLECULE_ATOM_SCALAR`
state constants
`protected static final int`
`MOLECULE_BOND`
state constants
`protected static final int`
`MOLECULE_BOND_ARRAY`
state constants
`protected static final int`
`MOLECULE_BOND_BUILTIN`
state constants
`protected static final int`
`MOLECULE_BOND_STEREO`
state constants
`protected static final int`
`MOLECULE_FORMULA`
state constants
`protected String`
`moleculeID`
`protected boolean`
`processing`
`protected static final int`
`START`
state constants
`protected int`
`state`
`protected static final int`
`SYMMETRY`
state constants
`protected String[]`
`tokens`
/////////////////////////////////////////////////////////////

### Fields inherited from class XmlReader

`atts, chars, keepChars, parent, thisAtom`

### Fields inherited from class 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
Constructor
Description
`XmlCmlReader()`

## Method Summary

Modifier and Type
Method
Description
`void`
`applySymmetryAndSetTrajectory()`
`void`
`endDocument()`
`protected void`
`processEnd2(String name)`
`protected void`
`processStart2(String name)`
`void`
`processStartElement(String name, String nodeName)`
`protected void`
`processXml(XmlReader parent, Object saxReader)`
the current state

### Methods inherited from class XmlReader

`finalizeSubclassReader, initializeReader, previewXML, processDOM, processXml2, setKeepChars`

### Methods inherited from class AtomSetCollectionReader

`addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addMoreUnitCellInfo, addSites, addSiteScript, appendLoadNote, 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, warnSkippingOperation`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### tokens

protected String[] tokens
/////////////////////////////////////////////////////////////

### processing

protected boolean processing

### state

protected int state

### moleculeID

protected String moleculeID

### htModelAtomMap

protected Map<String,Object> htModelAtomMap

### START

protected static final int START
state constants

See Also:
  - Constant Field Values

### CML

protected static final int CML
state constants

See Also:
  - Constant Field Values

### CRYSTAL

protected static final int CRYSTAL
state constants

See Also:
  - Constant Field Values

### CRYSTAL_SCALAR

protected static final int CRYSTAL_SCALAR
state constants

See Also:
  - Constant Field Values

### CRYSTAL_SYMMETRY

protected static final int CRYSTAL_SYMMETRY
state constants

See Also:
  - Constant Field Values

### CRYSTAL_SYMMETRY_TRANSFORM3

protected static final int CRYSTAL_SYMMETRY_TRANSFORM3
state constants

See Also:
  - Constant Field Values

### MOLECULE

protected static final int MOLECULE
state constants

See Also:
  - Constant Field Values

### MOLECULE_ATOM_ARRAY

protected static final int MOLECULE_ATOM_ARRAY
state constants

See Also:
  - Constant Field Values

### MOLECULE_ATOM

protected static final int MOLECULE_ATOM
state constants

See Also:
  - Constant Field Values

### MOLECULE_ATOM_SCALAR

protected static final int MOLECULE_ATOM_SCALAR
state constants

See Also:
  - Constant Field Values

### MOLECULE_BOND_ARRAY

protected static final int MOLECULE_BOND_ARRAY
state constants

See Also:
  - Constant Field Values

### MOLECULE_BOND

protected static final int MOLECULE_BOND
state constants

See Also:
  - Constant Field Values

### MOLECULE_BOND_STEREO

protected static final int MOLECULE_BOND_STEREO
state constants

See Also:
  - Constant Field Values

### MOLECULE_FORMULA

protected static final int MOLECULE_FORMULA
state constants

See Also:
  - Constant Field Values

### MOLECULE_ATOM_BUILTIN

protected static final int MOLECULE_ATOM_BUILTIN
state constants

See Also:
  - Constant Field Values

### MOLECULE_BOND_BUILTIN

protected static final int MOLECULE_BOND_BUILTIN
state constants

See Also:
  - Constant Field Values

### MODULE

protected static final int MODULE
state constants

See Also:
  - Constant Field Values

### SYMMETRY

protected static final int SYMMETRY
state constants

See Also:
  - Constant Field Values

### LATTICE_VECTOR

protected static final int LATTICE_VECTOR
state constants

See Also:
  - Constant Field Values

### ASSOCIATION

protected static final int ASSOCIATION
state constants

See Also:
  - Constant Field Values

## Constructor Details

### XmlCmlReader

public XmlCmlReader()

## Method Details

### processXml

protected void processXml(XmlReader parent, Object saxReader) throws Exception
the current state

Overrides:
  `processXml` in class `XmlReader`
Parameters:
  `parent` -
  `saxReader` -
Throws:
  `Exception`

### processStartElement

public void processStartElement(String name, String nodeName)

Overrides:
  `processStartElement` in class `XmlReader`
Parameters:
  `name` -
  `nodeName` - TODO

### processStart2

protected void processStart2(String name)

### processEnd2

protected void processEnd2(String name)

### applySymmetryAndSetTrajectory

public void applySymmetryAndSetTrajectory()

Overrides:
  `applySymmetryAndSetTrajectory` in class `XmlReader`

### endDocument

public void endDocument()

Overrides:
  `endDocument` in class `XmlReader`