Package org.itsnat.impl.core.css.lex

Examples of org.itsnat.impl.core.css.lex.Token


    }

    public boolean setFloatValueInternal(SourceCode cssTextCode)
    {
        // Se supone que hay almenos un token
        Token token0 = cssTextCode.getToken(0);
        if (!(token0 instanceof FloatNumber))
            return false;

        FloatNumber tokenNumber = (FloatNumber)token0;
        float floatValue = tokenNumber.getFloat();
        short unitType = -1;

        if (cssTextCode.tokenCount() > 2)
            throw new DOMException(DOMException.INVALID_ACCESS_ERR,"CSS: number format error: " + cssTextCode.toString());

        if (cssTextCode.tokenCount() == 1)
        {
            // No tiene sufijo
            unitType = CSS_NUMBER;
        }
        else
        {
            // Tiene sufijo
            Token token1 = cssTextCode.getToken(1);
            if (!(token1 instanceof Identifier) &&  !(token1 instanceof Percent))
                throw new DOMException(DOMException.INVALID_ACCESS_ERR,"CSS: expected a unit identifier: " + cssTextCode.toString());

            String suffix = token1.toString();
            suffix = suffix.toLowerCase();

            if ("%".equals(suffix))
            {
                unitType = CSS_PERCENTAGE;
View Full Code Here


    public boolean setFunctionBasedValueInternal(SourceCode cssTextCode)
    {
        if (cssTextCode.tokenCount() != 2)
            return false;

        Token token0 = cssTextCode.getToken(0);
        if (!(token0 instanceof Identifier))
            return false;
        Identifier tokIdent = (Identifier)token0;

        Token token1 = cssTextCode.getToken(1);
        if (!(token1 instanceof ParenthesisBlock))
            return false;
        ParenthesisBlock tokBlock = (ParenthesisBlock)token1;

        String identif = tokIdent.toString();
View Full Code Here

        if (setFunctionBasedValueInternal(cssTextCode))
            return;

        if (cssTextCode.tokenCount() == 1)
        {
            Token token = cssTextCode.getToken(0);
            if ((token instanceof StringDoubleQuote) ||
                (token instanceof StringSimpleQuote))
            {
                this.primitiveType = CSS_STRING;
                return;
View Full Code Here

TOP

Related Classes of org.itsnat.impl.core.css.lex.Token

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.