/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: LocalizedMessage.java,v 1.2 2008/06/25 05:51:36 qcheng Exp $
*
*/
/**
* Represents a localized message in the system. A <code>LocalizedMessage</code>
* is strongly tied to the <code>Module</code> from where it originates from
* and is uses a <code>Module</code> specific resource <code>id</code> to
* locate the actual resource. It also facilitates the localization into a
* different locale other than the <code>Module</code>'s configured locale.
*/
public class LocalizedMessage {
/**
* Returns the string representation of this <code>LocalizedMessage</code>
* in the given <code>locale</code>.
*
* @param locale the Locale to be used when rendering this message.
* @return the localized String representing this message.
*/
return getFormattedMessage(
}
/**
* Returns the string representation of this <code>LocalizedMessage</code>
* in the Locale of the originating <code>Module</code>.
*
* @return the localized String representing this message.
*/
} else {
getId()));
}
return result;
}
/**
* Allows the caller to set a locale different from the default locale
* associated with the <code>Module</code> from where the message originated.
*
* @param locale the Locale to be used when rendering the message.
*/
}
/**
* Constructs a <code>LocalizedMessage</code> associated with the
* <code>Module</code> corresponding to the given <code>moduleCode</code>,
* and the <code>id</code> of the localized resource.
*
* @param moduleCode the code of the <code>Module</code> from where the
* message originates.
* @param id the <code>id</code> of the resource.
*/
}
/**
* Constructs a <code>LocalizedMessage</code> associated with the
* <code>Module</code> corresponding to the given <code>moduleCode</code>,
* and the <code>id</code> of the localized resource. The optional
* <code>params</code> argument allows any special values to be inserted
* into the final message using the <code>MessageFormat</code> semantics.
*
* @param moduleCode the code of the <code>Module</code> from where the
* message originates.
* @param id the <code>id</code> of the resource.
* @param params optional parameters that will be inserted into the final
* message using the <code>MessageFormat</code> semantics.
*/
}
} else {
}
return message;
}
}
private byte getModuleCode() {
return _moduleCode;
}
private int getId() {
return _id;
}
}
return _params;
}
}
return _locale;
}
private byte _moduleCode;
private int _id;
}