|
Letzte
Bearbeitung dieses Dokuments: |
Code
Erklärungen
und Anwendungsbeispiele
Verwandte
Dokumentation
package
js_base.bo;
/*
*
de:
* Package mit den Klassen für die Serialization eines
Objekts dieser Klasse.
* Serialization ist notwendig um die
Werte des Objektes zwischen einem Java
* Application Server
(JAS) und einem Heavyweight-Client übertragen zu können.
* en:
* Package with the classes to serialize an object of
this class.
* Serialization is neccessary to exchange the
values of the object between a
* Java Application Server
(JAS) and a Heavyweight-Client. */import
java.io.Serializable;
/*
*
de:
* Package mit den DataBase-Access- (DBA-) Klassen für
den Zugriff auf Datenbank-Tabellen.
* en:
*
Package with the DataBase-Access- (DBA-) classes for the access to
database-tables. */
import
js_base.dba.*;
/**
*
* @author kurt[at]javascout(dot)biz
* @date
2010-11-13
*
* @description
* de:
Business Object (BO) für das 'Country' (Land).
*
en: Business Object (BO) for the 'Country'.
*
*
de:
* Die Werte dieses BO definieren ein Land die innerhalb
des Anwendungsprogramms
* verwendet werden kann.
*
Neben dem ISO-Code des Landes enthält dieses BO auch eine
Bezeichnung dieses
* Landes und ein Set von Markern, für
welche Themenbereiche (z.B. Adressen von Kunden,
* Adressen
von Zulieferern) dieses Land verwendet werden darf.
* Für
jedes Land kann definiert werden, welche Regel für die Umsatzsteuer
bei Lieferungen
* in dieses Land anzuwenden ist.
*
Die Bezeichnung (Name) des Landes kann in verschiedenen Sprachen
erfasst werden.
* Aus historischen Gründen ist für jedes
Land optional auch der postalische Code für das
* Land
erfasst werden; dieser wird aber innerhalb der Europäischen Union
nicht mehr genutzt.
*
* Dieses BO benutzt die Datenbanktabelle 'Parameter'.
*
Eine Beschreibung dieser 'virtuellen Tabelle' finden Sie beim
Datenmodell für das Anwendungsprogramm
* HandelsSepp:
http://www.javascout.biz/JS_HSepp_DM/de/DM_Parameter_Country_de.html.
*
* Anwender-bekannter-Schlüssel: ISOCountryCode,
LanguageCodeForLabelling.
*
* en:
* The
values of this BO define a country that can be used within the
application-program.
* Additional to the ISO-code of
the country, this BO contains the name of the country and a
* set
of markers (flags) which permit a restricted use of a country only
for specified areas (e.g.
* at the address of a customer or
at the address of a vendor).
* For each country can be
defines, which rule for a Value Added Tax has to be applied for
shipments
* to this country.
* The name of the
country can be defined in different languages.
*
Additionally, the name of the country can be kept in different
languages.
* For historical reasons, the postal-code of the
country can be defined; this value is outdated
* within the
European Union.
*
* This
BO uses the database-table 'Parameter'.
* The
description of this 'virtual table' you will find at the data-model
for the application-program
* HandelsSepp:
http://www.javascout.biz/JS_HSepp_DM/de/DM_Parameter_Country_de.html.
*
* User-Key: ISOCountryCode, LanguageCodeForLabelling.
*
* @change-log
*
when who why
*
--------------------------------------------------------
*
*/public
class
JSBS_Country_BO
extends
JSBS_BO
implements
Serializable
{
/*
*
de:
* Identifikation dieses BO innerhalb der DB-Tabelle
'Parameter'; unter diesem 'ParameterName'
* werden die Werte
der Attribute der DB-Tabelle eindeutig eines Landes zugeordnet.
*
en:
* Identifier of this BO within the DB-table
'Parameter'; under this 'ParameterName' the values
* of the
attributes of the DB-table are uniquely assigned to a country.
*/
public
static final
String
CONST_PARAMETER_NAME
=
"ISOCountryCode"
;
/*
*
VARIABLE dieses BO / VARIABLES of this BO.
*
------------------ *//*
*
de:
* ISO-Code des Landes.
* en:
*
ISO-Code of the Country. */
public
String
ISOCountryCode
=
""
;
/*
*
de:
* ISO-Code der Sprache für die Bezeichnung des Landes
im Attribut 'CountryName'.
* en:
*
ISO-Code of the language for the name of the Country - within the
attribute 'CountryName'. */
public
String
LanguageCodeForLabelling
=
""
;
/*
*
de:
* Markierungen für die 'Themenbereiche' in denen
das Land verwendet wird.
* Der 'Themenbereich' einer
einzelnen Markierung ist im Anwendungsprogramm bestimmt.
*
en:
*
Markers (flags) for the 'areas' where this Country is used,
*
The 'area' of usage of a single marker is defined within the
application program. */
public
Boolean
Marker01
=
false
;
public
Boolean
Marker02
=
false
;
public
Boolean
Marker03
=
false
;
public
Boolean
Marker04
=
false
;
public
Boolean
Marker05
=
false
;
public
Boolean
Marker06
=
false
;
public
Boolean
Marker07
=
false
;
public
Boolean
Marker08
=
false
;
public
Boolean
Marker09
=
false
;
public
Boolean
Marker10
=
false
;
public
Boolean
Marker11
=
false
;
public
Boolean
Marker12
=
false
;
public
Boolean
Marker13
=
false
;
public
Boolean
Marker14
=
false
;
public
Boolean
Marker15
=
false
;
public
Boolean
Marker16
=
false
;
public
Boolean
Marker17
=
false
;
public
Boolean
Marker18
=
false
;
public
Boolean
Marker19
=
false
;
public
Boolean
Marker20
=
false
;
/*
*
de:
* Bezeichnung des Landes entsprechend dem Sprach-Code im
Attribut 'LanguageCodeForLabelling'.
* en:
*
Name of the country according to the language-code in the
attribute 'LanguageCodeForLabelling'. */
public
String
CountryName
=
""
;
/*
*
de:
* Regel für die Berechnung der Umsatzsteuer bei einem
Abnehmer im Land, das durch den Wert im
* Attibut
'ISOCountryCode' festgelegt ist.
* en:
*
Rule to calculate the value added tax for a recipient located within
the country specified by
* the value in the attribute
'ISOCountryCode'. */
public
String
VAT_Rule
=
""
;
/*
*
de:
* Konstante für ein Land ausserhalb der EU; es wird
generell keine Umsatzsteuer eingehoben.
* en:
*
Constant for a country outside the EU; there is no VAT collected.
*/
public
static final
String
CONST_VAT_Rule__ForeignCountry
=
"A"
;
/*
*
de:
* Konstante für ein Land innerhalb der EU, bei dem die
Umsatzsteuer entsprechend den Gesetzen
* des
'Empfängerlandes' (in dem der Käufer beheimatet ist) eingehoben
wird.
* Diese Regel ist unter 'Versandhausregel' bekannt.
*
en:
*
Constant for a country within the EU where the VAT is collected
according to the legislation
* of this country (where the
buyer is located).
* This rule is known under the name
'mail-order-rule'. */
public
static final
String
CONST_VAT_Rule__EUForeign
=
"EE"
;
/*
*
de:
* Konstante für ein Land innerhalb der EU, bei dem die
Umsatzsteuer entsprechend den Gesetzen
* des
'Versenderlandes' (in dem das liefernde Unternehmen beheimatet ist)
eingehoben wird.
* en:
*
Constant for a country within the EU where the VAT is collected
according to the legislation
* of the country where the
selling enterprise is located. */
public
static final
String
CONST_VAT_Rule__EUDomestic
=
"EV"
;
/*
*
de:
* Konstante für das Land, in dem das Unternehmen seinen
Firmensitz hat.
* Die Umsatzsteuer wird nach den Gesetzen
dieses Landes eingehoben.
* en:
* Constant for the
country where the enterprise is located.
* The VAT is
collected according to the legislation of this country. */
public
static final
String
CONST_VAT_Rule__Domestic
=
"I"
;
/*
*
de:
* Länder-Code der von Postverwaltungen möglicherweise
noch auf Adressen gefordert wird.
* Dieses Attribut ist
historisch begründet; dessen Wert wird innerhalb der EU nicht mehr
verwendet.
* en:
*
Country-Code that may be requiered on adresses by postal
authorities.
* This attribute has historic reasons; its
usage is outdated within the EU. */
public
String
PostalCountryCode
=
""
;
/*
* --------------------
*
de:
* 'Fehler', die bei der Ausführung der
Geschäftsregeln auftreten können.
*
en:
* 'Errors' that may occur during processing the
business-rules. *//*
*
de:
* Ein Datensatz für eine weitere Sprache soll erstellt
werden obwohl noch kein Haupt-Datensatz
* (Leere
Zeichenkette im Attribut 'LanguageCodeForLabelling') für diesen
'ISOCountryCode' existiert.
*
en:
* A dataset for another language should be created
although no main-dataset (empty string in the
* attribute
'LanguageCodeForLabelling') does not already exist for that
'ISOCountryCode'. */
public
static final int
CONST_ERROR_No_Default_Dataset_For_ISOCountryCode
=
41;
/*
* --------------------
*
de:
* 'Fehler', die das 'Deaktivieren' des BO
verhindern.
* Diese Stati gelten nur für dieses BO.
*
en:
* 'Errors' that inhibit the 'deactivation' of the
BO.
* Those stati are only valid for this BO. *//*
*
de:
* Ein Haupt-Datensatz (Leere Zeichenkette im Attribut
'LanguageCodeForLabelling')
* darf nicht deaktiviert werden
weil noch Bezeichnungen in anderen Sprachen existieren.
*
en:
* A main-dataset (empty string in the attribute
'LanguageCodeForLabelling') may
* not be deactivated as
'Labels' in other languages still exist. */
public
static final
int
CONST_DEACTIVATE_INHIBIT_REASON_AdditionalLanguageLabelling
=
61;
/*
* --------------------
*
de: METHODE zum Kopieren der Werte eines anderen Objekts in dieses
Objekt.
*
en: METHOD to copy the values from another object into this object.
*/
public
void
copyFromJSBS_Country_BO
(JSBS_Country_BO parmJSBS_Country_BO) {
/*
*
de:
* Methode der Superklasse verwenden um die Allgemeinen
Attribute (Common Attributes),
* StatusCode und StatusMsg zu
kopieren.
* en:
* Use
the method of the super-class to copy the Common
Attributes,
* StatusCode and StatusMsg.
*/
super
.copyFromJSBS_BO(parmJSBS_Country_BO);
ISOCountryCode
=
parmJSBS_Country_BO.
ISOCountryCode
;
LanguageCodeForLabelling
=
parmJSBS_Country_BO.
LanguageCodeForLabelling
;
CountryName
=
parmJSBS_Country_BO.
CountryName
;
Marker01
=
parmJSBS_Country_BO.
Marker01
;
Marker02
=
parmJSBS_Country_BO.
Marker02
;
Marker03
=
parmJSBS_Country_BO.
Marker03
;
Marker04
=
parmJSBS_Country_BO.
Marker04
;
Marker05
=
parmJSBS_Country_BO.
Marker05
;
Marker06
=
parmJSBS_Country_BO.
Marker06
;
Marker07
=
parmJSBS_Country_BO.
Marker07
;
Marker08
=
parmJSBS_Country_BO.
Marker08
;
Marker09
=
parmJSBS_Country_BO.
Marker0
9;
Marker10
=
parmJSBS_Country_BO.
Marker10
;
Marker11
=
parmJSBS_Country_BO.
Marker11
;
Marker12
=
parmJSBS_Country_BO.
Marker12
;
Marker13
=
parmJSBS_Country_BO.
Marker13
;
Marker14
=
parmJSBS_Country_BO.
Marker14
;
Marker15
=
parmJSBS_Country_BO.
Marker15
;
Marker16
=
parmJSBS_Country_BO.
Marker16
;
Marker17
=
parmJSBS_Country_BO.
Marker17
;
Marker18
=
parmJSBS_Country_BO.
Marker18
;
Marker19
=
parmJSBS_Country_BO.
Marker19
;
Marker20
=
parmJSBS_Country_BO.
Marker20
;
VAT_Rule
=
parmJSBS_Country_BO.
VAT_Rule
;
PostalCountryCode
=
parmJSBS_Country_BO.
PostalCountryCode
;
}
/*
* --------------------
*
de:
* METHODE zum Vergleichen von zwei Business Objects und
zum Prüfen
* ob mindestens einer der geschäftsbezogenen
Werte unterschiedlich ist.
* en:
*
METHOD to compare two Business Objects and check if
* at
least one of the Business Values is different. */
public
boolean
isDifferent(JSBS_Country_BO
parmJSBS_Country_BO) {
/*
*
de:
* Wenn der Wert des Parameters 'null' ist dann 'true'
(verschieden) zurück liefern.
* en:
*
If the value of the parameter is 'null' then return 'true'
(different). */
if
(parmJSBS_Country_BO
==
null
)
return
true
;
/*
*
de: Vergleich zweier Werte die durch eine Klasse repräsentiert
sind.
* en: Comparison of two values represented by a class.
*/
if
((
this
.
ISOCountryCode
==
null
)
|| (parmJSBS_Country_BO.
ISOCountryCode
==
null
))
{
/*
de: Prüfen ob beide Werte 'null' sind.
* en: Verify if both
values are 'null'. */
if
((
this
.
ISOCountryCode
==
null
)
&& (parmJSBS_Country_BO.
ISOCountryCode
==
null
))
{
/*
de: Beide Werte sind 'null'; damit sind beide gleich.
* en:
Both values are 'null'; so both are equal.
*/
}
else
{
/*
de: Nur einer der beiden Werte kann 'null' sein; damit sind beide
verschieden.
* en: Only one of both values can be 'null'; so
there is a difference. */
return
true
;
}
}
else
{
/*
de: Keiner der beiden Werte ist 'null'; damit können beide Werte
verglichen werden.
* en: None of both values is 'null'; so
both values can be compared. */
if
(
this
.
ISOCountryCode
.compareTo(parmJSBS_Country_BO.
ISOCountryCode
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
LanguageCodeForLabelling
==
null
)
|| (parmJSBS_Country_BO.
LanguageCodeForLabelling
==
null
))
{
if
((
this
.
LanguageCodeForLabelling
==
null
)
&& (parmJSBS_Country_BO.
LanguageCodeForLabelling
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
LanguageCodeForLabelling
.compareTo(parmJSBS_Country_BO.
LanguageCodeForLabelling
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker01
==
null
)
|| (parmJSBS_Country_BO.
Marker01
==
null
))
{
if
((
this
.
Marker01
==
null
)
&& (parmJSBS_Country_BO.
Marker01
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker01
.compareTo(parmJSBS_Country_BO.
Marker01
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker02
==
null
)
|| (parmJSBS_Country_BO.
Marker02
==
null
))
{
if
((
this
.
Marker02
==
null
)
&& (parmJSBS_Country_BO.
Marker02
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker02
.compareTo(parmJSBS_Country_BO.
Marker02
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker03
==
null
)
|| (parmJSBS_Country_BO.
Marker03
==
null
))
{
if
((
this
.
Marker03
==
null
)
&& (parmJSBS_Country_BO.
Marker03
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker03
.compareTo(parmJSBS_Country_BO.
Marker03
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker04
==
null
)
|| (parmJSBS_Country_BO.
Marker04
==
null
))
{
if
((
this
.
Marker04
==
null
)
&& (parmJSBS_Country_BO.
Marker04
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker04
.compareTo(parmJSBS_Country_BO.
Marker04
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker05
==
null
)
|| (parmJSBS_Country_BO.
Marker05
==
null
))
{
if
((
this
.
Marker05
==
null
)
&& (parmJSBS_Country_BO.
Marker05
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker05
.compareTo(parmJSBS_Country_BO.
Marker05
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker06
==
null
)
|| (parmJSBS_Country_BO.
Marker06
==
null
))
{
if
((
this
.
Marker06
==
null
)
&& (parmJSBS_Country_BO.
Marker06
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker06
.compareTo(parmJSBS_Country_BO.
Marker06
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker07
==
null
)
|| (parmJSBS_Country_BO.
Marker07
==
null
))
{
if
((
this
.
Marker07
==
null
)
&& (parmJSBS_Country_BO.
Marker07
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker07
.compareTo(parmJSBS_Country_BO.
Marker07
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker08
==
null
)
|| (parmJSBS_Country_BO.
Marker08
==
null
))
{
if
((
this
.
Marker08
==
null
)
&& (parmJSBS_Country_BO.
Marker08
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker08
.compareTo(parmJSBS_Country_BO.
Marker08
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker09
==
null
)
|| (parmJSBS_Country_BO.
Marker09
==
null
))
{
if
((
this
.
Marker09
==
null
)
&& (parmJSBS_Country_BO.
Marker09
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker09
.compareTo(parmJSBS_Country_BO.
Marker09
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker10
==
null
)
|| (parmJSBS_Country_BO.
Marker10
==
null
))
{
if
((
this
.
Marker10
==
null
)
&& (parmJSBS_Country_BO.
Marker10
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker10
.compareTo(parmJSBS_Country_BO.
Marker10
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker11
==
null
)
|| (parmJSBS_Country_BO.
Marker11
==
null
))
{
if
((
this
.
Marker11
==
null
)
&& (parmJSBS_Country_BO.
Marker11
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker11
.compareTo(parmJSBS_Country_BO.
Marker11
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker12
==
null
)
|| (parmJSBS_Country_BO.
Marker12
==
null
))
{
if
((
this
.
Marker12
==
null
)
&& (parmJSBS_Country_BO.
Marker12
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker12
.compareTo(parmJSBS_Country_BO.
Marker12
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker13
==
null
)
|| (parmJSBS_Country_BO.
Marker13
==
null
))
{
if
((
this
.
Marker13
==
null
)
&& (parmJSBS_Country_BO.
Marker13
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker13
.compareTo(parmJSBS_Country_BO.
Marker13
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker14
==
null
)
|| (parmJSBS_Country_BO.
Marker14
==
null
))
{
if
((
this
.
Marker14
==
null
)
&& (parmJSBS_Country_BO.
Marker14
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker14
.compareTo(parmJSBS_Country_BO.
Marker14
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker15
==
null
)
|| (parmJSBS_Country_BO.
Marker15
==
null
))
{
if
((
this
.
Marker15
==
null
)
&& (parmJSBS_Country_BO.
Marker15
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker15
.compareTo(parmJSBS_Country_BO.
Marker15
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker16
==
null
)
|| (parmJSBS_Country_BO.
Marker16
==
null
))
{
if
((
this
.
Marker16
==
null
)
&& (parmJSBS_Country_BO.
Marker16
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker16
.compareTo(parmJSBS_Country_BO.
Marker16
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker17
==
null
)
|| (parmJSBS_Country_BO.
Marker17
==
null
))
{
if
((
this
.
Marker17
==
null
)
&& (parmJSBS_Country_BO.
Marker17
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker17
.compareTo(parmJSBS_Country_BO.
Marker17
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker18
==
null
)
|| (parmJSBS_Country_BO.
Marker18
==
null
))
{
if
((
this
.
Marker18
==
null
)
&& (parmJSBS_Country_BO.
Marker18
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker18
.compareTo(parmJSBS_Country_BO.
Marker18
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker19
==
null
)
|| (parmJSBS_Country_BO.
Marker19
==
null
))
{
if
((
this
.
Marker19
==
null
)
&& (parmJSBS_Country_BO.
Marker19
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker19
.compareTo(parmJSBS_Country_BO.
Marker19
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
Marker20
==
null
)
|| (parmJSBS_Country_BO.
Marker20
==
null
))
{
if
((
this
.
Marker20
==
null
)
&& (parmJSBS_Country_BO.
Marker20
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
Marker20
.compareTo(parmJSBS_Country_BO.
Marker20
)
!= 0)
return
true
;
/*
*
***** */
if
((
this
.
CountryName
==
null
)
|| (parmJSBS_Country_BO.
CountryName
==
null
))
{
if
((
this
.
CountryName
==
null
)
&& (parmJSBS_Country_BO.
CountryName
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
CountryName
.compareTo(parmJSBS_Country_BO.
CountryName
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
VAT_Rule
==
null
)
|| (parmJSBS_Country_BO.
VAT_Rule
==
null
))
{
if
((
this
.
VAT_Rule
==
null
)
&& (parmJSBS_Country_BO.
VAT_Rule
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
VAT_Rule
.compareTo(parmJSBS_Country_BO.
VAT_Rule
)
!= 0)
return
true
;
}
/*
*
***** */
if
((
this
.
PostalCountryCode
==
null
)
|| (parmJSBS_Country_BO.
PostalCountryCode
==
null
))
{
if
((
this
.
PostalCountryCode
==
null
)
&& (parmJSBS_Country_BO.
PostalCountryCode
==
null
))
{}
else
return
true
;
}
else
{
if
(
this
.
PostalCountryCode
.compareTo(parmJSBS_Country_BO.
PostalCountryCode
)
!= 0)
return
true
;
}
}
/*
de: Keine Unterschiede gefunden.
* en: No difference found.
*/
return
false
;
}/*
* --------------------
*
de:
* METHODE zum Übertragen der Attributs-Werte des
Data-Base-Access (DBA) Objekts
* das diesem Business-Object
thematisch zugeordnet ist auf die Variablen dieses BO.
*
en:
* METHOD
to transfer the attribute-values from the Data-Base-Access (DBA)
Object
* that is attached to this Business Object to
the variables of this BO. */
public
void
getDBAAttributes(JSBS_Parameter_DBA
parmJSBS_Parameter_DBA) {
/*
*
de:
* Methode der geerbten Superklasse (JSBS_BO) aufrufen um
die Werte der
* Allgemeinen Attribute (Common Attributes) zu
übertragen.
* en:
* Call the method of the
inherited superclass (JSBS_BO) to transfer the values of the
* Common Attributes.
*/
getCommonDBAAttributes(parmJSBS_Parameter_DBA);
/*
*
de: Geschäftsbezogene Werte dieses Business Object übertragen.
*
en: Transfer the business specific values of this Business Object.
*/
this
.
ISOCountryCode
=
parmJSBS_Parameter_DBA.
Value01
;
this
.
LanguageCodeForLabelling
=
parmJSBS_Parameter_DBA.
Value02
;
/*
*
de: Spezieller Algorithmus zum Übernehmen der Marker-Werte aus der
Zeichenkette.
* en: Special algorithm to transfer the values
for the markers out of the string.
*/
expandMarkerSet(parmJSBS_Parameter_DBA.Value03
);
/*
*** */
this
.
CountryName
=
parmJSBS_Parameter_DBA.
Value06
;
this
.
VAT_Rule
=
parmJSBS_Parameter_DBA.
Value07
;
this
.
PostalCountryCode
=
parmJSBS_Parameter_DBA.
Value08
;
}
/* ---------------------
* de:
* METHODE zum Prüfen auf
Konsistenz der Daten dieses BO.
*
*
Diese Methode ist dazu gedacht, eine Prüfung auf Korrektheit der
Werte dieses BO durchzuführen
*
bevor die Daten gespeichert werden.
*
Eine zusätzliche Prüfung der Konsistenz der Daten ist dann
erforderlich
* * wenn nicht sicher gestellt werden
kann, dass bei der Eingabe der Daten die Prüfungen durchgeführt
werden
* oder
* * wenn die Prüfungen so
komplex sind, dass sie bei der Eingabe nicht vollständig
durchgeführt werden können.
*
*
Wenn die Prüfregeln nicht erfüllt werden, kann als genereller
Status-Code die Konstante
*
CONST_INCONSISTENT_DATA (aus der Basisklasse JSBS_BO)
verwendet
werden oder es können in dieser Klasse
*
detailliertere Konstante für den Status-Code definiert werden.
*
*
Für Prüf-Algorithmen, die Werte anderer Business-Objects erfordern
(und damit auf die Datenbank)
*
zugreifen müssen) kann diese Methode in der Klasse für das
Server-Seitige BO (BOS)
*
überschrieben werden.
*
* en:
* METHOD
to verify the consistency of the data of this BO.
*
* This
method is intended to check the consistency of the values of this BO
before the data is stored.
* An additional verification
is needed
* * if it can not be assured that the checks
were made at the time when the data was entered (at the
GUI)
* or
* * the verification is so
complex that it could not be done completely when the data was
entered.
*
* If the consitency-rules are
not fulfilled, the general status-code CONST_INCONSISTENT_DATA
(defined as
* constant within the base-class JSBS_BO)
can be used or more detailed status-codes can be defined
* within
this class.
*
* For
verification-algorithms that requiere the values of othe
business-objects (which means they need
* acces to the
database), this method can be overwritten within the class for the
server-side-BO (BOS). */
public boolean
isConsistentData()
{
/*
* de: Anschließend ist der Algorithmus – wenn
notwendig.
* en: Following is the algorithm – if
needed.
* */
/*
*
de:
* Wenn in dieser Methode keine Prüfungen
durchgeführt werden, werden die Daten
*
als 'konsistent' betrachtet.
* en:
* If
no checks were made within this methode, then the data is considered
to be
* 'consistent'.*/
return
true
;
}
/* ---------------------
* de:
* METHODE zum 'komprimieren' der
Werte in den einzelnen Markern dieses BO
* in eine
Zeichenkette für die Speicherung im DB-Attribut
ParameterValue03.
*
* en:
* METHOD
to 'compress' the values of the single Markers of this BO into a
string
* that is stored within the DB-Attribute
ParameterValue03. */
public
String
compressMarkerSet()
{
/*
* de:
* Zur leichteren Bearbeitung eine Variable
der Klasse 'StringBuffer' definieren.
* Diese Variable wird
gleich mit den codierten Werten für 'false' initialisiert.
* en:
* Define a variable of class 'StringBuffer' for easier
processing in the following code.
* This variable is
initialized with the coded values for 'false'.
*/
StringBuffer
strParameterValue03
=
new
StringBuffer(
"00000000000000000000"
);
/*
* de:
* Abfragen jedes einzelnen Markers und bei
Bedarf die zugehörige Position im StringBuffer ändern.
* en:
* Verify each single Marker and change the associated
position in the StringBuffer if needed.
*/
if
(
Marker01
) strParameterValue03.setCharAt(0,
'1'
);
if
(
Marker02
) strParameterValue03.setCharAt(1,
'1'
);
if
(
Marker03
) strParameterValue03.setCharAt(2,
'1'
);
if
(
Marker04
) strParameterValue03.setCharAt(3,
'1'
);
if
(
Marker05
) strParameterValue03.setCharAt(4,
'1'
);
if
(
Marker06
) strParameterValue03.setCharAt(5,
'1'
);
if
(
Marker07
) strParameterValue03.setCharAt(6,
'1'
);
if
(
Marker08
) strParameterValue03.setCharAt(7,
'1'
);
if
(
Marker09
) strParameterValue03.setCharAt(8,
'1'
);
if
(
Marker10
) strParameterValue03.setCharAt(9,
'1'
);
if
(
Marker11
) strParameterValue03.setCharAt(10,
'1'
);
if
(
Marker12
) strParameterValue03.setCharAt(11,
'1'
);
if
(
Marker13
) strParameterValue03.setCharAt(12,
'1'
);
if
(
Marker14
) strParameterValue03.setCharAt(13,
'1'
);
if
(
Marker15
) strParameterValue03.setCharAt(14,
'1'
);
if
(
Marker16
) strParameterValue03.setCharAt(15,
'1'
);
if
(
Marker17
) strParameterValue03.setCharAt(16,
'1'
);
if
(
Marker18
) strParameterValue03.setCharAt(17,
'1'
);
if
(
Marker19
) strParameterValue03.setCharAt(18,
'1'
);
if
(
Marker20
) strParameterValue03.setCharAt(19,
'1'
);
/*
* de: Umwandeln des StringBuffer in einen String und an die
aufrufende Methode zurück liefern.
* en: Convert the
StringBuffer into a String and return to the calling method.
*/
return
strParameterValue03.toString();
}
/* ---------------------
* de:
* METHODE zum 'expandieren' des
komprimierten Wert im DB-Attribut ParameterValue03
*
in die einzelnen Werte der Variablen Marker01 bis Marker20 in diesem
BO.
*
* en:
* METHOD to
'expand' the compressed value of the DB-Attribute ParameterValue03
* into the singular values of the variables Marker01 to
Marker20 of this BO. */
public void
expandMarkerSet(String
parmParameterValue03)
{
/*
* de:
* Setzen der Marker auf den Standard-Wert
'false'.
* Damit haben die Marker einen definierten Wert
auch wenn die Zeichenkette mit dem
* komprimierten Wert
(parmParameterValue03) kein gültiges Format hat.
* en:
* Set the Markers to the default-value 'false'.
*
So the Markers have a defined value even if the string with the
compressed value
* (parmParameterValue03) contains an
invalid value.
*/
Marker01
=
false
;
Marker02
=
false
;
Marker03
=
false
;
Marker04
=
false
;
Marker05
=
false
;
Marker06
=
false
;
Marker07
=
false
;
Marker08
=
false
;
Marker09
=
false
;
Marker10
=
false
;
Marker11
=
false
;
Marker12
=
false
;
Marker13
=
false
;
Marker14
=
false
;
Marker15
=
false
;
Marker16
=
false
;
Marker17
=
false
;
Marker18
=
false
;
Marker19
=
false
;
Marker20
=
false
;
/*
* de: Prüfen ob der übergebene Parameter nicht
'null' ist.
* en: Verify if the passed parameter
is not 'null'. */
if
(parmParameterValue03
==
null
)
return
;
/*
* de: Zur leichteren Bearbeitung den übergebenen Parameter
in einen 'StringBuffer' umwandeln.
* en: Convert the
passed parameter into a 'StringBuffer' as this class is easier to
process. */
StringBuffer
strParameterValue03
=
new
StringBuffer(parmParameterValue03);
/*
* de: Feststellen der Anzahl der Zeichen für die Steuerung
der folgenden for-Schleife.
* en: Get the number of
character to control the following for-loop.
*/
int
intParameterLength
= strParameterValue03.length();
/*
* de: Index und einzelner Charakter für die Verarbeitung
in der folgenden for-Schleife.
* en: Index and single
character for the processing in the following for-loop.
*/
int
intIndex;
char
chrMarkerValue;
/*
* de:
* for-Schleife zum Untersuchen jedes
einzelnen Zeichens in der als Parameter übergebenen
*
Zeichenkette. Abhängig vom Wert des einzelnen Zeichens wird der Wert
des zugeordneten
* Markers verändert.
* en:
* for-loop to inspect each single character of the string
passed as parameter.
* Depending on the value of each
character the value of the associated Marker is changed.
*/
for
(intIndex
= 0; (intIndex < intParameterLength) && (intIndex <
20); intIndex++) {
/*
* de: 'Herausholen' des zu prüfenden Zeichens aus der
Zeichenkette.
* en: Get the character to be verified
out of the string. */
chrMarkerValue =
strParameterValue03.charAt(intIndex);
/*
* de:
* Prüfen ob das untersuchte Zeichen den
Wert '1' hat. Das bedeutet, dass der zugehörige Marker
*
auf den Wert 'true' gesetzt wird.
* Um Codezeilen zu sparen,
wird die verkehrte Logik codiert.
* en:
*
Verify if the inspected character has the value '1'. That means, that
the associated Marker
* ist set to the value 'true'.
*
To avoid lines of code a reverse logic is used.
*/
if
(chrMarkerValue
!=
'1'
)
continue
;
if
(intIndex
== 0)
Marker01
=
true
;
if
(intIndex
== 1)
Marker02
=
true
;
if
(intIndex
== 2)
Marker03
=
true
;
if
(intIndex
== 3)
Marker04
=
true
;
if
(intIndex
== 4)
Marker05
=
true
;
if
(intIndex
== 5)
Marker06
=
true
;
if
(intIndex
== 6)
Marker07
=
true
;
if
(intIndex
== 7)
Marker08
=
true
;
if
(intIndex
== 8)
Marker09
=
true
;
if
(intIndex
== 9)
Marker10
=
true
;
if
(intIndex
== 10)
Marker11
=
true
;
if
(intIndex
== 11)
Marker12
=
true
;
if
(intIndex
== 12)
Marker13
=
true
;
if
(intIndex
== 13)
Marker14
=
true
;
if
(intIndex
== 14)
Marker15
=
true
;
if
(intIndex
== 15)
Marker16
=
true
;
if
(intIndex
== 16)
Marker17
=
true
;
if
(intIndex
== 17)
Marker18
=
true
;
if
(intIndex
== 18)
Marker19
=
true
;
if
(intIndex
== 19)
Marker20
=
true
;
}
}
}
Die Methoden dieser Klasse werden nur von Methoden innerhalb des JavaScout Basis-Systems aufgerufen und sind nicht für eine allgemeine Verwendung gedacht.
Dokument |
Inhalt |
|
|