@Override protected boolean variant(int v, IntegerRef iteration, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { // we won't use multivalue functionallity int i = iteration.get(); switch (v) { case COLOR: // process color return genericTermIdent(types.get(COLOR), terms.get(i), AVOID_INH, names.get(COLOR), properties) || genericTermColor(terms.get(i), names.get(COLOR), BorderColor.color, properties, values); case STYLE: // process style return genericTermIdent(types.get(STYLE), terms.get(i), AVOID_INH, names.get(STYLE), properties); case WIDTH: // process width return genericTermIdent(types.get(WIDTH), terms.get(i), AVOID_INH, names.get(WIDTH), properties) || genericTermLength(terms.get(i), names .get(WIDTH), BorderWidth.length, true, properties, values); default: return false; } } }
@Override protected boolean variant(int v, IntegerRef iteration, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { // we won't use multivalue functionallity int i = iteration.get(); switch (v) { case COLOR: // process color return genericTermIdent(types.get(COLOR), terms.get(i), AVOID_INH, names.get(COLOR), properties) || genericTermColor(terms.get(i), names.get(COLOR), OutlineColor.color, properties, values); case STYLE: // process style return genericTermIdent(types.get(STYLE), terms.get(i), AVOID_INH, names.get(STYLE), properties); case WIDTH: // process width return genericTermIdent(types.get(WIDTH), terms.get(i), AVOID_INH, names.get(WIDTH), properties) || genericTermLength(terms.get(i), names .get(WIDTH), OutlineWidth.length, true, properties, values); default: return false; } } }
@Override protected boolean variant(int v, IntegerRef iteration, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { // we won't use multivalue functionallity int i = iteration.get(); switch (v) { case COLOR: // process color return genericTermIdent(types.get(COLOR), terms.get(i), AVOID_INH, names.get(COLOR), properties) || genericTermColor(terms.get(i), names.get(COLOR), BorderColor.color, properties, values); case STYLE: // process style return genericTermIdent(types.get(STYLE), terms.get(i), AVOID_INH, names.get(STYLE), properties); case WIDTH: // process width return genericTermIdent(types.get(WIDTH), terms.get(i), AVOID_INH, names.get(WIDTH), properties) || genericTermLength(terms.get(i), names .get(WIDTH), BorderWidth.length, true, properties, values); default: return false; } } }
@Override protected boolean variant(int v, IntegerRef iteration, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { // we won't use multivalue functionallity int i = iteration.get(); switch (v) { case COLOR: // process color return genericTermIdent(types.get(COLOR), terms.get(i), AVOID_INH, names.get(COLOR), properties) || genericTermColor(terms.get(i), names.get(COLOR), OutlineColor.color, properties, values); case STYLE: // process style return genericTermIdent(types.get(STYLE), terms.get(i), AVOID_INH, names.get(STYLE), properties); case WIDTH: // process width return genericTermIdent(types.get(WIDTH), terms.get(i), AVOID_INH, names.get(WIDTH), properties) || genericTermLength(terms.get(i), names .get(WIDTH), OutlineWidth.length, true, properties, values); default: return false; } } }
return genericTermIdent(types.get(COLOR), terms.get(i), AVOID_INH, names.get(COLOR), properties) || genericTermColor(terms.get(i), names.get(COLOR), BackgroundColor.color, properties, values); case IMAGE:
return genericTermIdent(types.get(COLOR), terms.get(i), AVOID_INH, names.get(COLOR), properties) || genericTermColor(terms.get(i), names.get(COLOR), BackgroundColor.color, properties, values); case IMAGE:
/** * Processes declaration which is supposed to contain one identification * term or one TermColor * * @param <T> * Type of CSSProperty * @param type * Class of enum to be stored * @param colorIdentification * Instance of CSSProperty stored into properties to indicate * that additional value of type TermColor is stored in values * @param d * Declaration to be parsed * @param properties * Properties map where to store enum * @param values * @return <code>true</code> in case of success, <code>false</code> * elsewhere */ protected <T extends CSSProperty> boolean genericOneIdentOrColor( Class<T> type, T colorIdentification, Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { if (d.size() != 1) return false; return genericTermIdent(type, d.get(0), ALLOW_INH, d.getProperty(), properties) || genericTermColor(d.get(0), d.getProperty(), colorIdentification, properties, values); }
/** * Processes declaration which is supposed to contain one identification * term or one TermColor * * @param <T> * Type of CSSProperty * @param type * Class of enum to be stored * @param colorIdentification * Instance of CSSProperty stored into properties to indicate * that additional value of type TermColor is stored in values * @param d * Declaration to be parsed * @param properties * Properties map where to store enum * @param values * @return <code>true</code> in case of success, <code>false</code> * elsewhere */ protected <T extends CSSProperty> boolean genericOneIdentOrColor( Class<T> type, T colorIdentification, Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { if (d.size() != 1) return false; return genericTermIdent(type, d.get(0), ALLOW_INH, d.getProperty(), properties) || genericTermColor(d.get(0), d.getProperty(), colorIdentification, properties, values); }
|| genericTerm(TermPercent.class, term, d.getProperty(), null, false, properties, values) || genericTerm(TermInteger.class, term, d.getProperty(), null, false, properties, values) || genericTermColor(term, d.getProperty(), null, properties, values);
|| genericTerm(TermPercent.class, term, d.getProperty(), null, false, properties, values) || genericTerm(TermInteger.class, term, d.getProperty(), null, false, properties, values) || genericTermColor(term, d.getProperty(), null, properties, values);