Package org.xhtmlrenderer.css.parser

Examples of org.xhtmlrenderer.css.parser.CSSParseException


    }
   
    protected void checkLengthOrPercentType(CSSName cssName, CSSPrimitiveValue value) {
        int type = value.getPrimitiveType();
        if (! isLength(value) && type != CSSPrimitiveValue.CSS_PERCENTAGE) {
            throw new CSSParseException("Value for " + cssName + " must be a length or percentage", -1);
        }
    }
View Full Code Here


        }
    }
   
    protected void checkLengthType(CSSName cssName, CSSPrimitiveValue value) {
        if (! isLength(value)) {
            throw new CSSParseException("Value for " + cssName + " must be a length", -1);
        }
    }
View Full Code Here

        }
    }
   
    protected void checkNumberType(CSSName cssName, CSSPrimitiveValue value) {
        if (value.getPrimitiveType() != CSSPrimitiveValue.CSS_NUMBER) {
            throw new CSSParseException("Value for " + cssName + " must be a number", -1);
        }
    }
View Full Code Here

        }
    }
   
    protected void checkStringType(CSSName cssName, CSSPrimitiveValue value) {
        if (value.getPrimitiveType() != CSSPrimitiveValue.CSS_STRING) {
            throw new CSSParseException("Value for " + cssName + " must be a string", -1);
        }
    }
View Full Code Here

    }
   
    protected void checkIdentOrString(CSSName cssName, CSSPrimitiveValue value) {
        short type = value.getPrimitiveType();
        if (type != CSSPrimitiveValue.CSS_STRING && type != CSSPrimitiveValue.CSS_IDENT) {
            throw new CSSParseException("Value for " + cssName + " must be an identifier or string", -1);
        }
    }
View Full Code Here

        int type = value.getPrimitiveType();
        if (type != CSSPrimitiveValue.CSS_IDENT &&
                ! isLength(value) &&
                type != CSSPrimitiveValue.CSS_PERCENTAGE &&
                type != CSSPrimitiveValue.CSS_NUMBER) {
            throw new CSSParseException("Value for " + cssName + " must be an identifier, length, or percentage", -1);
        }
    }
View Full Code Here

                || (unit == CSSPrimitiveValue.CSS_NUMBER && value.getFloatValue(CSSPrimitiveValue.CSS_IN) == 0.0f);
    }
   
    protected void checkValidity(CSSName cssName, BitSet validValues, IdentValue value) {
        if (! validValues.get(value.FS_ID)) {
            throw new CSSParseException("Ident " + value + " is an invalid or unsupported value for " + cssName, -1);
        }
    }
View Full Code Here

    }
   
    protected IdentValue checkIdent(CSSName cssName, CSSPrimitiveValue value) {
        IdentValue result = IdentValue.valueOf(value.getStringValue());
        if (result == null) {
            throw new CSSParseException("Value " + value.getStringValue() + " is not a recognized identifier", -1);
        }
        ((PropertyValue)value).setIdentValue(result);
        return result;
    }
View Full Code Here

        return new PropertyDeclaration(newName, decl.getValue(), decl.isImportant(), decl.getOrigin());
    }
   
    protected void checkInheritAllowed(CSSPrimitiveValue value, boolean inheritAllowed) {
        if (value.getCssValueType() == CSSPrimitiveValue.CSS_INHERIT && ! inheritAllowed) {
            throw new CSSParseException("Invalid use of inherit", -1);
        }
    }
View Full Code Here

                    return Collections.singletonList(
                            new PropertyDeclaration(
                                    cssName, Conversions.getBorderWidth(ident.toString()), important, origin));
                } else {
                    if (value.getFloatValue() < 0.0f) {
                        throw new CSSParseException(cssName + " may not be negative", -1);
                    }
                }
            }

            return Collections.singletonList(
View Full Code Here

TOP

Related Classes of org.xhtmlrenderer.css.parser.CSSParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.