public abstract class

ChanMarkup

extends Object
java.lang.Object
   ↳ chan.content.ChanMarkup

Summary

Fields
public static final int TAG_ASCII_ART Ascii art tag constant value.
public static final int TAG_BOLD Bold tag constant value.
public static final int TAG_CODE Code tag constant value.
public static final int TAG_HEADING Code tag constant value.
public static final int TAG_ITALIC Italic tag constant value.
public static final int TAG_OVERLINE Overline tag constant value.
public static final int TAG_QUOTE Quote tag constant value.
public static final int TAG_SPOILER Spoiler tag constant value.
public static final int TAG_STRIKE Strikethrough tag constant value.
public static final int TAG_SUBSCRIPT Subscript tag constant value.
public static final int TAG_SUPERSCRIPT Superscript tag constant value.
public static final int TAG_UNDERLINE Underline tag constant value.
Public Constructors
ChanMarkup()
Public Methods
void addBlock(String tagName, String cssClass, boolean block, boolean spaced)

Marks given tagName as block tag if tag contains cssClass in class attribute.

void addBlock(String tagName, boolean block, boolean spaced)

Marks given tagName as block tag.

void addBlock(String tagName, String attribute, String value, boolean block, boolean spaced)

Marks given tagName as block tag if tag contains attribute that exactly equals value.

void addColorable(String tagName, String cssClass)

Marks given tagName as tag that may contain color attribute or CSS style if tag contains cssClass in class attribute.

void addColorable(String tagName)

Marks given tagName as tag that may contain color attribute or CSS style.

void addColorable(String tagName, String attribute, String value)

Marks given tagName as tag that may contain color attribute or CSS style if tag contains attribute that exactly equals value.

void addPreformatted(String tagName, String attribute, String value, boolean preformatted)

Marks given tagName as preformatted if tag contains attribute that exactly equals value.

void addPreformatted(String tagName, String cssClass, boolean preformatted)

Marks given tagName as preformatted if tag contains cssClass in class attribute.

void addPreformatted(String tagName, boolean preformatted)

Marks given tagName as preformatted.

void addTag(String tagName, String attribute, String value, int tag)

Add tag to handle.

void addTag(String tagName, int tag)

Add tag to handle.

void addTag(String tagName, String cssClass, int tag)

Add tag to handle.

static <T extends ChanMarkup> T get(Object object)

Return linked ChanMarkup instance.

boolean isTagSupported(String boardName, int tag)

Calls when client want to determine tag's supportability.

CommentEditor obtainCommentEditor(String boardName)

Calls when client want to show posting activity.

Pair<String, String> obtainPostLinkThreadPostNumbers(String uriString)

This method calls every time HTML parser reaches links to other posts like >>12345678.

