com.generationjava.io.xml
Class JarvWriter

java.lang.Object
  extended by com.generationjava.io.xml.DelegatingXmlWriter
      extended by com.generationjava.io.xml.JarvWriter
All Implemented Interfaces:
XmlWriter, ErrorHandler

public class JarvWriter
extends DelegatingXmlWriter
implements ErrorHandler

Validates the written XML against a DTD or XML Schema using the iso_relax/jarv library.


Constructor Summary
JarvWriter(XmlWriter writer, org.iso_relax.verifier.VerifierHandler verifierHandler)
           
 
Method Summary
 void close()
          Close this writer.
 XmlWriter endEntity()
          End the current entity.
 void error(SAXParseException spe)
           
 void fatalError(SAXParseException spe)
           
 void warning(SAXParseException spe)
           
 XmlWriter writeAttribute(String attr, Object value)
          Write an attribute out for the current entity.
 XmlWriter writeEntity(String name)
          Begin to write out an entity.
 XmlWriter writeText(Object text)
          Output body text.
 
Methods inherited from class com.generationjava.io.xml.DelegatingXmlWriter
getWriter, writeCData, writeComment, writeEmptyEntity, writeEntityWithText, writeXmlVersion, writeXmlVersion, writeXmlVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarvWriter

public JarvWriter(XmlWriter writer,
                  org.iso_relax.verifier.VerifierHandler verifierHandler)
           throws IOException
Throws:
IOException
Method Detail

writeEntity

public XmlWriter writeEntity(String name)
                      throws IOException
Description copied from class: DelegatingXmlWriter
Begin to write out an entity. Unlike the helper tags, this tag will need to be ended with the endEntity method.

Specified by:
writeEntity in interface XmlWriter
Overrides:
writeEntity in class DelegatingXmlWriter
Parameters:
name - String name of tag
Throws:
IOException

endEntity

public XmlWriter endEntity()
                    throws IOException
Description copied from class: DelegatingXmlWriter
End the current entity. This will throw an exception if it is called when there is not a currently open entity.

Specified by:
endEntity in interface XmlWriter
Overrides:
endEntity in class DelegatingXmlWriter
Throws:
IOException

writeAttribute

public XmlWriter writeAttribute(String attr,
                                Object value)
                         throws IOException
Description copied from class: DelegatingXmlWriter
Write an attribute out for the current entity. Any xml characters in the value are escaped. Currently it does not actually throw the exception, but the api is set that way for future changes.

Specified by:
writeAttribute in interface XmlWriter
Overrides:
writeAttribute in class DelegatingXmlWriter
Throws:
IOException

writeText

public XmlWriter writeText(Object text)
                    throws IOException
Description copied from class: DelegatingXmlWriter
Output body text. Any xml characters are escaped.

Specified by:
writeText in interface XmlWriter
Overrides:
writeText in class DelegatingXmlWriter
Throws:
IOException

error

public void error(SAXParseException spe)
Specified by:
error in interface ErrorHandler

fatalError

public void fatalError(SAXParseException spe)
Specified by:
fatalError in interface ErrorHandler

warning

public void warning(SAXParseException spe)
Specified by:
warning in interface ErrorHandler

close

public void close()
           throws IOException
Description copied from class: DelegatingXmlWriter
Close this writer. It does not close the underlying writer, but does throw an exception if there are as yet unclosed tags.

Specified by:
close in interface XmlWriter
Overrides:
close in class DelegatingXmlWriter
Throws:
IOException


Copyright © 2000-2007 OSJava. All Rights Reserved.