public abstract class IDMessage
extends com.sap.localization.LocalizableTextFormatter
LocalizableTextFormatter
with extensions for safer
usage.
This includes the following issues:
Copyright (c) 2002 SAP AG.
Modifier and Type | Class and Description |
---|---|
static class |
IDMessage.BaseMsg
Inner class that represents a message consisting of message key and
default (non-localizable) default text.
|
static class |
IDMessage.Msg0
An IDMessage for a message with no arguments.
|
static class |
IDMessage.Msg1
An IDMessage for a message with one argument.
|
static class |
IDMessage.Msg2
An IDMessage for a message with two arguments.
|
static class |
IDMessage.Msg3
An IDMessage for a message with three arguments.
|
static class |
IDMessage.Msg4
An IDMessage for a message with four arguments.
|
com.sap.localization.LocalizableText.Key0, com.sap.localization.LocalizableText.Key1, com.sap.localization.LocalizableText.Key2, com.sap.localization.LocalizableText.Key3, com.sap.localization.LocalizableText.Key4, com.sap.localization.LocalizableText.Key5, com.sap.localization.LocalizableText.Key6, com.sap.localization.LocalizableText.Msg
Modifier | Constructor and Description |
---|---|
protected |
IDMessage(IDMessage.BaseMsg baseMsg,
Object[] args,
String messageIDPrefix)
Constructor called from subclasses using MessageID infrastructure.
|
protected |
IDMessage(IDMessage.BaseMsg baseMsg,
Object[] args,
String bundleName,
String prefixInBundle,
String prefixInOutput)
Deprecated.
Switch to AS Java MessageID infrastructure by using the constructor
with three parameters, where you specify the MessageID prefix.
|
Modifier and Type | Method and Description |
---|---|
void |
checkConsistency()
Consistency checker for the entire message class to be called
in test-targets of the make process.
|
String |
format()
Statement from Denitsa Evtimova on 2008-08-05:
Exception framework is deprecated and should not be used.
|
String |
formatNonLocalized()
Format the message using the default text.
|
IDMessage.BaseMsg |
getBaseMsg()
Returns the base message object of this message.
|
String |
getDefaultText()
Returns the unsubstituted default text of the message.
|
String |
getMessageClassDefinitionCode()
This method is PUBLIC for infrastructure reasons only.
|
String |
getMessageID()
Returns the MessageID, which is the concatenation of
prefix and key.
|
String |
getPrefixInBundle()
Returns the prefix of the message without the "com.sap." part.
|
String |
getPrefixInOutput()
Returns the prefix to be used in printed output.
|
String |
log(int severity,
Category category,
Location location,
String sublocation)
Write the message into a log using the SAP Logging API.
|
String |
log(int severity,
Category category,
Location location,
String dcName,
String csnComponent)
Wrapper for the MessageID infrastrucure (including the DC name and
CSN component fields, which can be left "null" to use the current
caller data).
|
boolean |
usesMessageID()
Returns the information whether this instance has been created
with support of the MessageID infrastructure (constructor with three
parameters).
|
clearCache, clearLocalizableTextFormatter, createKey0, createKey1, createKey2, createKey3, createKey4, createKey5, createKey6, finallyLocalize, finallyLocalize, finallyLocalize, finallyLocalize, format, format, format, formatString, formatString, formatString, formatString, formatString, getApplicationName, getArguments, getCacheEntry, getErrorText, getLocale, getPatternKey, getResourceAccessor, getResourceBundleName, getTimeZone, isCacheSetting, isFinallySetting, isLocalFormat, setApplicationName, setArguments, setCacheSetting, setLocale, setLocalFormat, setPatternKey, setResourceAccessor, setTimeZone, toString
protected IDMessage(IDMessage.BaseMsg baseMsg, Object[] args, String bundleName, String prefixInBundle, String prefixInOutput)
The implementing subclass calls it, passing in the parameters
from the static create()
method, enriched by its own
data.
baseMsg
- The base message object that has created the message.args
- The arguments for the message instance.bundleName
- The resource bundle name where the message can be found.prefixInBundle
- The prefix which is to be added to the message key before it can
be looked up in the bundle.prefixInOutput
- If the message is output within an exception, this prefix
is prepended to the message key to give a short message ID
suitable for looking up in a note tracking system.protected IDMessage(IDMessage.BaseMsg baseMsg, Object[] args, String messageIDPrefix)
baseMsg
- The base message object that has created the message.args
- The arguments for the message instance.messageIDPrefix
- The namespace, e.g. "ASJ.saml11.tk".
The MessageID that you can read later with getMessageID is this
plus the four number message number.public boolean usesMessageID()
public String getMessageID()
public String getDefaultText()
public String format()
format
in interface com.sap.localization.LocalizableText
format
in class com.sap.localization.LocalizableTextFormatter
public String formatNonLocalized()
public String getPrefixInOutput()
public String getPrefixInBundle()
public IDMessage.BaseMsg getBaseMsg()
public String log(int severity, Category category, Location location, String sublocation)
severity
- A constant from class Severity
. Note that for logs
only the severities INFO, WARNING, ERROR and FATAL are foreseen.category
- The Category
the writes the log.location
- The Location
for the log.sublocation
- The sublocation (method name) for the log.
Note that the new SimpleLogger (MessageID infrastructure) does not
support sublocations, so that this information is then lost.public String log(int severity, Category category, Location location, String dcName, String csnComponent)
severity
- A constant from class Severity.category
- The Category the writes the log.location
- The Location for the log.dcName
- Leave null for current component, otherwise you can overwrite.csnComponent
- Leave null for current component, otherwise you can overwrite.public void checkConsistency() throws Exception
It can be called on any instance of the message class and cannot be static because the data regarding resource bundle name and prefixes are given in the constructor.
By configuring the system property
Exception
- Any error is thrown as exception with detail message text.public String getMessageClassDefinitionCode() throws Exception
Exception
- Any error is thrown as exception with detail message text.Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] CORE-TOOLS
|
[sap.com]
|
default
|
BC-JAS
|
[sap.com] ENGFACADE
|
[sap.com] tc/bl/security/lib
|
api
|
BC-JAS-SEC
|
[sap.com] ENGINEAPI
|
[sap.com]
|
-
|
BC-JAS-SEC
|
[sap.com] ENGINEAPI
|
[sap.com]
|
default
|
BC-JAS-SEC
|
Copyright 2018 SAP AG Complete Copyright Notice