Enum JhoveMessages
- java.lang.Object
-
- java.lang.Enum<JhoveMessages>
-
- edu.harvard.hul.ois.jhove.messages.JhoveMessages
-
- All Implemented Interfaces:
Serializable,Comparable<JhoveMessages>
public enum JhoveMessages extends Enum<JhoveMessages>
Utility class that handles creation of Message type instances, etc.- Author:
- Carl Wilson carlwilson AT github
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Field Summary
Fields Modifier and Type Field Description static JhoveMessageDEFAULT_MESSAGEstatic StringEMPTY_MESSAGEstatic StringNO_ID
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JhoveMessageFactorygetInstance(String bundleName)Get a JhoveMessageFactory instance with the requested property based bundle name and the default user localestatic JhoveMessageFactorygetInstance(String bundleName, Locale locale)Get a JhoveMessageFactory instance with the requested property based bundle name and a specific localestatic JhoveMessagegetMessageInstance(String message)Create a new message instance with a DEFAULT_IDstatic JhoveMessagegetMessageInstance(String id, String message)Create a JhoveMessage instance with the give id and message valuestatic JhoveMessagegetMessageInstance(String id, String message, String subMessage)Create a new JhoveMessage instance with the given id, message and sub-messagestatic JhoveMessagesvalueOf(String name)Returns the enum constant of this type with the specified name.static JhoveMessages[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final JhoveMessages INSTANCE
-
-
Field Detail
-
NO_ID
public static final String NO_ID
- See Also:
- Constant Field Values
-
EMPTY_MESSAGE
public static final String EMPTY_MESSAGE
- See Also:
- Constant Field Values
-
DEFAULT_MESSAGE
public static final JhoveMessage DEFAULT_MESSAGE
-
-
Method Detail
-
values
public static JhoveMessages[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (JhoveMessages c : JhoveMessages.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JhoveMessages valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getMessageInstance
public static JhoveMessage getMessageInstance(String message) throws IllegalArgumentException
Create a new message instance with a DEFAULT_ID- Parameters:
message- the message of the new message- Returns:
- the new message instance
- Throws:
IllegalArgumentException- if the id or message is null or empty
-
getMessageInstance
public static JhoveMessage getMessageInstance(String id, String message) throws IllegalArgumentException
Create a JhoveMessage instance with the give id and message value- Parameters:
id- the id of the new messagemessage- the message of the new message- Returns:
- the new message instance
- Throws:
IllegalArgumentException- if the id or message is null or empty
-
getMessageInstance
public static JhoveMessage getMessageInstance(String id, String message, String subMessage) throws IllegalArgumentException
Create a new JhoveMessage instance with the given id, message and sub-message- Parameters:
id- the id of the new messagemessage- the message of the new messagesubMessage- the sub-message of the new message- Returns:
- the new message instance
- Throws:
IllegalArgumentException- if the id or message is null or empty
-
getInstance
public static JhoveMessageFactory getInstance(String bundleName) throws IllegalArgumentException
Get a JhoveMessageFactory instance with the requested property based bundle name and the default user locale- Parameters:
bundleName- the fully qualified resource path for the message bundle property file- Returns:
- a new JhoveMessageFactory instance backed by the bundle property file.
- Throws:
IllegalArgumentException- if the bundle name is empty or the message bundle can't be located
-
getInstance
public static JhoveMessageFactory getInstance(String bundleName, Locale locale) throws IllegalArgumentException
Get a JhoveMessageFactory instance with the requested property based bundle name and a specific locale- Parameters:
bundleName- the fully qualified resource path for the message bundle property filelocale- the locale for the message bundle- Returns:
- a new JhoveMessageFactory instance backed by the bundle property file.
- Throws:
IllegalArgumentException- if the bundle name is empty or the message bundle can't be located
-
-