use of com.gargoylesoftware.css.parser.LexicalUnit in project LoboEvolution by LoboEvolution.
the class CSSValueImpl method getCssText.
/**
* <p>getCssText.</p>
*
* @return the css text
*/
public String getCssText() {
if (getCssValueType() == CSSValueType.CSS_VALUE_LIST) {
// Create the string from the LexicalUnits so we include the correct
// operators in the string
final StringBuilder sb = new StringBuilder();
final List<?> list = (List<?>) value_;
final Iterator<?> it = list.iterator();
boolean separate = false;
while (it.hasNext()) {
final Object o = it.next();
final CSSValueImpl cssValue = (CSSValueImpl) o;
if (separate) {
if (cssValue.value_ instanceof LexicalUnit) {
final LexicalUnit lu = (LexicalUnit) cssValue.value_;
if (lu.getLexicalUnitType() != LexicalUnitType.OPERATOR_COMMA) {
sb.append(" ");
}
} else {
sb.append(" ");
}
}
sb.append(o.toString());
separate = true;
}
return sb.toString();
}
return value_ != null ? value_.toString() : "";
}
Aggregations