Build an XML schema.
Task package: | org.schmant.task.base |
Java package: | org.schmant.task.xml.validation |
Category: | XML tasks |
Since: | 0.5 |
EntityFS-aware? | Yes* |
Implements: | ActionTaskFactory |
Produces: | Schema |
Description:
Parse an XML schema file and create an XML
Schema object. After
running the task, the schema can be retrieved by calling get
or
getSchema
on it.
Required properties
Properties
errorHandler | top |
The ErrorHandler
for the XML
parser used to parse the schema.
- Setter method:
setErrorHandler(ErrorHandler h)
parameters:h
– The error handler.- Default value:
- The XML parser's default error handler (parser-dependent).
factoryClassName | top |
The fully qualified class name of a SchemaFactory
class name. The task's class loader, or any of its parents, must be able to find
the class.
- Setter method:
setFactoryClassName(String s)
parameters:s
– The fully qualified class name.- Default value:
- The current default
SchemaFactory
. This is affected by service provider information in the Jar files in Schmant's class path and in enabled task packages.
features | top |
A map of features for the XML parser used to parse the schema.
- Setter method:
clearFeatures()
Clear the feature map.- Setter method:
putFeature(String name, boolean b)
Add one feature.parameters:b
– Is the feature on or off?- Setter method:
putFeatures(Map<String, Boolean> m)
Add all features from a map.parameters:m
– A map of features.
logFooter | top |
The message that is logged to info
level
after the task has been successfully run.
- Setter method:
setLogFooter(String s)
parameters:s
– The footer message.- Default value:
- Empty (no footer message is logged.)
- See also:
- logHeader
logHeader | top |
The message that is logged to info
level
before the task is run.
- Setter method:
setLogHeader(String s)
parameters:s
– The header message.- Default value:
- A task class specific message.
- See also:
- logFooter
properties | top |
A list of schema factory properties. The properties are set on the schema factory in the order that they were added. See SchemaFactory.
- Setter method:
addProperties(Object o)
Add one or several properties.parameters:- Setter method:
addProperty(String name, Object value)
Add one property.parameters:name
– The property's name.value
– The property's value.- Setter method:
clearProperties()
Clear the list of properties.
publicId | top |
The public id of the created schema. This can be used when resolving the schema from other documents.
- Setter method:
setPublicId(String s)
parameters:s
– The public id.- See also:
- systemId
reportLevel | top |
This property is used to change the Report level for all task created by this task factory. The report level is changed for the thread running the task when the it is run, and is restored to its previous level when the it is done.
- Setter method:
setReportLevel(Level l)
Set the report levelparameters:l
– The new report level.
resourceResolverDecorator | top |
A LSResourceResolverDecorator that is used for creating a resource resolver for the schema factory.
- Setter method:
setResourceResolverDecorator(LSResourceResolverDecorator<?> d)
parameters:d
– A resource resolver decorator.
schemaLanguage (required) | top |
The schema language. This should be set to a language understood by the
schema factory.
XMLConstants.W3C_XML_SCHEMA_NS_URI
is a safe bet.
- Setter method:
setSchemaLanguage(String s)
parameters:s
– The identifier of a schema language.- Default value:
- XMLConstants.W3C_XML_SCHEMA_NS_URI
source (semi-required) | top |
An XML schema document.
- Setter method:
setSource(Object o)
parameters:- See also:
- xmlSources
systemId | top |
The system id of the created schema. This can be used when resolving the schema from other documents.
- Setter method:
setSystemId(String s)
parameters:s
– The system id.- See also:
- publicId
traceLogging | top |
If trace logging is enabled for a task, it reports its configuration before it is run.
Trace logging may also be enabled globally for all tasks by calling TraceMode.setTraceMode(boolean).
- Setter method:
setTraceLogging(boolean b)
Enable or disable trace logging.parameters:b
– Enable trace logging?
xmlSources (semi-required) | top |
A list of XML Source:s that together make up the XML schema.
- Setter method:
addXmlSource(Object o)
Add one or several sources.parameters:- Setter method:
addXmlSources(Object o)
Add one or several sources.parameters:- Setter method:
clearXmlSources()
Clear the list of XML sources.- See also:
- source
Examples
* An EntityFS-aware task is implemented using EntityFS. This means that it uses the filter settings of DirectoryView:s and also that it often can work with other file system implementations than File-based, such as the RAM file system.