org.cip4.elk.impl.jmf.preprocess
Class CheckJDFWrapper

java.lang.Object
  extended by org.cip4.elk.impl.jmf.preprocess.CheckJDFWrapper

public class CheckJDFWrapper
extends java.lang.Object

A wrapper for easy validation with CheckJDF. TODO Use caching to improve performance

Author:
Claes Buckwalter (clabu@itn.liu.se)

Method Summary
static boolean isValid(java.io.File reportFile)
          Deprecated. Validation calls now return a boolean
static boolean isValid(java.io.Reader reportReader)
          Deprecated. Validation calls now return a boolean
static boolean isValid(java.lang.String reportString)
          Deprecated. Validation calls now return a boolean
static boolean validate(java.io.File jdfFile, java.io.File reportFile)
          Validates the JDF instance or JMF message read from a file.
static boolean validate(java.io.File jdfFile, java.io.File schemaFile, java.io.File devcapFile, java.io.File reportFile)
          Validates the JDF instance or JMF message read from a file.
static boolean validate(java.io.File jdf, java.lang.StringBuffer report)
           
static boolean validate(java.io.InputStream jdfIn, java.io.File reportFile)
          Validates the JDF instance or JMF message read from the InputStream
static boolean validate(java.io.InputStream jdf, java.lang.StringBuffer report)
           
static boolean validate(org.cip4.jdflib.node.JDFNode jdf, java.io.File schemaFile, org.cip4.jdflib.jmf.JDFJMF devcap, java.io.File reportFile)
          Validates the JDF instance or JMF message read from a file.
static boolean validate(java.lang.String jdf)
          Validates a JDF instance or JMF message read from the specified String
static boolean validate(java.lang.String jdf, java.io.File reportFile)
          Validates the JDF instance or JMF message read from the String
static boolean validate(java.lang.String jdf, java.lang.StringBuffer report)
          Validates a JDF instance or JMF message read from the specified String
static void validateCommandLine(java.lang.String[] commandLineArgs)
          Deprecated. CheckJDF's validation settings can now relatively easily be configured by setting public members instead of using the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

validate

public static boolean validate(java.io.InputStream jdfIn,
                               java.io.File reportFile)
                        throws java.io.IOException
Validates the JDF instance or JMF message read from the InputStream

Parameters:
jdfIn - the JDF instance or JMF message to parse
reportFile - the absolute path to the file to write the validation report to
Returns:
true if the JDF was valid; false otherwise
Throws:
java.io.IOException

validate

public static boolean validate(java.lang.String jdf)
                        throws java.io.IOException
Validates a JDF instance or JMF message read from the specified String

Parameters:
jdf - the JDF instance or JMF message to parse
Returns:
true if valid; false otherwise
Throws:
java.io.IOException

validate

public static boolean validate(java.lang.String jdf,
                               java.lang.StringBuffer report)
                        throws java.io.IOException
Validates a JDF instance or JMF message read from the specified String

Parameters:
jdf - the JDF instance or JMF message to parse
report - a buffer to append the XML validation report to
Returns:
true if valid; false otherwise
Throws:
java.io.IOException

validate

public static boolean validate(java.io.InputStream jdf,
                               java.lang.StringBuffer report)
                        throws java.io.IOException
Throws:
java.io.IOException

validate

public static boolean validate(java.io.File jdf,
                               java.lang.StringBuffer report)
                        throws java.io.IOException
Throws:
java.io.IOException

validate

public static boolean validate(java.lang.String jdf,
                               java.io.File reportFile)
                        throws java.io.IOException
Validates the JDF instance or JMF message read from the String

Parameters:
jdf - the JDF instance or JMF message to parse
reportFile - the absolute path to the file to write the validation report to
Throws:
java.io.IOException

validate

public static boolean validate(java.io.File jdfFile,
                               java.io.File reportFile)
                        throws java.io.IOException
Validates the JDF instance or JMF message read from a file. A validation report in XML format is written to a file. Both schema valid

Parameters:
jdfFile - the JDF instance or JMF message to parse
reportFile - the absolute path to the file to write the validation report to
Throws:
java.io.IOException

validate

public static boolean validate(org.cip4.jdflib.node.JDFNode jdf,
                               java.io.File schemaFile,
                               org.cip4.jdflib.jmf.JDFJMF devcap,
                               java.io.File reportFile)
                        throws java.io.IOException
Validates the JDF instance or JMF message read from a file. A validation report in XML format is written to a file.

Parameters:
jdf - the JDF instance or JMF message to parse
schemaFile - The schema file to use for schema validation. If null then schema validation is not performed.
devcap - The device capabilities to use for validation. If null testing against device capabilities is not performed.
reportFile - The file to write the validation XMl report to. If null no XML report is written.
Throws:
java.io.IOException

validate

public static boolean validate(java.io.File jdfFile,
                               java.io.File schemaFile,
                               java.io.File devcapFile,
                               java.io.File reportFile)
                        throws java.io.IOException
Validates the JDF instance or JMF message read from a file. A validation report in XML format is written to a file.

Parameters:
jdfFile - the JDF instance or JMF message to parse
schemaFile - The schema file to use for schema validation. If null then schema validation is not performed.
devcapFile - The device capabilities file to use for validation. If null testing against device capabilities is not performed.
reportFile - The file to write the validation XMl report to. If null no XML report is written.
Returns:
true if JDF file passed validatio; false otherwise
Throws:
java.io.IOException

validateCommandLine

public static void validateCommandLine(java.lang.String[] commandLineArgs)
Deprecated. CheckJDF's validation settings can now relatively easily be configured by setting public members instead of using the command line.

Calls CheckJDF using the specified command line.

Parameters:
commandLineArgs -
See Also:
validate(File, File, File, File)

isValid

public static boolean isValid(java.io.File reportFile)
                       throws java.lang.Exception
Deprecated. Validation calls now return a boolean

Looks at a CheckJDF XML report to see if the validated JDF was valid.

Parameters:
reportFile - the CheckJDF XML report
Returns:
true if the JDF was valid; false otherwise
Throws:
java.lang.Exception

isValid

public static boolean isValid(java.lang.String reportString)
                       throws java.lang.Exception
Deprecated. Validation calls now return a boolean

Looks at a CheckJDF XML report to see if the validated JDF was valid.

Parameters:
reportString - a string containing the CheckJDF XML report
Returns:
true if the JDF was valid; false otherwise
Throws:
java.lang.Exception

isValid

public static boolean isValid(java.io.Reader reportReader)
                       throws java.lang.Exception
Deprecated. Validation calls now return a boolean

Looks at a CheckJDF XML report to see if the validated JDF was valid.

Parameters:
reportReader - a Reader that reads an CheckJDF XML report
Returns:
true if the JDF was valid; false otherwise
Throws:
java.lang.Exception


Copyright © 2004-2009 CIP4. All Rights Reserved.