01: /*
02: * $Id: RuntimePropsImpl.java,v 1.2 2007/03/12 10:46:14 agoubard Exp $
03: */
04: package com.mycompany.allinone.api;
05:
06: /**
07: * Implementation of the <code>RuntimeProps</code> function.
08: *
09: * @version $Revision: 1.2 $ $Date: 2007/03/12 10:46:14 $
10: * @author John Doe (<a href="mailto:john.doe@mycompany.com">john.doe@mycompany.com</a>)
11: */
12: public class RuntimePropsImpl extends RuntimeProps {
13:
14: /**
15: * Constructs a new <code>RuntimePropsImpl</code> instance.
16: *
17: * @param api
18: * the API to which this function belongs, guaranteed to be not
19: * <code>null</code>.
20: */
21: public RuntimePropsImpl(APIImpl api) {
22: super (api);
23: }
24:
25: public final Result call(Request request) throws Throwable {
26: RuntimeProperties props = (RuntimeProperties) getAPI()
27: .getProperties();
28: SuccessfulResult result = new SuccessfulResult();
29: result.setTaxes(props.getAllinoneRate() * request.getPrice());
30: if (props.getCurrency() != null) {
31: result.setCurrency(props.getCurrency());
32: }
33: return result;
34: }
35: }
|