public class Document extends FormattingObject
Modifier and Type | Class and Description |
---|---|
static class |
Document.Factory |
EMPTY_ARRAY
MAP_TYPE_FLYWEIGHT, MAP_TYPE_HASH
Constructor and Description |
---|
Document()
Creates a new empty document.
|
Document(PageMaster pageMaster)
Creates a new document, adds a PageMaster and a empty PageSequence.
|
Document(SimplePageMaster.PageDescription pageDesc)
Creates a new document, adds a SimplePageMaster and a empty PageSequence.
|
Modifier and Type | Method and Description |
---|---|
void |
add(PageSequence ps)
Adds a PageSequence to this document.
|
boolean |
addUnsafe(java.lang.Object child)
Adds a NodeElement to this FormattingObject.
|
void |
append(Document doc)
Appends another document to this document.
|
void |
append(Document doc,
boolean pageNumberingRestart)
Appends another document to this document.
|
void |
appendContent(Document doc)
Appends the content of the given document to this document.
|
java.lang.Object |
clone()
Clones this document.
|
Document |
copy()
Similar to clone(), but throws no CloneNotSupportedException.
|
java.lang.String |
getBaseURL()
Gets the base URL that is used to resolve relative URLs.
|
Declarations |
getDeclarations()
Gets declarations of this document.
|
java.util.List |
getElements()
Gets childreen of this node.
|
PageSequence |
getFirstPageSequence()
Gets the first PageSequence.
|
PageSequence |
getLastPageSequence()
Gets the last PageSequence.
|
LayoutMasterSet |
getLayoutMasterSet()
Gets the LayoutMasterSet of this FO-Document.
|
java.util.List<PageSequence> |
getPageSequences()
Gets the list of all contained PageSequences.
|
boolean |
removeElement(java.lang.Object o)
Removes an element from the list of page-sequences.
|
boolean |
render(OutputFormat outputFormat,
java.io.File out)
Renders this document into given output format into a file.
|
boolean |
render(OutputFormat outputFormat,
java.io.OutputStream out)
Renders this document into given output format into a stream.
|
boolean |
render(Renderer renderer,
OutputFormat outputFormat,
java.io.File out)
Renders this document into given output format to a file.
|
boolean |
render(Renderer renderer,
OutputFormat outputFormat,
java.io.OutputStream os)
Renders this document into given output format.
|
boolean |
replaceElement(java.lang.Object oldElement,
java.lang.Object newElement)
Replaces an element in the list of page-sequences.
|
void |
setBaseURL(java.lang.String baseURL)
Sets the base URL that is used to resolve relative URLs.
|
void |
setDeclaration(Declarations declarations)
Sets some declarations of this document.
|
void |
writeTo(java.io.OutputStream os)
Writes full XML-tree into give OutputStream as XML.
|
void |
writeTo(XMLWriter writer)
Writes this node through an XML-Writer.
|
addElement, addElement, addUnsafe, cloned, clonedList, createUniqueID, doGetAttribute, doSetAttribute, elementCount, get, getAbsolutePosition, getAccessibility, getAttributeMap, getBackground, getBorder, getDefinedAttributes, getDocument, getFont, getID, getLanguage, getLogger, getMargin, getMeasureValue, getObjectValue, getObjectValue, getObjectValue, getObjectValue, getOrphans, getPadding, getParentFO, getRelativePosition, getWidows, hasBorder, hasID, hasPadding, isEmpty, isHyphenation, removeElement, setAbsolutePosition, setAccessibility, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setBackground, setBorder, setElement, setFont, setHyphenation, setID, setLanguage, setLanguage, setMargin, setOrphans, setPadding, setRelativePosition, setWidows
getDefaultMapType, setDefaultMapType
addAttributeChangeListener, addElements, addElements, clearEqualAttributes, clearInheratedAttribute, clearInheratedAttributes, clearValue, contains, contains, copyAttributes, createID, findFirstNodeWithText, findNode, findNodesWithText, fire, fireSaxEvents, firstElement, getAttrAsBoolean, getAttrAsInteger, getAttrAsString, getAttrAsString, getAttribute, getAttribute, getAttributeMap, getContentText, getContentText, getDefinedAttributes, getElements, getElements, getElements, getFirstElement, getIndex, getLocalName, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getParent, getParent, getParent, getParentOrThis, getQName, getRoot, hasEqualAttrs, indexOf, lastElement, liftInheritedAttribute, removeAttributeChangeListener, setAttribute, setAttributes, setAttrIfNotNull, setEnableAttributeChangeEvent, setNamespace, setParent, setQName, setUndefinedAttributes, writeTo, writeTo
public Document()
public Document(SimplePageMaster.PageDescription pageDesc)
pageDesc
- PageDescription of pages.public Document(PageMaster pageMaster)
pageMaster
- PageMaster.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface NodeElement
clone
in class FormattingObject
java.lang.CloneNotSupportedException
- Should never be thrown.public Document copy()
public LayoutMasterSet getLayoutMasterSet()
public java.util.List<PageSequence> getPageSequences()
public java.util.List getElements()
AbstractNode
NodeElement
or String
.getElements
in interface Node
getElements
in class AbstractNode
public void add(PageSequence ps)
ps
- PageSequence.public boolean removeElement(java.lang.Object o)
removeElement
in interface Node
removeElement
in class FormattingObject
o
- NodeElementpublic boolean replaceElement(java.lang.Object oldElement, java.lang.Object newElement)
replaceElement
in interface Node
replaceElement
in class FormattingObject
oldElement
- Old element.newElement
- New element.true
if this node contained oldElementpublic void setDeclaration(Declarations declarations)
declarations
- Declarations.public Declarations getDeclarations()
public PageSequence getLastPageSequence()
public PageSequence getFirstPageSequence()
public void append(Document doc)
doc
- A document.public void append(Document doc, boolean pageNumberingRestart)
doc
- A document.pageNumberingRestart
- true, if page-numbering should restart at first
page of appended document.public void appendContent(Document doc)
doc
- A document.public boolean render(Renderer renderer, OutputFormat outputFormat, java.io.OutputStream os)
Rendered.render()
methodes that throws exceptions.renderer
- Used renderer. (See package de.vc.jfo.renderer)outputFormat
- Output format. (Must be supported by renderer)os
- Output stream where rendered document is written into.true
if document was rendered without an exception.public boolean render(Renderer renderer, OutputFormat outputFormat, java.io.File out)
Rendered.render()
methodes that throws exceptions.renderer
- Used renderer. (See package de.vc.jfo.renderer)outputFormat
- Output format. (Must be supported by renderer)out
- Output file.true
if document was rendered without an exception.public boolean render(OutputFormat outputFormat, java.io.File out)
Rendered.render()
methodes that throws exceptions.outputFormat
- Output format.out
- Output file.true
if document was rendered without an exception.public boolean render(OutputFormat outputFormat, java.io.OutputStream out)
Rendered.render()
methodes that throws exceptions.outputFormat
- Output format.out
- Output file.true
if document was rendered without an exception.public void writeTo(XMLWriter writer)
AbstractNode
writeTo
in interface NodeElement
writeTo
in class AbstractNode
writer
- Writer.public void setBaseURL(java.lang.String baseURL)
baseURL
- URLpublic java.lang.String getBaseURL()
public void writeTo(java.io.OutputStream os) throws java.io.IOException
AbstractNode
writeTo
in class AbstractNode
os
- OutputStreamjava.io.IOException
public boolean addUnsafe(java.lang.Object child)
FormattingObject
addUnsafe
in class FormattingObject
child
- Element.false
if this FO is unable to add object.© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.