net.sf.kernow
Class Config

java.lang.Object
  extended by net.sf.kernow.Config

public class Config
extends java.lang.Object


Nested Class Summary
static class Config.MessageLevel
           
 
Method Summary
 java.lang.String getAllowedInputSuffixes()
           
static Config getConfig()
          Gets Kernow's configuration object.
 java.lang.String getInitialMode()
           
 java.lang.String getInitialTemplate()
           
 java.lang.String getKernowVersion()
          Gets the version of Kernow
 java.lang.String getLocalCacheDir()
           
 Config.MessageLevel getMessageLevel()
          Gets Kernows message level
 NamespaceBindings getNamespaceBindings()
           
 int getNumberOfTasksToIgnore()
           
 int getNumberOfTimesToRepeatTask()
           
 java.lang.String getSAStatus()
          For internal use.
 java.lang.String getSaxonVersion()
          Gets the version of Saxon Kernow is using
 java.lang.String getSpecificSuffix()
           
 int getThreadPoolSize()
           
 boolean isAllowXML11()
           
 boolean isCleanOutputFiles()
          Gets whether target output directory/file will be deleted first.
 boolean isDirectoryRecurseSubdirectories()
           
 boolean isDirectoryStopOnAnError()
           
 boolean isLaxValidation()
          Gets the LaxValidation switch (-vlax)
 boolean isNovw()
           
 boolean isRecoverablesAreFatal()
           
 boolean isRecoverablesAreReported()
           
 boolean isRecoverablesAreSilent()
           
 boolean isRetainLineNumbers()
           
 boolean isRunRepeatedly()
           
 boolean isSchemaAwareEnabled()
           
 boolean isSchemaRecurseSubdirectories()
           
 boolean isSchemaReportFailuresOnly()
          Gets the VW switch (-vw)
 boolean isShowTiming()
           
 boolean isSkipValidation()
          Gets the SkipValidation switch
 boolean isStrictValidation()
          Gets the StrictValidation switch (-val)
 boolean isStripAllWhitespace()
           
 boolean isStripIgnorableWhitespace()
           
 boolean isStripNoWhitespace()
           
 boolean isSuppressURIandEntityMessages()
           
 boolean isTraceCalls()
           
 boolean isTreatValidationErrorsAsWarnings()
          Gets the NOVW switch (-novw)
 boolean isUseCachingCollectionEntityResolver()
          Gets whether a caching entity resolver will be used for the collection() function.
 boolean isUseCachingEntityResolver()
          Gets whether a caching entity resolver will be used.
 boolean isUseCachingURIResolver()
          Gets whether a caching URI resolver will be used.
 boolean isUseInitialMode()
           
 boolean isUseInitialTemplate()
           
 boolean isUseSchemaAware()
           
 boolean isUseSpecificSuffix()
           
 boolean isUseStandardTree()
           
 boolean isUseTinyTree()
           
 boolean isValidationSaxon()
           
 boolean isValidationXerces()
           
 void setAllowedInputSuffixes(java.lang.String suffixes)
           
 void setAllowXML11(boolean allowXML11)
          Sets the -1.1 switch (Allow XML 1.1 input).
 void setCleanOutputFiles(boolean cleanOutputFiles)
          Sets whether target output directory/file should be deleted first.
