junit.extensions.xml.elements
Class SaveTagHandler

java.lang.Object
  extended byjunit.extensions.xml.elements.AbstractTagHandler
      extended byjunit.extensions.xml.elements.SaveTagHandler
All Implemented Interfaces:
XMLConstants
Direct Known Subclasses:
XMLRecorder

public class SaveTagHandler
extends AbstractTagHandler

Title: class SaveTagHandler

Description: This tag handler saves the XML tree to a filename given

Copyright: Copyright (c) 2002

Company: JFCUnit project

Tag Name

save

Required Attributes

file - file name to be saved.

Optional Attributes

encoding - encoding to be used.

Examples

<save file="myfile.xml"/>

Version:
1.0
Author:
Kevin Wilson

Field Summary
 
Fields inherited from class junit.extensions.xml.elements.AbstractTagHandler
 
Fields inherited from interface junit.extensions.xml.XMLConstants
ACTION, ACTUALOBJ, ACTUALREFID, ADD, ASSERTENABLED, ASSERTEQUALS, ASSERTNOTEQUALS, ASSERTNOTNULL, ASSERTNOTSAME, ASSERTNULL, ASSERTSAME, CALL, CASE, CHOOSE, CLASSNAME, COLUMN, CONFIRM, DEBUG, DEFAULT, DELIMITER, DIALOG, DUMP, ECHO, ENABLED, ENCODING, EVALUATE, EXPECTEDOBJ, EXPECTEDREFID, FAIL, FILE, FOCUS, FOREACH, ID, INDEX, JFCFILELOC, LESSTHAN, LISTITEM, LOG, MARK, MESSAGE, METHOD, MODE, NAME, OTHERWISE, PATHREFID, PROCEDURE, PROPERTY, RECURSIVE, REFID, RELATIVE, REMOVE, ROW, SAVE, STDERR, STDOUT, STOPWATCH, SUITE, SWITCH, TABLECELL, TAGHANDLERS, TAGNAME, TEST, TYPE, USERE, VALUE, WHEN, WHILE
 
Constructor Summary
SaveTagHandler(org.w3c.dom.Element element, IXMLTestCase testCase)
          Construct the Tag handler.
 
Method Summary
private  java.lang.String getEncoding()
          Get the encoding to be used.
private  java.lang.String getFileName()
          Return the file name stored in the XML Element.
 void processElement()
          Save the data to the filename given.
 void validateElement()
          Insure that the file attribute is specified.
 
Methods inherited from class junit.extensions.xml.elements.AbstractTagHandler
checkAtLeastOneRequiredAttribute, checkAtLeastOneRequiredAttribute, checkElementTagName, checkOneRequiredAttribute, checkOneRequiredAttribute, checkRequiredAttribute, checkRequiredAttribute, getBoolean, getBoolean, getBoolean, getBoolean, getElement, getInt, getInt, getLong, getLong, getPoint, getPoint, getString, getString, getString, getString, getTagName, getTest, getTestCase, getXMLTestCase, getXMLTestSuite, resolveVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaveTagHandler

public SaveTagHandler(org.w3c.dom.Element element,
                      IXMLTestCase testCase)
Construct the Tag handler.

Parameters:
element - Element describing the save operation.
testCase - The test case.
Method Detail

processElement

public void processElement()
                    throws XMLException
Save the data to the filename given.

Specified by:
processElement in class AbstractTagHandler
Throws:
XMLException - is thrown if the element cannot be understood.

validateElement

public void validateElement()
                     throws XMLException
Insure that the file attribute is specified.

Overrides:
validateElement in class AbstractTagHandler
Throws:
XMLException - if the tag file attribute is not specified.

getEncoding

private java.lang.String getEncoding()
Get the encoding to be used.

Returns:
Encoding to be used.

getFileName

private java.lang.String getFileName()
Return the file name stored in the XML Element.

Returns:
file name.


Licensed under: GNU Lesser General Public License, Ver 2.1, February 1999