|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.xml_project.morganaxproc.XProcConfiguration
public class XProcConfiguration
This class holds the configuration settings used during compilation and running
of an XProc pipeline. See the documentation for MorganaXProc
for
the meaning and the use of the different configuration settings.
To obtain a new XProcConfiguration
use
newConfiguration()
, newConfiguration(nu.xom.Element)
or newConfiguration(String uri)
.
In any case the values of the configuration settings in an XProcConfiguration
object are the result of a cascading initialization. First the default settings as described in
the documentation are attached to the settings in the XProcConfiguration
. Second,
XProcConfiguration
tries to open a file with the name specified
in DEFAULT_CONFIGURATION_FILE
from the same location as MorganaXProc.jar
. If
such a file is found, the configuration settings are overwritten by the values found in the file. Third,
if you use the newConfiguration
methods with a parameter, the configuration settings
are overwritten with the values found in the Element
or the document designated by
the uri.
Nested Class Summary | |
---|---|
static class |
XProcConfiguration.LogStyle
The possible values for logging. |
Field Summary | |
---|---|
static String |
DEFAULT_CONFIGURATION_FILE
The name of the default configuration file used. |
static String |
EXTENSION_FOLDER
The name of the folder with MorganaXProc will look for extensions. |
static HashMap<String,String> |
KNOWN_CONNECTORS
This HashMap hold the java package names for the known connectors for xslt and xquery |
Method Summary | |
---|---|
void |
addExtensionLibrary(String javaName)
This method tells MorganaXProc to use some piece of Java
code to extend the build-in functionality. |
void |
addXPathFunctions(FunctionPackage aPackage)
Adds a user written XPath extension functions from a FunctionPackage to the XPath context. |
boolean |
appendDebugInfoStream()
Returns the current value for AppendDebugInfoStream |
XProcConfiguration |
copy()
Creates a new XProcConfiguration object which is a verbatim copy
of the existing. |
List<XPathFunction> |
getAllXPathFunctions()
Returns a list of all currently known user written XPath extension functions coming either from addXPathFunction or addExtensionLibrary . |
URI |
getCompilerInfoStreamURI()
Returns the CompileInfoStreamURI currently used. |
nu.xom.Document |
getConfigurationDocument()
Returns the current configuration (incl. default settings) as document. |
String |
getCurrentLanguage()
Returns the current language used in XProc as defined for p:system-property('p:language'). |
URI |
getDebugInfoStreamURI()
Returns the DebugInfoStreamURI currently used. |
static nu.xom.Document |
getDefaultConfigurationDocument()
Returns the default (factory) configuration as document. |
float |
getDefaultXPathVersion()
Returns the currently used default version of XPath. |
URI |
getDependencyMapURI()
Returns the URI to write dependency map to. |
URI |
getDocumentBaseURI()
Returns the documentBaseURI used. |
com.xml_project.morganaxproc.morganapkg.MorganaPKG |
getEXPathPackagingSystem()
Returns the EXPathPackagingSystem associated with this configuration. |
String[] |
getExtensionLibraries()
Returns the Java class or package names of the extension libraries set for
this XProcConfiguration . |
String |
getExtensionWrapper(String extension)
Returns a string with the Java class name of the extension wrapper set
for the given extension. |
XProcFilesystem |
getFileSystem()
Returns the XProcFileSystem currently used. |
String |
getHTMLParserClass()
Returns the Java class name of the HTMLParserClass. |
String |
getLogFileName()
Returns the LogFileName used. |
URI |
getLogPathURI()
Returns the LogPathURI used or null, if no uri can be found. |
XProcConfiguration.LogStyle |
getLogStyle()
Returns the current LogStyle . |
String |
getMimeWrapper(String mime)
Returns a string with the Java class name of the mime wrapper set
for the given mime. |
URI |
getPipelineFolderURI()
Returns the pipelineFolderURI used. |
String |
getPKGRepository()
Returns the repository to use for EXPath.org's packaging system |
URI |
getPortDumperURI()
Returns the value of the uri used for port dumping. |
XProcSecurityManager |
getSecurityManager()
Returns the currently used XProcSecurityManager . |
boolean |
getStrictExternalBinding()
Returns true if strict external binding is used with this configuration,
otherwise false . |
String |
getXMLCatalogFiles()
Returns the catalog files currently used for XML catalog. |
com.xml_project.morganaxproc.xmlcatalog.XMLCatalogInterface |
getXMLCatalogInterface()
Returns the current used interface to resolve uris from an XMLCatalog system. |
Object |
getXQueryConnector()
Returns the XQueryConnector used in this configuration. |
Object |
getXSLTConnector()
Returns the XSLTConnector used in this configuration. |
XQueryConnector |
makeXQueryConnector(PrintWriter infoWriter)
Returns a new XQueryConnector from the settings of this configuration. |
XSLTConnector |
makeXSLTConnector(PrintWriter infoWriter)
Returns a new XSLTConnector from the settings in this configuration. |
static XProcConfiguration |
newConfiguration()
Creates a new XProcConfiguration with the default settings and possibly overwritten by the values found in the default configuration file. |
static XProcConfiguration |
newConfiguration(nu.xom.Element prefs)
Creates a new XProcConfiguration with the default setting, the settings from the default configuration file (if found) and the settings from the xom element. |
static XProcConfiguration |
newConfiguration(String uri)
Creates a new XProcConfiguration with the default settings, the settings from the default configuration file (if found) and the settings found in the xml document at the specified uri. |
void |
removeExtensionLibrary(String javaName)
Removes a piece of Java previously set with addExtensionLibrary
from the list of used extensions. |
void |
removeXPathFunctions(FunctionPackage aPackage)
Removes a user written XPath extension function in a FunctionPackage from the XPath context. |
void |
setCompilerInfoStreamURI(URI aCompilerStreamURI)
Sets the CompileInfoStreamURI to be used. |
void |
setConfiguration(nu.xom.Element prefs)
Overwrites the setting in the XProcConfiguration with the value
found in the prefs element. |
void |
setConfiguration(String uri)
Overwrites the settings in the XProcConfiguration with the values
found in the xml document at the given uri. |
void |
setDebugInfoStreamAppend(boolean append)
Controls whether a new debugInfoStream is appended to an existing stream or a new is created. |
void |
setDebugInfoStreamURI(URI debugStream)
Sets the debugInfoStreamURI to be used. |
void |
setDefaultXPathVersion(float f)
Sets the default XPath version used by MorganaXProc. |
void |
setDependencyMapURI(URI uri)
Sets the URI to write dependency map to. |
void |
setDocumentBaseURI(URI uri)
Sets the documentBaseURI to be used. |
void |
setExtensionWrapper(String extension,
String javaClass)
Add a ExtensionWrapper for the given extension by the given Java class name. |
void |
setFileSystem(String className)
Sets the Java class name of the XProcFileSystem
to be used. |
void |
setFileSystem(XProcFilesystem fileSystem)
Sets the XProcFileSystem to be used. |
void |
setHTMLParserClass(String parserClass)
Sets the Java class name of the HTMLParser class to be used. |
void |
setLogFileName(String name)
Set the LogFileName to be used. |
void |
setLogPathURI(URI uri)
Sets the LogPathURI used. |
void |
setLogStyle(XProcConfiguration.LogStyle s)
Sets the logStyle for this configuration. |
void |
setMimeWrapper(String mime,
String javaClass)
Adds a MimeWrapper for the given mime by the given Java class name. |
void |
setPipelineFolderURI(URI uri)
Sets the pipelineFolderURI to be used. |
void |
setPKGRepository(String value)
Sets the path for the repository for EXPath.org's packaging system. |
void |
setPortDumperURI(URI uri)
Sets the uri for the port dumper. |
void |
setSecurityManager(String className)
Sets the XProcSecurityManager to be used by giving its
Java class name. |
void |
setSecurityManager(XProcSecurityManager newManager)
Sets the XProcSecurityManager to be used. |
void |
setStrictExternalBinding(boolean v)
Sets the value strict external binding |
void |
setXMLCatalogFiles(String files)
Sets the catalog files to be used for xml catalog (a ";" separated list). |
void |
setXQueryConnector(String newConnector)
Set the XQuery processor to use with this Configuration. |
void |
setXQueryConnector(XQueryConnector newConnector)
Sets the XQueryConnector to use in this configuration. |
void |
setXSLTConnector(String newConnector)
Set the XSLT processor to use with this Configuration. |
void |
setXSLTConnector(XSLTConnector newConnector)
Sets the XSLTConnector to use in this configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CONFIGURATION_FILE
MorganaXProc.jar
, the configuration settings are overwritten with the
values found in this file.
public static final String EXTENSION_FOLDER
MorganaXProc
will look for extensions. See the
documentation for details.
public static final HashMap<String,String> KNOWN_CONNECTORS
Method Detail |
---|
public static final XProcConfiguration newConfiguration()
Creates a new XProcConfiguration with the default settings and possibly overwritten by the values found in the default configuration file.
public static final XProcConfiguration newConfiguration(String uri) throws IOException, XProcSecurityException, URISyntaxException
Creates a new XProcConfiguration with the default settings, the settings from the default configuration file (if found) and the settings found in the xml document at the specified uri.
uri
- the uri of the xml document with the configuration or null to get default settings
IOException
- if there is ANY exception occurred in reading or parsing the configuration document.
XProcSecurityException
- if any security setting cannot be obeyed.
URISyntaxException
- if an URISyntaxException occurs with any uri settings IN the configurationpublic static final XProcConfiguration newConfiguration(nu.xom.Element prefs) throws IOException, XProcSecurityException, XProcInterfaceException
Creates a new XProcConfiguration with the default setting, the settings from the default configuration file (if found) and the settings from the xom element.
prefs
- a xom element in MorganaXProc's namespace and the local name config
IOException
- if there is ANY exception occurred in reading or parsing the configuration document.
XProcSecurityException
- if any security setting cannot be obeyed.
XProcInterfaceException
- if any value is not allowed for a given optionpublic XProcConfiguration copy()
Creates a new XProcConfiguration
object which is a verbatim copy
of the existing. Any change to either the new or the existing object will NOT affect
the other one.
XProcConfiguration
public static final nu.xom.Document getDefaultConfigurationDocument()
Returns the default (factory) configuration as document. See documentation for details.
public void setDefaultXPathVersion(float f)
Sets the default XPath version used by MorganaXProc. This is used, when no @xpath-version is found.
f
- the version to use. Must be a supported version.public float getDefaultXPathVersion()
Returns the currently used default version of XPath.
public nu.xom.Document getConfigurationDocument()
Returns the current configuration (incl. default settings) as document.
public void setConfiguration(String uri) throws IOException, XProcSecurityException, URISyntaxException
Overwrites the settings in the XProcConfiguration
with the values
found in the xml document at the given uri.
uri
- the uri of the document.
IOException
- if there is ANY exception occurred in reading or parsing the configuration document.
XProcSecurityException
- if any security setting cannot be obeyed.
URISyntaxException
- if there is a syntax exception with any uri used in the configuration.public void setConfiguration(nu.xom.Element prefs) throws IOException, URISyntaxException, XProcSecurityException, XProcInterfaceException
Overwrites the setting in the XProcConfiguration
with the value
found in the prefs
element.
prefs
- an element with the name config
in MorganaXProc's namespace.
IOException
- if there is ANY exception occurred in reading or parsing the configuration document.
URISyntaxException
- if there is a syntax exception with any uri used in the configuration.
XProcSecurityException
- if any security setting cannot be obeyed.
XProcInterfaceException
- if any value is not allowed for a given optionpublic void addXPathFunctions(FunctionPackage aPackage) throws XProcInterfaceException
aPackage
- the package to add (may be null).
XProcInterfaceException
- if any function is in any XProc namespace or functions
namespace uri does not conform to package's namespace uri.public void removeXPathFunctions(FunctionPackage aPackage)
aPackage
- the package to remove (may be null).public List<XPathFunction> getAllXPathFunctions() throws IOException, XPathException
addXPathFunction
or addExtensionLibrary
.
XPathException
IOException
public com.xml_project.morganaxproc.xmlcatalog.XMLCatalogInterface getXMLCatalogInterface()
public com.xml_project.morganaxproc.morganapkg.MorganaPKG getEXPathPackagingSystem() throws com.xml_project.morganaxproc.morganapkg.MorganaPKGException, IOException, XProcSecurityException
EXPathPackagingSystem
associated with this configuration.
null
if none is found.
XProcSecurityException
IOException
com.xml_project.morganaxproc.morganapkg.MorganaPKGException
public String[] getExtensionLibraries()
Java
class or package names of the extension libraries set for
this XProcConfiguration
.
public XQueryConnector makeXQueryConnector(PrintWriter infoWriter) throws XQueryConnectorException, XPathException, IOException
XQueryConnector
from the settings of this configuration.
The current file system is used as ModuleURIResolver
and all
registered XPathFunction
s are installed.
infoWriter
- the PrintWriter
to use or null
.
XQueryConnectorException
XPathException
IOException
public XSLTConnector makeXSLTConnector(PrintWriter infoWriter) throws com.xml_project.morganaxproc.core.XProcRuntimeException, XPathException, IOException
XSLTConnector
from the settings in this configuration.
The current file system is used as ImportURIResolver
and all
registered XPathFunction
s are installed.
infoWriter
- the PrintWriter
to use or null
.
com.xml_project.morganaxproc.core.XProcRuntimeException
XPathException
IOException
public void addExtensionLibrary(String javaName)
MorganaXProc
to use some piece of Java
code to extend the build-in functionality. This can either be done by giving the
name of a Java
class which implements StepPackage
(as a
collection of XProc
step implementations) or the name of a Java
package name which will be looked up by MorganaXProc
for implementations of
BuildInStep
(for XProc
-steps) or for XPathFunction
for additional XPath
functions.
If javaName
is null, an empty string or "null" all previously loaded
extensions are discarded.
javaName
- a Java
class name or a Java
package name.public void removeExtensionLibrary(String javaName)
Java
previously set with addExtensionLibrary
from the list of used extensions. Ignored if packageName
is null,
an empty string or if the javaName was not added to the list.
javaName
- a java
package name.public void setXSLTConnector(String newConnector)
KNOWN_CONNECTORS
.
Ignored if newConnector
is null, an empty string or "null".
newConnector
- a qualified Java
class name or the name of a registered connector.public void setXSLTConnector(XSLTConnector newConnector)
newConnector
is null.
newConnector
- the new connector to use.public void setXQueryConnector(String newConnector)
KNOWN_CONNECTORS
.
Ignored if newConnector
is null, an empty string or "null".
newConnector
- a qualified Java
class name or the name of a registered connector.public void setXQueryConnector(XQueryConnector newConnector)
newConnector
is null.
newConnector
- the new connector to use.public String getCurrentLanguage()
public Object getXSLTConnector()
Java
class name or an instance of
XSLTConnector
.
public Object getXQueryConnector()
Java
class name or an instance of
XQueryConnector
.
public void setSecurityManager(String className) throws IOException
XProcSecurityManager
to be used by giving its
Java
class name. Ignored if className
is null
className
- the Java
class name of a XProcSecurityManager
.
IOException
- if any exception occures while loading the securityManager.public XProcSecurityManager getSecurityManager()
XProcSecurityManager
.
public void setSecurityManager(XProcSecurityManager newManager)
XProcSecurityManager
to be used. Ignored if newManager
is null.
newManager
- the XProcSecurityManager
to be used.1public boolean getStrictExternalBinding()
true
if strict external binding is used with this configuration,
otherwise false
.
public void setStrictExternalBinding(boolean v)
v
- the new value.public void setPKGRepository(String value)
XProcSecurityManager
associated with this XProcConfiguration
is augmented, so read access to the resources in the repository is granted.
Please mind that this only holds for repository resources in MorganaXProc
.
For a pipeline's access to the resources via "public import URI" you have to
grant access by adding an appropriate rule to the used XProcSecurityManager
.
value
- public String getPKGRepository()
public void setPortDumperURI(URI uri)
uri
- a uri or null.public URI getPortDumperURI()
public XProcConfiguration.LogStyle getLogStyle()
LogStyle
.
LogStyle
used.public void setLogStyle(XProcConfiguration.LogStyle s)
s
- the new LogStyle
.public void setLogPathURI(URI uri)
uri
- the uri to use. If value is "null" the user home folder will be used for port dumping.public URI getLogPathURI()
public String getLogFileName()
public void setLogFileName(String name)
name
is null or an empty string.
name
- theLogFileName to be used.public XProcFilesystem getFileSystem()
XProcFileSystem
currently used.
XProcFileSystem
currently used.public void setPipelineFolderURI(URI uri)
uri
- an uri or null, if no pipelineFolderURI should be used.public URI getPipelineFolderURI()
public void setDocumentBaseURI(URI uri)
uri
- an uri or null, if no documentBaseURI should be used.public void setDependencyMapURI(URI uri)
uri
- the uri or null, if no dependency map should be created.public URI getDocumentBaseURI()
public void setDebugInfoStreamAppend(boolean append)
append
- true, if a new stream should be appended to the
existing stream.public void setDebugInfoStreamURI(URI debugStream)
debugStream
- an uri or null, if no debugInfoStream should be used.public void setXMLCatalogFiles(String files)
files
- the catalog files to be used or "", if no catalog should be used.public void setCompilerInfoStreamURI(URI aCompilerStreamURI)
aCompilerStreamURI
- an uri or null, if no compilerInfoStream should be used.public URI getDebugInfoStreamURI()
public boolean appendDebugInfoStream()
public String getXMLCatalogFiles()
public URI getCompilerInfoStreamURI()
public URI getDependencyMapURI()
public void setFileSystem(XProcFilesystem fileSystem)
XProcFileSystem
to be used. Ignored if null.
fileSystem
- the XProcFileSystem
to be used.public void setFileSystem(String className) throws IOException
Java
class name of the XProcFileSystem
to be used. Ignored if null or an empty string.
className
- the class name of the XProcFileSystem
to be used.
IOException
- if any error occured while loading the class with the given name.public void setHTMLParserClass(String parserClass)
Java
class name of the HTMLParser class to be used.
parserClass
- a Java
class name or null, if no parser should be used.public void setMimeWrapper(String mime, String javaClass)
Java
class name. Ignored if
mime
is null or an empty string or if javaClass
is null or an
empty string. Any existing association between this mime and a java class is overwritten.
If javaClass.equals("null"), any existing wrapper for this mime is removed.
If mime.equals("null") and javaClass.equals("null") all previously set MimeWrappers are discarded.
mime
- a string with a mime.javaClass
- a string with a Java
class name.public String getMimeWrapper(String mime)
Java
class name of the mime wrapper set
for the given mime.
mime
- the mime for which the MimeWrapper should be returned.
Java
class name or null, if no wrapper is set for
this mime.public void setExtensionWrapper(String extension, String javaClass)
Java
class name. Ignored
if extension
is null or an empty string or if javaClass
is null or
an empty string. Any existing associating between this extension and a java class is overwritten.
If javaClass.equals("null"), any existing wrapper for this extension is removed.
If extension.equals("null") and javaClass.equals("null") all previously set MimeWrappers are discarded.
extension
- a string with an extension.javaClass
- a string with a Java
class name.public String getHTMLParserClass()
Java
class name of the HTMLParserClass.
Java
class name or null, if no HTMLParserClass is used.public String getExtensionWrapper(String extension)
Java
class name of the extension wrapper set
for the given extension.
extension
- the extension for which the ExtensionWrapper should be returned.
Java
class name or null, if no wrapper is set for
this extension.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |