Class HtmlUtilities


  • @Deprecated
    public class HtmlUtilities
    extends java.lang.Object
    Deprecated.
    since 5.5.2
    A class that contains some utilities to parse HTML attributes and content.
    Since:
    5.0.6 (some of these methods used to be in the Markup class)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static float DEFAULT_FONT_SIZE
      Deprecated.
      a default value for font-size
      static int[] FONTSIZES
      Deprecated.
      A series of predefined font sizes.
      private static java.util.HashMap<java.lang.String,​java.lang.Float> sizes
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      HtmlUtilities()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static int alignmentValue​(java.lang.String alignment)
      Deprecated.
      Translates a String value to an alignment value.
      static BaseColor decodeColor​(java.lang.String s)
      Deprecated.
      Converts a BaseColor into a HTML representation of this BaseColor.
      static java.lang.String eliminateWhiteSpace​(java.lang.String content)
      Deprecated.
      Helper class that reduces the white space in a String
      static int getIndexedFontSize​(java.lang.String value, java.lang.String previous)
      Deprecated.
      Picks a font size from a series of predefined font sizes.
      static java.util.Properties parseAttributes​(java.lang.String string)
      Deprecated.
      This method parses a String with attributes and returns a Properties object.
      static float parseLength​(java.lang.String string)
      Deprecated.
      Parses a length.
      static float parseLength​(java.lang.String string, float actualFontSize)
      Deprecated.
      New method contributed by: Lubos Strapko
      static java.lang.String removeComment​(java.lang.String string, java.lang.String startComment, java.lang.String endComment)
      Deprecated.
      Removes the comments sections of a String.
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_FONT_SIZE

        public static final float DEFAULT_FONT_SIZE
        Deprecated.
        a default value for font-size
        Since:
        2.1.3
        See Also:
        Constant Field Values
      • sizes

        private static java.util.HashMap<java.lang.String,​java.lang.Float> sizes
        Deprecated.
      • FONTSIZES

        public static final int[] FONTSIZES
        Deprecated.
        A series of predefined font sizes.
        Since:
        5.0.6 (renamed)
    • Constructor Detail

      • HtmlUtilities

        public HtmlUtilities()
        Deprecated.
    • Method Detail

      • parseLength

        public static float parseLength​(java.lang.String string)
        Deprecated.
        Parses a length.
        Parameters:
        string - a length in the form of an optional + or -, followed by a number and a unit.
        Returns:
        a float
      • parseLength

        public static float parseLength​(java.lang.String string,
                                        float actualFontSize)
        Deprecated.
        New method contributed by: Lubos Strapko
        Since:
        2.1.3
      • decodeColor

        public static BaseColor decodeColor​(java.lang.String s)
        Deprecated.
        Converts a BaseColor into a HTML representation of this BaseColor.
        Parameters:
        s - the BaseColor that has to be converted.
        Returns:
        the HTML representation of this BaseColor
      • parseAttributes

        public static java.util.Properties parseAttributes​(java.lang.String string)
        Deprecated.
        This method parses a String with attributes and returns a Properties object.
        Parameters:
        string - a String of this form: 'key1="value1"; key2="value2";... keyN="valueN" '
        Returns:
        a Properties object
      • removeComment

        public static java.lang.String removeComment​(java.lang.String string,
                                                     java.lang.String startComment,
                                                     java.lang.String endComment)
        Deprecated.
        Removes the comments sections of a String.
        Parameters:
        string - the original String
        startComment - the String that marks the start of a Comment section
        endComment - the String that marks the end of a Comment section.
        Returns:
        the String stripped of its comment section
      • eliminateWhiteSpace

        public static java.lang.String eliminateWhiteSpace​(java.lang.String content)
        Deprecated.
        Helper class that reduces the white space in a String
        Parameters:
        content - content containing whitespace
        Returns:
        the content without all unnecessary whitespace
      • getIndexedFontSize

        public static int getIndexedFontSize​(java.lang.String value,
                                             java.lang.String previous)
        Deprecated.
        Picks a font size from a series of predefined font sizes.
        Parameters:
        value - the new value of a font, expressed as an index
        previous - the previous value of the font size
        Returns:
        a new font size.
      • alignmentValue

        public static int alignmentValue​(java.lang.String alignment)
        Deprecated.
        Translates a String value to an alignment value. (written by Norman Richards, integrated into iText by Bruno)
        Parameters:
        alignment - a String (one of the ALIGN_ constants of this class)
        Returns:
        an alignment value (one of the ALIGN_ constants of the Element interface)