gizmoball.boardIO
Class boardIO
java.lang.Object
org.xml.sax.helpers.DefaultHandler
gizmoball.boardIO.boardIO
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class boardIO
- extends org.xml.sax.helpers.DefaultHandler
- Author:
- Sara Mustin
|
Constructor Summary |
boardIO(double L)
|
|
Method Summary |
static void |
main(java.lang.String[] args)
|
static GizmoBoard |
parse(java.io.File xmlFile,
double L)
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
org.xml.sax.Attributes attributes)
|
static java.lang.String |
unparse(java.io.File file,
GizmoBoard gboard,
double L)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
theBoard
public static GizmoBoard theBoard
boardIO
public boardIO(double L)
- Parameters:
double - L - the scale of the board
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
org.xml.sax.Attributes attributes)
- Specified by:
startElement in interface org.xml.sax.ContentHandler- Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
- Parameters:
uri - the Namespace uri, or the empty string if the element has no
Namespace URI or if Namespace processing is not being
performed.localName - -
The local name (without prefix), or the empty string if
Namespace processing is not being performed.rawName - -
the actual name of the elementattributes - -
The attributes attached to the element. If there are no
attributes, it shall be an empty Attributes object.
unparse
public static java.lang.String unparse(java.io.File file,
GizmoBoard gboard,
double L)
throws java.io.IOException
- Parameters:
File - -
the File the board will get saved intoBoard - -
the board to be unparsed into an xml file
- Throws:
java.io.IOException - if the filename cannot be read
parse
public static GizmoBoard parse(java.io.File xmlFile,
double L)
throws java.io.IOException
- Parameters:
File - a file to be parsedL - the scale
- Throws:
java.lang.Exception - if the filename cannot be read
java.io.IOException
main
public static void main(java.lang.String[] args)