com.atlassian.renderer
Enum TokenType

java.lang.Object
  extended by java.lang.Enum<TokenType>
      extended by com.atlassian.renderer.TokenType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TokenType>

public enum TokenType
extends java.lang.Enum<TokenType>

Represents the different types of token that are used in the RenderedContentStore when rendering wiki markup to html.


Enum Constant Summary
BLOCK
          Block tokens are used for block elements such as paragraphs, divs, tables and pre blocks.
INLINE
          Inline tokens are used for inline content such as plain text, spans, images, bold tags, and links.
INLINE_BLOCK
          Similar (but not identical) to the html concept of inline-block, these tokens are used for elements that have a block and inline nature, as divs can.
 
Method Summary
 Replacer getTokenDeleteReplacer()
           
 java.lang.String getTokenMarker()
          An unlikely-to-appear-in-real-text token, for use in content replacement.
 java.util.regex.Pattern getTokenPattern()
          A Pattern that can be used to find tokens of this type.
 java.lang.String getTokenPatternString()
          A String that can be used as to make Patterns to find tokens of this type.
static TokenType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TokenType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INLINE

public static final TokenType INLINE
Inline tokens are used for inline content such as plain text, spans, images, bold tags, and links.


BLOCK

public static final TokenType BLOCK
Block tokens are used for block elements such as paragraphs, divs, tables and pre blocks.


INLINE_BLOCK

public static final TokenType INLINE_BLOCK
Similar (but not identical) to the html concept of inline-block, these tokens are used for elements that have a block and inline nature, as divs can. In this case they are used for tokens that shouldn't be wrapped in a paragraph, because they can be a block, but also shouldn't break a containing paragraph in half, because they can be inline.

Method Detail

values

public static TokenType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TokenType c : TokenType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TokenType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getTokenMarker

public java.lang.String getTokenMarker()
An unlikely-to-appear-in-real-text token, for use in content replacement.


getTokenPatternString

public java.lang.String getTokenPatternString()
A String that can be used as to make Patterns to find tokens of this type. Intended for use in composing more complex patterns, since getTokenPattern() is also available.


getTokenPattern

public java.util.regex.Pattern getTokenPattern()
A Pattern that can be used to find tokens of this type.


getTokenDeleteReplacer

public Replacer getTokenDeleteReplacer()


Copyright © 2013 Atlassian. All Rights Reserved.