net.sf.kernow.transform
Class TransformControllerImpl

java.lang.Object
  extended by net.sf.kernow.transform.TransformControllerImpl
All Implemented Interfaces:
TransformController

public class TransformControllerImpl
extends java.lang.Object
implements TransformController


Constructor Summary
TransformControllerImpl(TabbedView view)
          Creates a new instance of TransformControllerImpl
 
Method Summary
 boolean isSchemaAwareEnabled()
           
static boolean isXqueryFile(java.lang.String path)
           
 boolean runAnt(java.lang.String buildFile, java.lang.String target, int messageLevel)
           
 boolean runDirectoryTransform(java.io.File inputDir, javax.xml.transform.Source stylesheet, java.io.File outputDir)
          Creates a DirectoryTransformer to compile the stylesheet and then transform each file in the input directory with the compiled stylesheet
 boolean runDirectoryValidate(java.io.File dir, javax.xml.transform.Source schema)
           
 boolean runDirectoryValidate(java.io.File dir, javax.xml.transform.Source[] schemas)
           
 boolean runSchemaCheck(javax.xml.transform.Source schema)
           
 boolean runSchemaCheck(javax.xml.transform.Source[] schemas)
           
 boolean runSingleFileTransform(javax.xml.transform.Source input, javax.xml.transform.Source stylesheet, javax.xml.transform.Result output)
          Transforms a single XML file using a normal uncompiled stylesheet
 boolean runStandaloneTransform(javax.xml.transform.Source stylesheet, javax.xml.transform.Result output, java.lang.String initialTemplate)
          Transforms a dummy XML file using a normal uncompiled stylesheet
 boolean runStandaloneXQuery(java.io.InputStream query, javax.xml.transform.Result output)
          Evaluate a standalone XQuery
 boolean runStandaloneXQuery(java.io.Reader query, javax.xml.transform.Result output)
          Evaluate a standalone XQuery
 boolean runStandaloneXQuery(java.lang.String query, javax.xml.transform.Result output)
          Evaluate a standalone XQuery
 boolean runValidate(javax.xml.transform.Source doc, javax.xml.transform.Source schema)
           
 boolean runValidate(javax.xml.transform.Source doc, javax.xml.transform.Source[] schemas)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformControllerImpl

public TransformControllerImpl(TabbedView view)
Creates a new instance of TransformControllerImpl

Method Detail

runStandaloneXQuery

public boolean runStandaloneXQuery(java.lang.String query,
                                   javax.xml.transform.Result output)
Evaluate a standalone XQuery

Specified by:
runStandaloneXQuery in interface TransformController
Parameters:
query - The query to evaluate
output - Where to send the result of the evaluation

runStandaloneXQuery

public boolean runStandaloneXQuery(java.io.Reader query,
                                   javax.xml.transform.Result output)
Evaluate a standalone XQuery

Specified by:
runStandaloneXQuery in interface TransformController
Parameters:
query - The query to evaluate
output - Where to send the result of the evaluation

runStandaloneXQuery

public boolean runStandaloneXQuery(java.io.InputStream query,
                                   javax.xml.transform.Result output)
Evaluate a standalone XQuery

Specified by:
runStandaloneXQuery in interface TransformController
Parameters:
query - The query to evaluate
output - Where to send the result of the evaluation

runStandaloneTransform

public boolean runStandaloneTransform(javax.xml.transform.Source stylesheet,
                                      javax.xml.transform.Result output,
                                      java.lang.String initialTemplate)
Transforms a dummy XML file using a normal uncompiled stylesheet

Specified by:
runStandaloneTransform in interface TransformController
Parameters:
stylesheet - The stylesheet to be used
output - The destination of the transform

runSingleFileTransform

public boolean runSingleFileTransform(javax.xml.transform.Source input,
                                      javax.xml.transform.Source stylesheet,
                                      javax.xml.transform.Result output)
Transforms a single XML file using a normal uncompiled stylesheet

Specified by:
runSingleFileTransform in interface TransformController
Parameters:
input - The XML document to transform
stylesheet - The stylesheet to be used
output - The destination of the transform

runDirectoryTransform

public boolean runDirectoryTransform(java.io.File inputDir,
                                     javax.xml.transform.Source stylesheet,
                                     java.io.File outputDir)
Creates a DirectoryTransformer to compile the stylesheet and then transform each file in the input directory with the compiled stylesheet

Specified by:
runDirectoryTransform in interface TransformController
Parameters:
inputDir - the source directory contains the XML files
stylesheet - the path to the stylesheet
outputDir - the target output directory for the transformations

runSchemaCheck

public boolean runSchemaCheck(javax.xml.transform.Source schema)
Specified by:
runSchemaCheck in interface TransformController

runSchemaCheck

public boolean runSchemaCheck(javax.xml.transform.Source[] schemas)
Specified by:
runSchemaCheck in interface TransformController

runValidate

public boolean runValidate(javax.xml.transform.Source doc,
                           javax.xml.transform.Source schema)
Specified by:
runValidate in interface TransformController

runValidate

public boolean runValidate(javax.xml.transform.Source doc,
                           javax.xml.transform.Source[] schemas)
Specified by:
runValidate in interface TransformController

runDirectoryValidate

public boolean runDirectoryValidate(java.io.File dir,
                                    javax.xml.transform.Source schema)
Specified by:
runDirectoryValidate in interface TransformController

runDirectoryValidate

public boolean runDirectoryValidate(java.io.File dir,
                                    javax.xml.transform.Source[] schemas)
Specified by:
runDirectoryValidate in interface TransformController

runAnt

public boolean runAnt(java.lang.String buildFile,
                      java.lang.String target,
                      int messageLevel)
Specified by:
runAnt in interface TransformController

isSchemaAwareEnabled

public boolean isSchemaAwareEnabled()

isXqueryFile

public static boolean isXqueryFile(java.lang.String path)