public class Processor extends Object
book
; called the "realized" document).Modifier and Type | Field and Description |
---|---|
static String |
DOCBOOK_NS_URI
The namespace URI of DocBook v5+.
|
static String |
VERSION
The version number of this processor.
|
Constructor and Description |
---|
Processor()
Equivalent to
Processor(null) . |
Processor(Console c)
Constructs a Processor using specified console to display
its progress, warning, error, etc, messages.
|
Modifier and Type | Method and Description |
---|---|
int |
configure(String[] args)
Allows to configure this processor using the options
of command-line utility
assembly (that is,
-struct , -format , etc). |
boolean |
getCheckRealizedDocument()
Returns
true if realized document is to be checked for
cross-reference errors, missing image resources, etc. |
ConsoleHelper |
getConsole() |
Loader |
getDocumentLoader()
Returns the document loader used to load XML documents.
|
String[] |
getOutputFormats()
Returns the output formats which are to be considered by this processor.
|
String |
getProcessedStructId()
Returns the value of the ID of the
structure
to be processed. |
String[] |
getProfile()
Returns the profile applied to the realized document.
|
XMLResolver |
getResolver()
Returns the entity and URI resolver being used when
loading or transforming an XML document.
|
Processor |
getTransclusionProcessor()
Returns the processor used to process transcluded documents.
|
static void |
main(String[] args)
Implementation of the
assembly command-line utility. |
boolean |
process(URL inURL,
File outFile)
Processes specified assembly and saves the realized document
to specified file.
|
Document |
process(URL inURL,
URL realizedDocURL)
Processes specified assembly and returns the realized document.
|
void |
setCheckRealizedDocument(boolean check)
Specifies whether realized document is to be checked for
cross-reference errors, missing image resources, etc.
|
void |
setConsole(Console c) |
void |
setDocumentLoader(Loader loader)
Specifies which document loader to use to load XML documents.
|
void |
setOutputFormat(String format)
Similar to
setOutputFormats(java.lang.String[]) except that specified string
is split around character ; . |
void |
setOutputFormats(String[] formats)
Specifies the output formats (generally only one)
which are to be considered by this processor.
|
void |
setProcessedStructId(String id)
Specifies the value of the ID of the
structure
to be processed. |
void |
setProfile(String[] profile)
Specifies the profile applied to the realized document.
|
void |
setResolver(XMLResolver resolver)
Specifies which entity and URI resolver to use when
loading or transforming an XML document.
|
void |
setTransclusionProcessor(Processor proc)
Specifies which processor to use to process transcluded documents.
|
public static final String VERSION
public static final String DOCBOOK_NS_URI
public Processor()
Processor(null)
.public Processor(Console c)
c
- the console. May be null
.setConsole(com.xmlmind.util.Console)
public void setConsole(Console c)
public ConsoleHelper getConsole()
public void setResolver(XMLResolver resolver)
resolver
- which resolver to use. May be null
.getResolver()
public XMLResolver getResolver()
null
.public void setDocumentLoader(Loader loader)
This loader is expected to process XInclude elements.
loader
- which loader to use. May be null
, in which
case an instance of LoaderImpl
is used.getDocumentLoader()
public Loader getDocumentLoader()
public void setTransclusionProcessor(Processor proc)
proc
- which transclusion processor to use.
May be null
, in which case an instance
of Processor
is used.getTransclusionProcessor()
public Processor getTransclusionProcessor()
public void setProcessedStructId(String id)
structure
to be processed. This may be needed in case the assembly
contains several structure
s.id
- the value of the xml:id
attribute of
the structure
to be processed.
May be null
, in which case, the first structure
in document order is processed.getProcessedStructId()
public String getProcessedStructId()
structure
to be processed. May return null
.setProcessedStructId(java.lang.String)
public void setOutputFormat(String format)
setOutputFormats(java.lang.String[])
except that specified string
is split around character ;
.public void setOutputFormats(String[] formats)
formats
- the output formats which are to be considered
by this processor. May be null
, in which case:
structure
to be processed has a
outputformat
attribute, then the value of this attribute
is the output format considered by this processor.
output
,
filterin
, filterout
elements without any
outputformat
attribute.
setProcessedStructId(java.lang.String)
,
getOutputFormats()
public String[] getOutputFormats()
null
.setOutputFormats(java.lang.String[])
public void setCheckRealizedDocument(boolean check)
false
.getCheckRealizedDocument()
public boolean getCheckRealizedDocument()
true
if realized document is to be checked for
cross-reference errors, missing image resources, etc.setCheckRealizedDocument(boolean)
public void setProfile(String[] profile)
This may be needed if you want the diagnostics reported by the realized document checker to be accurate.
profile
- a list of profiling attribute name/value pairs.
May be null
.getProfile()
,
setCheckRealizedDocument(boolean)
public String[] getProfile()
null
.setProfile(java.lang.String[])
public int configure(String[] args) throws IllegalArgumentException
assembly
(that is,
-struct
, -format
, etc).args
- command-line optionsIllegalArgumentException
- if an usage error is found
in argspublic Document process(URL inURL, URL realizedDocURL) throws IOException
Warning, errors and fatal errors (other than
IOException
s) are reported using the
console
.
inURL
- URL of the assembly input documentrealizedDocURL
- URL of the realized document.
May be null
if unimportant or unknown.null
if a fatal error has
been reportedIOException
- if, for any reason, an I/O exception is
raised during the processing.process(URL, File)
public boolean process(URL inURL, File outFile) throws IOException
Warning, errors and fatal errors (other than
IOException
s) are reported using the
console
.
inURL
- URL of the assembly input documentoutFile
- save file of the realized documenttrue
if realized document has been saved;
false
if a fatal error has been reportedIOException
- if, for any reason, an I/O exception is
raised during the processing.process(URL, URL)
public static void main(String[] args)
assembly
command-line utility.