com.xml_project.morganaxproc
Class XProcLibrary

java.lang.Object
  extended by com.xml_project.morganaxproc.XProcLibrary

public class XProcLibrary
extends java.lang.Object

This class represents the compiled form of an XProc library. To compile an XProc library call compileLibrary() from an XProcCompiler.

Objects of this class can be used to run the same (compiled) step from the library multiple times possibly with different port bindings and/or options.


Method Summary
 boolean containsStep(java.lang.String stepname)
           Returns true, if the library contains a step with the given (Clark-) name.
 XProcConfiguration getConfiguration()
           Return the XProcConfiguration used to run this XProcLibrary/XProcPipeline.
 XProcEngine getEngine()
           Returns the XProcEngine used to generate this XProcLibrary/XProcPipeline.
 XProcOutput run(java.lang.String stepName)
          Runs the step with the given (Clark-) name without any input.
 XProcOutput run(java.lang.String stepName, XProcInput inputs)
          Runs the step with the given (Clark-) name and the given input.
 void setConfiguration(XProcConfiguration config)
           Sets the XProcConfiguration to use when running this XProcLibrary/XProcPipeline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

containsStep

public boolean containsStep(java.lang.String stepname)

Returns true, if the library contains a step with the given (Clark-) name.

Parameters:
stepname - a (Clark-) name
Returns:
true, if library contains step

run

public XProcOutput run(java.lang.String stepName)

Runs the step with the given (Clark-) name without any input. Produces an XProcOutput object anyway, even if an error occurs.

Parameters:
stepName - the (Clark-) name of the step to run
Returns:
an XProcOutput holding the result of the execution.

run

public XProcOutput run(java.lang.String stepName,
                       XProcInput inputs)

Runs the step with the given (Clark-) name and the given input. Produces an XProcOutput object anyway, even if an error occurs.

Parameters:
stepName - the (Clark-) name of the step to run
inputs - the inputs (port bindings and option settings) for the execution of the pipeline.
Returns:
an XProcOutput holding the result of the execution.

getEngine

public XProcEngine getEngine()

Returns the XProcEngine used to generate this XProcLibrary/XProcPipeline.

Please mind that the XProcConfiguration object hold by XProcEngine might have changed since generation of the pipeline/library.

Returns:
the XProcEngine used to generate this XProcPipeline.

getConfiguration

public XProcConfiguration getConfiguration()

Return the XProcConfiguration used to run this XProcLibrary/XProcPipeline.

Returns:
the configuration currently used.

setConfiguration

public void setConfiguration(XProcConfiguration config)
                      throws XProcInterfaceException

Sets the XProcConfiguration to use when running this XProcLibrary/XProcPipeline.

Parameters:
config - the configuration to use.
Throws:
XProcInterfaceException - if config is null.