Package com.xmlmind.w2x.docx.toxhtml

## Class Util

- java.lang.Object
- - com.xmlmind.w2x.docx.toxhtml.Util

-     public final class Util
      extends Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `addClass​(Element element, String cls)` |
    `static void` | `addClass​(Element element, String cls, boolean prepend)` |
    `static void` | `addStyleProp​(Element element, String propName, String propValue)` |
    `static void` | `appendText​(String text, Element xhtmlParent)` |
    `static String` | `checkBorderWidth​(String width)` |
    `static String` | `checkIntAttribute​(Element element, Name attrName)` |
    `static String` | `checkIntAttribute​(Element element, Name attrName, int min, int max)` |
    `static PrefixPreferences` | `createPrefixPreferences​(int docxVersion)` |
    `static double` | `doParsePt​(String val, int divider, boolean negate)` |
    `static long` | `emuToPx​(long emu)` |
    `static void` | `findAllDescendants​(Element parent, Name name, boolean recurse, List<Element> list)` |
    `static Element` | `findAncestor​(Element element, Name name)` |
    `static Element` | `findDescendant​(Element parent, Name... names)` |
    `static Element` | `findDescendant​(Element parent, Name name, boolean recurse)` |
    `static String` | `formatDouble​(double val)` |
    `static String` | `getAnyAttribute​(Element element, Name... attrNames)` |
    `static long` | `getLengthAttribute​(Element element, Name attrName, long fallback)` |
    `static String` | `getNonEmptyAttribute​(Element element, Name attrName)` |
    `static String` | `getNonEmptyTokenAttribute​(Element element, Name attrName)` |
    `static Part` | `getPartProperty​(Node node)` |
    `static double` | `getPercentageAttribute​(Element element, Name attrName, double fallback)` |
    `static String` | `getStyleProp​(Element element, String propName)` |
    `static String` | `getStyleProperty​(Element element, String propName)` |
    `static String` | `getStyleProperty​(String style, String propName)` |
    `static boolean` | `hasUnit​(String val)` |
    `static int` | `lengthToPx​(String length)` |
    `static String` | `normalizeFieldCode​(String fieldCode)` |
    `static void` | `numberToAlpha​(int number, boolean lowerCase, StringBuilder buffer)` |
    `static void` | `numberToRoman​(int number, boolean lowerCase, StringBuilder buffer)` |
    `static String` | `parseEm​(String val, int divider)` |
    `static String` | `parseEm​(String val, int divider, boolean negate)` |
    `static String` | `parsePt​(String val, int divider)` |
    `static String` | `parsePt​(String val, int divider, boolean negate)` |
    `static String` | `processFieldCodeIdref​(String fieldCode, Map<String,​String> remap)` |
    `static void` | `putStyleProperty​(Element element, String propName, String propValue)` |
    `static String` | `putStyleProperty​(String style, String propName, String propValue)` |
    `static void` | `removeClass​(Element element, String cls)` |
    `static void` | `removeStyleProp​(Element element, String propName)` |
    `static void` | `setDocumentType​(Document xhtmlDoc, XHTMLVersion version)` |
    `static void` | `setPartProperty​(Document doc, Part part)` |
    `static String[]` | `splitStyleProps​(String styles)` |
    `static String[]` | `splitStyleProps​(String styles, int[] offset)` |
    `static String` | `toCSSString​(String text)` |
    `static String` | `toCSSURL​(String location)` |
    `static String` | `trimLeft​(String s)` |
    `static Node` | `unwrapElement​(Element element)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### setPartProperty

          public static void setPartProperty​(Document doc,
                                             Part part)

    - #### getPartProperty

          public static Part getPartProperty​(Node node)

    - #### setDocumentType

          public static void setDocumentType​(Document xhtmlDoc,
                                             XHTMLVersion version)

    - #### createPrefixPreferences

          public static PrefixPreferences createPrefixPreferences​(int docxVersion)

    - #### appendText

          public static void appendText​(String text,
                                        Element xhtmlParent)

    - #### findAncestor

          public static Element findAncestor​(Element element,
                                             Name name)

    - #### findDescendant

          public static Element findDescendant​(Element parent,
                                               Name... names)

    - #### findDescendant

          public static Element findDescendant​(Element parent,
                                               Name name,
                                               boolean recurse)

    - #### findAllDescendants

          public static void findAllDescendants​(Element parent,
                                                Name name,
                                                boolean recurse,
                                                List<Element> list)

    - #### getAnyAttribute

          public static String getAnyAttribute​(Element element,
                                               Name... attrNames)

    - #### getNonEmptyAttribute

          public static String getNonEmptyAttribute​(Element element,
                                                    Name attrName)

    - #### getNonEmptyTokenAttribute

          public static String getNonEmptyTokenAttribute​(Element element,
                                                         Name attrName)

    - #### getLengthAttribute

          public static long getLengthAttribute​(Element element,
                                                Name attrName,
                                                long fallback)

    - #### emuToPx

          public static long emuToPx​(long emu)

    - #### getPercentageAttribute

          public static double getPercentageAttribute​(Element element,
                                                      Name attrName,
                                                      double fallback)

    - #### checkIntAttribute

          public static String checkIntAttribute​(Element element,
                                                 Name attrName)

    - #### checkIntAttribute

          public static String checkIntAttribute​(Element element,
                                                 Name attrName,
                                                 int min,
                                                 int max)

    - #### putStyleProperty

          public static void putStyleProperty​(Element element,
                                              String propName,
                                              String propValue)

    - #### putStyleProperty

          public static String putStyleProperty​(String style,
                                                String propName,
                                                String propValue)

    - #### getStyleProperty

          public static String getStyleProperty​(Element element,
                                                String propName)

    - #### getStyleProperty

          public static String getStyleProperty​(String style,
                                                String propName)

    - #### checkBorderWidth

          public static String checkBorderWidth​(String width)

    - #### lengthToPx

          public static int lengthToPx​(String length)

    - #### hasUnit

          public static boolean hasUnit​(String val)

    - #### parsePt

          public static String parsePt​(String val,
                                       int divider)

    - #### parsePt

          public static String parsePt​(String val,
                                       int divider,
                                       boolean negate)

    - #### doParsePt

          public static double doParsePt​(String val,
                                         int divider,
                                         boolean negate)

    - #### formatDouble

          public static String formatDouble​(double val)

    - #### parseEm

          public static String parseEm​(String val,
                                       int divider)

    - #### parseEm

          public static String parseEm​(String val,
                                       int divider,
                                       boolean negate)

    - #### toCSSString

          public static String toCSSString​(String text)

    - #### toCSSURL

          public static String toCSSURL​(String location)

    - #### addClass

          public static void addClass​(Element element,
                                      String cls)

    - #### addClass

          public static void addClass​(Element element,
                                      String cls,
                                      boolean prepend)

    - #### removeClass

          public static void removeClass​(Element element,
                                         String cls)

    - #### addStyleProp

          public static void addStyleProp​(Element element,
                                          String propName,
                                          String propValue)

    - #### splitStyleProps

          public static String[] splitStyleProps​(String styles)

    - #### splitStyleProps

          public static String[] splitStyleProps​(String styles,
                                                 int[] offset)

    - #### getStyleProp

          public static String getStyleProp​(Element element,
                                            String propName)

    - #### removeStyleProp

          public static void removeStyleProp​(Element element,
                                             String propName)

    - #### normalizeFieldCode

          public static String normalizeFieldCode​(String fieldCode)

    - #### trimLeft

          public static final String trimLeft​(String s)

    - #### processFieldCodeIdref

          public static String processFieldCodeIdref​(String fieldCode,
                                                     Map<String,​String> remap)

    - #### unwrapElement

          public static Node unwrapElement​(Element element)

    - #### numberToAlpha

          public static void numberToAlpha​(int number,
                                           boolean lowerCase,
                                           StringBuilder buffer)

    - #### numberToRoman

          public static void numberToRoman​(int number,
                                           boolean lowerCase,
                                           StringBuilder buffer)