edu.washington.biostr.sig.brainj3d.data.decoder
Class BasicXMLDecoder

java.lang.Object
  extended by edu.washington.biostr.sig.brainj3d.data.decoder.BasicXMLDecoder
All Implemented Interfaces:
Decoder
Direct Known Subclasses:
BrainInfoAtlasDecoder, LibraryDecoder, TreeTemplateDecoder, XMapDecoder

public abstract class BasicXMLDecoder
extends Object
implements Decoder

Title:

Description:

Copyright: Copyright (c) 2003

Company:

This is a generic class for reading xml files using the DOM, which is most appropriate for this kind of Decoder.

Version:
1.0
Author:
not attributable

Constructor Summary
BasicXMLDecoder()
           
 
Method Summary
 Data decode(String directory, URL[] urls, FileGroup source)
           
static Document decode(URL url)
          This is a helper function to decode a Document from a url using the basic factory and a nonvalidating parser.
 int getNumberOfFiles()
           
protected  String getSubText(Node element)
          Often you may want to get the trimmed text from a node that should only have one subnode, which is a text node.
abstract  Data interpret(Document document, String directory, FileGroup source)
          This is where you should interpret the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.washington.biostr.sig.brainj3d.data.Decoder
getResultType
 

Constructor Detail

BasicXMLDecoder

public BasicXMLDecoder()
Method Detail

decode

public Data decode(String directory,
                   URL[] urls,
                   FileGroup source)
            throws BadDataFile,
                   FileNotFoundException,
                   IOException
Specified by:
decode in interface Decoder
Throws:
BadDataFile
FileNotFoundException
IOException

interpret

public abstract Data interpret(Document document,
                               String directory,
                               FileGroup source)
This is where you should interpret the document.

Returns:

getNumberOfFiles

public int getNumberOfFiles()
Specified by:
getNumberOfFiles in interface Decoder

decode

public static Document decode(URL url)
                       throws IOException
This is a helper function to decode a Document from a url using the basic factory and a nonvalidating parser.

Parameters:
url -
Returns:
Throws:
IOException

getSubText

protected String getSubText(Node element)
Often you may want to get the trimmed text from a node that should only have one subnode, which is a text node. This is a convenience method for that.

Parameters:
element -
Returns:


Copyright © 2006 University of Washington. All Rights Reserved.