proj_name stringclasses 131
values | relative_path stringlengths 30 228 | class_name stringlengths 1 68 | func_name stringlengths 1 48 | masked_class stringlengths 78 9.82k | func_body stringlengths 46 9.61k | len_input int64 29 2.01k | len_output int64 14 1.94k | total int64 55 2.05k | relevant_context stringlengths 0 38.4k |
|---|---|---|---|---|---|---|---|---|---|
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/SimTocExtension.java | SimTocExtension | extend | class SimTocExtension implements Parser.ParserExtension, HtmlRenderer.HtmlRendererExtension, Formatter.FormatterExtension {
// duplicated here for convenience
final public static AttributablePart TOC_CONTENT = TocUtils.TOC_CONTENT; // div element wrapping TOC list
final public static AttributablePart... |
if (htmlRendererBuilder.isRendererType("HTML")) {
htmlRendererBuilder.nodeRendererFactory(new SimTocNodeRenderer.Factory());
} else if (htmlRendererBuilder.isRendererType("JIRA")) {
}
| 866 | 59 | 925 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/SimTocVisitorExt.java | SimTocVisitorExt | VISIT_HANDLERS | class SimTocVisitorExt {
public static <V extends SimTocVisitor> VisitHandler<?>[] VISIT_HANDLERS(V visitor) {<FILL_FUNCTION_BODY>}
} |
return new VisitHandler<?>[] {
new VisitHandler<>(SimTocBlock.class, visitor::visit),
new VisitHandler<>(SimTocOptionList.class, visitor::visit),
new VisitHandler<>(SimTocOption.class, visitor::visit),
new VisitHandler<>(SimTocContent.class, visit... | 55 | 94 | 149 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/TocBlock.java | TocBlock | getAstExtra | class TocBlock extends TocBlockBase {
protected BasedSequence openingMarker = BasedSequence.NULL;
protected BasedSequence tocKeyword = BasedSequence.NULL;
protected BasedSequence style = BasedSequence.NULL;
protected BasedSequence closingMarker = BasedSequence.NULL;
@Override
public void getAst... |
segmentSpan(out, openingMarker, "openingMarker");
segmentSpan(out, tocKeyword, "tocKeyword");
segmentSpan(out, style, "style");
segmentSpan(out, closingMarker, "closingMarker");
| 628 | 62 | 690 | <methods>public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence, boolean) ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence) ,public void <init>(com.vladsch.flexmark.ut... |
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/TocBlockBase.java | TocBlockBase | getSegments | class TocBlockBase extends Block {
protected BasedSequence openingMarker = BasedSequence.NULL;
protected BasedSequence tocKeyword = BasedSequence.NULL;
protected BasedSequence style = BasedSequence.NULL;
protected BasedSequence closingMarker = BasedSequence.NULL;
@Override
public void getAstExt... |
BasedSequence[] nodeSegments = new BasedSequence[] { openingMarker, tocKeyword, style, closingMarker };
if (lineSegments.size() == 0) return nodeSegments;
BasedSequence[] allSegments = new BasedSequence[lineSegments.size() + nodeSegments.length];
lineSegments.toArray(allSegments);
... | 568 | 124 | 692 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public @Nullable Block getParent() <variables> |
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/TocExtension.java | TocExtension | rendererOptions | class TocExtension implements Parser.ParserExtension, HtmlRenderer.HtmlRendererExtension {
// duplicated here for convenience
final public static AttributablePart TOC_CONTENT = TocUtils.TOC_CONTENT; // div element wrapping TOC list
final public static AttributablePart TOC_LIST = TocUtils.TOC_LIST; ... |
// set header id options if not already set
if (!options.contains(HtmlRenderer.RENDER_HEADER_ID)) {
options.set(HtmlRenderer.RENDER_HEADER_ID, true);
options.set(HtmlRenderer.GENERATE_HEADER_ID, true);
} else if (!options.contains(HtmlRenderer.GENERATE_HEADER_ID)) {
... | 799 | 121 | 920 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/internal/SimTocBlockParser.java | TocParsing | canContain | class TocParsing extends Parsing {
final Pattern TOC_BLOCK_START;
//private static Pattern TOC_BLOCK_CONTINUE = Pattern.compile("^.+$");
public TocParsing(DataHolder options) {
super(options);
if (CASE_SENSITIVE_TOC_TAG.get(options)) {
this.TOC_BLOCK_STAR... |
if (block instanceof HtmlBlock) {
if ((haveChildren & ~HAVE_BLANK_LINE) == 0) {
haveChildren |= HAVE_HTML;
return true;
}
} else if (block instanceof Heading) {
if ((haveChildren & ~HAVE_BLANK_LINE) == 0) {
haveChildren... | 611 | 165 | 776 | <methods>public non-sealed void <init>() ,public void addLine(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.util.sequence.BasedSequence) ,public boolean breakOutOnDoubleBlankLine() ,public boolean canContain(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.parser.block.BlockPars... |
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/internal/SimTocNodeFormatter.java | SimTocNodeFormatter | renderTocHeaders | class SimTocNodeFormatter implements NodeFormatter {
final private TocOptions options;
final private TocFormatOptions formatOptions;
private MarkdownTable myTable;
public SimTocNodeFormatter(DataHolder options) {
this.options = new TocOptions(options, true);
this.formatOptions = new To... |
List<Heading> filteredHeadings = TocUtils.filteredHeadings(headings, options);
Paired<List<Heading>, List<String>> paired = TocUtils.markdownHeaderTexts(filteredHeadings, options);
TocUtils.renderTocContent(markdown, options, this.options, paired.getFirst(), paired.getSecond());
| 753 | 92 | 845 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/internal/SimTocNodeRenderer.java | SimTocNodeRenderer | getNodeRenderingHandlers | class SimTocNodeRenderer implements NodeRenderer {
final private TocOptions options;
public SimTocNodeRenderer(DataHolder options) {
this.options = new TocOptions(options, true);
}
@Override
public Set<NodeRenderingHandler<?>> getNodeRenderingHandlers() {<FILL_FUNCTION_BODY>}
private ... |
return new HashSet<>(Arrays.asList(
new NodeRenderingHandler<>(SimTocBlock.class, this::render),
new NodeRenderingHandler<>(SimTocContent.class, this::render),
new NodeRenderingHandler<>(SimTocOptionList.class, this::render),
new NodeRenderingHand... | 660 | 102 | 762 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/internal/TocBlockParser.java | BlockFactory | tryStart | class BlockFactory extends AbstractBlockParserFactory {
final private TocParsing myParsing;
BlockFactory(DataHolder options) {
super(options);
this.myParsing = new TocParsing(options);
}
@Override
public BlockStart tryStart(ParserState state, MatchedBloc... |
if (state.getIndent() >= 4) {
return BlockStart.none();
}
BasedSequence line = state.getLine();
int nextNonSpace = state.getNextNonSpaceIndex();
BasedSequence trySequence = line.subSequence(nextNonSpace, line.length());
Matcher mat... | 103 | 276 | 379 | <methods>public non-sealed void <init>() ,public void addLine(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.util.sequence.BasedSequence) ,public boolean breakOutOnDoubleBlankLine() ,public boolean canContain(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.parser.block.BlockPars... |
vsch_flexmark-java | flexmark-java/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/internal/TocNodeRenderer.java | TocNodeRenderer | render | class TocNodeRenderer implements NodeRenderer {
final private TocOptions options;
final private boolean haveTitle;
public TocNodeRenderer(DataHolder options) {
this.haveTitle = options != null && options.contains(TocExtension.TITLE);
this.options = new TocOptions(options, false);
}
... |
HeadingCollectingVisitor visitor = new HeadingCollectingVisitor();
List<Heading> headings = visitor.collectAndGetHeadings(context.getDocument());
if (headings != null) {
TocOptionsParser optionsParser = new TocOptionsParser();
TocOptions titleOptions = haveTitle ? this.o... | 467 | 140 | 607 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-typographic/src/main/java/com/vladsch/flexmark/ext/typographic/TypographicExtension.java | TypographicExtension | extend | class TypographicExtension implements Parser.ParserExtension, HtmlRenderer.HtmlRendererExtension {
final public static DataKey<Boolean> ENABLE_QUOTES = new DataKey<>("ENABLE_QUOTES", true);
final public static DataKey<Boolean> ENABLE_SMARTS = new DataKey<>("ENABLE_SMARTS", true);
final public static DataKey... |
if (ENABLE_QUOTES.get(parserBuilder)) {
TypographicOptions options = new TypographicOptions(parserBuilder);
parserBuilder.customDelimiterProcessor(new AngleQuoteDelimiterProcessor(options));
parserBuilder.customDelimiterProcessor(new SingleQuoteDelimiterProcessor(options));
... | 805 | 144 | 949 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-typographic/src/main/java/com/vladsch/flexmark/ext/typographic/TypographicQuotes.java | TypographicQuotes | getAstExtra | class TypographicQuotes extends Node implements DelimitedNode, DoNotAttributeDecorate, TypographicText {
protected BasedSequence openingMarker = BasedSequence.NULL;
protected BasedSequence text = BasedSequence.NULL;
protected BasedSequence closingMarker = BasedSequence.NULL;
protected String typographic... |
if (openingMarker.isNotNull()) out.append(" typographicOpening: ").append(typographicOpening).append(" ");
if (closingMarker.isNotNull()) out.append(" typographicClosing: ").append(typographicClosing).append(" ");
delimitedSegmentSpanChars(out, openingMarker, text, closingMarker, "text");
| 548 | 90 | 638 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark-ext-typographic/src/main/java/com/vladsch/flexmark/ext/typographic/TypographicSmarts.java | TypographicSmarts | collectText | class TypographicSmarts extends Node implements DoNotAttributeDecorate, TypographicText {
private String typographicText;
public TypographicSmarts() {
}
public TypographicSmarts(BasedSequence chars) {
super(chars);
}
public TypographicSmarts(String typographicText) {
this.typo... |
if (any(flags, F_NODE_TEXT)) {
out.append(getChars());
} else {
ReplacedTextMapper textMapper = new ReplacedTextMapper(getChars());
BasedSequence unescaped = Escaping.unescape(getChars(), textMapper);
out.append(unescaped);
}
return false;... | 357 | 91 | 448 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark-ext-typographic/src/main/java/com/vladsch/flexmark/ext/typographic/TypographicVisitorExt.java | TypographicVisitorExt | VISIT_HANDLERS | class TypographicVisitorExt {
public static <V extends TypographicVisitor> VisitHandler<?>[] VISIT_HANDLERS(V visitor) {<FILL_FUNCTION_BODY>}
} |
return new VisitHandler<?>[] {
new VisitHandler<>(TypographicSmarts.class, visitor::visit),
new VisitHandler<>(TypographicQuotes.class, visitor::visit),
};
| 53 | 55 | 108 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-typographic/src/main/java/com/vladsch/flexmark/ext/typographic/internal/QuoteDelimiterProcessorBase.java | QuoteDelimiterProcessorBase | haveNextCloser | class QuoteDelimiterProcessorBase implements DelimiterProcessor {
protected final TypographicOptions myOptions;
protected final char myOpenDelimiter;
protected final char myCloseDelimiter;
protected final String myOpener;
protected final String myCloser;
protected final String myUnmatched;
... |
DelimiterRun next = closer.getNext();
int minLength = getMinLength();
while (next != null) {
if (next.getDelimiterChar() == myCloseDelimiter) {
return canClose(next, minLength);
}
next = next.getNext();
}
return false;
| 1,413 | 87 | 1,500 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-typographic/src/main/java/com/vladsch/flexmark/ext/typographic/internal/SmartsInlineParser.java | SmartsInlineParser | parse | class SmartsInlineParser implements InlineParserExtension {
final private SmartsParsing parsing;
public SmartsInlineParser(LightInlineParser inlineParser) {
this.parsing = new SmartsParsing(inlineParser.getParsing());
}
@Override
public void finalizeDocument(@NotNull InlineParser inlinePar... |
// hard coding implementation because pattern matching can be very slow for large files
BasedSequence input = inlineParser.getInput();
String typographicSmarts = null;
BasedSequence match = null;
int i = inlineParser.getIndex();
char c = input.charAt(i);
if (c ... | 329 | 422 | 751 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-typographic/src/main/java/com/vladsch/flexmark/ext/typographic/internal/TypographicNodeRenderer.java | TypographicNodeRenderer | render | class TypographicNodeRenderer implements NodeRenderer {
public TypographicNodeRenderer(DataHolder options) {
}
@Override
public Set<NodeRenderingHandler<?>> getNodeRenderingHandlers() {
HashSet<NodeRenderingHandler<?>> set = new HashSet<>();
set.add(new NodeRenderingHandler<>(Typograph... |
if (node.getTypographicOpening() != null && !node.getTypographicOpening().isEmpty()) html.raw(node.getTypographicOpening());
context.renderChildren(node);
if (node.getTypographicClosing() != null && !node.getTypographicClosing().isEmpty()) html.raw(node.getTypographicClosing());
| 255 | 90 | 345 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-wikilink/src/main/java/com/vladsch/flexmark/ext/wikilink/WikiLinkExtension.java | WikiLinkExtension | extend | class WikiLinkExtension implements Parser.ParserExtension, HtmlRenderer.HtmlRendererExtension, Formatter.FormatterExtension {
final public static DataKey<Boolean> ALLOW_INLINES = new DataKey<>("ALLOW_INLINES", false);
final public static DataKey<Boolean> ALLOW_ANCHORS = new DataKey<>("ALLOW_ANCHORS", false);
... |
if (htmlRendererBuilder.isRendererType("HTML")) {
htmlRendererBuilder.nodeRendererFactory(new WikiLinkNodeRenderer.Factory());
htmlRendererBuilder.linkResolverFactory(new WikiLinkLinkResolver.Factory());
} else if (htmlRendererBuilder.isRendererType("JIRA")) {
htmlRe... | 1,107 | 117 | 1,224 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-wikilink/src/main/java/com/vladsch/flexmark/ext/wikilink/internal/WikiLinkJiraRenderer.java | WikiLinkJiraRenderer | getNodeRenderingHandlers | class WikiLinkJiraRenderer implements NodeRenderer {
final private WikiLinkOptions options;
public WikiLinkJiraRenderer(DataHolder options) {
this.options = new WikiLinkOptions(options);
}
@Override
public Set<NodeRenderingHandler<?>> getNodeRenderingHandlers() {<FILL_FUNCTION_BODY>}
... |
HashSet<NodeRenderingHandler<?>> set = new HashSet<>();
set.add(new NodeRenderingHandler<>(WikiLink.class, this::render));
return set;
| 306 | 50 | 356 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-wikilink/src/main/java/com/vladsch/flexmark/ext/wikilink/internal/WikiLinkLinkRefProcessor.java | WikiLinkLinkRefProcessor | updateNodeElements | class WikiLinkLinkRefProcessor implements LinkRefProcessor {
static final int BRACKET_NESTING_LEVEL = 1;
final private WikiLinkOptions options;
public WikiLinkLinkRefProcessor(Document document) {
this.options = new WikiLinkOptions(document);
}
@Override
public boolean getWantExclamat... |
assert (node instanceof WikiNode);
WikiNode wikiNode = (WikiNode) node;
if (node instanceof WikiLink && WikiLinkExtension.ALLOW_INLINES.get(document)) {
// need to update link and pageRef with plain text versions
if (wikiNode.getText().isNull()) {
BasedSe... | 888 | 163 | 1,051 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-wikilink/src/main/java/com/vladsch/flexmark/ext/wikilink/internal/WikiLinkLinkResolver.java | WikiLinkLinkResolver | resolveLink | class WikiLinkLinkResolver implements LinkResolver {
final private WikiLinkOptions options;
public WikiLinkLinkResolver(LinkResolverBasicContext context) {
this.options = new WikiLinkOptions(context.getOptions());
}
@NotNull
@Override
public ResolvedLink resolveLink(@NotNull Node node,... |
if (link.getLinkType() == WIKI_LINK) {
StringBuilder sb = new StringBuilder();
final boolean isWikiImage = node instanceof WikiImage;
String wikiLink = link.getUrl();
int iMax = wikiLink.length();
boolean absolute = iMax > 0 && wikiLink.charAt(0) == '... | 251 | 630 | 881 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-wikilink/src/main/java/com/vladsch/flexmark/ext/wikilink/internal/WikiLinkNodeRenderer.java | WikiLinkNodeRenderer | render | class WikiLinkNodeRenderer implements NodeRenderer {
final private WikiLinkOptions options;
public WikiLinkNodeRenderer(DataHolder options) {
this.options = new WikiLinkOptions(options);
}
@Override
public Set<NodeRenderingHandler<?>> getNodeRenderingHandlers() {
HashSet<NodeRender... |
if (!context.isDoNotRenderLinks()) {
if (options.disableRendering) {
html.text(node.getChars().unescape());
} else {
String altText = node.getText().isNotNull() ? node.getText().toString() : node.getLink().unescape();
ResolvedLink resolve... | 431 | 175 | 606 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-xwiki-macros/src/main/java/com/vladsch/flexmark/ext/xwiki/macros/Macro.java | Macro | getAttributes | class Macro extends Node {
protected BasedSequence openingMarker = BasedSequence.NULL;
protected BasedSequence name = BasedSequence.NULL;
protected BasedSequence attributeText = BasedSequence.NULL;
protected BasedSequence closingMarker = BasedSequence.NULL;
@NotNull
@Override
public BasedSe... |
Map<String, String> attributes = new LinkedHashMap<>();
Node child = getFirstChild();
while (child != null) {
if (child instanceof MacroAttribute) {
MacroAttribute attribute = (MacroAttribute) child;
attributes.put(attribute.getAttribute().toString(),... | 753 | 102 | 855 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark-ext-xwiki-macros/src/main/java/com/vladsch/flexmark/ext/xwiki/macros/MacroBlock.java | MacroBlock | getMacroContentChars | class MacroBlock extends Block {
@Override
public void getAstExtra(@NotNull StringBuilder out) {
if (isClosedTag()) out.append(" isClosed");
segmentSpanChars(out, getMacroContentChars(), "macroContent");
}
@NotNull
@Override
public BasedSequence[] getSegments() {
return... |
Node firstChild = getFirstChild();
Node lastChild = getLastChild();
Node firstContentNode = firstChild.getNext();
Node lastContentNode = lastChild instanceof MacroClose ? lastChild.getPrevious() : lastChild;
//noinspection UnnecessaryLocalVariable
BasedSequence contentC... | 304 | 149 | 453 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public @Nullable Block getParent() <variables> |
vsch_flexmark-java | flexmark-java/flexmark-ext-xwiki-macros/src/main/java/com/vladsch/flexmark/ext/xwiki/macros/MacroVisitorExt.java | MacroVisitorExt | VISIT_HANDLERS | class MacroVisitorExt {
public static <V extends MacroVisitor> VisitHandler<?>[] VISIT_HANDLERS(V visitor) {<FILL_FUNCTION_BODY>}
} |
return new VisitHandler<?>[] {
new VisitHandler<>(Macro.class, visitor::visit),
new VisitHandler<>(MacroClose.class, visitor::visit),
new VisitHandler<>(MacroBlock.class, visitor::visit),
};
| 53 | 70 | 123 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-xwiki-macros/src/main/java/com/vladsch/flexmark/ext/xwiki/macros/internal/MacroBlockParser.java | BlockFactory | tryStart | class BlockFactory extends AbstractBlockParserFactory {
final private MacroParsing parsing;
BlockFactory(DataHolder options) {
super(options);
this.parsing = new MacroParsing(new Parsing(options));
}
@Override
public BlockStart tryStart(ParserState state... |
BasedSequence line = state.getLine();
int currentIndent = state.getIndent();
if (currentIndent == 0 && !(matchedBlockParser.getBlockParser().getBlock() instanceof Paragraph)) {
final BasedSequence tryLine = line.subSequence(state.getIndex());
Matcher ... | 104 | 1,189 | 1,293 | <methods>public non-sealed void <init>() ,public void addLine(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.util.sequence.BasedSequence) ,public boolean breakOutOnDoubleBlankLine() ,public boolean canContain(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.parser.block.BlockPars... |
vsch_flexmark-java | flexmark-java/flexmark-ext-xwiki-macros/src/main/java/com/vladsch/flexmark/ext/xwiki/macros/internal/MacroInlineParser.java | MacroInlineParser | parse | class MacroInlineParser implements InlineParserExtension {
final private MacroParsing parsing;
private List<Macro> openMacros;
public MacroInlineParser(LightInlineParser inlineParser) {
this.parsing = new MacroParsing(inlineParser.getParsing());
this.openMacros = new ArrayList<>();
}
... |
if (inlineParser.peek(1) == '{') {
BasedSequence input = inlineParser.getInput();
int index = inlineParser.getIndex();
Matcher matcher = inlineParser.matcher(parsing.MACRO_TAG);
if (matcher != null) {
BasedSequence macroOpen = input.subSequence(ma... | 410 | 1,043 | 1,453 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-xwiki-macros/src/main/java/com/vladsch/flexmark/ext/xwiki/macros/internal/MacroNodeRenderer.java | MacroNodeRenderer | getNodeRenderingHandlers | class MacroNodeRenderer implements NodeRenderer {
final private MacroOptions options;
public MacroNodeRenderer(DataHolder options) {
this.options = new MacroOptions(options);
}
@Override
public Set<NodeRenderingHandler<?>> getNodeRenderingHandlers() {<FILL_FUNCTION_BODY>}
private void... |
HashSet<NodeRenderingHandler<?>> set = new HashSet<>();
set.add(new NodeRenderingHandler<>(Macro.class, this::render));
set.add(new NodeRenderingHandler<>(MacroAttribute.class, this::render));
set.add(new NodeRenderingHandler<>(MacroClose.class, this::render));
set.add(new NodeR... | 344 | 118 | 462 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-yaml-front-matter/src/main/java/com/vladsch/flexmark/ext/yaml/front/matter/YamlFrontMatterNode.java | YamlFrontMatterNode | getValuesSequences | class YamlFrontMatterNode extends Node {
private BasedSequence key;
//private List<BasedSequence> values;
@NotNull
@Override
public BasedSequence[] getSegments() {
return new BasedSequence[] { key };
}
public YamlFrontMatterNode(BasedSequence key, List<BasedSequence> values) {
... |
ArrayList<BasedSequence> list = new ArrayList<>();
Node child = getFirstChild();
while (child != null) {
list.add(child.getChars());
child = child.getNext();
}
return list;
| 306 | 64 | 370 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark-ext-yaml-front-matter/src/main/java/com/vladsch/flexmark/ext/yaml/front/matter/YamlFrontMatterVisitorExt.java | YamlFrontMatterVisitorExt | VISIT_HANDLERS | class YamlFrontMatterVisitorExt {
public static <V extends YamlFrontMatterVisitor> VisitHandler<?>[] VISIT_HANDLERS(V visitor) {<FILL_FUNCTION_BODY>}
} |
return new VisitHandler<?>[] {
new VisitHandler<>(YamlFrontMatterNode.class, visitor::visit),
new VisitHandler<>(YamlFrontMatterBlock.class, visitor::visit),
};
| 61 | 61 | 122 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-yaml-front-matter/src/main/java/com/vladsch/flexmark/ext/yaml/front/matter/internal/YamlFrontMatterBlockParser.java | YamlFrontMatterBlockParser | tryContinue | class YamlFrontMatterBlockParser extends AbstractBlockParser {
final private static Pattern REGEX_METADATA = Pattern.compile("^[ ]{0,3}([A-Za-z0-9_\\-.]+):\\s*(.*)");
final private static Pattern REGEX_METADATA_LIST = Pattern.compile("^[ ]+-\\s*(.*)");
final private static Pattern REGEX_METADATA_LITERAL = P... |
final BasedSequence line = state.getLine();
if (inYAMLBlock) {
if (REGEX_END.matcher(line).matches()) {
if (currentKey != null) {
YamlFrontMatterNode child = new YamlFrontMatterNode(currentKey, currentValues);
child.setCharsFromConten... | 846 | 658 | 1,504 | <methods>public non-sealed void <init>() ,public void addLine(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.util.sequence.BasedSequence) ,public boolean breakOutOnDoubleBlankLine() ,public boolean canContain(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.parser.block.BlockPars... |
vsch_flexmark-java | flexmark-java/flexmark-ext-yaml-front-matter/src/main/java/com/vladsch/flexmark/ext/yaml/front/matter/internal/YamlFrontMatterNodeFormatter.java | YamlFrontMatterNodeFormatter | renderDocument | class YamlFrontMatterNodeFormatter implements PhasedNodeFormatter {
public YamlFrontMatterNodeFormatter(DataHolder options) {
}
@Nullable
@Override
public Set<FormattingPhase> getFormattingPhases() {
return new HashSet<>(Collections.singleton(FormattingPhase.DOCUMENT_FIRST));
}
@Nu... |
if (phase == FormattingPhase.DOCUMENT_FIRST) {
Node node = document.getFirstChild();
if (node instanceof YamlFrontMatterBlock) {
markdown.openPreFormatted(false);
markdown.append(node.getChars()).blankLine();
markdown.closePreFormatted();
... | 353 | 93 | 446 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-youtube-embedded/src/main/java/com/vladsch/flexmark/ext/youtube/embedded/YouTubeLink.java | YouTubeLink | setTextChars | class YouTubeLink extends InlineLinkNode {
public YouTubeLink() {
}
public YouTubeLink(Link other) {
super(other.baseSubSequence(other.getStartOffset() - 1, other.getEndOffset()),
other.baseSubSequence(other.getStartOffset() - 1, other.getTextOpeningMarker().getEndOffset()),
... |
int textCharsLength = textChars.length();
this.textOpeningMarker = textChars.subSequence(0, 1);
this.text = textChars.subSequence(1, textCharsLength - 1).trim();
this.textClosingMarker = textChars.subSequence(textCharsLength - 1, textCharsLength);
| 196 | 92 | 288 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, ... |
vsch_flexmark-java | flexmark-java/flexmark-ext-youtube-embedded/src/main/java/com/vladsch/flexmark/ext/youtube/embedded/YouTubeLinkExtension.java | YouTubeLinkExtension | extend | class YouTubeLinkExtension implements Parser.ParserExtension, HtmlRenderer.HtmlRendererExtension {
private YouTubeLinkExtension() {
}
public static YouTubeLinkExtension create() {
return new YouTubeLinkExtension();
}
@Override
public void extend(Parser.Builder parserBuilder) {
... |
if (htmlRendererBuilder.isRendererType("HTML")) {
htmlRendererBuilder.nodeRendererFactory(new YouTubeLinkNodeRenderer.Factory());
} else if (htmlRendererBuilder.isRendererType("JIRA")) {
}
| 186 | 58 | 244 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-youtube-embedded/src/main/java/com/vladsch/flexmark/ext/youtube/embedded/internal/YouTubeLinkNodePostProcessor.java | YouTubeLinkNodePostProcessor | process | class YouTubeLinkNodePostProcessor extends NodePostProcessor {
public YouTubeLinkNodePostProcessor(DataHolder options) {
}
@Override
public void process(@NotNull NodeTracker state, @NotNull Node node) {<FILL_FUNCTION_BODY>}
public static class Factory extends NodePostProcessorFactory {
pu... |
if (node instanceof Link) {
Node previous = node.getPrevious();
if (previous instanceof Text) {
BasedSequence chars = previous.getChars();
if (chars.endsWith("@") && chars.isContinuedBy(node.getChars())) {
int prevBackslash = chars.su... | 149 | 243 | 392 | <methods>public non-sealed void <init>() ,public final @NotNull Document processDocument(@NotNull Document) <variables> |
vsch_flexmark-java | flexmark-java/flexmark-ext-youtube-embedded/src/main/java/com/vladsch/flexmark/ext/youtube/embedded/internal/YouTubeLinkNodeRenderer.java | YouTubeLinkNodeRenderer | render | class YouTubeLinkNodeRenderer implements NodeRenderer {
public YouTubeLinkNodeRenderer(DataHolder options) {
}
@Override
public Set<NodeRenderingHandler<?>> getNodeRenderingHandlers() {
HashSet<NodeRenderingHandler<?>> set = new HashSet<>();
set.add(new NodeRenderingHandler<>(YouTubeLi... |
if (context.isDoNotRenderLinks()) {
context.renderChildren(node);
} else {
// standard Link Rendering
ResolvedLink resolvedLink = context.resolveLink(LinkType.LINK, node.getUrl().unescape(), null);
URL url = null;
try {
url = ... | 189 | 569 | 758 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/ZzzzzzBlock.java | ZzzzzzBlock | getAstExtra | class ZzzzzzBlock extends Block {
protected BasedSequence openingMarker = BasedSequence.NULL;
protected BasedSequence text = BasedSequence.NULL;
protected BasedSequence closingMarker = BasedSequence.NULL;
protected BasedSequence zzzzzz = BasedSequence.NULL;
private int zzzzzzOrdinal = 0;
private... |
out.append(" ordinal: ").append(zzzzzzOrdinal).append(" ");
segmentSpan(out, openingMarker, "open");
segmentSpan(out, text, "text");
segmentSpan(out, closingMarker, "close");
segmentSpan(out, zzzzzz, "zzzzzz");
| 648 | 81 | 729 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public @Nullable Block getParent() <variables> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/ZzzzzzExtension.java | ZzzzzzExtension | extend | class ZzzzzzExtension implements Parser.ParserExtension
, HtmlRenderer.HtmlRendererExtension // zzzoptionszzz(NODE_RENDERER, PHASED_NODE_RENDERER)
, Parser.ReferenceHoldingExtension //zzzoptionszzz(CUSTOM_NODE_REPOSITORY)
{
final public static DataKey<KeepType> ZZZZZZS_KEEP = new DataKey<>("ZZZZZZS_... |
// zzzoptionszzz(REMOVE, BLOCK_PARSER)
// zzzoptionszzz(BLOCK_PRE_PROCESSOR)
// zzzoptionszzz(REMOVE, DELIMITER_PROCESSOR)
// zzzoptionszzz(REMOVE, LINK_REF_PROCESSOR)
// zzzoptionszzz(NODE_RENDERER)
// zzzoptionszzz(LINK_RESOLVER)
// zzzoptionszzz(CUSTOM_PROPERT... | 1,123 | 577 | 1,700 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/ZzzzzzVisitorExt.java | ZzzzzzVisitorExt | VISIT_HANDLERS | class ZzzzzzVisitorExt {
public static <V extends ZzzzzzVisitor> VisitHandler<?>[] VISIT_HANDLERS(V visitor) {<FILL_FUNCTION_BODY>}
} |
return new VisitHandler<?>[] {
new VisitHandler<>(Zzzzzz.class, visitor::visit),// zzzoptionszzz(CUSTOM_NODE)
new VisitHandler<>(ZzzzzzBlock.class, visitor::visit),// zzzoptionszzz(CUSTOM_BLOCK_NODE)
};
| 57 | 85 | 142 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzAttributeProvider.java | ZzzzzzAttributeProvider | setLinkAttributes | class ZzzzzzAttributeProvider implements AttributeProvider {
final private String missingTargetClass;
final private String localOnlyTargetClass;
final private AttributeProviderAdapter nodeAdapter;
public ZzzzzzAttributeProvider(LinkResolverContext context) {
DataHolder options = context.getOpti... |
if (part == LINK) {
String linkStatus = attributes.getValue(LINK_STATUS_ATTR);
if (LinkStatus.NOT_FOUND.isStatus(linkStatus)) {
attributes.addValue("class", missingTargetClass);
} else if (ZzzzzzExtension.LOCAL_ONLY.isStatus(linkStatus)) {
att... | 545 | 108 | 653 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzBlockParser.java | Factory | getAfterDependents | class Factory implements CustomBlockParserFactory {
@Nullable
@Override
public Set<Class<?>> getAfterDependents() {<FILL_FUNCTION_BODY>}
@Nullable
@Override
public Set<Class<?>> getBeforeDependents() {
return null;
//return new HashSet<>(Arrays.as... |
return null;
//return new HashSet<>(Arrays.asList(
// BlockQuoteParser.Factory.class,
// HeadingParser.Factory.class,
// FencedCodeBlockParser.Factory.class,
// HtmlBlockParser.Factory.class,
// Thema... | 245 | 117 | 362 | <methods>public non-sealed void <init>() ,public void addLine(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.util.sequence.BasedSequence) ,public boolean breakOutOnDoubleBlankLine() ,public boolean canContain(com.vladsch.flexmark.parser.block.ParserState, com.vladsch.flexmark.parser.block.BlockPars... |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzBlockPreProcessor.java | Factory | getBlockTypes | class Factory implements BlockPreProcessorFactory {
@NotNull
@Override
public Set<Class<? extends Block>> getBlockTypes() {<FILL_FUNCTION_BODY>}
@Nullable
@Override
public Set<Class<?>> getAfterDependents() {
return null;
}
@Nullable
... |
HashSet<Class<? extends Block>> set = new HashSet<>();
set.add(Heading.class);
return set;
| 178 | 37 | 215 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzDelimiterProcessor.java | ZzzzzzDelimiterProcessor | getDelimiterUse | class ZzzzzzDelimiterProcessor implements DelimiterProcessor {
@Override
public char getOpeningCharacter() {
return ':';
}
@Override
public char getClosingCharacter() {
return ':';
}
@Override
public int getMinLength() {
return 1;
}
@Override
publi... |
if (opener.length() >= 1 && closer.length() >= 1) {
return 1;
} else {
return 0;
}
| 455 | 43 | 498 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzDocumentPostProcessor.java | ZzzzzzDocumentPostProcessor | visit | class ZzzzzzDocumentPostProcessor extends DocumentPostProcessor {
final private NodeVisitor myVisitor;
public ZzzzzzDocumentPostProcessor(Document document) {
myVisitor = new NodeVisitor(
new VisitHandler<>(Text.class, this::visit)
);
}
@NotNull
@Override
public... |
if (!node.isOrDescendantOfType(DoNotDecorate.class)) {
// do some processing
BasedSequence original = node.getChars();
boolean wrapInTextBase = !(node.getParent() instanceof TextBase);
TextBase textBase = null;
while (wrapInTextBase) {
... | 193 | 142 | 335 | <methods>public non-sealed void <init>() ,public final void process(@NotNull NodeTracker, @NotNull Node) <variables> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzInlineParserExtension.java | ZzzzzzInlineParserExtension | finalizeBlock | class ZzzzzzInlineParserExtension implements InlineParserExtension {
private List<Zzzzzz> openZzzzzzs;
public ZzzzzzInlineParserExtension(LightInlineParser inlineParser) {
this.openZzzzzzs = new ArrayList<>();
}
@Override
public void finalizeDocument(@NotNull InlineParser inlineParser) {
... |
for (int j = openZzzzzzs.size(); j-- > 0; ) {
inlineParser.moveNodes(openZzzzzzs.get(j), inlineParser.getBlock().getLastChild());
}
openZzzzzzs.clear();
| 338 | 70 | 408 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzJiraRenderer.java | ZzzzzzJiraRenderer | getNodeRenderingHandlers | class ZzzzzzJiraRenderer implements NodeRenderer {
public ZzzzzzJiraRenderer(DataHolder options) {
}
@Override
public Set<NodeRenderingHandler<?>> getNodeRenderingHandlers() {<FILL_FUNCTION_BODY>}
private void render(Zzzzzz node, NodeRendererContext context, HtmlWriter html) {
html.raw(""... |
return new HashSet<>(Arrays.asList(
new NodeRenderingHandler<>(Zzzzzz.class, this::render),// zzzoptionszzz(CUSTOM_NODE)
new NodeRenderingHandler<>(ZzzzzzBlock.class, this::render)// zzzoptionszzz(CUSTOM_BLOCK_NODE)
));
| 216 | 91 | 307 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzLinkRefProcessor.java | ZzzzzzLinkRefProcessor | adjustInlineText | class ZzzzzzLinkRefProcessor implements LinkRefProcessor {
static final boolean WANT_EXCLAMATION_PREFIX = false;
static final int BRACKET_NESTING_LEVEL = 1;
final private ZzzzzzOptions options;
public ZzzzzzLinkRefProcessor(Document document) {
this.options = new ZzzzzzOptions(document);
}... |
// nothing to do, our prefixes are stripped out of a link ref
return node.getChars();
| 545 | 30 | 575 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzNodePostProcessor.java | ZzzzzzNodePostProcessor | processText | class ZzzzzzNodePostProcessor extends NodePostProcessor {
public ZzzzzzNodePostProcessor(Document document) {
}
@Override
public void process(@NotNull NodeTracker state, @NotNull Node node) {
}
private void processText(NodeTracker state, Text node) {<FILL_FUNCTION_BODY>}
public static cl... |
BasedSequence original = node.getChars();
boolean wrapInTextBase = !(node.getParent() instanceof TextBase);
TextBase textBase = null;
while (wrapInTextBase) {
if (wrapInTextBase) {
wrapInTextBase = false;
textBase = new TextBase(original);
... | 206 | 120 | 326 | <methods>public non-sealed void <init>() ,public final @NotNull Document processDocument(@NotNull Document) <variables> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzNodeRenderer.java | ZzzzzzNodeRenderer | getNodeRenderingHandlers | class ZzzzzzNodeRenderer implements NodeRenderer
, PhasedNodeRenderer // zzzoptionszzz(PHASED_NODE_RENDERER)
{
private static String fromChars = " +/<>";
private static String toChars = "-----";
final private ZzzzzzOptions options;// zzzoptionszzz(CUSTOM_PROPERTIES)
public ZzzzzzNodeRenderer(D... |
Set<NodeRenderingHandler<?>> set = new HashSet<>();
// @formatter:off
set.add(new NodeRenderingHandler<>(Zzzzzz.class, ZzzzzzNodeRenderer.this::render));// zzzoptionszzz(CUSTOM_NODE)
set.add(new NodeRenderingHandler<>(ZzzzzzBlock.class, ZzzzzzNodeRenderer.this::render));// zzzoptionszzz... | 663 | 147 | 810 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzParagraphPreProcessor.java | ZzzzzzParagraphPreProcessor | skipNext | class ZzzzzzParagraphPreProcessor implements ParagraphPreProcessor {
private static String COL = "(?:" + "\\s*-{3,}\\s*|\\s*:-{2,}\\s*|\\s*-{2,}:\\s*|\\s*:-+:\\s*" + ")";
private static Pattern TABLE_HEADER_SEPARATOR = Pattern.compile(
// For single column, require at least one pipe, otherwise it's ... |
return c == ' ' || c == '\t';
//return false;
| 695 | 22 | 717 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-ext-zzzzzz/src/main/java/com/vladsch/flexmark/ext/zzzzzz/internal/ZzzzzzRepository.java | ZzzzzzRepository | resolveZzzzzzOrdinals | class ZzzzzzRepository extends NodeRepository<ZzzzzzBlock> {
private ArrayList<ZzzzzzBlock> referencedZzzzzzBlocks = new ArrayList<>();
public ZzzzzzRepository(DataHolder options) {
super(ZzzzzzExtension.ZZZZZZS_KEEP.get(options));
}
public void addZzzzzzReference(ZzzzzzBlock zzzzzzBlock, Zzzz... |
// need to sort by first referenced offset then set each to its ordinal position in the array+1
referencedZzzzzzBlocks.sort((f1, f2) -> f1.getFirstReferenceOffset() - f2.getFirstReferenceOffset());
int ordinal = 0;
for (ZzzzzzBlock zzzzzzBlock : referencedZzzzzzBlocks) {
zzz... | 515 | 119 | 634 | <methods>public void <init>(@Nullable KeepType) ,public void clear() ,public boolean containsKey(@NotNull Object) ,public boolean containsValue(java.lang.Object) ,public @NotNull Set<Map.Entry<String,ZzzzzzBlock>> entrySet() ,public boolean equals(java.lang.Object) ,public @Nullable ZzzzzzBlock get(@NotNull Object) ,pu... |
vsch_flexmark-java | flexmark-java/flexmark-html2md-converter/src/main/java/com/vladsch/flexmark/html2md/converter/DelegatingNodeRendererFactoryWrapper.java | DelegatingNodeRendererFactoryWrapper | getBeforeDependents | class DelegatingNodeRendererFactoryWrapper implements Function<DataHolder, HtmlNodeRenderer>, Dependent, DelegatingNodeRendererFactory {
final private HtmlNodeRendererFactory nodeRendererFactory;
private List<DelegatingNodeRendererFactoryWrapper> nodeRenderers;
private Set<Class<?>> myDelegates = null;
... |
if (myDelegates == null && nodeRenderers != null) {
Set<Class<?>> delegates = getDelegates();
if (delegates != null) {
myDelegates = new HashSet<>();
for (DelegatingNodeRendererFactoryWrapper factory : nodeRenderers) {
if (delegates.co... | 351 | 153 | 504 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-html2md-converter/src/main/java/com/vladsch/flexmark/html2md/converter/HtmlConverterState.java | HtmlConverterState | toString | class HtmlConverterState {
final @NotNull Node myParent;
final List<Node> myElements;
int myIndex;
final @NotNull MutableAttributes myAttributes;
private @Nullable LinkedList<Runnable> myPrePopActions;
HtmlConverterState(@NotNull Node parent) {
myParent = parent;
myElements = pa... |
return "State{" +
"myParent=" + myParent +
", myElements=" + myElements +
", myIndex=" + myIndex +
", myAttributes=" + myAttributes +
'}';
| 383 | 59 | 442 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-html2md-converter/src/main/java/com/vladsch/flexmark/html2md/converter/HtmlMarkdownWriter.java | HtmlMarkdownWriter | lastBlockQuoteChildPrefix | class HtmlMarkdownWriter extends MarkdownWriterBase<HtmlMarkdownWriter, Node, HtmlNodeConverterContext> {
public HtmlMarkdownWriter() {
this(null, 0);
}
public HtmlMarkdownWriter(int formatOptions) {
this(null, formatOptions);
}
public HtmlMarkdownWriter(@Nullable Appendable builde... |
Node node = context.getCurrentNode();
if (node instanceof Element) {
Element element = (Element) node;
while (element.nextElementSibling() == null) {
Element parent = element.parent();
if (parent == null) break;
if (parent.nodeNa... | 192 | 204 | 396 | <methods>public void <init>() ,public void <init>(int) ,public void <init>(@Nullable Appendable, int) ,public @NotNull HtmlMarkdownWriter addIndentOnFirstEOL(@NotNull Runnable) ,public @NotNull HtmlMarkdownWriter addPrefix(@NotNull CharSequence) ,public @NotNull HtmlMarkdownWriter addPrefix(@NotNull CharSequence, boole... |
vsch_flexmark-java | flexmark-java/flexmark-html2md-converter/src/main/java/com/vladsch/flexmark/html2md/converter/HtmlNodeConverterSubContext.java | HtmlNodeConverterSubContext | flushTo | class HtmlNodeConverterSubContext implements HtmlNodeConverterContext {
final protected HtmlMarkdownWriter markdown;
NodeRenderingHandlerWrapper<?> renderingHandlerWrapper;
@Nullable Node myRenderingNode;
public HtmlNodeConverterSubContext(@NotNull HtmlMarkdownWriter markdown) {
this.markdown =... |
markdown.line();
try {
markdown.appendTo(out, maxBlankLines, maxTrailingBlankLines);
} catch (IOException e) {
e.printStackTrace();
}
| 286 | 58 | 344 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-html2md-converter/src/main/java/com/vladsch/flexmark/html2md/converter/HtmlNodeRendererHandler.java | HtmlNodeRendererHandler | equals | class HtmlNodeRendererHandler<N extends Node> implements CustomHtmlNodeRenderer<N> {
protected final String myTagName;
protected final Class<? extends N> myClass;
protected final CustomHtmlNodeRenderer<N> myAdapter;
public HtmlNodeRendererHandler(String tagName, Class<? extends N> aClass, CustomHtmlNod... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
HtmlNodeRendererHandler<?> other = (HtmlNodeRendererHandler<?>) o;
if (myClass != other.myClass) return false;
return myAdapter == other.myAdapter;
| 319 | 87 | 406 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-html2md-converter/src/main/java/com/vladsch/flexmark/html2md/converter/ListState.java | ListState | getItemPrefix | class ListState {
final public boolean isNumbered;
public int itemCount;
public ListState(boolean isNumbered) {
this.isNumbered = isNumbered;
itemCount = 0;
}
public String getItemPrefix(HtmlConverterOptions options) {<FILL_FUNCTION_BODY>}
} |
if (isNumbered) {
return String.format(Locale.US, "%d%c ", itemCount, options.orderedListDelimiter);
} else {
return String.format("%c ", options.unorderedListDelimiter);
}
| 85 | 66 | 151 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-jira-converter/src/main/java/com/vladsch/flexmark/jira/converter/JiraConverterExtension.java | JiraConverterExtension | extend | class JiraConverterExtension implements Parser.ParserExtension, HtmlRenderer.HtmlRendererExtension {
private JiraConverterExtension() {
}
public static JiraConverterExtension create() {
return new JiraConverterExtension();
}
@Override
public void extend(Parser.Builder parserBuilder) {... |
if (htmlRendererBuilder.isRendererType("JIRA")) {
htmlRendererBuilder.nodeRendererFactory(new JiraConverterNodeRenderer.Factory());
} else {
throw new IllegalStateException("Jira Converter Extension used with non Jira Renderer " + rendererType);
}
| 259 | 74 | 333 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-pdf-converter/src/main/java/com/vladsch/flexmark/pdf/converter/PdfConverterExtension.java | PdfConverterExtension | exportToPdf | class PdfConverterExtension {
final public static NullableDataKey<PdfRendererBuilder.TextDirection> DEFAULT_TEXT_DIRECTION = new NullableDataKey<>("DEFAULT_TEXT_DIRECTION");
final public static NullableDataKey<ProtectionPolicy> PROTECTION_POLICY = new NullableDataKey<>("PROTECTION_POLICY");
final public sta... |
PdfBoxRenderer renderer = null;
try {
// There are more options on the builder than shown below.
PdfRendererBuilder builder = new PdfRendererBuilder();
handleTextDirection(defaultTextDirection, builder);
handleW3cDocument(html, url, builder);
... | 1,111 | 228 | 1,339 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-tree-iteration/src/main/java/com/vladsch/flexmark/tree/iteration/FixedIterationConditions.java | FixedIterationConditions | mapTtoB | class FixedIterationConditions<N> implements IterationConditions<N> {
final private @NotNull Function<? super N, N> initializer;
final private @NotNull Function<? super N, N> iterator;
final private @NotNull Function<? super N, N> reverseInitializer;
final private @NotNull Function<? super N, N> reverse... |
return new FixedIterationConditions<>(
getAdapter(constraints.getInitializer(), adaptBtoT, adaptTtoB),
getAdapter(constraints.getIterator(), adaptBtoT, adaptTtoB),
getAdapter(constraints.getReversed().getInitializer(), adaptBtoT, adaptTtoB),
getAd... | 472 | 113 | 585 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-tree-iteration/src/main/java/com/vladsch/flexmark/tree/iteration/ValueIterationAdapterImpl.java | ChainedConsumerAdapter | of | class ChainedConsumerAdapter<P, T, V> implements ValueIterationConsumerAdapter<P, V> {
final private ValueIterationConsumerAdapter<? super P, T> myBeforeAdapter;
final private ValueIterationConsumerAdapter<? super T, V> myAfterAdapter;
public ChainedConsumerAdapter(ValueIterationConsumerAdapter... |
return new ValueIterationAdapterImpl<>(it -> {
for (Class<? extends T> clazz : clazzes) {
if (clazz.isInstance(it)) return clazz.cast(it);
}
return null;
});
| 812 | 67 | 879 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/AllNodesVisitor.java | AllNodesVisitor | visitChildren | class AllNodesVisitor {
protected abstract void process(@NotNull Node node);
public void visit(@NotNull Node node) {
visitChildren(node);
}
private void visitChildren(@NotNull Node parent) {<FILL_FUNCTION_BODY>}
} |
Node node = parent.getFirstChild();
while (node != null) {
// A subclass of this visitor might modify the node, resulting in getNext returning a different node or no
// node after visiting it. So get the next node before visiting.
Node next = node.getNext();
... | 67 | 95 | 162 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/Block.java | Block | setParent | class Block extends ContentNode {
public Block() {
}
public Block(@NotNull BasedSequence chars) {
super(chars);
}
public Block(@NotNull BasedSequence chars, @NotNull List<BasedSequence> lineSegments) {
super(chars, lineSegments);
}
public Block(@NotNull List<BasedSequence>... |
if (parent != null && !(parent instanceof Block)) {
throw new IllegalArgumentException("Parent of block must also be block (can not be inline)");
}
super.setParent(parent);
| 185 | 52 | 237 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(@NotNull BlockContent) ,public @NotNull BasedSequence getContentChars() ,public @NotNull BasedSequence... |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/BlockContent.java | BlockContent | getContents | class BlockContent {
// list of line text
final private ArrayList<BasedSequence> lines = new ArrayList<>();
final private ArrayList<Integer> lineIndents = new ArrayList<>();
public @NotNull BasedSequence getLine(int line) {
return lines.get(line);
}
public @NotNull BasedSequence getSpa... |
if (lines.size() == 0) return BasedSequence.NULL;
if (startLine < 0) {
throw new IndexOutOfBoundsException("startLine must be at least 0");
}
if (endLine < 0) {
throw new IndexOutOfBoundsException("endLine must be at least 0");
}
if (endLine < st... | 875 | 183 | 1,058 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/BlockNodeVisitor.java | BlockNodeVisitor | processNode | class BlockNodeVisitor extends NodeVisitor {
public BlockNodeVisitor() {
}
public BlockNodeVisitor(@NotNull VisitHandler... handlers) {
super(handlers);
}
public BlockNodeVisitor(@NotNull VisitHandler[]... handlers) {
super(handlers);
}
public BlockNodeVisitor(@NotNull Col... |
if (node instanceof Block) {
super.processNode(node, withChildren, processor);
}
| 156 | 29 | 185 | <methods>public void <init>() ,public transient void <init>(@NotNull VisitHandler#RAW []) ,public transient void <init>(@NotNull VisitHandler#RAW [] []) ,public void <init>(@NotNull Collection<VisitHandler#RAW>) ,public @NotNull NodeVisitor addHandler(@NotNull VisitHandler#RAW) ,public @NotNull NodeVisitor addHandlers(... |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/ClassifyingNodeTracker.java | ClassifyingNodeTracker | validateLinked | class ClassifyingNodeTracker implements NodeTracker {
protected final @NotNull ClassificationBag<Class<?>, Node> nodeClassifier;
final private @Nullable NodeTracker host;
final private @NotNull OrderedMap<Class<?>, Set<Class<?>>> exclusionMap;
final private @NotNull OrderedSet<Class<?>> exclusionSet;
... |
if (node.getNext() == null && node.getParent() == null) {
throw new IllegalStateException("Added block " + node + " is not linked into the AST");
}
| 1,076 | 50 | 1,126 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/ContentNode.java | ContentNode | setContentLine | class ContentNode extends Node implements Content {
protected List<BasedSequence> lineSegments = BasedSequence.EMPTY_LIST;
public ContentNode() {
}
public ContentNode(@NotNull BasedSequence chars) {
super(chars);
}
public ContentNode(@NotNull BasedSequence chars, @NotNull List<BasedS... |
ArrayList<BasedSequence> lines = new ArrayList<>(lineSegments);
lines.set(lineIndex, contentLine);
this.lineSegments = lines;
setCharsFromContent();
| 802 | 50 | 852 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/DescendantNodeIterator.java | DescendantNodeIterator | next | class DescendantNodeIterator implements ReversiblePeekingIterator<Node> {
final private boolean isReversed;
private @NotNull ReversiblePeekingIterator<Node> iterator;
private @Nullable Stack<ReversiblePeekingIterator<Node>> iteratorStack;
private Node result;
/**
* iterate nodes, with descenda... |
result = iterator.next();
if (result.getFirstChild() != null) {
// push the current iterator on to the stack and make the node's children the iterator
if (iterator.hasNext()) {
if (iteratorStack == null) iteratorStack = new Stack<>();
iteratorSta... | 416 | 191 | 607 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/Document.java | Document | getLineNumber | class Document extends Block implements MutableDataHolder {
final public static Document NULL = new Document(null, BasedSequence.NULL);
final private MutableDataSet dataSet;
@Override
public @NotNull BasedSequence[] getSegments() {
return EMPTY_SEGMENTS;
}
public Document(DataHolder o... |
if (lineSegments == EMPTY_LIST) {
BasedSequence preText = getChars().baseSubSequence(0, Utils.maxLimit(offset + 1, getChars().length()));
if (preText.isEmpty()) return 0;
int lineNumber = 0;
int nextLineEnd = preText.endOfLineAnyEOL(0);
int length = ... | 967 | 306 | 1,273 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public @Nullable Block getParent() <variables> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/NodeClassifierVisitor.java | NodeClassifierVisitor | updateNodeAncestry | class NodeClassifierVisitor extends NodeVisitorBase implements NodeTracker {
final private OrderedMap<Class<?>, Set<Class<?>>> exclusionMap;
final private OrderedSet<Class<?>> exclusionSet;
final private HashMap<Integer, BitSet> nodeAncestryMap;
final private Stack<BitSet> nodeAncestryBitSetStack = new ... |
if (!exclusionMap.isEmpty() && !(node instanceof Document)) {
// add flags if needed
BitSet bitSet = nodeAncestryBitSet.getPeek();
assert bitSet != null;
int index = classifyingNodeTracker.getItems().indexOf(node);
if (index == -1) {
... | 1,086 | 453 | 1,539 | <methods>public non-sealed void <init>() ,public void visitChildren(@NotNull Node) <variables> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/NodeCollectingVisitor.java | NodeCollectingVisitor | visitChildren | class NodeCollectingVisitor {
final public static Function<Node, Class<?>> NODE_CLASSIFIER = Node::getClass;
final private static Class<?>[] EMPTY_CLASSES = new Class<?>[0];
final private @NotNull HashMap<Class<?>, List<Class<?>>> subClassMap;
final private @NotNull HashSet<Class<?>> included;
fina... |
Node node = parent.getFirstChild();
while (node != null) {
// A subclass of this visitor might modify the node, resulting in getNext returning a different node or no
// node after visiting it. So get the next node before visiting.
Node next = node.getNext();
... | 666 | 89 | 755 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/NodeIterable.java | NodeIterable | forEach | class NodeIterable implements ReversiblePeekingIterable<Node> {
final Node firstNode;
final Node lastNode;
final boolean reversed;
public NodeIterable(Node firstNode, Node lastNode, boolean reversed) {
this.firstNode = firstNode;
this.lastNode = lastNode;
this.reversed = reverse... |
ReversibleIterator<Node> iterator = iterator();
while (iterator.hasNext()) {
consumer.accept(iterator.next());
}
| 486 | 41 | 527 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/NodeIterator.java | NodeIterator | next | class NodeIterator implements ReversiblePeekingIterator<Node> {
final Node firstNode;
final Node lastNode;
final boolean reversed;
Node node;
Node result;
/**
* @param firstNode node from which to start the iteration and continue until all sibling nodes have been traversed
*/
publ... |
result = null;
if (node == null) {
throw new NoSuchElementException();
}
result = node;
node = reversed ? node.getPrevious() : node.getNext();
if (node == null || result == (reversed ? firstNode : lastNode)) node = null;
return result;
| 1,025 | 86 | 1,111 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/NodeRepository.java | NodeRepository | transferReferences | class NodeRepository<T> implements Map<String, T> {
protected final ArrayList<T> nodeList = new ArrayList<>();
protected final Map<String, T> nodeMap = new HashMap<>();
protected final KeepType keepType;
public abstract @NotNull DataKey<? extends NodeRepository<T>> getDataKey();
public abstract @No... |
// copy references but only if they are not defined in the original document
boolean transferred = false;
for (Map.Entry<String, T> entry : included.entrySet()) {
String key = entry.getKey();
// map as requested
if (referenceIdMap != null) referenceIdMap.get... | 1,108 | 136 | 1,244 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/NodeVisitorBase.java | NodeVisitorBase | visitChildren | class NodeVisitorBase {
protected abstract void visit(@NotNull Node node);
public void visitChildren(@NotNull Node parent) {<FILL_FUNCTION_BODY>}
} |
Node node = parent.getFirstChild();
while (node != null) {
// A subclass of this visitor might modify the node, resulting in getNext returning a different node or no
// node after visiting it. So get the next node before visiting.
Node next = node.getNext();
... | 45 | 89 | 134 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-ast/src/main/java/com/vladsch/flexmark/util/ast/TextCollectingVisitor.java | TextCollectingVisitor | processNode | class TextCollectingVisitor {
final private NodeVisitor myVisitor;
SpaceInsertingSequenceBuilder out;
int flags; // flags defined by TextContainer
public TextCollectingVisitor() {
myVisitor = new NodeVisitor() {
@Override
public void processNode(@NotNull Node node, bool... |
if (!node.isOrDescendantOfType(DoNotCollectText.class)) {
out.setLastNode(node);
if (node instanceof Block && out.isNotEmpty()) {
out.appendEol();
}
if (node instanceof TextContainer) {
... | 370 | 210 | 580 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-builder/src/main/java/com/vladsch/flexmark/util/builder/BuilderBase.java | BuilderBase | addExtensionApiPoint | class BuilderBase<T extends BuilderBase<T>> extends MutableDataSet {
// loaded extensions
final private HashSet<Class<?>> loadedExtensions = new HashSet<>();
// map of which api points were loaded by which extensions
final private HashMap<Class<?>, HashSet<Object>> extensionApiPoints = new HashMap<>()... |
Extension extension = currentExtension;
if (extension != null) {
Class<? extends Extension> extensionClass = extension.getClass();
HashSet<Object> apiPoints = extensionApiPoints.computeIfAbsent(extensionClass, k -> new HashSet<>());
apiPoints.add(apiPoint);
... | 1,300 | 81 | 1,381 | <methods>public void <init>() ,public void <init>(@Nullable DataHolder) ,public @NotNull MutableDataSet clear() ,public @Nullable Object getOrCompute(@NotNull DataKeyBase<?>, @NotNull DataValueFactory<?>) ,public static transient com.vladsch.flexmark.util.data.MutableDataSet merge(com.vladsch.flexmark.util.data.DataHol... |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/BoundedMaxAggregator.java | BoundedMaxAggregator | apply | class BoundedMaxAggregator implements BiFunction<Integer, Integer, Integer> {
final public int maxBound;
public BoundedMaxAggregator(int maxBound) {
this.maxBound = maxBound;
}
@Override
public Integer apply(@Nullable Integer aggregate, @Nullable Integer next) {<FILL_FUNCTION_BODY>}
} |
if (next != null && next < maxBound) return MaxAggregator.INSTANCE.apply(aggregate, next);
else return aggregate;
| 89 | 39 | 128 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/BoundedMinAggregator.java | BoundedMinAggregator | apply | class BoundedMinAggregator implements BiFunction<Integer, Integer, Integer> {
final public int minBound;
public BoundedMinAggregator(int minBound) {
this.minBound = minBound;
}
@Override
public Integer apply(@Nullable Integer aggregate, @Nullable Integer next) {<FILL_FUNCTION_BODY>}
} |
if (next != null && next > minBound) return MinAggregator.INSTANCE.apply(aggregate, next);
else return aggregate;
| 89 | 39 | 128 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/ClassificationBag.java | ClassificationBag | categoriesBitSet | class ClassificationBag<K, V> {
final private @NotNull OrderedSet<V> items;
final @NotNull IndexedItemBitSetMap<K, V> bag;
final @Nullable CollectionHost<V> host;
public ClassificationBag(Function<V, K> mapper) {
this(0, mapper);
}
public ClassificationBag(@NotNull Function<V, K> mappe... |
BitSet bitSet = new BitSet();
for (K category : categories) {
BitSet bitSet1 = bag.get(category);
if (bitSet1 != null) {
bitSet.or(bitSet1);
}
}
return bitSet;
| 1,684 | 73 | 1,757 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/CopyOnWriteRef.java | CopyOnWriteRef | getMutable | class CopyOnWriteRef<T> {
private @Nullable T value;
private int referenceCount;
final private @NotNull Function<T, T> copyFunction;
public CopyOnWriteRef(@Nullable T value, @NotNull Function<T, T> copyFunction) {
this.value = value;
referenceCount = 0;
this.copyFunction = copyF... |
if (referenceCount > 0) {
value = copyFunction.apply(value);
referenceCount = 0;
}
return value;
| 229 | 39 | 268 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/IndexedItemSetMapBase.java | IndexedItemSetMapBase | containsItem | class IndexedItemSetMapBase<K, S, M> implements IndexedItemSetMap<K, S, M> {
protected final HashMap<K, S> bag;
public IndexedItemSetMapBase() {
this(0);
}
public IndexedItemSetMapBase(int capacity) {
this.bag = new HashMap<>();
}
@Override
public abstract @NotNull K mapKe... |
K mapKey = mapKey(key);
S itemSet = bag.get(mapKey);
return itemSet != null && containsSetItem(itemSet, item);
| 726 | 45 | 771 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/ItemFactoryMap.java | ItemFactoryMap | getItem | class ItemFactoryMap<I, P> implements Map<Function<P, I>, I> {
protected final HashMap<Function<P, I>, I> itemMap;
protected final @NotNull P param;
public ItemFactoryMap(@NotNull P param) {
this(param, 0);
}
public ItemFactoryMap(@NotNull P param, int capacity) {
this.itemMap = ne... |
I item = itemMap.get(factory);
if (item == null) {
item = factory.apply(param);
itemMap.put(factory, item);
}
return item;
| 516 | 53 | 569 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/MapEntry.java | MapEntry | equals | class MapEntry<K, V> implements Map.Entry<K, V> {
final private @NotNull K key;
final private @Nullable V value;
public MapEntry(@NotNull K key, @Nullable V value) {
this.key = key;
this.value = value;
}
@Override
public @NotNull K getKey() {
return key;
}
@Ove... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MapEntry<?, ?> entry = (MapEntry<?, ?>) o;
if (!Objects.equals(key, entry.key)) return false;
return Objects.equals(value, entry.value);
| 234 | 88 | 322 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/MaxAggregator.java | MaxAggregator | apply | class MaxAggregator implements BiFunction<Integer, Integer, Integer> {
final public static MaxAggregator INSTANCE = new MaxAggregator();
private MaxAggregator() {
}
@Override
public @Nullable Integer apply(@Nullable Integer aggregate, @Nullable Integer next) {<FILL_FUNCTION_BODY>}
} |
return next == null || aggregate != null && aggregate >= next ? aggregate : next;
| 82 | 23 | 105 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/MinAggregator.java | MinAggregator | apply | class MinAggregator implements BiFunction<Integer, Integer, Integer> {
final public static MinAggregator INSTANCE = new MinAggregator();
private MinAggregator() {
}
@Override
public @Nullable Integer apply(@Nullable Integer aggregate, @Nullable Integer next) {<FILL_FUNCTION_BODY>}
} |
return next == null || aggregate != null && aggregate <= next ? aggregate : next;
| 82 | 23 | 105 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/SubClassingBag.java | SubClassingBag | typeBitSet | class SubClassingBag<T> {
final private @NotNull ClassificationBag<Class<?>, T> items;
final private @NotNull HashMap<Class<?>, BitSet> subClassMap;
public SubClassingBag(@NotNull ClassificationBag<Class<?>, T> items, HashMap<Class<?>, @NotNull List<Class<?>>> subClassMap) {
this.items = items;
... |
BitSet bitSet = new BitSet();
for (Class<?> category : categories) {
if (xClass.isAssignableFrom(category) && subClassMap.containsKey(category)) {
bitSet.or(subClassMap.get(category));
}
}
return bitSet;
| 829 | 80 | 909 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/iteration/ArrayIterable.java | MyIterator | hasNext | class MyIterator<E> implements ReversibleIterator<E> {
final private E[] array;
final private int startIndex;
final private int endIndex;
final private boolean isReversed;
private int index;
public MyIterator(E[] array, int startIndex, int endIndex, boolean isReversed) {... |
return isReversed ? index >= startIndex : index < endIndex;
| 230 | 21 | 251 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/iteration/BitSetIterator.java | BitSetIterator | next | class BitSetIterator implements ReversibleIterator<Integer> {
final private @NotNull BitSet bitSet;
final private boolean reversed;
private int next;
private int last;
public BitSetIterator(@NotNull BitSet bitSet) {
this(bitSet, false);
}
public BitSetIterator(@NotNull BitSet bitSe... |
if (next == -1)
throw new NoSuchElementException();
last = next;
next = reversed ? (next == 0 ? -1 : bitSet.previousSetBit(next - 1)) : bitSet.nextSetBit(next + 1);
return last;
| 312 | 72 | 384 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/iteration/IndexedItemIterator.java | IndexedItemIterator | next | class IndexedItemIterator<R> implements ReversibleIndexedIterator<R> {
final private Indexed<R> items;
final private boolean reversed;
private int next;
private int last;
private int modificationCount;
public IndexedItemIterator(@NotNull Indexed<R> items) {
this(items, false);
}
... |
if (modificationCount != items.modificationCount()) {
throw new ConcurrentModificationException();
}
if (next == -1) {
throw new NoSuchElementException();
}
last = next;
next = reversed ? (next <= 0 ? -1 : next - 1) : next == items.size() - 1 ? ... | 455 | 109 | 564 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/iteration/IndexedIterator.java | IndexedIterator | remove | class IndexedIterator<R, S, I extends ReversibleIterator<Integer>> implements ReversibleIndexedIterator<R> {
final private I iterator;
final private Indexed<S> items;
private int lastIndex;
private int modificationCount;
public IndexedIterator(@NotNull Indexed<S> items, @NotNull I iterator) {
... |
if (lastIndex == -1) {
throw new NoSuchElementException();
}
if (modificationCount != items.modificationCount()) {
throw new ConcurrentModificationException();
}
items.removeAt(lastIndex);
lastIndex = -1;
modificationCount = items.modifi... | 375 | 86 | 461 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-collection/src/main/java/com/vladsch/flexmark/util/collection/iteration/Reverse.java | ReversedListIterator | next | class ReversedListIterator<T> implements ReversibleIterator<T> {
final private @NotNull List<T> list;
final private boolean isReversed;
private int index;
ReversedListIterator(@NotNull List<T> list, boolean isReversed) {
this.list = list;
this.isReversed = isReve... |
T t = list.get(index);
if (index != -1) {
if (isReversed) {
index--;
} else {
if (index == list.size() - 1) {
index = -1;
} else {
index++;
... | 250 | 92 | 342 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-data/src/main/java/com/vladsch/flexmark/util/data/DataKey.java | DataKey | toString | class DataKey<T> extends DataKeyBase<T> {
/**
* Creates a DataKey with non-null data value and factory
* <p>
* Use this constructor to ensure that factory is never called with null data holder value
*
* @param name See {@link #getName()}.
* @param defaultValue default to use wh... |
// factory applied to null in constructor, no sense doing it again here
T defaultValue = getDefaultValue();
return "DataKey<" + defaultValue.getClass().getSimpleName() + "> " + getName();
| 672 | 56 | 728 | <methods>public void <init>(@NotNull String, T, @NotNull DataValueFactory<T>) ,public void <init>(@NotNull String, @NotNull DataKeyBase<T>) ,public void <init>(@NotNull String, T) ,public final boolean equals(java.lang.Object) ,public T get(@Nullable DataHolder) ,public T getDefaultValue() ,public T getDefaultValue(@No... |
vsch_flexmark-java | flexmark-java/flexmark-util-data/src/main/java/com/vladsch/flexmark/util/data/DataKeyBase.java | DataKeyBase | toString | class DataKeyBase<T> implements MutableDataValueSetter<T> {
final private @NotNull String name;
final private @NotNull DataValueFactory<T> factory;
final private T defaultValue;
/**
* Creates a NullableDataKey with a computed default value and a provided default value when data holder is null.
... |
if (defaultValue != null) {
return "NullableDataKey<" + defaultValue.getClass().getSimpleName() + "> " + name;
} else {
return "NullableDataKey<unknown> " + name;
}
| 735 | 63 | 798 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-data/src/main/java/com/vladsch/flexmark/util/data/DataSet.java | DataSet | registerDataKeyAggregator | class DataSet implements DataHolder {
protected final HashMap<DataKeyBase<?>, Object> dataSet;
public DataSet() {
this(null);
}
public DataSet(@Nullable DataHolder other) {
if (other == null) dataSet = new HashMap<>();
else dataSet = new HashMap<>(other.getAll());
}
/*... |
if (isAggregatorRegistered(keyAggregator)) {
throw new IllegalStateException("Aggregator " + keyAggregator + " is already registered");
}
// find where in the list it should go so that all combiners
for (int i = 0; i < ourDataKeyAggregators.size(); i++) {
DataKe... | 1,243 | 240 | 1,483 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-data/src/main/java/com/vladsch/flexmark/util/data/MutableDataSet.java | MutableDataSet | merge | class MutableDataSet extends DataSet implements MutableDataHolder {
public MutableDataSet() {
super();
}
public MutableDataSet(@Nullable DataHolder other) {
super(other);
}
@NotNull
@Override
public <T> MutableDataSet set(@NotNull DataKey<T> key, @NotNull T value) {
... |
MutableDataSet dataSet = new MutableDataSet();
for (DataHolder dataHolder : dataHolders) {
if (dataHolder != null) {
dataSet.dataSet.putAll(dataHolder.getAll());
}
}
return dataSet;
| 649 | 73 | 722 | <methods>public void <init>() ,public void <init>(@Nullable DataHolder) ,public @NotNull DataHolder aggregate() ,public static @NotNull DataHolder aggregate(@Nullable DataHolder, @Nullable DataHolder) ,public static @NotNull DataHolder aggregateActions(@NotNull DataHolder, @NotNull DataHolder) ,public boolean contains(... |
vsch_flexmark-java | flexmark-java/flexmark-util-data/src/main/java/com/vladsch/flexmark/util/data/MutableScopedDataSet.java | MutableScopedDataSet | getKeys | class MutableScopedDataSet extends MutableDataSet {
protected final DataHolder parent;
public MutableScopedDataSet(DataHolder parent) {
super();
this.parent = parent;
}
public MutableScopedDataSet(DataHolder parent, MutableDataHolder other) {
super(other);
this.parent =... |
if (parent != null) {
ArrayList<DataKeyBase<?>> all = new ArrayList<>(super.getKeys());
for (DataKeyBase<?> key : parent.getKeys()) {
if (!contains(key)) {
all.add(key);
}
}
return all;
} else {
... | 427 | 97 | 524 | <methods>public void <init>() ,public void <init>(@Nullable DataHolder) ,public @NotNull MutableDataSet clear() ,public @Nullable Object getOrCompute(@NotNull DataKeyBase<?>, @NotNull DataValueFactory<?>) ,public static transient com.vladsch.flexmark.util.data.MutableDataSet merge(com.vladsch.flexmark.util.data.DataHol... |
vsch_flexmark-java | flexmark-java/flexmark-util-data/src/main/java/com/vladsch/flexmark/util/data/NullableDataKey.java | NullableDataKey | toString | class NullableDataKey<T> extends DataKeyBase<T> {
/**
* Creates a DataKey with nullable data value and factory with non-nullable dataHolder
* <p>
* Use this constructor to ensure that factory is never called with null data holder value
*
* @param name See {@link #getName()}.
* ... |
// factory applied to null in constructor, no sense doing it again here
T defaultValue = getDefaultValue();
if (defaultValue != null) {
return "DataKey<" + defaultValue.getClass().getSimpleName() + "> " + getName();
} else {
return "DataKey<null> " + getName();
... | 837 | 89 | 926 | <methods>public void <init>(@NotNull String, T, @NotNull DataValueFactory<T>) ,public void <init>(@NotNull String, @NotNull DataKeyBase<T>) ,public void <init>(@NotNull String, T) ,public final boolean equals(java.lang.Object) ,public T get(@Nullable DataHolder) ,public T getDefaultValue() ,public T getDefaultValue(@No... |
vsch_flexmark-java | flexmark-java/flexmark-util-data/src/main/java/com/vladsch/flexmark/util/data/ScopedDataSet.java | ScopedDataSet | getKeys | class ScopedDataSet extends DataSet {
protected final DataHolder parent;
public ScopedDataSet(@Nullable DataHolder parent) {
super();
this.parent = parent;
}
public ScopedDataSet(@Nullable DataHolder parent, @Nullable DataHolder other) {
super(other);
this.parent = pare... |
if (parent != null) {
HashSet<DataKeyBase<?>> all = new HashSet<>(parent.getKeys());
all.addAll(super.getKeys());
return all;
} else {
return super.getKeys();
}
| 471 | 69 | 540 | <methods>public void <init>() ,public void <init>(@Nullable DataHolder) ,public @NotNull DataHolder aggregate() ,public static @NotNull DataHolder aggregate(@Nullable DataHolder, @Nullable DataHolder) ,public static @NotNull DataHolder aggregateActions(@NotNull DataHolder, @NotNull DataHolder) ,public boolean contains(... |
vsch_flexmark-java | flexmark-java/flexmark-util-dependency/src/main/java/com/vladsch/flexmark/util/dependency/DependencyHandler.java | DependencyHandler | resolveDependencies | class DependencyHandler<D extends Dependent, S, R extends ResolvedDependencies<S>> {
protected abstract @NotNull S createStage(List<D> dependents);
protected abstract @NotNull Class getDependentClass(D dependent);
protected abstract @NotNull R createResolvedDependencies(List<S> stages);
public R resolv... |
if (dependentsList.size() == 0) {
//noinspection unchecked
return createResolvedDependencies((List<S>) Collections.EMPTY_LIST);
} else if (dependentsList.size() == 1) {
D dependent = dependentsList.get(0);
List<D> dependents = Collections.singletonList(de... | 144 | 1,252 | 1,396 | <no_super_class> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.