public class XLIFFDocument extends Object
| Constructor and Description |
|---|
XLIFFDocument() |
XLIFFDocument(StartXliffData sxd) |
XLIFFDocument(String sourceLang,
String version)
Creates a new
XLIFFDocument() with given source and version. |
| Modifier and Type | Method and Description |
|---|---|
FileNode |
addFileNode(String id)
Adds a
FileNode object to this document. |
Iterator<Event> |
createEventIterator()
Creates an iterator for the events of this document.
|
Object |
fetchReference(URIParser up)
Retrieves the object corresponding to a given URI fragment.
|
File |
getFile()
Gets the File object associated with this document.
|
FileNode |
getFileNode(String id)
Gets the
FileNode from a given file id. |
List<String> |
getFileNodeIds()
Gets the IDs of all
FileNode in this XLIFF document. |
GroupNode |
getGroupNode(String fileId,
String groupId)
Gets the
GroupNode from a given file id and a given group id. |
StartXliffData |
getStartXliffData()
Gets the document-level data for this document.
|
UnitNode |
getUnitNode(String fileId,
String unitId)
Gets the
UnitNode from a given file id and a given unit id. |
List<Unit> |
getUnits()
Gets a list of all the units in this document.
|
void |
load(File file)
Loads a document from a given file, with maximum validation.
|
void |
load(File file,
int validation)
Loads a document from a given File.
|
void |
load(String input,
int validation)
Loads a document from a string.
|
void |
load(URI inputURI,
int validation)
Loads a document from a given URI.
|
void |
save()
Saves this document to the current file.
|
void |
save(Writer outputWriter)
Saves this document to a writer.
|
void |
saveAs(File outputFile)
Saves this document to a specified file.
|
void |
setLineBreak(String lineBreak)
Sets the line break to use when writing out this document.
|
public XLIFFDocument()
public XLIFFDocument(StartXliffData sxd)
public XLIFFDocument(String sourceLang, String version)
XLIFFDocument() with given source and version.sourceLang - the source language.version - version of the XLIFF document (use null for the default).public void load(File file)
file - the file to load.public void load(File file, int validation)
file - the file to load.validation - one of the VALIDATION_* constants or a ORed combination.public void load(URI inputURI, int validation)
inputURI - the URI to load from.validation - one of the VALIDATION_* constants or a ORed combination.public void load(String input, int validation)
input - the content of the document to load.validation - one of the VALIDATION_* constants or a ORed combination.public void saveAs(File outputFile)
outputFile - the output file.save()public void save()
load(File), load(File, int)
or saveAs(File) before.saveAs(File)public void save(Writer outputWriter)
outputWriter - the output writer.public StartXliffData getStartXliffData()
public FileNode getFileNode(String id)
FileNode from a given file id.id - the id of the file to lookup.FileNode object or null if not found.public List<String> getFileNodeIds()
FileNode in this XLIFF document.
The order of IDs is the insertion order of files.public GroupNode getGroupNode(String fileId, String groupId)
GroupNode from a given file id and a given group id.fileId - the id of the file where the group is.groupId - the id of the group to lookup.GroupNode or null if not found.public UnitNode getUnitNode(String fileId, String unitId)
UnitNode from a given file id and a given unit id.fileId - the id of the file where the unit is.unitId - the id of the unit to lookup.UnitNode or null if not found.public Iterator<Event> createEventIterator()
public Object fetchReference(URIParser up)
up - the URIParser representing the fragment to resolve.public List<Unit> getUnits()
public File getFile()
load(File), load(File, int)
and saveAs(File).public FileNode addFileNode(String id)
FileNode object to this document.id - the ID of the file to add.FileNode object.public void setLineBreak(String lineBreak)
lineBreak - the line break to use for this document.Copyright © 2020. All rights reserved.