Webiyo

This page was generated using Webiyo. See its source code and unit tests.

org/webiyo/web/StyleSheet.java

package org.webiyo.web;

import org.webiyo.xml.AttributeSink;
import org.webiyo.xml.AttributeSource;

import java.io.IOException;

import static org.webiyo.xml.dtds.Html.REL;
import static org.webiyo.xml.dtds.Html.TYPE;

public class StyleSheet implements AttributeSource {

    private final Link link;

    public StyleSheet(Link link) {
        this.link = link;
    }

    public StyleSheet(String link) {
        this.link = new Link(link);
    }

    public void sendAttributes(AttributeSink sink) throws IOException {
        sink.putAttribute(REL.getName(), "stylesheet");
        link.sendAttributes(sink);
        sink.putAttribute(TYPE.getName(), "text/css");
    }
}
SourceForge