Top Description Inners Fields Constructors Methods
de.undercouch.citeproc.csl.internal.token

public Class TextToken

extends Token
Class Inheritance
Imports
de.undercouch.citeproc.csl.internal.behavior.FormattingAttributes

A token that renders to text
Author
Michel Kraemer

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
TextToken.Type

The token's type

Field Summary

Modifier and TypeField and Description
private final String
private final TextToken.Type

Constructor Summary

AccessConstructor and Description
public
TextToken(String
the token's text
text
,
TextToken.Type
the token's type
type
)

Construct a new token

public
TextToken(String
the token's text
text
,
TextToken.Type
the token's type
type
,
int
the token's formatting attributes
formattingAttributes
)

Construct a new token

public
TextToken(String
the token's text
text
,
TextToken.Type
the token's type
type
,
int
the token's formatting attributes
formattingAttributes
,
boolean
true if the token is part of the first rendered field in a bibliography entry
firstField
)

Construct a new token

Method Summary

Modifier and TypeMethod and Description
public TextToken
copyWithFirstField(boolean firstField)

Implements abstract de.undercouch.citeproc.csl.internal.token.Token.copyWithFirstField.

Create a copy of this token but replaces its first-field flag

public TextToken

Returns:

the copied token with new text
copyWithText
(String
the new text
text
)

Create a copy of this token but replaces its text

public String

Returns:

the text
getText
()

Get the token's text

public TextToken.Type

Returns:

the type
getType
()

Get the token's type

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public Token
wrapFormattingAttributes(int otherFormattingAttributes)

Implements abstract de.undercouch.citeproc.csl.internal.token.Token.wrapFormattingAttributes.

Wrap other formatting attributes around the formatting attributes of this token and return a new token.

Inherited from de.undercouch.citeproc.csl.internal.token.Token:
getFormattingAttributesisFirstField

Field Detail

textback to summary
private final String text
typeback to summary
private final TextToken.Type type

Constructor Detail

TextTokenback to summary
public TextToken(String text, TextToken.Type type)

Construct a new token

Parameters
text:String

the token's text

type:TextToken.Type

the token's type

TextTokenback to summary
public TextToken(String text, TextToken.Type type, int formattingAttributes)

Construct a new token

Parameters
text:String

the token's text

type:TextToken.Type

the token's type

formattingAttributes:int

the token's formatting attributes

TextTokenback to summary
public TextToken(String text, TextToken.Type type, int formattingAttributes, boolean firstField)

Construct a new token

Parameters
text:String

the token's text

type:TextToken.Type

the token's type

formattingAttributes:int

the token's formatting attributes

firstField:boolean

true if the token is part of the first rendered field in a bibliography entry

Method Detail

copyWithFirstFieldback to summary
public TextToken copyWithFirstField(boolean firstField)

Implements abstract de.undercouch.citeproc.csl.internal.token.Token.copyWithFirstField.

Doc from de.undercouch.citeproc.csl.internal.token.Token.copyWithFirstField.

Create a copy of this token but replaces its first-field flag

Annotations
@Override
copyWithTextback to summary
public TextToken copyWithText(String text)

Create a copy of this token but replaces its text

Parameters
text:String

the new text

Returns:TextToken

the copied token with new text

getTextback to summary
public String getText()

Get the token's text

Returns:String

the text

getTypeback to summary
public TextToken.Type getType()

Get the token's type

Returns:TextToken.Type

the type

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
wrapFormattingAttributesback to summary
public Token wrapFormattingAttributes(int otherFormattingAttributes)

Implements abstract de.undercouch.citeproc.csl.internal.token.Token.wrapFormattingAttributes.

Doc from de.undercouch.citeproc.csl.internal.token.Token.wrapFormattingAttributes.

Wrap other formatting attributes around the formatting attributes of this token and return a new token. The formatting attributes of this token will be merged into the other attributes, so that attributes that are set in this token overwrite the other attributes.

Annotations
@Override
de.undercouch.citeproc.csl.internal.token back to summary

public final Enum TextToken.Type

extends Enum<TextToken.Type>
Class Inheritance

The token's type

Field Summary

Modifier and TypeField and Description
public static final TextToken.Type
CLOSE_QUOTE

A token that represents a closing quotation mark

public static final TextToken.Type
DELIMITER

A token that represents a delimiter

public static final TextToken.Type
DOI

A token that represents a DOI

public static final TextToken.Type
OPEN_QUOTE

A token that represents an opening quotation mark

public static final TextToken.Type
PREFIX

A token that represents a prefix

public static final TextToken.Type
SUFFIX

A token that represents a suffix

public static final TextToken.Type
TEXT

A simple text token

public static final TextToken.Type
URL

A token that represents a URL

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static TextToken.Type
public static TextToken.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CLOSE_QUOTEback to summary
public static final TextToken.Type CLOSE_QUOTE

A token that represents a closing quotation mark

DELIMITERback to summary
public static final TextToken.Type DELIMITER

A token that represents a delimiter

DOIback to summary
public static final TextToken.Type DOI

A token that represents a DOI

OPEN_QUOTEback to summary
public static final TextToken.Type OPEN_QUOTE

A token that represents an opening quotation mark

PREFIXback to summary
public static final TextToken.Type PREFIX

A token that represents a prefix

SUFFIXback to summary
public static final TextToken.Type SUFFIX

A token that represents a suffix

TEXTback to summary
public static final TextToken.Type TEXT

A simple text token

URLback to summary
public static final TextToken.Type URL

A token that represents a URL

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static TextToken.Type valueOf(String name)
valuesback to summary
public static TextToken.Type[] values()