org.openinvoice.ubl4j.util
Class UBL4JConfigurationBean

java.lang.Object
  extended by org.openinvoice.ubl4j.util.UBL4JConfigurationBean

public class UBL4JConfigurationBean
extends Object

Contains configuration properties used by UBL4J components. UBL4JConfigurationBeanBuilder creates an instance of UBL4JConfigurationBean based on the content of ubl4j.properties file.

Since:
0.2
Version:
\$Revision: 269823a876f3 $
Author:
Javad K. Heshmati
See Also:
UBL4JConfigurationBeanBuilder, ubl4j.properties

Constructor Summary
UBL4JConfigurationBean()
           
 
Method Summary
 Locale getDefaultLocale()
          Gets the default locale used for locale sensitive operations.
 WorkTimeUnit getDisplayWorkTimeUnit()
          Gets the WorkTimeUnit that is included in the printable invoice.
 String getInvoiceTermsFileName()
          Gets the file that contains the invoice terms and conditions.
 List getInvoiceTypeConstraintClassNames()
          Gets the list of constraints classes called to validate the invoice
 List getInvoiceTypeProcessUnitClassNames()
          Gets the list of process unit classes called to process the invoice
 List getOrderTypeConstraintClassNames()
          Gets the list of constraints classes called to validate the order
 List getOrderTypeProcessUnitClassNames()
          Gets the list of process unit classes called to process the order
 WorkTimeUnit getPersistenceWorkTimeUnit()
          Gets the persistenceWorkTimeUnit that is used for invoice calculation and persisted.
 BigDecimal getWorkHourPerDay()
          Gets the number of working hours in a day.
 boolean isIncludeQuantityUnitInInvoiceLine()
          Indicates weather to include the unit quantity in all invoice lines or just as a single token
 boolean isIncludeVatRateInInvoiceLine()
          Indicates weather to include the VAT rate in all invoice lines or just as a single token
 boolean isWorkTimeUnitConversionEnabled()
          Indicates weather the the conversion is performed or not.
 void setDefaultLocale(Locale defaultLocale)
          Sets the default locale to be used for locale sensitive operations.
 void setDisplayWorkTimeUnit(WorkTimeUnit displayWorkTimeUnit)
          Sets the WorkTimeUnit that is used for rendering the invoice output; by default, it's initialised based on the value of org.openinvoice.ubl4j.util.WorkTimeUnit.display.unit property.
 void setIncludeQuantityUnitInInvoiceLine(boolean includeQuantityUnitInInvoiceLine)
          Sets the flag for adding the unit code either as a field in the invoice line or as a single token.
 void setIncludeVatRateInInvoiceLine(boolean includeVatRateInInvoiceLine)
          Adding the VAT rate either as a field in the invoice line or as a single token.
 void setInvoiceTermsFileName(String invoiceTermsFileName)
          Sets the file name to be used for constructing the invoice terms and conditions.
 void setInvoiceTypeConstraintClassNames(List invoiceTypeConstraintClassNames)
          Sets the list of constraints classes called to validate the given invoice; by default, the value of the org.openinvoice.ubl4j.invoice.constraint.InvoiceTypeConstraintFactory property is used to construct the list.
 void setInvoiceTypeProcessUnitClassNames(List invoiceTypeProcessUnitClassNames)
          Sets the list of process units called to process a given invoice after it's generated; by default, the value of the org.openinvoice.ubl4j.invoice.pu.InvoiceTypeProcessUnitFactory property is used to construct the list.
 void setOrderTypeConstraintClassNames(List orderTypeConstraintClassNames)
          Sets the list of constraints classes called to validate a given order; by default, the value of the org.openinvoice.ubl4j.order.constraint.OrderTypeConstraintFactory property is used to construct the list.
 void setOrderTypeProcessUnitClassNames(List orderTypeProcessUnitClassNames)
          Sets the list of process units called to process a given order after it's un-marshaled; by default, the value of the org.openinvoice.ubl4j.order.pu.OrderTypeProcessUnitFactory property is used to construct the list.
 void setPersistenceWorkTimeUnit(WorkTimeUnit persistenceWorkTimeUnit)
          Sets the WorkTimeUnit that is used for the invoice calculation; by default, it's initialised based on the value of org.openinvoice.ubl4j.util.WorkTimeUnit.persistence.unit property.
 void setWorkHourPerDay(BigDecimal workHourPerDay)
          Sets the number of working hours in a day.
 void setWorkTimeUnitConversionEnabled(boolean workTimeUnitConversionEnabled)
          Sets the conversion on or off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UBL4JConfigurationBean

public UBL4JConfigurationBean()
Method Detail

getInvoiceTermsFileName

public String getInvoiceTermsFileName()
Gets the file that contains the invoice terms and conditions.

Returns:
invoiceTerms file

setInvoiceTermsFileName

public void setInvoiceTermsFileName(String invoiceTermsFileName)
Sets the file name to be used for constructing the invoice terms and conditions. By default, it looks for the payment-terms.properties in the current user home directory.

Parameters:
invoiceTermsFileName - the invoiceTerms file

getWorkHourPerDay

public BigDecimal getWorkHourPerDay()
Gets the number of working hours in a day.

Returns:
workHourPerDay

setWorkHourPerDay

public void setWorkHourPerDay(BigDecimal workHourPerDay)
Sets the number of working hours in a day. By default, it is set to 8 hours.

Parameters:
workHourPerDay - defines the number of hours in a working day

isWorkTimeUnitConversionEnabled

public boolean isWorkTimeUnitConversionEnabled()
Indicates weather the the conversion is performed or not.

Returns:
boolean enables or disables the conversion

setWorkTimeUnitConversionEnabled