static void setConfig(Config aConfig)
           
 void setDirectoryRecurseSubdirectories(boolean recurse)
          Recurse subdirectories of the input directory for Directory Transforms
 void setDirectoryStopOnAnError(boolean directoryStopOnAnError)
          Sets whether Directory Transforms should stop if one of the transforms throws an error.
 void setInitialMode(java.lang.String initialMode)
          Sets the name of the initial mode for the transform (the -im switch equivalent) setUseInitialMode must also be called to enable the feature
 void setInitialTemplate(java.lang.String initialTemplate)
          Set the name of the initial template for the trasform (the -it switch equivalent) setUseInitialTemplate must also be called to enable the feature
 void setLaxValidation(boolean laxValidation)
          Sets the LaxValidation switch (-vlax)
 void setLocalCacheDir(java.lang.String path)
           
 void setMessageLevel(Config.MessageLevel messageLevel)
          Sets Kernows message level For example: MessageLevel.SILENT will suppress all message output
 void setNovw(boolean novw)
          Sets the -novw switch (No Version Warning).
 void setNumberOfTasksToIgnore(int numberOfTasksToIgnore)
          Performance Testing: Sets the number of initial transform times to ignore when working out the average time for a sequence of repeatedly run transforms.
 void setNumberOfTimesToRepeatTask(int numberOfTimesToRepeatTask)
          Performance Testing: Sets the number of times to repeat the transform
 void setRecoverablesAreFatal(boolean recoverablesAreFatal)
           
 void setRecoverablesAreReported(boolean recoverablesAreReported)
           
 void setRecoverablesAreSilent(boolean recoverablesAreSilent)
           
 void setRetainLineNumbers(boolean retainLineNumbers)
           
 void setRunRepeatedly(boolean runRepeatedly)
          Enables or disables the Perfomance Testing feature.
 void setSchemaAwareEnabled(boolean schemaAwareEnabled)
          For internal use.
 void setSchemaRecurseSubdirectories(boolean recurse)
           
 void setSchemaReportFailuresOnly(boolean report)
           
 void setShowTiming(boolean showTiming)
          Sets the -t switch (Saxon's show timing info).
 void setSkipValidation(boolean skipValidation)
          Sets the SkipValidation switch
 void setSpecificSuffix(java.lang.String specificSuffix)
           
 void setStrictValidation(boolean strictValidation)
          Sets the StrictValidation switch (-val)
 void setStripAllWhitespace(boolean stripAllWhitespace)
           
 void setStripIgnorableWhitespace(boolean stripIgnorableWhitespace)
           
 void setStripNoWhitespace(boolean stripNoWhitespace)
           
 void setSuppressURIandEntityMessages(boolean suppress)
           
 void setThreadPoolSize(int threadPoolSize)
          Sets the size of the thread pool to use for Directory Transforms.
 void setTraceCalls(boolean traceCalls)
           
 void setTreatValidationErrorsAsWarnings(boolean treatValidationErrorsAsWarnings)
           
 void setUseCachingCollectionEntityResolver(boolean useCachingCollectionEntityResolver)
          Sets whether a caching entity resolver should be used for the collection() function.
 void setUseCachingEntityResolver(boolean useCachingEntityResolver)
          Sets whether a caching entity resolver should be used.
 void setUseCachingURIResolver(boolean useCachingURIResolver)
          Sets whether a caching URI resolver should be used.
 void setUseInitialMode(boolean useInitialMode)
          Enables or disables the -im (Initial Mode) switch equivalent.
 void setUseInitialTemplate(boolean useInitialTemplate)
          Enables or disables the -it (Initial Template) switch equivalent.
 void setUseSchemaAware(boolean useSchemaAware)
          Sets whether to run in Schema Aware mode
 void setUseSpecificSuffix(boolean useSpecificSuffix)
           
 void setUseStandardTree(boolean useStandardTree)
           
 void setUseTinyTree(boolean useTinyTree)
           
 void setValidationSaxon(boolean validationSaxon)
           
 void setValidationXerces(boolean validationXerces)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConfig

public static Config getConfig()
Gets Kernow's configuration object. This is a singleton.

Returns:
Returns the singleton instance

getNamespaceBindings

public NamespaceBindings getNamespaceBindings()
Returns:
The namespace bindings registered within this configuration.

isSchemaAwareEnabled

public boolean isSchemaAwareEnabled()
Returns:
Whether schema-aware Saxon has been detected.

isUseSchemaAware

public boolean isUseSchemaAware()
Returns:
true if Kernow is running in Schema Aware mode, otherwise false

setUseSchemaAware

public void setUseSchemaAware(boolean useSchemaAware)
Sets whether to run in Schema Aware mode

Parameters:
useSchemaAware - true if Kernow should run in Schema Aware mode, otherwise false

setSchemaAwareEnabled

public void setSchemaAwareEnabled(boolean schemaAwareEnabled)
For internal use.


getSAStatus

public java.lang.String getSAStatus()
For internal use.


getKernowVersion

public java.lang.String getKernowVersion()
Gets the version of Kernow

Returns:
The version number

getSaxonVersion

public java.lang.String getSaxonVersion()
Gets the version of Saxon Kernow is using

Returns:
The version as a string "Saxon nn.nn"

isUseCachingURIResolver

public boolean isUseCachingURIResolver()
Gets whether a caching URI resolver will be used.

Returns:
true if a caching URI resolver will be used, false if not.

setUseCachingURIResolver

public void setUseCachingURIResolver(boolean useCachingURIResolver)
Sets whether a caching URI resolver should be used.

Parameters:
useCachingURIResolver - true if a caching URI resolver should be used, false if not.

isUseCachingEntityResolver

public boolean isUseCachingEntityResolver()
Gets whether a caching entity resolver will be used.

Returns:
true if a caching entity resolver will be used, false if not.

setUseCachingEntityResolver

public void setUseCachingEntityResolver(boolean useCachingEntityResolver)
Sets whether a caching entity resolver should be used.

Parameters:
useCachingEntityResolver - true if a caching entity resolver should be used, false if not.

isUseCachingCollectionEntityResolver

public boolean isUseCachingCollectionEntityResolver()
Gets whether a caching entity resolver will be used for the collection() function.

Returns:
true if a caching entity resolver will be used for the collection() function, false if not.

setUseCachingCollectionEntityResolver

public void setUseCachingCollectionEntityResolver(boolean useCachingCollectionEntityResolver)
Sets whether a caching entity resolver should be used for the collection() function.

Parameters:
useCachingCollectionEntityResolver - true if a caching entity resolver should be used for the collection() function, false if not.

isCleanOutputFiles

public boolean isCleanOutputFiles()
Gets whether target output directory/file will be deleted first.

Returns:
true if output directory/file will be deleted first, false if not.

setCleanOutputFiles

public void setCleanOutputFiles(boolean cleanOutputFiles)
Sets whether target output directory/file should be deleted first.

Parameters:
cleanOutputFiles - true if output directory/file should be deleted first, false if not.

isSkipValidation

public boolean isSkipValidation()
Gets the SkipValidation switch

Returns:
true if set, false if not set.

setSkipValidation

public void setSkipValidation(boolean skipValidation)
Sets the SkipValidation switch

Parameters:
skipValidation - true if set, false if not set.

isLaxValidation

public boolean isLaxValidation()
Gets the LaxValidation switch (-vlax)

Returns:
true if set, false if not set.

setLaxValidation

public void setLaxValidation(boolean laxValidation)
Sets the LaxValidation switch (-vlax)

Parameters:
laxValidation - true if set, false if not set.

isStrictValidation

public boolean isStrictValidation()
Gets the StrictValidation switch (-val)

Returns:
true if set, false if not set.

setStrictValidation

public void setStrictValidation(boolean strictValidation)
Sets the StrictValidation switch (-val)

Parameters:
strictValidation - true if set, false if not set.

isTreatValidationErrorsAsWarnings

public boolean isTreatValidationErrorsAsWarnings()
Gets the NOVW switch (-novw)


setTreatValidationErrorsAsWarnings

public void setTreatValidationErrorsAsWarnings(boolean treatValidationErrorsAsWarnings)

setLocalCacheDir

public void setLocalCacheDir(java.lang.String path)

getLocalCacheDir

public java.lang.String getLocalCacheDir()

isUseSpecificSuffix

public boolean isUseSpecificSuffix()

setUseSpecificSuffix

public void setUseSpecificSuffix(boolean useSpecificSuffix)

getSpecificSuffix

public java.lang.String getSpecificSuffix()

setSpecificSuffix

public void setSpecificSuffix(java.lang.String specificSuffix)

isSchemaRecurseSubdirectories

public boolean isSchemaRecurseSubdirectories()

setSchemaRecurseSubdirectories

public void setSchemaRecurseSubdirectories(boolean recurse)

isSchemaReportFailuresOnly

public boolean isSchemaReportFailuresOnly()
Gets the VW switch (-vw)

Returns:
true if set, false if not set.

setSchemaReportFailuresOnly

public void setSchemaReportFailuresOnly(boolean report)

isSuppressURIandEntityMessages

public boolean isSuppressURIandEntityMessages()

setSuppressURIandEntityMessages

public void setSuppressURIandEntityMessages(boolean suppress)

setAllowedInputSuffixes

public void setAllowedInputSuffixes(java.lang.String suffixes)

getAllowedInputSuffixes

public java.lang.String getAllowedInputSuffixes()

isValidationSaxon

public boolean isValidationSaxon()

setValidationSaxon

public void setValidationSaxon(boolean validationSaxon)

isValidationXerces

public boolean isValidationXerces()

setValidationXerces

public void setValidationXerces(boolean validationXerces)

isDirectoryRecurseSubdirectories

public boolean isDirectoryRecurseSubdirectories()

setDirectoryRecurseSubdirectories

public void setDirectoryRecurseSubdirectories(boolean recurse)
Recurse subdirectories of the input directory for Directory Transforms

Parameters:
recurse - true to recursively find all XML files in the input directory, false to not process subdirectories

isUseStandardTree

public boolean isUseStandardTree()

setUseStandardTree

public void setUseStandardTree(boolean useStandardTree)

isUseTinyTree

public boolean isUseTinyTree()

setUseTinyTree

public void setUseTinyTree(boolean useTinyTree)

getInitialMode

public java.lang.String getInitialMode()

setInitialMode

public void setInitialMode(java.lang.String initialMode)
Sets the name of the initial mode for the transform (the -im switch equivalent) setUseInitialMode must also be called to enable the feature

Parameters:
initialMode - The initial mode

getInitialTemplate

public java.lang.String getInitialTemplate()

setInitialTemplate

public void setInitialTemplate(java.lang.String initialTemplate)
Set the name of the initial template for the trasform (the -it switch equivalent) setUseInitialTemplate must also be called to enable the feature

Parameters:
initialTemplate - The name of the initial template

isNovw

public boolean isNovw()

setNovw

public void setNovw(boolean novw)
Sets the -novw switch (No Version Warning). Disabled by default.

Parameters:
novw - true to set the switch, false to unset it

isRetainLineNumbers

public boolean isRetainLineNumbers()

setRetainLineNumbers

public void setRetainLineNumbers(boolean retainLineNumbers)

isStripAllWhitespace

public boolean isStripAllWhitespace()

setStripAllWhitespace

public void setStripAllWhitespace(boolean stripAllWhitespace)

isStripIgnorableWhitespace

public boolean isStripIgnorableWhitespace()

setStripIgnorableWhitespace

public void setStripIgnorableWhitespace(boolean stripIgnorableWhitespace)

isStripNoWhitespace

public boolean isStripNoWhitespace()

setStripNoWhitespace

public void setStripNoWhitespace(boolean stripNoWhitespace)

isShowTiming

public boolean isShowTiming()

setShowTiming

public void setShowTiming(boolean showTiming)
Sets the -t switch (Saxon's show timing info). Disabled by default.

Parameters:
showTiming - true to set the switch, false to unset it

isTraceCalls

public boolean isTraceCalls()

setTraceCalls

public void setTraceCalls(boolean traceCalls)

isRecoverablesAreSilent

public boolean isRecoverablesAreSilent()

setRecoverablesAreSilent

public void setRecoverablesAreSilent(boolean recoverablesAreSilent)

isRecoverablesAreReported

public boolean isRecoverablesAreReported()

setRecoverablesAreReported

public void setRecoverablesAreReported(boolean recoverablesAreReported)

isRecoverablesAreFatal

public boolean isRecoverablesAreFatal()

setRecoverablesAreFatal

public void setRecoverablesAreFatal(boolean recoverablesAreFatal)

isAllowXML11

public boolean isAllowXML11()

setAllowXML11

public void setAllowXML11(boolean allowXML11)
Sets the -1.1 switch (Allow XML 1.1 input). Disabled by default.

Parameters:
allowXML11 - true to set the switch, false to unset it

isUseInitialMode

public boolean isUseInitialMode()

setUseInitialMode

public void setUseInitialMode(boolean useInitialMode)
Enables or disables the -im (Initial Mode) switch equivalent. Disabled by default. setInitialMode should also be called with the value for the initial mode.

Parameters:
useInitialMode - true to set the switch, false to unset it

isUseInitialTemplate

public boolean isUseInitialTemplate()

setUseInitialTemplate

public void setUseInitialTemplate(boolean useInitialTemplate)
Enables or disables the -it (Initial Template) switch equivalent. Disabled by default. setInitialTemplate should also be called with the value for the initial template.

Parameters:
useInitialTemplate - true to set the switch, false to unset it

setConfig

public static void setConfig(Config aConfig)

isDirectoryStopOnAnError

public boolean isDirectoryStopOnAnError()

setDirectoryStopOnAnError

public void setDirectoryStopOnAnError(boolean directoryStopOnAnError)
Sets whether Directory Transforms should stop if one of the transforms throws an error. Enabled by default.

Parameters:
directoryStopOnAnError - true to stop on an error, false to continue

getMessageLevel

public Config.MessageLevel getMessageLevel()
Gets Kernows message level

Returns:
true if Kernow has been silenced

setMessageLevel

public void setMessageLevel(Config.MessageLevel messageLevel)
Sets Kernows message level For example: MessageLevel.SILENT will suppress all message output

Parameters:
messageLevel -

getThreadPoolSize

public int getThreadPoolSize()

setThreadPoolSize

public void setThreadPoolSize(int threadPoolSize)
Sets the size of the thread pool to use for Directory Transforms. By default this is set 1 to make Kernow single threaded.

Parameters:
threadPoolSize - The size of the thread pool to use

isRunRepeatedly

public boolean isRunRepeatedly()

setRunRepeatedly

public void setRunRepeatedly(boolean runRepeatedly)
Enables or disables the Perfomance Testing feature. Kernow will repeatedly run Single File or Standalone Transforms and then provide a summary of the transform times.

Parameters:
runRepeatedly - true to enable the feature, false to disable it

getNumberOfTimesToRepeatTask

public int getNumberOfTimesToRepeatTask()

setNumberOfTimesToRepeatTask

public void setNumberOfTimesToRepeatTask(int numberOfTimesToRepeatTask)
Performance Testing: Sets the number of times to repeat the transform

Parameters:
numberOfTimesToRepeatTask -

getNumberOfTasksToIgnore

public int getNumberOfTasksToIgnore()

setNumberOfTasksToIgnore

public void setNumberOfTasksToIgnore(int numberOfTasksToIgnore)
Performance Testing: Sets the number of initial transform times to ignore when working out the average time for a sequence of repeatedly run transforms.

Parameters:
numberOfTasksToIgnore -