Class BorderSpacing

All Implemented Interfaces:
CssProperty, Serializable, Cloneable

public class BorderSpacing extends AbstractCssProperty<BorderSpacing>
 border-spacing: length|initial|inherit;

 The border-spacing property sets the distance between the borders of adjacent cells (only for the "separated borders" model).
 Default value:  0
 Inherited:      yes
 Animatable:     yes
 Version:        CSS2
 JavaScript syntax:      object.style.borderSpacing="15px"
 
Since:
1.0.0
See Also:
  • Field Details

  • Constructor Details

    • BorderSpacing

      public BorderSpacing()
      The 0px will be set as the value
    • BorderSpacing

      public BorderSpacing(String cssValue)
      Parameters:
      cssValue - the css value to set.
    • BorderSpacing

      public BorderSpacing(BorderSpacing borderSpacing)
      Parameters:
      borderSpacing - the borderSpacing object from which the cssValue to set.And, null will throw NullValueException
    • BorderSpacing

      public BorderSpacing(float horizontalVerticalValue, CssLengthUnit cssLengthUnit)
      Parameters:
      horizontalVerticalValue - the value to set.
      cssLengthUnit - the value unit to set.
      Since:
      1.0.0
    • BorderSpacing

      public BorderSpacing(float horizontalValue, CssLengthUnit horizontalCssLengthUnit, float verticalValue, CssLengthUnit verticalCssLengthUnit)
      Parameters:
      horizontalValue -
      horizontalCssLengthUnit -
      verticalValue -
      verticalCssLengthUnit -
      Since:
      1.0.0
  • Method Details

    • setValue

      public BorderSpacing setValue(float horizontalValue, CssLengthUnit horizontalCssLengthUnit, float verticalValue, CssLengthUnit verticalCssLengthUnit)
      Parameters:
      horizontalValue -
      horizontalCssLengthUnit -
      verticalValue -
      verticalCssLengthUnit -
      Returns:
      Since:
      1.0.0
    • setValue

      public BorderSpacing setValue(float horizontalVerticalValue, CssLengthUnit cssLengthUnit)
      Parameters:
      horizontalVerticalValue -
      cssLengthUnit -
      Returns:
      the current object
      Since:
      1.0.0
    • getCssName

      public String getCssName()
      Returns:
      the name portion in style, eg align-content for style align-content: center.
    • getCssValue

      public String getCssValue()
      Returns:
      the value portion in style, eg center for style align-content: center.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getHorizontalValue

      public Float getHorizontalValue()
      gets the horizontal value in float value. BorderSpacing#getHorizontalUnit() should be used to get the cssLengthUnit for this value.
      Returns:
      the horizontal value in float or null if the value is any inbuilt value like inherit.
      Since:
      1.0.0
    • getVerticalValue

      public Float getVerticalValue()
      gets the vertical value in float value. BorderSpacing#getVerticalUnit() should be used to get the cssLengthUnit for this value.
      Returns:
      the vertical value in float or null if the value is any inbuilt value like inherit.
      Since:
      1.0.0
    • getHorizontalUnit

      public CssLengthUnit getHorizontalUnit()
      Returns:
      the cssLengthUnit PX/PER, or null if the value is any inbuilt value like inherit.
      Since:
      1.0.0
    • getVerticalUnit

      public CssLengthUnit getVerticalUnit()
      Returns:
      the cssLengthUnit PX/PER, or null if the value is any inbuilt value like inherit.
      Since:
      1.0.0
    • setCssValue

      public BorderSpacing setCssValue(String cssValue)
      Specified by:
      setCssValue in class AbstractCssProperty<BorderSpacing>
      Parameters:
      cssValue - the value should be in the format of 55px or 95%. null is considered as an invalid value and it will throw NullValueException.
      Returns:
      the current object.
      Since:
      1.0.0
    • setAsInitial

      public void setAsInitial()
      sets as initial
      Since:
      1.0.0
    • setAsInherit

      public void setAsInherit()
      sets as inherit
      Since:
      1.0.0
    • isValid

      public static boolean isValid(String cssValue)
      validates if the given cssValue is valid for this class.
      Parameters:
      cssValue - the value to check.
      Returns:
      true if valid and false if invalid.
      Since:
      1.0.0