org.daisy.zedval
Class ZedVal

java.lang.Object
  extended byorg.daisy.zedval.ZedVal

public class ZedVal
extends java.lang.Object

Main application class.

Command line usage

To run ZedVal using default (provided) test maps: Java -jar ZedVal.jar D:/myDtb/package.opf

For more information on options, run Java -jar ZedVal.jar -help

Component usage

Use of the instantiation convenience methods:


  public class ZedComponent implements ZedReporter {
 		//....
 		Zedval zv = new ZedVal();
		try {
			zv.setReporter(this);
			zv.validate(opfFile);
		} catch (ZedContextException e) {
			//...				
		} catch (ZedFileInitializationException e) {
			//...				
	    }	
 	   	   
    //implement the ZedReporter interface	
    public void addMessage(ZedMessage m) throws ZedReporterException {
      if (m instanceof FailureMessage) {
      	//...
      }else{
        System.out.println(m.getText());
  	}
    }
  
  }
 

Author:
mgylling

Constructor Summary
ZedVal()
          Constructor when using ZedVal as a component.
 
Method Summary
 DefaultContext getContext()
           
static java.lang.String getVersion()
           
static void main(java.lang.String[] args)
           
 void sendApplicationErrMsg(java.lang.String msg, boolean fatal, java.lang.String context)
          Constructs and sends an ApplicationErrMsg to the Reporter, if available.
 void setReporter(ZedReporter zr)
          Convenience method to register a reporter when using ZedVal as a reporter.
 void validate(java.io.File opf)
          Convenience method when using ZedVal as a component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZedVal

public ZedVal()
Constructor when using ZedVal as a component.

Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

setReporter

public void setReporter(ZedReporter zr)
                 throws ZedContextException
Convenience method to register a reporter when using ZedVal as a reporter.

Throws:
ZedContextException

validate

public void validate(java.io.File opf)
              throws ZedContextException,
                     ZedFileInitializationException

Convenience method when using ZedVal as a component.

This method is reentrant: several validate() calls can be made on the same ZedVal instance.

If the user has not specified custom test- or processor maps to use prior to calling this method, the default (provided) maps will be used.

If this method does not throw an Exception, validation was completed succssfully.

Throws:
ZedContextException
ZedFileInitializationException

getContext

public DefaultContext getContext()
Returns:
the ZedContext object used in this run

sendApplicationErrMsg

public void sendApplicationErrMsg(java.lang.String msg,
                                  boolean fatal,
                                  java.lang.String context)
Constructs and sends an ApplicationErrMsg to the Reporter, if available. Otherwise, sends to error output

Parameters:
msg - The message text
fatal - Is the error fatal?
context - String expressing application context

getVersion

public static java.lang.String getVersion()