Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.sourceforge.jsdialect.util;
 
 
 import java.util.Map;
 
import static net.sourceforge.jsdialect.util.ContextPathAppender.appendContextPathIfRelativeResource;
import static net.sourceforge.jsdialect.util.ResourceAppender.appendResource;
import static net.sourceforge.jsdialect.util.ResourceChecker.resourceIsNotIncluded;

Add a <link href="..." /> element to the head of the document.
public final class LinkAppender {
    private final ResourceUrlResolver resourceUrlResolver;
    private LinkAppender(Map<StringStringresourceUrls) {
        this. = new ResourceUrlResolver(resourceUrls);
    }
    public static LinkAppender withResourceUrls(Map<StringStringresourceUrls) {
        return new LinkAppender(resourceUrls);
    }
    public void addLinkAfter(Arguments argumentsString keyElement element) {
        if (!(arguments.getContext() instanceof IWebContext)) {
            throw new UnsupportedOperationException("JQuery dialect must be used in a web environment");
        }
          String resourceUrl = .getResourceUrlOrDefault(key);
      if (resourceUrl == null) {
            throw new TemplateProcessingException("Required dependence -" + key + "- was not provided");
        }
        resourceUrl = appendContextPathIfRelativeResource(resourceUrlarguments);
        if (resourceIsNotIncluded(resourceUrl.arguments)){
            appendResource(resourceUrl.elementarguments);
        }
    }
New to GrepCode? Check out our FAQ X