InvoiceDetailOidCalculator.java :  » ERP-CRM-Financial » OpenXava-3.0 » org » openxava » test » calculators » Java Open Source

Java Open Source » ERP CRM Financial » OpenXava 3.0 
OpenXava 3.0 » org » openxava » test » calculators » InvoiceDetailOidCalculator.java
package org.openxava.test.calculators;

import org.openxava.calculators.*;
import org.openxava.test.model.*;


/**
 * The container is injected using setContainer method of IAggregateOidCalculator.
 * 
 * @author Javier Paniza
 */
public class InvoiceDetailOidCalculator implements IAggregateOidCalculator {
  
  private IInvoice invoice;
  private int counter;

  public void setContainer(Object containerKey) {
    // In the case of POJO container key is the container POJO itself,
    // in the case of EJB the container key is the EJB key
    invoice = (IInvoice) containerKey;
  }

  public void setCounter(int counter) {
    this.counter = counter;
  }

  public Object calculate() throws Exception {
    return invoice.getYear() + ":" + invoice.getNumber() + ":" + counter;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.