|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jopendocument.dom.ODXMLDocument org.jopendocument.dom.ODSingleXMLDocument
public class ODSingleXMLDocument
An XML document containing all of an office document, see section 2.1 of OpenDocument 1.1.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jopendocument.dom.ODXMLDocument |
---|
ODXMLDocument.ElementTransformer |
Field Summary |
---|
Fields inherited from class org.jopendocument.dom.ODXMLDocument |
---|
NOP_ElementTransformer |
Constructor Summary | |
---|---|
ODSingleXMLDocument(org.jdom.Document content)
|
Method Summary | |
---|---|
void |
add(org.jdom.Element where,
int index,
ODSingleXMLDocument doc)
Add the passed document at the specified place. |
void |
add(ODSingleXMLDocument doc)
Append a document. |
void |
add(ODSingleXMLDocument doc,
boolean pageBreak)
Append a document. |
Set<String> |
addBasicLibraries(Collection<? extends Library> libraries)
Add the passed libraries to this document. |
Set<String> |
addBasicLibraries(ODPackage pkg)
|
ODSingleXMLDocument |
clone()
|
static ODSingleXMLDocument |
createFromDocument(org.jdom.Document content,
org.jdom.Document style)
Create a document from a collection of subdocuments. |
static ODSingleXMLDocument |
createFromFile(File f)
Create a document from a flat XML. |
static ODSingleXMLDocument |
createFromPackage(File f)
Create a document from a package. |
static ODSingleXMLDocument |
createFromStream(InputStream ins)
|
protected void |
detachDuplicate(org.jdom.Element elem)
Detach the children of elem whose names already exist in the body. |
org.jdom.Element |
getBody()
|
int |
getNumero()
The number of files concatenated with add(ODSingleXMLDocument) . |
ODPackage |
getPackage()
|
boolean |
isDead()
Return true if this document was split. |
Map<String,Library> |
readBasicLibraries()
Parse BASIC libraries in this flat XML. |
Set<String> |
removeBasicLibraries(Collection<String> libraries)
Remove the passed libraries. |
void |
replace(org.jdom.Element elem,
ODSingleXMLDocument doc)
|
File |
save()
|
File |
saveAs(File fNoExt)
|
File |
saveToPackageAs(File f)
Saves this OO document to a file. |
Methods inherited from class org.jopendocument.dom.ODXMLDocument |
---|
add, add, add, addAutoStyle, addIfNotPresent, addIfNotPresent, asString, create, findUnusedName, getChild, getChild, getDefaultStyle, getDescendant, getDescendant, getDescendantByName, getDescendantByName, getDocument, getFormatVersion, getNamedElements, getStyle, getStyle, getValidator, getVersion, getXML, getXPath, mergeAll, mergeAll, setChild |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ODSingleXMLDocument(org.jdom.Document content)
Method Detail |
---|
public static ODSingleXMLDocument createFromDocument(org.jdom.Document content, org.jdom.Document style)
content
- the content.style
- the styles, can be null
.
public static ODSingleXMLDocument createFromPackage(File f) throws org.jdom.JDOMException, IOException
f
- an OpenDocument package file.
org.jdom.JDOMException
- if the file is not a valid OpenDocument file.
IOException
- if the file can't be read.public static ODSingleXMLDocument createFromFile(File f) throws org.jdom.JDOMException, IOException
f
- an OpenDocument XML file.
org.jdom.JDOMException
- if the file is not a valid OpenDocument file.
IOException
- if the file can't be read.public static ODSingleXMLDocument createFromStream(InputStream ins) throws org.jdom.JDOMException, IOException
org.jdom.JDOMException
IOException
public ODSingleXMLDocument clone()
clone
in class Object
public final int getNumero()
add(ODSingleXMLDocument)
.
public ODPackage getPackage()
public final Map<String,Library> readBasicLibraries()
public void add(ODSingleXMLDocument doc)
doc
- the document to add.public void add(ODSingleXMLDocument doc, boolean pageBreak)
doc
- the document to add, null
means no-op.pageBreak
- whether a page break should be inserted before doc
.public void replace(org.jdom.Element elem, ODSingleXMLDocument doc)
public void add(org.jdom.Element where, int index, ODSingleXMLDocument doc)
where
- a descendant of the body, null
meaning the body itself.index
- the content index inside where
, -1 meaning the end.doc
- the document to add, null
means no-op.public final Set<String> addBasicLibraries(Collection<? extends Library> libraries)
libraries
- what to add.
IllegalArgumentException
- if libraries
contains duplicates or if it
cannot be merged into this.Library.canBeMerged(Library)
public final Set<String> addBasicLibraries(ODPackage pkg)
public final Set<String> removeBasicLibraries(Collection<String> libraries)
libraries
- which libraries to remove.
protected final void detachDuplicate(org.jdom.Element elem) throws org.jdom.JDOMException
elem
- the elem to be trimmed.
org.jdom.JDOMException
- if an error occurs.public final org.jdom.Element getBody()
public final boolean isDead()
true
if this document was split.
true
if this has no package anymore.ODPackage.split()
public File saveToPackageAs(File f) throws IOException
f
- the file where this document will be saved, without extension, eg "dir/myfile".
IOException
- if an error occurs.public File save() throws IOException
IOException
public File saveAs(File fNoExt) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |