Code example for MalformedObjectNameException

0
	public static ObjectName getInstance(Object objectName) throws MalformedObjectNameException {
		if (objectName instanceof ObjectName) {
			return (ObjectName) objectName;
		} 
		if (!(objectName instanceof String)) {
			throw new MalformedObjectNameException("Invalid ObjectName value type [" +
					objectName.getClass().getName() + "]: only ObjectName and String supported."); 
		} 
		return getInstance((String) objectName);
	} 
 
	/** 
	 * Retrieve the {@code ObjectName} instance corresponding to the supplied name. 
	 * @param objectName the {@code ObjectName} in {@code String} format 
	 * @return the {@code ObjectName} instance 
	 * @throws MalformedObjectNameException in case of an invalid object name specification 
	 * @see ObjectName#ObjectName(String) 
	 * @see ObjectName#getInstance(String) 
	 */ 
	public static ObjectName getInstance(String objectName) throws MalformedObjectNameException {