All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pkl.thirdparty.commonmark.internal.InlineParserContextImpl Maven / Gradle / Ivy

Go to download

Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.

There is a newer version: 0.27.1
Show newest version
package org.pkl.thirdparty.commonmark.internal;

import org.pkl.thirdparty.commonmark.node.LinkReferenceDefinition;
import org.pkl.thirdparty.commonmark.parser.InlineParserContext;
import org.pkl.thirdparty.commonmark.parser.beta.LinkProcessor;
import org.pkl.thirdparty.commonmark.parser.beta.InlineContentParserFactory;
import org.pkl.thirdparty.commonmark.parser.delimiter.DelimiterProcessor;

import java.util.List;
import java.util.Set;

public class InlineParserContextImpl implements InlineParserContext {

    private final List inlineContentParserFactories;
    private final List delimiterProcessors;
    private final List linkProcessors;
    private final Set linkMarkers;
    private final Definitions definitions;

    public InlineParserContextImpl(List inlineContentParserFactories,
                                   List delimiterProcessors,
                                   List linkProcessors,
                                   Set linkMarkers,
                                   Definitions definitions) {
        this.inlineContentParserFactories = inlineContentParserFactories;
        this.delimiterProcessors = delimiterProcessors;
        this.linkProcessors = linkProcessors;
        this.linkMarkers = linkMarkers;
        this.definitions = definitions;
    }

    @Override
    public List getCustomInlineContentParserFactories() {
        return inlineContentParserFactories;
    }

    @Override
    public List getCustomDelimiterProcessors() {
        return delimiterProcessors;
    }

    @Override
    public List getCustomLinkProcessors() {
        return linkProcessors;
    }

    @Override
    public Set getCustomLinkMarkers() {
        return linkMarkers;
    }

    @Override
    public LinkReferenceDefinition getLinkReferenceDefinition(String label) {
        return definitions.getDefinition(LinkReferenceDefinition.class, label);
    }

    @Override
    public  D getDefinition(Class type, String label) {
        return definitions.getDefinition(type, label);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy