Class Util


  • public final class Util
    extends Object
    • 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)
      • 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)
      • 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)
      • removeStyleProp

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

        public static String normalizeFieldCode​(String fieldCode)
      • trimLeft

        public static final String trimLeft​(String s)
      • 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)