package net.sourceforge.jaxor.example.domain;
import net.sourceforge.jaxor.example.Money;
/**
* This source file demonstrates the 'impl' attribute of a generated entity. When the 'impl' attribute is specified on an entity
* jaxor generates an abstract base class. The impl attribute specifies the concreate implementation of this abstract class.
* This class is coded by hand, so it can extend the base abstract class with domain specific methods, as demonstrated here. Any
* methods added to the 'impl' class will be parsed during build time and added to the interface definitions automatically.
*/
public class OrderImpl extends OrdersBase {
public Money getOrderTotal() {
return getEquipmentCost().add(getSalesTax().add(getShippingCharge()));
}
public Money subtractFromTotal(Money amount) {
return getOrderTotal().subtract(amount);
}
}
|