public class XLIFFReader
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
static int |
VALIDATION_INCLUDE_FRAGIDPREFIX
Includes validation of the fragment identification values.
|
static int |
VALIDATION_INCLUDE_SCHEMAS
Includes schemas-based validation.
|
static int |
VALIDATION_MAXIMAL
Performs as much validation as possible with the reader
(which may not be a full validation for the modules, depending on the modules supported).
|
static int |
VALIDATION_MINIMAL
Performs as little validation as possible.
|
| Constructor and Description |
|---|
XLIFFReader()
Creates a new XLIFFReader object with full validation.
|
XLIFFReader(int validation)
Creates a new XLIFFReader object.
|
XLIFFReader(int validation,
URIParser uriParserToUse)
Creates a new XLIFFReader object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the document.
|
int |
getWarningCount()
Gets the number of warnings.
|
boolean |
hasNext()
Indicates if there is another event.
|
Event |
next()
Gets the next filter event.
|
void |
open(java.io.File file)
Opens an XLIFF document by its File object.
|
void |
open(java.io.InputStream inputStream)
Opens an XLIFF document by its stream.
|
void |
open(java.lang.String input)
Opens an XLIFF document passed as a string.
|
void |
open(java.net.URI inputURI)
Opens an XLIFF document by its URI.
|
protected void |
processMatches() |
void |
setReportUnsingnificantParts(boolean reportUnsingnificantParts)
Sets the flag to report or not parts of the documents that are not significant.
|
static void |
validate(java.io.File file)
Validates an XLIFF document passed as a File object.
|
static void |
validate(java.io.File file,
URIParser uriParser)
Validates an XLIFF document passed as a File object.
|
static void |
validate(java.io.InputStream inputStream,
URIParser uriParser)
Validates an XLIFF document passed as a stream.
|
static void |
validate(java.lang.String input,
URIParser uriParser)
Validates an XLIFF document passed as a string.
|
static void |
validate(java.net.URI inputURI,
URIParser uriParser)
Validates an XLIFF document passed as a URI.
|
public static final int VALIDATION_MINIMAL
public static final int VALIDATION_MAXIMAL
public static final int VALIDATION_INCLUDE_SCHEMAS
public static final int VALIDATION_INCLUDE_FRAGIDPREFIX
public XLIFFReader()
public XLIFFReader(int validation)
validation - one of the VALIDATION_* constants or a ORed combination.public XLIFFReader(int validation,
URIParser uriParserToUse)
validation - one of the VALIDATION_* constants or a ORed combination.uriParserToUse - URI parser to use when processing references (e.g. value of ref in an <mrk> element).
If it is set to null, a URIParser object that handles default prefixes will be used.public static void validate(java.io.File file)
file - the XLIFF document to validate.public static void validate(java.io.File file,
URIParser uriParser)
file - the XLIFF document to validate.uriParser - the URI parser to use when processing references (can be null).public static void validate(java.net.URI inputURI,
URIParser uriParser)
inputURI - the URI to process.uriParser - the URI parser to use when processing references (can be null).public static void validate(java.lang.String input,
URIParser uriParser)
input - the content to process.uriParser - the URI parser to use when processing references (can be null).public static void validate(java.io.InputStream inputStream,
URIParser uriParser)
inputStream - the stream to process.uriParser - the URI parser to use when processing references (can be null).public void open(java.io.File file)
file - the file to process.public void open(java.net.URI inputURI)
inputURI - the URI to process.public void open(java.lang.String input)
input - the string containing the document to process.public void open(java.io.InputStream inputStream)
open(File), open(URI) or open(String).inputStream - the input stream to process.public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic boolean hasNext()
public Event next()
public void setReportUnsingnificantParts(boolean reportUnsingnificantParts)
By default those parts are not reported.
reportUnsingnificantParts - true to report those parts, false to not report them.public int getWarningCount()
protected void processMatches()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException