Class StyleParser


  • public final class StyleParser
    extends java.lang.Object
    Some helper routines to parse CSS-style formatting attributes
    Author:
    rstein
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Boolean getBooleanPropertyValue​(java.lang.String style, java.lang.String key)  
      static javafx.scene.paint.Color getColorPropertyValue​(java.lang.String style, java.lang.String key)  
      static double[] getFloatingDecimalArrayPropertyValue​(java.lang.String style, java.lang.String key)  
      static java.lang.Double getFloatingDecimalPropertyValue​(java.lang.String style, java.lang.String key)  
      static javafx.scene.text.Font getFontPropertyValue​(java.lang.String style)  
      static java.lang.Integer getIntegerPropertyValue​(java.lang.String style, java.lang.String key)  
      static java.lang.String getPropertyValue​(java.lang.String style, java.lang.String key)  
      static void main​(java.lang.String[] args)  
      static java.lang.String mapToString​(java.util.Map<java.lang.String,​java.lang.String> map)  
      static java.util.Map<java.lang.String,​java.lang.String> splitIntoMap​(java.lang.String style)
      spits input string, converts keys and values to lower case, and replaces '"' and ''' if any
      • Methods inherited from class java.lang.Object

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

      • splitIntoMap

        public static java.util.Map<java.lang.String,​java.lang.String> splitIntoMap​(java.lang.String style)
        spits input string, converts keys and values to lower case, and replaces '"' and ''' if any
        Parameters:
        style - the input style string
        Returns:
        the sanitised map
      • mapToString

        public static java.lang.String mapToString​(java.util.Map<java.lang.String,​java.lang.String> map)
      • getPropertyValue

        public static java.lang.String getPropertyValue​(java.lang.String style,
                                                        java.lang.String key)
      • getColorPropertyValue

        public static javafx.scene.paint.Color getColorPropertyValue​(java.lang.String style,
                                                                     java.lang.String key)
      • getIntegerPropertyValue

        public static java.lang.Integer getIntegerPropertyValue​(java.lang.String style,
                                                                java.lang.String key)
      • getFloatingDecimalPropertyValue

        public static java.lang.Double getFloatingDecimalPropertyValue​(java.lang.String style,
                                                                       java.lang.String key)
      • getFloatingDecimalArrayPropertyValue

        public static double[] getFloatingDecimalArrayPropertyValue​(java.lang.String style,
                                                                    java.lang.String key)
      • getBooleanPropertyValue

        public static java.lang.Boolean getBooleanPropertyValue​(java.lang.String style,
                                                                java.lang.String key)
      • getFontPropertyValue

        public static javafx.scene.text.Font getFontPropertyValue​(java.lang.String style)
      • main

        public static void main​(java.lang.String[] args)
        Parameters:
        args - the command line arguments