Top Description Fields Constructors Methods
org.javamoney.moneta.spi.format

pack-priv final Class LiteralToken

extends Object
implements FormatToken, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.javamoney.moneta.spi.format.FormatToken
Imports
java.io.IOException, .Serializable, javax.money.MonetaryAmount, javax.money.format.MonetaryParseException

FormatToken which adds an arbitrary literal constant value to the output.

This class is thread safe, immutable and serializable.

Authors
Anatole Tresch, Werner Keil

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

serialVersionUID.

private final String
token

The literal part.

Constructor Summary

AccessConstructor and Description
pack-priv
LiteralToken(String
The literal token part.
token
)

Creates a new LiteralToken.

Method Summary

Modifier and TypeMethod and Description
public void
parse(ParseContext context)

Implements org.javamoney.moneta.spi.format.FormatToken.parse.

Parses the literal from the current ParseContext.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

serialVersionUID.

tokenback to summary
private final String token

The literal part.

Constructor Detail

LiteralTokenback to summary
pack-priv LiteralToken(String token)

Creates a new LiteralToken.

Parameters
token:String

The literal token part.

Method Detail

parseback to summary
public void parse(ParseContext context) throws MonetaryParseException

Implements org.javamoney.moneta.spi.format.FormatToken.parse.

Parses the literal from the current ParseContext.

Annotations
@Override
Exceptions
MonetaryParseException:

Doc from org.javamoney.moneta.spi.format.FormatToken.parse.

if parsing fails.

See Also
FormatToken#parse(ParseContext)
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