org.opends.messages
Class MessageDescriptor

java.lang.Object
  extended by org.opends.messages.MessageDescriptor
Direct Known Subclasses:
MessageDescriptor.Arg0, MessageDescriptor.Arg1, MessageDescriptor.Arg10, MessageDescriptor.Arg11, MessageDescriptor.Arg2, MessageDescriptor.Arg3, MessageDescriptor.Arg4, MessageDescriptor.Arg5, MessageDescriptor.Arg6, MessageDescriptor.Arg7, MessageDescriptor.Arg8, MessageDescriptor.Arg9, MessageDescriptor.ArgN

@PublicAPI(stability=UNCOMMITTED,
           mayInstantiate=false,
           mayExtend=false,
           mayInvoke=true)
public abstract class MessageDescriptor
extends java.lang.Object

Base class for all Message descriptor classes.


Nested Class Summary
static class MessageDescriptor.Arg0
          Subclass for creating messages with no arguments.
static class MessageDescriptor.Arg1<T1>
          Subclass for creating messages with one argument.
static class MessageDescriptor.Arg10<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>
          Subclass for creating messages with ten arguments.
static class MessageDescriptor.Arg11<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>
          Subclass for creating messages with eleven arguments.
static class MessageDescriptor.Arg2<T1,T2>
          Subclass for creating messages with two arguments.
static class MessageDescriptor.Arg3<T1,T2,T3>
          Subclass for creating messages with three arguments.
static class MessageDescriptor.Arg4<T1,T2,T3,T4>
          Subclass for creating messages with four arguments.
static class MessageDescriptor.Arg5<T1,T2,T3,T4,T5>
          Subclass for creating messages with five arguments.
static class MessageDescriptor.Arg6<T1,T2,T3,T4,T5,T6>
          Subclass for creating messages with six arguments.
static class MessageDescriptor.Arg7<T1,T2,T3,T4,T5,T6,T7>
          Subclass for creating messages with seven arguments.
static class MessageDescriptor.Arg8<T1,T2,T3,T4,T5,T6,T7,T8>
          Subclass for creating messages with eight arguments.
static class MessageDescriptor.Arg9<T1,T2,T3,T4,T5,T6,T7,T8,T9>
          Subclass for creating messages with nine arguments.
static class MessageDescriptor.ArgN
          Subclass for creating messages with an any number of arguments.
 
Field Summary
static java.lang.String DESCRIPTOR_CLASS_BASE_NAME
          The base name of the specific argument handling subclasses defined below.
static int DESCRIPTOR_MAX_ARG_HANDLER
          The maximum number of arguments that can be handled by a specific subclass.
static int NULL_ID
          ID for messages that don't have a real ID.
 
Method Summary
protected  boolean containsArgumentLiterals(java.lang.String s)
          Indicates whether or not formatting should be applied to the given format string.
 java.lang.String getBase()
          Obtains the resource bundle base string used to access the resource bundle containing created message's format string.
 Category getCategory()
          Obtains the category of this descriptor.
 int getId()
          Returns the ID unique to all OpenDS messages.
 java.lang.String getKey()
          Returns the key for accessing the message template in a resource bundle.
 int getMask()
          Obtains the mask of this descriptor.
 int getOrdinal()
          Obtains the ordinal value for this message which makes messages unique among messages defined with the same category and severity.
 Severity getSeverity()
          Obtains the severity of this descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_ID

public static final int NULL_ID
ID for messages that don't have a real ID.

See Also:
Constant Field Values

DESCRIPTOR_MAX_ARG_HANDLER

public static final int DESCRIPTOR_MAX_ARG_HANDLER
The maximum number of arguments that can be handled by a specific subclass. If you define more subclasses be sure to increment this number appropriately.

See Also:
Constant Field Values

DESCRIPTOR_CLASS_BASE_NAME

public static final java.lang.String DESCRIPTOR_CLASS_BASE_NAME
The base name of the specific argument handling subclasses defined below. The class names consist of the base name followed by a number indicating the number of arguments that they handle when creating messages or the letter "N" meaning any number of arguments.

See Also:
Constant Field Values
Method Detail

getCategory

public final Category getCategory()
Obtains the category of this descriptor. Gauranteed not to be null.

Returns:
Category of this message

getSeverity

public final Severity getSeverity()
Obtains the severity of this descriptor. Gauranteed not to be null.

Returns:
Category of this message

getOrdinal

public final int getOrdinal()
Obtains the ordinal value for this message which makes messages unique among messages defined with the same category and severity.

Returns:
int ordinal value

getId

public final int getId()
Returns the ID unique to all OpenDS messages.

Returns:
unique ID

getMask

public final int getMask()
Obtains the mask of this descriptor. The mask will either be the mask of the associated Category or the mask explicitly set in the constructor.

Returns:
Integer mask value

getKey

public final java.lang.String getKey()
Returns the key for accessing the message template in a resource bundle. May be null for raw messages.

Returns:
key of this message

getBase

public final java.lang.String getBase()
Obtains the resource bundle base string used to access the resource bundle containing created message's format string. May be null for raw messages.

Returns:
string base

containsArgumentLiterals

protected final boolean containsArgumentLiterals(java.lang.String s)
Indicates whether or not formatting should be applied to the given format string. Note that a format string might have literal specifiers (%% or %n for example) that require formatting but are not replaced by arguments.

Parameters:
s - candiate for formatting
Returns:
boolean where true indicates that the format string requires formatting