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

pack-priv final Class MultiPrinterParser

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, java.util.Arrays, org.joda.money.BigMoney

Prints and parses multiple printers/parsers.

This class is immutable and thread-safe.

Field Summary

Modifier and TypeField and Description
private final MoneyParser[]
parsers

The parsers.

private final MoneyPrinter[]
printers

The printers.

private static final long
serialVersionUID

Serialization version.

Constructor Summary

AccessConstructor and Description
pack-priv
MultiPrinterParser(MoneyPrinter[]
the printers, not null
printers
,
MoneyParser[] parsers)

Constructor.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv boolean
pack-priv boolean
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

parsersback to summary
private final MoneyParser[] parsers

The parsers.

printersback to summary
private final MoneyPrinter[] printers

The printers.

serialVersionUIDback to summary
private static final long serialVersionUID

Serialization version.

Constructor Detail

MultiPrinterParserback to summary
pack-priv MultiPrinterParser(MoneyPrinter[] printers, MoneyParser[] parsers)

Constructor.

Parameters
printers:MoneyPrinter[]

the printers, not null

Method Detail

appendToback to summary
pack-priv void appendTo(MoneyFormatterBuilder builder)
isParserback to summary
pack-priv boolean isParser()
isPrinterback to summary
pack-priv boolean isPrinter()
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