psdi.iface.bidi.core

Class DirectBidiTransformer

  • java.lang.Object
    • psdi.iface.bidi.core.DirectBidiTransformer


  • public class DirectBidiTransformer
    extends java.lang.Object
    Provides a simplified access to use of the 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.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      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 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 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 transform(java.util.List 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 transform(java.util.List inStrs, java.lang.String inFormat, java.lang.String outFormat, java.util.Map 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • transform

        public static java.lang.String transform(java.lang.String text,
                                                 java.lang.String inFormat,
                                                 java.lang.String outFormat)
                                          throws BidiTransformationException
        Transform the input string from input Bidi layout format to output Bidi layout format. Formats are supplied into Bidi FlagSet format. See BidiFlags
        Parameters:
        text - Input text
        inFormat - Input Bidi flag-set format parameters
        outFormat - Output Bidi flag-set format parameters

      • For more robustness, method initializes the working BidiTransformer to throw exception if in & out attributes are equal.
      • Returns:
        returns the transformed String
        Throws:
        BidiTransformationException
      • transform

        public static java.util.List transform(java.util.List inStrs,
                                               java.lang.String inFormat,
                                               java.lang.String outFormat)
                                        throws BidiTransformationException
        Transform batch of strings using the input Bidi layout format to output Bidi layout format. Formats are supplied into Bidi FlagSet format. See BidiFlags The method doesn't expect transformation errors to be logged.
        Parameters:
        inStrs - Input String list
        inFormat - Input Bidi flag-set format parameters
        outFormat - Output Bidi flag-set format parameters
        Returns:
        transformed Strings into an List. Returned list may contain null values to indicate errors happened while text transformation.
        Throws:
        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.
      • transform

        public static java.util.List transform(java.util.List inStrs,
                                               java.lang.String inFormat,
                                               java.lang.String outFormat,
                                               java.util.Map errors)
                                        throws BidiTransformationException
        Transform batch of strings using the input Bidi layout format to output Bidi layout format. Formats are supplied into Bidi FlagSet format. See BidiFlags
        Parameters:
        inStrs - Input String list
        inFormat - Input Bidi flag-set format parameters
        outFormat - Output Bidi flag-set format parameters
        errors - Map to hold the exceptions thrown particularly thru any transformation. If null, no errors will be logged.

      • For more robustness, method initializes the working BidiTransformer to throw exception if in & out attributes are equal.
      • Returns:
        transformed Strings into an List
        Throws:
        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.
      • transform

        public static void transform(org.w3c.dom.Document inDoc,
                                     java.lang.String inFormat,
                                     java.lang.String outFormat)
                              throws BidiTransformationException
        Transform the input org.w3c.dom.Document/code> using the input Bidi layout format to output Bidi layout format
        Parameters:
        inDoc - Input XML document. If null, IllegalArgumentException will be thrown.
        inFormat - Input Bidi flag-set format parameters
        outFormat - Output Bidi flag-set format parameters

      • exclusionsSet is set to null
      • transformAttributes is set to false
      • Throws:
        BidiTransformationException
      • transform

        public static void transform(org.w3c.dom.Document inDoc,
                                     java.lang.String inFormat,
                                     java.lang.String outFormat,
                                     java.util.Set exclusionsSet)
                              throws BidiTransformationException
        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.
        Parameters:
        inDoc - Input XML document. If null, IllegalArgumentException will be thrown.
        inFormat - Input Bidi flag-set format parameters
        outFormat - Output Bidi flag-set format parameters
        exclusionsSet - 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 is set to false
      • Throws:
        BidiTransformationException
      • transform

        public static void transform(org.w3c.dom.Document inDoc,
                                     java.lang.String inFormat,
                                     java.lang.String outFormat,
                                     java.util.Set exclusionsSet,
                                     boolean transformAttributes)
                              throws BidiTransformationException
        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.
        Parameters:
        inDoc - Input XML document. If null, BidiTransformationException will be thrown.
        inFormat - Input Bidi flag-set format parameters
        outFormat - Output Bidi flag-set format parameters
        exclusionsSet - 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

      • For more robustness, method initializes the working BidiTransformer to throw exception if in & out attributes are equal.
      • Throws:
        BidiTransformationException