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

cz.vutbr.web.domassign.decode.FlexFlowVariator Maven / Gradle / Ivy

Go to download

jStyleParser is a CSS parser written in Java. It has its own application interface that is designed to allow an efficient CSS processing in Java and mapping the values to the Java data types. It parses CSS 2.1 style sheets into structures that can be efficiently assigned to DOM elements. It is intended be the primary CSS parser for the CSSBox library. While handling errors, it is user agent conforming according to the CSS specification.

The newest version!
/**
 * 
 */
package cz.vutbr.web.domassign.decode;

import java.util.Map;

import cz.vutbr.web.css.CSSProperty;
import cz.vutbr.web.css.Term;
import cz.vutbr.web.css.CSSProperty.FlexDirection;
import cz.vutbr.web.css.CSSProperty.FlexWrap;

/**
 * Variator for flex-flow. Grammar:
 * 
 * 
 * <'flex-direction'> || <'flex-wrap'>
 * | inherit
 * 
 * @author burgetr
 */
public class FlexFlowVariator extends Variator {

    public static final int DIRECTION = 0;
    public static final int WRAP = 1;

    public FlexFlowVariator() {
        super(2);
        names.add("flex-direction");
        types.add(FlexDirection.class);
        names.add("flex-wrap");
        types.add(FlexWrap.class);
    }

    @Override
    protected boolean variant(int v, IntegerRef iteration,
            Map properties, Map> values) {

        int i = iteration.get();

        switch (v) {
        case DIRECTION:
            return genericTermIdent(FlexDirection.class, terms.get(i),
                    AVOID_INH, names.get(DIRECTION), properties);
        case WRAP:
            return genericTermIdent(FlexWrap.class, terms.get(i),
                    AVOID_INH, names.get(WRAP), properties);
        default:
            return false;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy