# Class XmlCdxReader

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

All Implemented Interfaces:
  `GenericLineReader, CDXMLParser.CDXReaderI`

Direct Known Subclasses:
  `CDXReader`

public class XmlCdxReader extends XmlReader implements CDXMLParser.CDXReaderI
A reader for CambridgeSoft CDXML files. revvity site: https://support.revvitysignals.com/hc/en-us/articles/4408233129748-Where-is-the-ChemDraw-SDK-located Their link: https://web.archive.org/web/20221209095323/https://www.cambridgesoft.com/services/documentation/sdk/chemdraw/cdx/ WayBack machine Overview: https://web.archive.org/web/20240000000000* /https://www.cambridgesoft.com/services/documentation/sdk/chemdraw/cdx Partial archives: https://web.archive.org/web/20160911235313/http://www.cambridgesoft.com/services/documentation/sdk/chemdraw/cdx/index.htm https://web.archive.org/web/20160310081515/http://www.cambridgesoft.com/services/documentation/sdk/chemdraw/cdx/ https://web.archive.org/web/20100503174209/http://www.cambridgesoft.com/services/documentation/sdk/chemdraw/cdx/ Unfortunately, there appears to be no single archive that has all the images, and so some of those are missing. for the full, detailed specification. Here we are just looking for simple aspects that could be converted to valid 2D MOL files, SMILES, and InChI. Fragments (such as CH2CH2OH) and "Nickname"-type fragments such as Ac and Ph, are processed correctly. But their 2D representations are pretty nuts. ChemDraw does not make any attempt to place these in reasonable locations. That said, Jmol's 3D minimization does a pretty fair job, and the default is to do that minimization. If minimization and addition of H is not desired, use FILTER "NOH" or FILTER "NO3D" XmlChemDrawReader also serves as the reader for binary CDX files, as CDXReader subclasses this class. See that class for details.

Author:
  hansonr@stolaf.edu

## Field Summary

Fields
Modifier and Type
Field
Description
`boolean`
`isCDX`

### 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
`XmlCdxReader()`

## Method Summary

Modifier and Type
Method
Description
`void`
`createMolecule()`
`protected void`
`finalizeSubclassReader()`
Fix connections to Fragments and Nicknames, adjust stereochemistry for wavy displays, flag invalid atoms, and adjust the scale to something more molecular.
`int`
`getBondOrder(String key)`
`void`
`handleCoordinates(Map<String,String> atts)`
`void`
`processStartElement(String localName, String nodeName)`
`protected void`
`processXml(XmlReader parent, Object saxReader)`
`void`
`setKeepChars(boolean TF)`
`void`
`warn(String warning)`

### Methods inherited from class XmlReader

`applySymmetryAndSetTrajectory, endDocument, initializeReader, previewXML, processDOM, processXml2`

### 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

### isCDX

public boolean isCDX

## Constructor Details

### XmlCdxReader

public XmlCdxReader()

## Method Details

### processXml

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

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

### processStartElement

public void processStartElement(String localName, String nodeName)

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

### setKeepChars

public void setKeepChars(boolean TF)

Specified by:
  `setKeepChars` in interface `CDXMLParser.CDXReaderI`
Overrides:
  `setKeepChars` in class `XmlReader`

### finalizeSubclassReader

protected void finalizeSubclassReader() throws Exception
Fix connections to Fragments and Nicknames, adjust stereochemistry for wavy displays, flag invalid atoms, and adjust the scale to something more molecular. Finalize the 2D/3D business.

Overrides:
  `finalizeSubclassReader` in class `XmlReader`
Throws:
  `Exception`

### getBondOrder

public int getBondOrder(String key)

Specified by:
  `getBondOrder` in interface `CDXMLParser.CDXReaderI`

### handleCoordinates

public void handleCoordinates(Map<String,String> atts)

Specified by:
  `handleCoordinates` in interface `CDXMLParser.CDXReaderI`

### createMolecule

public void createMolecule()

### warn

public void warn(String warning)

Specified by:
  `warn` in interface `CDXMLParser.CDXReaderI`