All Downloads are FREE. Search and download functionalities are using the official Maven repository.

w3c.css.properties.css3.CssColumnRuleWidth Maven / Gradle / Ivy

//
// $Id$
// From Sijtsche de Jong ([email protected])
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.css3;

import org.w3c.css.properties.css.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
 * @spec http://www.w3.org/TR/2011/CR-css3-multicol-20110412/#crw
 */

public class CssColumnRuleWidth extends org.w3c.css.properties.css.CssColumnRuleWidth {

    CssValue value;

    /**
     * Create a new CssColumnRuleWidth
     */
    public CssColumnRuleWidth() {
        value = initial;
        // nothing to do
    }

    /**
     * Create a new CssColumnRuleWidth
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Incorrect value
     */
    public CssColumnRuleWidth(ApplContext ac, CssExpression expression,
                              boolean check) throws InvalidParamException {

        setByUser();
        // value is a border-width. in the CR spec it is a CSS2.1 border width
        // but we will use the CSS3 value here.
        value = CssBorderWidth.checkBorderSideWidth(ac, this, expression, check);
    }

    public CssColumnRuleWidth(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssColumnRuleWidth &&
                value.equals(((CssColumnRuleWidth) property).value));
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
        return value;
    }

    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
        return inherit.equals(value);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
        return value.toString();
    }

    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function print
     */
    public boolean isDefault() {
        return (initial == value);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy