com.aspose.html.dom.css

Class CSSPrimitiveValue



  • @DOMObjectAttribute
     @DOMNameAttribute(name="CSSPrimitiveValue")
    public abstract class CSSPrimitiveValue
    extends CSSValue

    The CSSPrimitiveValue interface represents a single CSS value. This interface may be used to determine the value of a specific style property currently set in a block or to set a specific style property explicitly within the block. An instance of this interface might be obtained from the getPropertyCSSValue method of the CSSStyleDeclaration interface. A CSSPrimitiveValue object only occurs in a context of a CSS property.

    • Field Detail

      • CSS_UNKNOWN

        public static final int CSS_UNKNOWN

        The value is not a recognized CSS2 value. The value can only be obtained by using the cssText attribute.

        See Also:
        Constant Field Values
      • CSS_NUMBER

        public static final int CSS_NUMBER

        The value is a simple number. The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_PERCENTAGE

        public static final int CSS_PERCENTAGE

        The value is a percentage. The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_EMS

        public static final int CSS_EMS

        The value is a length (ems). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_EXS

        public static final int CSS_EXS

        The value is a length (exs). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_PX

        public static final int CSS_PX

        The value is a length (px). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_CM

        public static final int CSS_CM

        The value is a length (cm). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_MM

        public static final int CSS_MM

        The value is a length (mm). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_IN

        public static final int CSS_IN

        The value is a length (in). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_PT

        public static final int CSS_PT

        The value is a length (pt). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_PC

        public static final int CSS_PC

        The value is a length (pc). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_DEG

        public static final int CSS_DEG

        The value is an angle (deg). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_RAD

        public static final int CSS_RAD

        The value is an angle (rad). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_GRAD

        public static final int CSS_GRAD

        The value is an angle (grad). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_MS

        public static final int CSS_MS

        The value is a time (ms). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_S

        public static final int CSS_S

        The value is a time (s). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_HZ

        public static final int CSS_HZ

        The value is a frequency (Hz). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_KHZ

        public static final int CSS_KHZ

        The value is a frequency (kHz). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_DIMENSION

        public static final int CSS_DIMENSION

        The value is a number with an unknown dimension. The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_REM

        public static final int CSS_REM

        The value is a length (rem). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_CH

        public static final int CSS_CH

        The value is a length (ch). The value can be obtained by using the getFloatValue method.

        See Also:
        Constant Field Values
      • CSS_STRING

        public static final int CSS_STRING

        The value is a STRING. The value can be obtained by using the getStringValue method.

        See Also:
        Constant Field Values
      • CSS_URI

        public static final int CSS_URI

        The value is a URI. The value can be obtained by using the getStringValue method.

        See Also:
        Constant Field Values
      • CSS_IDENT

        public static final int CSS_IDENT

        The value is an identifier. The value can be obtained by using the getStringValue method.

        See Also:
        Constant Field Values
      • CSS_ATTR

        public static final int CSS_ATTR

        The value is a attribute function. The value can be obtained by using the getStringValue method.

        See Also:
        Constant Field Values
      • CSS_COUNTER

        public static final int CSS_COUNTER

        The value is a counter or counters function. The value can be obtained by using the GetCounterValue method.

        See Also:
        Constant Field Values
      • CSS_RECT

        public static final int CSS_RECT

        The value is a rect function. The value can be obtained by using the GetRectValue method.

        See Also:
        Constant Field Values
      • CSS_RGBCOLOR

        public static final int CSS_RGBCOLOR

        The value is a RGB color. The value can be obtained by using the GetRGBColorValue method.

        See Also:
        Constant Field Values
      • CSS_DPI

        public static final int CSS_DPI

        The value is a dots per inch (dpi).

        See Also:
        Constant Field Values
      • CSS_DPCM

        public static final int CSS_DPCM

        The value is a dots per centimeter (dpcm).

        See Also:
        Constant Field Values
      • CSS_DPPX

        public static final int CSS_DPPX

        The value is a dots per 'px' unit (dppx).

        See Also:
        Constant Field Values
    • Method Detail

      • getPrimitiveType

        @DOMNameAttribute(name="primitiveType")
        public int getPrimitiveType()

        The type of the value as defined by the constants specified above.

        Value: The type of the primitive.
      • setFloatValue

        @DOMNameAttribute(name="setFloatValue")
        public abstract void setFloatValue(int unitType,
                                                                                    float floatValue)

        A method to set the float value with a specified unit. If the property attached with this value can not accept the specified unit or the float value, the value will be unchanged and a DOMException will be raised.

        Parameters:
        unitType - Type of the unit.
        floatValue - The float value.
      • getFloatValue

        @DOMNameAttribute(name="getFloatValue")
        public abstract float getFloatValue(int unitType)

        This method is used to get a float value in a specified unit. If this CSS value doesn't contain a float value or can't be converted into the specified unit, a DOMException is raised.

        Parameters:
        unitType - Type of the unit.
        Returns:
        Returns value
      • setIntValue

        public abstract void setIntValue(int unitType,
                                         int intValue)

        A method to set the int value with a specified unit. If the property attached with this value can not accept the specified unit or the int value, the value will be unchanged and a DOMException will be raised.

        Parameters:
        unitType - Type of the unit.
        intValue - The int value.
      • getIntValue

        public abstract int getIntValue(int unitType)

        This method is used to get an int value in a specified unit. If this CSS value doesn't contain an int value or can't be converted into the specified unit, a DOMException is raised.

        Parameters:
        unitType - Type of the unit.
        Returns:
        Returns value
      • setStringValue

        @DOMNameAttribute(name="setStringValue")
        public abstract void setStringValue(int stringType,
                                                                                      String stringValue)

        A method to set the string value with the specified unit. If the property attached to this value can't accept the specified unit or the string value, the value will be unchanged and a DOMException will be raised.

        Parameters:
        stringType - Type of the string.
        stringValue - The string value.
      • getStringValue

        @DOMNameAttribute(name="getStringValue")
        public abstract String getStringValue()

        This method is used to get the string value. If the CSS value doesn't contain a string value, a DOMException is raised.

        Returns:
        Returns value
      • getCounterValue

        @DOMNameAttribute(name="getCounterValue")
        public abstract Counter getCounterValue()

        This method is used to get the Counter value. If this CSS value doesn't contain a counter value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Counter interface.

        Returns:
        Returns Counter value
      • getRectValue

        @DOMNameAttribute(name="getRectValue")
        public abstract Rect getRectValue()

        This method is used to get the Rect value. If this CSS value doesn't contain a rect value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Rect interface.

        Returns:
        Returns Rect value
      • getRGBColorValue

        @DOMNameAttribute(name="getRGBColorValue")
        public abstract RGBColor getRGBColorValue()

        This method is used to get the RGB color. If this CSS value doesn't contain a RGB color value, a DOMException is raised. Modification to the corresponding style property can be achieved using the RGBColor interface.

        Returns:
        Returns RGB color value