|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.print.DocumentPrinter
public class DocumentPrinter
Name: DocumentPrinter
Description: A class printing xml based documents.
Constructor Summary | |
---|---|
DocumentPrinter()
Constructs a DocumentPrinter instance with specific attributes. |
|
DocumentPrinter(DocumentTagFactory tagFactory)
Constructs a DocumentPrinter instance with specific attributes. |
|
DocumentPrinter(InputStream templateStream,
Map properties)
Constructs a DocumentPrinter instance with specific arguments. |
|
DocumentPrinter(InputStream templateStream,
Map properties,
DocumentTagFactory tagFactory)
Constructs a DocumentPrinter instance with specific arguments. |
|
DocumentPrinter(Reader templateReader,
Map properties)
Constructs a DocumentPrinter instance with specific arguments. |
|
DocumentPrinter(Reader templateReader,
Map properties,
DocumentTagFactory tagFactory)
Constructs a DocumentPrinter instance with specific arguments. |
Method Summary | |
---|---|
protected void |
addDefaultProperties()
Adds default properties. |
void |
clearProperties()
Clears the document property map. |
protected DocumentHandler |
createDocumentHandler(OutputStream outputStream)
Creates a DocumentHandler instance for the given output stream. |
protected XMLReader |
createXmlReader()
Creates a XMLReader instance. |
ContentFilter |
getContentFilter()
Getter method for the the property contentFilter. |
int |
getExpectedNumberOfPages()
Getter method for the the property expectedNumberOfPages. |
FormatHelper |
getFormatHelper()
Gets the format helper. |
DocumentMetaData |
getMetaData()
Gets the document meta data. |
protected List |
getModules()
Getter method for the the property modules. |
Map |
getProperties()
Gets the document properties. |
ResourceLoader |
getResourceLoader()
Gets the resource loader. |
DocumentTagFactory |
getTagFactory()
Getter method for the the property tagFactory. |
DocumentTagInterceptor |
getTagInterceptor()
Getter method for the the property tagInterceptor. |
TemplateInterpreter |
getTemplateInterpreter()
Getter method for the the property templateInterpeter. |
String |
getXmlReaderClass()
Gets the XML reader implementation. |
boolean |
isCacheImages()
Getter method for the the property cacheImages. |
boolean |
isEvaluateExpressions()
Getter method for the the property evaluateExpressions. |
boolean |
isPageNumberingStartsAfterHead()
Getter method for the the property pageNumberingStartsAfterHead. |
boolean |
isParseDynamicContent()
Getter method for the the property parseDynamicContent. |
boolean |
isStrictlyCheckDocumentStructure()
Getter method for the the property strictlyCheckDocumentStructure. |
boolean |
isTranslateEscapeSequences()
Getter method for the the property translateEscapeSequences. |
void |
loadModule(String modulePath)
Loads a module from a resource loader. |
static Map |
loadProperties(String location)
Loads document properties from the given location. |
static void |
main(String[] args)
The main method for command line access. |
protected DocumentHandler |
printDocument(DocumentHandler documentHandler,
InputSource templateSource,
List modules)
Prints the document to the given output stream. |
DocumentHandler |
printDocument(OutputStream outputStream)
Prints the document to the given output stream. |
DocumentHandler |
printDocument(OutputStream outputStream,
boolean supportToc)
Prints the document to the given output stream. |
protected void |
removeInternalDocumentProperties()
Removes document properties, which are internally used by the DocumentHandler. |
void |
setCacheImages(boolean cacheImages)
Setter method for the the property cacheImages. |
void |
setContentFilter(ContentFilter contentFilter)
Setter method for the the property contentFilter. |
void |
setDataAccessor(DocumentDataAccessor dataAccessor)
Sets the data accessor component. |
void |
setEvaluateExpressions(boolean evaluateExpressions)
Setter method for the the property evaluateExpressions. |
void |
setExpectedNumberOfPages(int expectedNumberOfPages)
Setter method for the the property expectedNumberOfPages. |
void |
setFormatHelper(FormatHelper formatHelper)
Sets the format helper. |
void |
setMetaData(DocumentMetaData metaData)
Sets the document meta data. |
void |
setPageNumberingStartsAfterHead(boolean pageNumberingStartsAfterHead)
Setter method for the the property pageNumberingStartsAfterHead. |
void |
setParseDynamicContent(boolean parseDynamicContent)
Setter method for the the property parseDynamicContent. |
void |
setProperties(Map properties)
Sets the document properties. |
void |
setResourceLoader(ResourceLoader resourceLoader)
Sets the resource loader. |
void |
setStrictlyCheckDocumentStructure(boolean strictlyCheckDocumentStructure)
Setter method for the the property strictlyCheckDocumentStructure. |
void |
setTagFactory(DocumentTagFactory tagFactory)
Setter method for the the property tagFactory. |
void |
setTagInterceptor(DocumentTagInterceptor tagInterceptor)
Setter method for the the property tagInterceptor. |
void |
setTemplateInterpreter(TemplateInterpreter templateInterpeter)
Setter method for the the property templateInterpeter. |
void |
setTemplateSource(InputStream templateStream)
Sets the template source. |
void |
setTemplateSource(Reader templateReader)
Sets the template source. |
void |
setTranslateEscapeSequences(boolean translateEscapeSequences)
Setter method for the the property translateEscapeSequences. |
void |
setXmlReaderClass(String xmlReaderClass)
Sets the XML reader implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentPrinter()
public DocumentPrinter(DocumentTagFactory tagFactory)
tagFactory
- The document tag factory.public DocumentPrinter(InputStream templateStream, Map properties)
templateStream
- The template input stream.properties
- The document's properties.public DocumentPrinter(InputStream templateStream, Map properties, DocumentTagFactory tagFactory)
templateStream
- The template input stream.properties
- The document's properties.tagFactory
- The document tag factory.public DocumentPrinter(Reader templateReader, Map properties)
templateReader
- The template reader.properties
- The document's properties.public DocumentPrinter(Reader templateReader, Map properties, DocumentTagFactory tagFactory)
templateReader
- The template reader.properties
- The document's properties.tagFactory
- The document tag factory.Method Detail |
---|
public TemplateInterpreter getTemplateInterpreter()
public void setTemplateInterpreter(TemplateInterpreter templateInterpeter)
templateInterpeter
- The value to set for the property templateInterpeter.public FormatHelper getFormatHelper()
public void setFormatHelper(FormatHelper formatHelper)
formatHelper
- The format helper to set.public void setTemplateSource(InputStream templateStream)
templateStream
- The input stream to read from.public void setTemplateSource(Reader templateReader)
templateReader
- The reader to read from.public Map getProperties()
public void setProperties(Map properties)
properties
- The document's properties.public String getXmlReaderClass()
public void setXmlReaderClass(String xmlReaderClass)
xmlReaderClass
- The class name of the XML reader implementation
to set, only non null values are accepted, null values are ignored.protected XMLReader createXmlReader() throws SAXException
SAXException
- If no default XMLReader class
can be identified and instantiated or the class cannot be
loaded, instantiated, and cast to XMLReader.public ResourceLoader getResourceLoader()
public void setResourceLoader(ResourceLoader resourceLoader)
resourceLoader
- The resource loader to set.public void setDataAccessor(DocumentDataAccessor dataAccessor)
dataAccessor
- The data accessor to set.public DocumentTagInterceptor getTagInterceptor()
public void setTagInterceptor(DocumentTagInterceptor tagInterceptor)
tagInterceptor
- The value to set for the property tagInterceptor.public ContentFilter getContentFilter()
public void setContentFilter(ContentFilter contentFilter)
contentFilter
- The value to set for the property contentFilter.public boolean isTranslateEscapeSequences()
public void setTranslateEscapeSequences(boolean translateEscapeSequences)
translateEscapeSequences
- The value to set for the property translateEscapeSequences.public boolean isParseDynamicContent()
public void setParseDynamicContent(boolean parseDynamicContent)
parseDynamicContent
- The value to set for the property parseDynamicContent.public boolean isEvaluateExpressions()
public void setEvaluateExpressions(boolean evaluateExpressions)
evaluateExpressions
- The value to set for the property evaluateExpressions.public boolean isCacheImages()
public void setCacheImages(boolean cacheImages)
cacheImages
- The value to set for the property cacheImages.public boolean isStrictlyCheckDocumentStructure()
public void setStrictlyCheckDocumentStructure(boolean strictlyCheckDocumentStructure)
strictlyCheckDocumentStructure
- The value to set for the property strictlyCheckDocumentStructure.public int getExpectedNumberOfPages()
public void setExpectedNumberOfPages(int expectedNumberOfPages)
expectedNumberOfPages
- The value to set for the property expectedNumberOfPages.public boolean isPageNumberingStartsAfterHead()
public void setPageNumberingStartsAfterHead(boolean pageNumberingStartsAfterHead)
pageNumberingStartsAfterHead
- The value to set for the property pageNumberingStartsAfterHead.public void loadModule(String modulePath) throws IOException
modulePath
- The path that leads to the module.
IOException
- In case the given directory couldn't be accessed.public DocumentHandler printDocument(OutputStream outputStream) throws DocumentHandlerException, IOException
outputStream
- The output stream to which to write the document.
DocumentHandlerException
- If something went wrong at document handling.
IOException
- In case something went wrong during output.public DocumentHandler printDocument(OutputStream outputStream, boolean supportToc) throws DocumentHandlerException, IOException
outputStream
- The output stream to which to write the document.supportToc
- Tells whether or not to support the output of a leading table of contents.
Notice: if you use this option, the document will be generated in up to three document
processing steps which has negative performance impacts.
DocumentHandlerException
- If something went wrong at document handling.
IOException
- In case something went wrong during output.protected void removeInternalDocumentProperties()
protected DocumentHandler printDocument(DocumentHandler documentHandler, InputSource templateSource, List modules) throws DocumentHandlerException, IOException
documentHandler
- The document handler to use for XML processing.templateSource
- The template to process.modules
- The modules to use.
DocumentHandlerException
- If something went wrong at document handling.
IOException
- In case something went wrong during output.protected DocumentHandler createDocumentHandler(OutputStream outputStream)
outputStream
- The output stream to use.
public static Map loadProperties(String location) throws IOException
location
- The file system location to load the properties from.
IOException
- In case a problem occurred while reading the properties.public void clearProperties()
protected void addDefaultProperties()
protected List getModules()
public static void main(String[] args)
args
- The command line arguments.public DocumentTagFactory getTagFactory()
public void setTagFactory(DocumentTagFactory tagFactory)
tagFactory
- The value to set for the property tagFactory.public DocumentMetaData getMetaData()
public void setMetaData(DocumentMetaData metaData)
metaData
- The XMP meta data to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |