net.sf.xbus.sample
Class Dealer

java.lang.Object
  extended by net.sf.xbus.sample.Dealer
All Implemented Interfaces:
AdditionalAddress

public class Dealer
extends java.lang.Object
implements AdditionalAddress

Specific data about dealers is stored in the standard configuration. This convience class enables an easy access.


Constructor Summary
Dealer()
           
 
Method Summary
 java.util.List getAddresses()
          Returns a list of all dealernumbers.
 java.lang.String getDealerName(java.lang.String dealernumber)
          Returns the name of the dealer.
 java.lang.String getValue(java.lang.String inValue, java.lang.String outValue, java.lang.String key)
           
 boolean hasMarker(java.lang.String text)
          Returns if the given text contains placeholders for informations on the address.
 java.lang.String replaceMarker(java.lang.String text, java.lang.String address)
          Replaces all occurences of special markers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dealer

public Dealer()
Method Detail

getAddresses

public java.util.List getAddresses()
                            throws XException
Returns a list of all dealernumbers.

Specified by:
getAddresses in interface AdditionalAddress
Returns:
list of dealernumbers
Throws:
XException - if the entry is not found or any error occurs

hasMarker

public boolean hasMarker(java.lang.String text)
Returns if the given text contains placeholders for informations on the address.

Specified by:
hasMarker in interface AdditionalAddress
Parameters:
text - text eventually containing markers
Returns:
true if text contains markers
Throws:
XException - if any error occurs

replaceMarker

public java.lang.String replaceMarker(java.lang.String text,
                                      java.lang.String address)
                               throws XException
Replaces all occurences of special markers. The following markers are defined for dealers:

Specified by:
replaceMarker in interface AdditionalAddress
Parameters:
text - text containing markers
address - dealernumber
Returns:
text with replacements for markers
Throws:
XException - if the entry is not found or any error occurs

getDealerName

public java.lang.String getDealerName(java.lang.String dealernumber)
                               throws XException
Returns the name of the dealer.

Parameters:
dealernumber -
Returns:
name of the dealer
Throws:
XException - if the entry is not found or any error occurs

getValue

public java.lang.String getValue(java.lang.String inValue,
                                 java.lang.String outValue,
                                 java.lang.String key)
Specified by:
getValue in interface AdditionalAddress
See Also:
AdditionalAddress.getValue(java.lang.String, java.lang.String, java.lang.String)