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

com.aventstack.extentreports.markuputils.CodeBlock Maven / Gradle / Ivy

package com.aventstack.extentreports.markuputils;

import java.util.concurrent.atomic.AtomicInteger;

class CodeBlock implements Markup {
    
    private static final AtomicInteger id = new AtomicInteger(0);

    private String code;
    private CodeLanguage lang;
    
    public void setCodeBlock(String code) {
        this.code = code;
    }
    public String getCodeBlock() {
        return code;
    }

    public void setCodeBlock(String code, CodeLanguage lang) {
        this.code = code;
        this.lang = lang;
    }
    
    @Override
    public String getMarkup() {
        if (lang == CodeLanguage.JSON) {
            int index = id.getAndIncrement();
            String markup = "
" + ""; return markup; } String lhs = ""; return lhs + code + rhs; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy