public class DirectBidiTransformer
extends java.lang.Object
DirectBidiTransformer
without taking the
overhead of the initializations required by the wrapper.
It provides an flag-set in/out formats initialization, and string batch transformation to reduce
the cost of repetitive initialization per string conversion.
XML document transformation capabilities is also provided by this API class.Modifier and Type | Method and Description |
---|---|
static void |
transform(org.w3c.dom.Document inDoc,
java.lang.String inFormat,
java.lang.String outFormat)
Transform the input
org.w3c.dom.Document/code> using the input Bidi layout format to output Bidi
layout format |
static void |
transform(org.w3c.dom.Document inDoc,
java.lang.String inFormat,
java.lang.String outFormat,
java.util.Set<java.lang.String> exclusionsSet)
Transform the input
org.w3c.dom.Document using the input Bidi layout format to output Bidi
layout format, skipping the text values included in the passed exclusion list. |
static void |
transform(org.w3c.dom.Document inDoc,
java.lang.String inFormat,
java.lang.String outFormat,
java.util.Set<java.lang.String> exclusionsSet,
boolean transformAttributes)
Transform the input
org.w3c.dom.Document using the input Bidi layout format to output Bidi
layout format, skipping the text values included in the passed exclusion list. |
static java.util.List<java.lang.String> |
transform(java.util.List<java.lang.String> inStrs,
java.lang.String inFormat,
java.lang.String outFormat)
Transform batch of strings using the input Bidi layout format to output Bidi
layout format.
|
static java.util.List<java.lang.String> |
transform(java.util.List<java.lang.String> inStrs,
java.lang.String inFormat,
java.lang.String outFormat,
java.util.Map<java.lang.Integer,BidiTransformationException> errors)
Transform batch of strings using the input Bidi layout format to output Bidi
layout format.
|
static java.lang.String |
transform(java.lang.String text,
java.lang.String inFormat,
java.lang.String outFormat)
Transform the input string from input Bidi layout format to output Bidi
layout format.
|
public static java.lang.String transform(java.lang.String text, java.lang.String inFormat, java.lang.String outFormat) throws BidiTransformationException
BidiFlags
text
- Input textinFormat
- Input Bidi flag-set format parametersoutFormat
- Output Bidi flag-set format parameters
BidiTransformer
to throw exception
if in & out attributes are equal.BidiTransformationException
public static java.util.List<java.lang.String> transform(java.util.List<java.lang.String> inStrs, java.lang.String inFormat, java.lang.String outFormat) throws BidiTransformationException
BidiFlags
The method doesn't expect transformation errors to be logged.inStrs
- Input String listinFormat
- Input Bidi flag-set format parametersoutFormat
- Output Bidi flag-set format parametersList
. Returned list may contain null values to
indicate errors happened while text transformation.BidiTransformationException
- exception is thrown in case of initialization failure
Null's in the returned list should be anticipated if the transformation/reshaping fails
in the batch.public static java.util.List<java.lang.String> transform(java.util.List<java.lang.String> inStrs, java.lang.String inFormat, java.lang.String outFormat, java.util.Map<java.lang.Integer,BidiTransformationException> errors) throws BidiTransformationException
BidiFlags
inStrs
- Input String listinFormat
- Input Bidi flag-set format parametersoutFormat
- Output Bidi flag-set format parameterserrors
- Map to hold the exceptions thrown particularly thru any transformation.
If null, no errors will be logged.
BidiTransformer
to throw exception
if in & out attributes are equal.List
BidiTransformationException
- exception is thrown in case of initialization failure
Null's in the returned list should be anticipated if the transformation/reshaping fails
in the batch.public static void transform(org.w3c.dom.Document inDoc, java.lang.String inFormat, java.lang.String outFormat) throws BidiTransformationException
org.w3c.dom.Document/code> using the input Bidi layout format to output Bidi
layout format
inDoc
- Input XML document. If null, IllegalArgumentException
will be thrown.inFormat
- Input Bidi flag-set format parametersoutFormat
- Output Bidi flag-set format parameters
BidiTransformationException
public static void transform(org.w3c.dom.Document inDoc, java.lang.String inFormat, java.lang.String outFormat, java.util.Set<java.lang.String> exclusionsSet) throws BidiTransformationException
org.w3c.dom.Document
using the input Bidi layout format to output Bidi
layout format, skipping the text values included in the passed exclusion list.inDoc
- Input XML document. If null, IllegalArgumentException
will be thrown.inFormat
- Input Bidi flag-set format parametersoutFormat
- Output Bidi flag-set format parametersexclusionsSet
- the list of unique text entries those shouldn't be processed by the Bidi transformer.
Exclusion for a node doesn't exclude its children.
BidiTransformationException
public static void transform(org.w3c.dom.Document inDoc, java.lang.String inFormat, java.lang.String outFormat, java.util.Set<java.lang.String> exclusionsSet, boolean transformAttributes) throws BidiTransformationException
org.w3c.dom.Document
using the input Bidi layout format to output Bidi
layout format, skipping the text values included in the passed exclusion list.inDoc
- Input XML document. If null, BidiTransformationException
will be thrown.inFormat
- Input Bidi flag-set format parametersoutFormat
- Output Bidi flag-set format parametersexclusionsSet
- the list of unique text entries those shouldn't be processed by the Bidi transformer.
Exclusion for a node doesn't exclude its children.transformAttributes
- decides whether to transform the values of element's attributes or not
BidiTransformer
to throw exception
if in & out attributes are equal.BidiTransformationException