* @param name A property name.
* @param values A list of property values.
*/
public default void property(EnumSet<Vendor> prefixes, String separator, String name, Object... values) {
if (name != null && name.length() != 0 && values != null) {
EnumMap<Vendor, List<String>> properties = new EnumMap(Vendor.class);
// calculate dependent vendors
EnumSet<Vendor> vendors = EnumSet.copyOf(prefixes);
for (Object value : values) {
if (value instanceof CSSValue) {
vendors.addAll(((CSSValue) value).vendors());
}
}
for (Vendor vendor : vendors) {
List<String> text = new ArrayList();
for (Object value : values) {
if (value != null) {
if (value instanceof CSSValue) {
String vendered = ((CSSValue) value).valueFor(vendor);
if (vendered != null && vendered.length() != 0) {
text.add(vendered);
}
} else if (value instanceof Number) {
Number number = (Number) value;
if (number.intValue() == number.doubleValue()) {
text.add(String.valueOf(number.intValue()));
} else {
text.add(number.toString());
}
} else {
String decoded = value.toString();
if (decoded != null && decoded.length() != 0) {
text.add(decoded);
}
}
}
}
properties.put(vendor, text);
}
for (Entry<Vendor, List<String>> property : properties.entrySet()) {
String value = I.join(separator, property.getValue());
if (value.length() != 0) {
Vendor vendor = property.getKey();