com.vladsch.flexmark.superscript.Superscript Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of flexmark-ext-superscript Show documentation
Show all versions of flexmark-ext-superscript Show documentation
flexmark-java extension for superscript
package com.vladsch.flexmark.superscript;
import com.vladsch.flexmark.ast.CustomNode;
import com.vladsch.flexmark.ast.DelimitedNode;
import com.vladsch.flexmark.ast.DoNotDecorate;
import com.vladsch.flexmark.util.sequence.BasedSequence;
/**
* A Superscript node
*/
public class Superscript extends CustomNode implements DelimitedNode {
protected BasedSequence openingMarker = BasedSequence.NULL;
protected BasedSequence text = BasedSequence.NULL;
protected BasedSequence closingMarker = BasedSequence.NULL;
protected String superscriptBlockText;
@Override
public BasedSequence[] getSegments() {
//return EMPTY_SEGMENTS;
return new BasedSequence[] { openingMarker, text, closingMarker };
}
@Override
public void getAstExtra(StringBuilder out) {
delimitedSegmentSpanChars(out, openingMarker, text, closingMarker, "text");
}
public Superscript() {
}
public Superscript(BasedSequence chars) {
super(chars);
}
public Superscript(BasedSequence openingMarker, BasedSequence text, BasedSequence closingMarker) {
super(openingMarker.baseSubSequence(openingMarker.getStartOffset(), closingMarker.getEndOffset()));
this.openingMarker = openingMarker;
this.text = text;
this.closingMarker = closingMarker;
}
public Superscript(BasedSequence chars, String superscriptBlockText) {
super(chars);
this.superscriptBlockText = superscriptBlockText;
}
public BasedSequence getOpeningMarker() {
return openingMarker;
}
public void setOpeningMarker(BasedSequence openingMarker) {
this.openingMarker = openingMarker;
}
public BasedSequence getText() {
return text;
}
public void setText(BasedSequence text) {
this.text = text;
}
public BasedSequence getClosingMarker() {
return closingMarker;
}
public void setClosingMarker(BasedSequence closingMarker) {
this.closingMarker = closingMarker;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy