Package com.steadystate.css.sac

Examples of com.steadystate.css.sac.TestCSSParseException


        else
        {
            message.append(MessageFormat.format(
                messagePattern2, new Object[] {invalid, expected}));
        }
        return new TestCSSParseException(message.toString(),
            this.getInputSource().getURI(), e.currentToken.next.beginLine,
            e.currentToken.next.beginColumn, this.getGrammarUri());
    }
View Full Code Here


    protected CSSParseException toCSSParseException(TokenMgrError e)
    {
        String messagePattern =
            this.getSACParserMessages().getString("tokenMgrError");
        return new TestCSSParseException(messagePattern,
            this.getInputSource().getURI(), 1, 1, this.getGrammarUri());
    }
View Full Code Here

        }
        catch (MissingResourceException ex)
        {
            s = key;
        }
        return new TestCSSParseException(s, e.getURI(), e.getLineNumber(),
            e.getColumnNumber(), this.getGrammarUri());
    }
View Full Code Here

            } else if (len == 6) {
                r = Integer.parseInt(t.image.substring(i + 0, i + 2), 16);
                g = Integer.parseInt(t.image.substring(i + 2, i + 4), 16);
                b = Integer.parseInt(t.image.substring(i + 4, i + 6), 16);
            } else {
                throw new TestCSSParseException(MessageFormat.format(
                    pattern, new Object[] {t}),
                    this.getInputSource().getURI(), t.beginLine,
                    t.beginColumn, this.getGrammarUri());
            }

            // Turn into an "rgb()"
            LexicalUnit lr = LexicalUnitImpl.createNumber(null, r);
            LexicalUnit lc1 = LexicalUnitImpl.createComma(lr);
            LexicalUnit lg = LexicalUnitImpl.createNumber(lc1, g);
            LexicalUnit lc2 = LexicalUnitImpl.createComma(lg);
            LexicalUnit lb = LexicalUnitImpl.createNumber(lc2, b);

            return LexicalUnitImpl.createRgbColor(prev, lr);
        }
        catch (NumberFormatException ex)
        {
            throw new TestCSSParseException(MessageFormat.format(
                pattern, new Object[] {t}),
                this.getInputSource().getURI(), t.beginLine,
                t.beginColumn, ex, this.getGrammarUri());
        }
    }
View Full Code Here

                        break;
                    default:
                        buf.append(c);
                    }
                } else {
                    throw new TestCSSParseException("invalid string " + s,
                        getLocator(), this.getGrammarUri());
                }
            } else {
                buf.append(c);
            }
View Full Code Here

TOP

Related Classes of com.steadystate.css.sac.TestCSSParseException

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.