ucar.ncx.dom
Class NcxGenericDOMEncoder

java.lang.Object
  |
  +--ucar.ncx.dom.NcxGenericDOMEncoder
All Implemented Interfaces:
NcxDOMEncoder
Direct Known Subclasses:
NcxCFDOMEncoder

public class NcxGenericDOMEncoder
extends java.lang.Object
implements NcxDOMEncoder

Java class implementation of NcxDOMEncoder interface for generic netcdf files. XML metadata is encoded according to the generic netcdf schema http://www.ucar.edu/schemas/netcdf.


Field Summary
protected  org.w3c.dom.Document doc
          XML target document containing encoded Element objects (used as a factory to create DOM Elements)
protected  java.lang.String separator
          String used as separator for variables and attributes values (default is blank)
 
Constructor Summary
NcxGenericDOMEncoder(org.w3c.dom.Document doc)
          Constructor
 
Method Summary
 org.w3c.dom.Element encodeAttribute(ucar.nc2.Attribute ncatt)
          Implementation of NcxDOMEncoder method for generic netcdf schema
 org.w3c.dom.Element encodeDimension(ucar.nc2.Dimension ncdim)
          Implementation of NcxDOMEncoder method for generic netcdf schema
 org.w3c.dom.Element encodeVariable(ucar.nc2.Variable ncvar)
          Implementation of NcxDOMEncoder method for generic netcdf schema.
 void setSeparator(java.lang.String separator)
          Method to set the separator token used for listing variable or attribute values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

separator

protected java.lang.String separator
String used as separator for variables and attributes values (default is blank)


doc

protected org.w3c.dom.Document doc
XML target document containing encoded Element objects (used as a factory to create DOM Elements)

Constructor Detail

NcxGenericDOMEncoder

public NcxGenericDOMEncoder(org.w3c.dom.Document doc)
Constructor

Parameters:
doc - target DOM document where netcdf metadata will be stored
Method Detail

encodeDimension

public org.w3c.dom.Element encodeDimension(ucar.nc2.Dimension ncdim)
Implementation of NcxDOMEncoder method for generic netcdf schema

Specified by:
encodeDimension in interface NcxDOMEncoder
Parameters:
ncdim - netcdf dimension object to be encoded
Returns:
xml dimension tag as DOM Element object

encodeVariable

public org.w3c.dom.Element encodeVariable(ucar.nc2.Variable ncvar)
Implementation of NcxDOMEncoder method for generic netcdf schema. This method writes out the variable values iif the variable is a coordinate as defined in the netcdf specification (i.e. a one-dimensional variable that has the same name as its dimension).

Specified by:
encodeVariable in interface NcxDOMEncoder
Parameters:
ncvar - netcdf variable object to be encoded
Returns:
xml variable tag as DOM Element object

encodeAttribute

public org.w3c.dom.Element encodeAttribute(ucar.nc2.Attribute ncatt)
Implementation of NcxDOMEncoder method for generic netcdf schema

Specified by:
encodeAttribute in interface NcxDOMEncoder
Parameters:
ncatt - netcdf attribute object to be encoded
Returns:
xml attribute tag as DOM Element object

setSeparator

public void setSeparator(java.lang.String separator)
Method to set the separator token used for listing variable or attribute values

Parameters:
separator - String used to separate values (default is blank separator)