public void setWorkTimeUnitConversionEnabled(boolean workTimeUnitConversionEnabled)
Sets the conversion on or off. If it's set to false, no conversion is done.

Parameters:
workTimeUnitConversionEnabled - enables conversion

getPersistenceWorkTimeUnit

public WorkTimeUnit getPersistenceWorkTimeUnit()
Gets the persistenceWorkTimeUnit that is used for invoice calculation and persisted.

Returns:
persistenceWorkTimeUnit used for invoice calculation

setPersistenceWorkTimeUnit

public void setPersistenceWorkTimeUnit(WorkTimeUnit persistenceWorkTimeUnit)
Sets the WorkTimeUnit that is used for the invoice calculation; by default, it's initialised based on the value of org.openinvoice.ubl4j.util.WorkTimeUnit.persistence.unit property. The time unit can be:

Parameters:
persistenceWorkTimeUnit - the time unit for invoice calculation

getDisplayWorkTimeUnit

public WorkTimeUnit getDisplayWorkTimeUnit()
Gets the WorkTimeUnit that is included in the printable invoice. Valid values are: HUR and DAY.

Returns:
displayWorkTimeUnit used for rendering the invoice output

setDisplayWorkTimeUnit

public void setDisplayWorkTimeUnit(WorkTimeUnit displayWorkTimeUnit)
Sets the WorkTimeUnit that is used for rendering the invoice output; by default, it's initialised based on the value of org.openinvoice.ubl4j.util.WorkTimeUnit.display.unit property. The time unit can be:

Parameters:
persistenceWorkTimeUnit - the time unit for invoice calculation

isIncludeQuantityUnitInInvoiceLine

public boolean isIncludeQuantityUnitInInvoiceLine()
Indicates weather to include the unit quantity in all invoice lines or just as a single token

Returns:
includeQuantityUnitInInvoiceLine

setIncludeQuantityUnitInInvoiceLine

public void setIncludeQuantityUnitInInvoiceLine(boolean includeQuantityUnitInInvoiceLine)
Sets the flag for adding the unit code either as a field in the invoice line or as a single token. It is more practical to add the unit code as a single toke when all invoice lines share the same unit code; or when there is only one invoice line

Parameters:
includeQuantityUnitInInvoiceLine - flag indicating the inclusion of the unit code in invoice lines

isIncludeVatRateInInvoiceLine

public boolean isIncludeVatRateInInvoiceLine()
Indicates weather to include the VAT rate in all invoice lines or just as a single token

Returns:
includeVatRateInInvoiceLine

setIncludeVatRateInInvoiceLine

public void setIncludeVatRateInInvoiceLine(boolean includeVatRateInInvoiceLine)
Adding the VAT rate either as a field in the invoice line or as a single token.

Parameters:
includeVatRateInInvoiceLine - flags the inclusion of VAT rate in invoice lines

getInvoiceTypeProcessUnitClassNames

public List getInvoiceTypeProcessUnitClassNames()
Gets the list of process unit classes called to process the invoice

Returns:
invoiceTypeProcessUnitClassNames

setInvoiceTypeProcessUnitClassNames

public void setInvoiceTypeProcessUnitClassNames(List invoiceTypeProcessUnitClassNames)
Sets the list of process units called to process a given invoice after it's generated; by default, the value of the org.openinvoice.ubl4j.invoice.pu.InvoiceTypeProcessUnitFactory property is used to construct the list.

Parameters:
invoiceTypeProcessUnitClassNames - list of process units

getInvoiceTypeConstraintClassNames

public List getInvoiceTypeConstraintClassNames()
Gets the list of constraints classes called to validate the invoice

Returns:
invoiceTypeConstraintClassNames

setInvoiceTypeConstraintClassNames

public void setInvoiceTypeConstraintClassNames(List invoiceTypeConstraintClassNames)
Sets the list of constraints classes called to validate the given invoice; by default, the value of the org.openinvoice.ubl4j.invoice.constraint.InvoiceTypeConstraintFactory property is used to construct the list.

Parameters:
invoiceTypeConstraintClassNames - the list of constraints

getOrderTypeProcessUnitClassNames

public List getOrderTypeProcessUnitClassNames()
Gets the list of process unit classes called to process the order

Returns:
orderTypeProcessUnitClassNames

setOrderTypeProcessUnitClassNames

public void setOrderTypeProcessUnitClassNames(List orderTypeProcessUnitClassNames)
Sets the list of process units called to process a given order after it's un-marshaled; by default, the value of the org.openinvoice.ubl4j.order.pu.OrderTypeProcessUnitFactory property is used to construct the list.

Parameters:
orderTypeProcessUnitClassNames - list of process units

getOrderTypeConstraintClassNames

public List getOrderTypeConstraintClassNames()
Gets the list of constraints classes called to validate the order

Returns:
orderTypeConstraintClassNames

setOrderTypeConstraintClassNames

public void setOrderTypeConstraintClassNames(List orderTypeConstraintClassNames)
Sets the list of constraints classes called to validate a given order; by default, the value of the org.openinvoice.ubl4j.order.constraint.OrderTypeConstraintFactory property is used to construct the list.

Parameters:
orderTypeConstraintClassNames - the list of constraints

getDefaultLocale

public Locale getDefaultLocale()
Gets the default locale used for locale sensitive operations.

Returns:
defaultLocale

setDefaultLocale

public void setDefaultLocale(Locale defaultLocale)
Sets the default locale to be used for locale sensitive operations. The invoice locale is determined based on the Language.LocaleCode and Country.IdentificationCode of the SellerSupplierParty.party in the given UBL order. For example, fr and BE selects French as the invoice language and the invoice fields formatting are done according to the Belgian locale.

Parameters:
defaultLocale - the input locale


Copyright © 2011-2012 Plain Source. All Rights Reserved.