[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final int TAG_ASCII_ART

Ascii art tag constant value.

public static final int TAG_BOLD

Bold tag constant value.

public static final int TAG_CODE

Code tag constant value.

public static final int TAG_HEADING

Code tag constant value.

public static final int TAG_ITALIC

Italic tag constant value.

public static final int TAG_OVERLINE

Overline tag constant value.

public static final int TAG_QUOTE

Quote tag constant value.

public static final int TAG_SPOILER

Spoiler tag constant value.

public static final int TAG_STRIKE

Strikethrough tag constant value.

public static final int TAG_SUBSCRIPT

Subscript tag constant value.

public static final int TAG_SUPERSCRIPT

Superscript tag constant value.

public static final int TAG_UNDERLINE

Underline tag constant value.

Public Constructors

public ChanMarkup ()

Public Methods

public void addBlock (String tagName, String cssClass, boolean block, boolean spaced)

Marks given tagName as block tag if tag contains cssClass in class attribute. For spaced blocks parser will add empty lines around.

Parameters
tagName String: Tag to handle.
cssClass String: Tag CSS class.
block boolean: True to enable block tag.
spaced boolean: True to enable spacing.

public void addBlock (String tagName, boolean block, boolean spaced)

Marks given tagName as block tag. For spaced blocks parser will add empty lines around.

Parameters
tagName String: Tag to handle.
block boolean: True to enable block tag.
spaced boolean: True to enable spacing.

public void addBlock (String tagName, String attribute, String value, boolean block, boolean spaced)

Marks given tagName as block tag if tag contains attribute that exactly equals value. For spaced blocks parser will add empty lines around.

Parameters
tagName String: Tag to handle.
attribute String: Tag attribute.
value String: Attribute value.
block boolean: True to enable block tag.
spaced boolean: True to enable spacing.

public void addColorable (String tagName, String cssClass)

Marks given tagName as tag that may contain color attribute or CSS style if tag contains cssClass in class attribute. Parser will handle these cases automatically.

Parameters
tagName String: Tag to handle.
cssClass String: Tag CSS class.

public void addColorable (String tagName)

Marks given tagName as tag that may contain color attribute or CSS style. Parser will handle these cases automatically.

Parameters
tagName String: Tag to handle.

public void addColorable (String tagName, String attribute, String value)

Marks given tagName as tag that may contain color attribute or CSS style if tag contains attribute that exactly equals value. Parser will handle these cases automatically.

Parameters
tagName String: Tag to handle.
attribute String: Tag attribute.
value String: Attribute value.

public void addPreformatted (String tagName, String attribute, String value, boolean preformatted)

Marks given tagName as preformatted if tag contains attribute that exactly equals value. In this mode all tabs, spaces and line breaks will be taken into account.

Parameters
tagName String: Tag to handle.
attribute String: Tag attribute.
value String: Attribute value.
preformatted boolean: True to enable preformatted tag.

public void addPreformatted (String tagName, String cssClass, boolean preformatted)

Marks given tagName as preformatted if tag contains cssClass in class attribute. In this mode all tabs, spaces and line breaks will be taken into account.

Parameters
tagName String: Tag to handle.
cssClass String: Tag CSS class.
preformatted boolean: True to enable preformatted tag.

public void addPreformatted (String tagName, boolean preformatted)

Marks given tagName as preformatted. In this mode all tabs, spaces and line breaks will be taken into account.

Parameters
tagName String: Tag to handle.
preformatted boolean: True to enable preformatted tag.

public void addTag (String tagName, String attribute, String value, int tag)

Add tag to handle. Given tagName will be replaced with span defined by spanType if tag contains attribute that exactly equals value.

Parameters
tagName String: Tag to handle.
attribute String: Tag attribute.
value String: Attribute value.
tag int: Tag type.

public void addTag (String tagName, int tag)

Add tag to handle. Given tagName will be replaced with span defined by tag.

Parameters
tagName String: Tag to handle.
tag int: Tag type.

public void addTag (String tagName, String cssClass, int tag)

Add tag to handle. Given tagName will be replaced with span defined by tag if tag contains cssClass in class attribute.

Parameters
tagName String: Tag to handle.
cssClass String: Tag CSS class.
tag int: Tag type.

public static T get (Object object)

Return linked ChanMarkup instance.

Parameters
object Object: Linked object: ChanConfiguration, ChanPerformer, ChanLocator or ChanMarkup.
Returns
T ChanMarkup instance.

public boolean isTagSupported (String boardName, int tag)

Calls when client want to determine tag's supportability. This method must return whether board support given tag.

Parameters
boardName String: Board name to check.
tag int: Tag to check.
Returns
boolean True if tag is supported, false otherwise.

public CommentEditor obtainCommentEditor (String boardName)

Calls when client want to show posting activity.

Parameters
boardName String: Board name string.
Returns
CommentEditor CommentEditor instance.

public Pair<String, String> obtainPostLinkThreadPostNumbers (String uriString)

This method calls every time HTML parser reaches links to other posts like >>12345678.

You can leave this method not overridden, but overriding can make this method much faster and more correct in some cases.

You must return a Pair of strings where the first string is thread number and the second string is post number. You can return both values as null: null thread number means this thread, null post number means original post.

Parameters
uriString String: Parsed URI string.
Returns
Pair<String, String> Pair of strings.