Top Description Fields Constructors Methods
org.joda.money.format

pack-priv final Class LiteralPrinterParser

extends Object
implements MoneyPrinter, MoneyParser, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.joda.money.format.MoneyParser, org.joda.money.format.MoneyPrinter
Imports
java.io.IOException, .Serializable, org.joda.money.BigMoney

Prints and parses a literal.

This class is immutable and thread-safe.

Field Summary

Modifier and TypeField and Description
private final String
literal

Literal.

private static final long
serialVersionUID

Serialization version.

Constructor Summary

AccessConstructor and Description
pack-priv
LiteralPrinterParser(String
the literal text, not null
literal
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
parse(MoneyParseContext
the context to use and parse into, not null
context
)

Implements org.joda.money.format.MoneyParser.parse.

Parses monetary information using a textual representation.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

literalback to summary
private final String literal

Literal.

serialVersionUIDback to summary
private static final long serialVersionUID

Serialization version.

Constructor Detail

LiteralPrinterParserback to summary
pack-priv LiteralPrinterParser(String literal)

Constructor.

Parameters
literal:String

the literal text, not null

Method Detail

parseback to summary
public void parse(MoneyParseContext context)

Implements org.joda.money.format.MoneyParser.parse.

Doc from org.joda.money.format.MoneyParser.parse.

Parses monetary information using a textual representation.

The text and parse index are stored in the context. The parsed data and updated index is also stored in the context.

Implementations should avoid throwing exceptions and use the error index in the context instead to record the problem. The context can be assumed to not be in error on entry to this method.

The context is not a thread-safe object and a new instance will be created for each parse. The context must not be stored in an instance variable or shared with any other threads.

Parameters
context:MoneyParseContext

the context to use and parse into, not null

Annotations
@Override
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.

Returns:String

a string representation of the object

Annotations
@Override