public class DefaultProblemFactory extends java.lang.Object implements IProblemFactory
| Modifier and Type | Field and Description |
|---|---|
HashtableOfInt |
messageTemplates |
| Constructor and Description |
|---|
DefaultProblemFactory() |
DefaultProblemFactory(java.util.Locale loc) |
| Modifier and Type | Method and Description |
|---|---|
CategorizedProblem |
createProblem(char[] originatingFileName,
int problemId,
java.lang.String[] problemArguments,
int elaborationId,
java.lang.String[] messageArguments,
int severity,
int startPosition,
int endPosition,
int lineNumber,
int columnNumber)
Answer a new IProblem created according to the parameters values.
|
CategorizedProblem |
createProblem(char[] originatingFileName,
int problemId,
java.lang.String[] problemArguments,
java.lang.String[] messageArguments,
int severity,
int startPosition,
int endPosition,
int lineNumber,
int columnNumber)
Answer a new IProblem created according to the parameters value
originatingFileName the name of the file name from which the problem is originated
problemId the problem id
problemArguments the fully qualified arguments recorded inside the problem
messageArguments the arguments needed to set the error message (shorter names than problemArguments ones)
severity the severity of the problem
startPosition the starting position of the problem
endPosition the end position of the problem
lineNumber the line on which the problem occured
|
java.util.Locale |
getLocale()
Answer the locale used to retrieve the error messages
|
java.lang.String |
getLocalizedMessage(int id,
int elaborationId,
java.lang.String[] problemArguments)
Inject the supplied message arguments into a localized template
elaborated from the supplied problem id and an optional elaboration id
and return the resulting message.
|
java.lang.String |
getLocalizedMessage(int id,
java.lang.String[] problemArguments) |
static HashtableOfInt |
loadMessageTemplates(java.util.Locale loc)
This method initializes the MessageTemplates class variable according
to the current Locale.
|
java.lang.String |
localizedMessage(CategorizedProblem problem) |
void |
setLocale(java.util.Locale locale) |
public HashtableOfInt messageTemplates
public DefaultProblemFactory()
public DefaultProblemFactory(java.util.Locale loc)
loc - the locale used to get the right messagepublic CategorizedProblem createProblem(char[] originatingFileName, int problemId, java.lang.String[] problemArguments, java.lang.String[] messageArguments, int severity, int startPosition, int endPosition, int lineNumber, int columnNumber)
createProblem in interface IProblemFactoryoriginatingFileName - char[]problemId - intproblemArguments - String[]messageArguments - String[]severity - intstartPosition - intendPosition - intlineNumber - intpublic CategorizedProblem createProblem(char[] originatingFileName, int problemId, java.lang.String[] problemArguments, int elaborationId, java.lang.String[] messageArguments, int severity, int startPosition, int endPosition, int lineNumber, int columnNumber)
IProblemFactorycreateProblem in interface IProblemFactoryoriginatingFileName - the name of the file from which the problem is originatedproblemId - the problem idproblemArguments - the fully qualified arguments recorded inside the problemelaborationId - the message elaboration id (0 for problems that have no message elaboration)messageArguments - the arguments needed to set the error message (shorter names than problemArguments ones)severity - the severity of the problemstartPosition - the start position of the problemendPosition - the end position of the problemlineNumber - the line on which the problem occurredpublic java.util.Locale getLocale()
getLocale in interface IProblemFactorypublic void setLocale(java.util.Locale locale)
public final java.lang.String getLocalizedMessage(int id,
java.lang.String[] problemArguments)
getLocalizedMessage in interface IProblemFactorypublic final java.lang.String getLocalizedMessage(int id,
int elaborationId,
java.lang.String[] problemArguments)
IProblemFactorygetLocalizedMessage in interface IProblemFactoryid - the problem id taken from
IProblem constantselaborationId - 0 if the considered problem has no elaboration, a
valid elaboration id elseproblemArguments - the arguments to inject into the templatepublic final java.lang.String localizedMessage(CategorizedProblem problem)
problem - CategorizedProblempublic static HashtableOfInt loadMessageTemplates(java.util.Locale loc)
loc - Locale