- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 04 Sep 2012 08:23:22 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css2 In directory hutz:/tmp/cvs-serv27446/css2 Modified Files: CssWordSpacing.java Log Message: use the root class CssValue Index: CssWordSpacing.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/CssWordSpacing.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssWordSpacing.java 9 Feb 2012 17:36:31 -0000 1.1 +++ CssWordSpacing.java 4 Sep 2012 08:23:20 -0000 1.2 @@ -6,7 +6,6 @@ // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css2; -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; @@ -16,90 +15,58 @@ import org.w3c.css.values.CssValue; /** - * @spec http://www.w3.org/TR/2008/REC-CSS2-20080411/text.html#propdef-word-spacing - * @version $Revision$ + * @spec http://www.w3.org/TR/2008/REC-CSS2-20080411/text.html#propdef-word-spacing */ public class CssWordSpacing extends org.w3c.css.properties.css.CssWordSpacing { - private CssValue value; - private static CssIdent normal = CssIdent.getIdent("normal"); - - /** - * Create a new CssWordSpacing. - */ - public CssWordSpacing() { - value = normal; - } - - /** - * Create a new CssWordSpacing with an expression - * - * @param expression The expression - * @throws org.w3c.css.util.InvalidParamException The expression is incorrect - */ - public CssWordSpacing(ApplContext ac, CssExpression expression, - boolean check) throws InvalidParamException { - - if (check && expression.getCount() > 1) { - throw new InvalidParamException("unrecognize", ac); - } + private static CssIdent normal = CssIdent.getIdent("normal"); - CssValue val = expression.getValue(); + /** + * Create a new CssWordSpacing. + */ + public CssWordSpacing() { + value = normal; + } - setByUser(); + /** + * Create a new CssWordSpacing with an expression + * + * @param expression The expression + * @throws org.w3c.css.util.InvalidParamException + * The expression is incorrect + */ + public CssWordSpacing(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { - switch (val.getType()) { - case CssTypes.CSS_NUMBER: - val = ((CssNumber) val).getLength(); - case CssTypes.CSS_LENGTH: - value = val; - break; - case CssTypes.CSS_IDENT: - if (inherit.equals(val) || normal.equals(val)) { - value = val; - break; - } - default: - throw new InvalidParamException("value", expression.getValue(), - getPropertyName(), ac); - } - expression.next(); - } + if (check && expression.getCount() > 1) { + throw new InvalidParamException("unrecognize", ac); + } - public CssWordSpacing(ApplContext ac, CssExpression expression) - throws InvalidParamException { - this(ac, expression, false); - } + CssValue val = expression.getValue(); - /** - * Returns the value of this property - */ - public Object get() { - return value; - } + setByUser(); - /** - * Returns true if this property is "softly" inherited - * e.g. his value equals inherit - */ - public boolean isSoftlyInherited() { - return value == inherit; - } + switch (val.getType()) { + case CssTypes.CSS_NUMBER: + val = ((CssNumber) val).getLength(); + case CssTypes.CSS_LENGTH: + value = val; + break; + case CssTypes.CSS_IDENT: + if (inherit.equals(val) || normal.equals(val)) { + value = val; + break; + } + default: + throw new InvalidParamException("value", expression.getValue(), + getPropertyName(), ac); + } + expression.next(); + } - /** - * Returns a string representation of the object. - */ - public String toString() { - return value.toString(); - } + public CssWordSpacing(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 CssWordSpacing && - value.equals(((CssWordSpacing) property).value)); - } }
Received on Tuesday, 4 September 2012 08:23:29 UTC