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

pack-priv final Class AmountPrinterParser

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.math.BigDecimal, org.joda.money.BigMoney

Prints and parses the amount part of the money.

This class is immutable and thread-safe.

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

Serialization version.

private final MoneyAmountStyle
style

The style to use.

Constructor Summary

AccessConstructor and Description
pack-priv
AmountPrinterParser(MoneyAmountStyle
the style, not null
style
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private boolean
isPostGroupingPoint(int i, int post, int groupingSize, int extendedGroupingSize)

private boolean
isPreGroupingPoint(int remaining, int groupingSize, int extendedGroupingSize)

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

serialVersionUIDback to summary
private static final long serialVersionUID

Serialization version.

styleback to summary
private final MoneyAmountStyle style

The style to use.

Constructor Detail

AmountPrinterParserback to summary
pack-priv AmountPrinterParser(MoneyAmountStyle style)

Constructor.

Parameters
style:MoneyAmountStyle

the style, not null

Method Detail

isPostGroupingPointback to summary
private boolean isPostGroupingPoint(int i, int post, int groupingSize, int extendedGroupingSize)
isPreGroupingPointback to summary
private boolean isPreGroupingPoint(int remaining, int groupingSize, int extendedGroupingSize)
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