Here you can find the source of writeSvgAttributes(XMLStreamWriter w, Supplier
Parameter | Description |
---|---|
w | XMLStreamWriter |
cssClass | Supplier of css class or null if none |
fill | Supplier of fill or null if none |
stroke | Supplier of stroke or null if none <p> |
Parameter | Description |
---|---|
XMLStreamException | on failure |
public static void writeSvgAttributes(XMLStreamWriter w, Supplier<String> cssClass, Supplier<String> fill, Supplier<String> stroke) throws XMLStreamException
//package com.java2s; //License from project: Apache License import java.util.function.Supplier; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; public class Main { /**/*from w ww. j a v a 2s . c o m*/ * Write common attributes to the {@link XMLStreamWriter} * <p> * @param w XMLStreamWriter * @param cssClass Supplier of css class or null if none * @param fill Supplier of fill or null if none * @param stroke Supplier of stroke or null if none * <p> * @throws XMLStreamException on failure */ public static void writeSvgAttributes(XMLStreamWriter w, Supplier<String> cssClass, Supplier<String> fill, Supplier<String> stroke) throws XMLStreamException { if (cssClass != null) { w.writeAttribute("class", cssClass.get()); } if (fill != null) { w.writeAttribute("fill", fill.get()); } if (stroke != null) { w.writeAttribute("stroke", stroke.get()); } } }