/** * Creates a message bean signaling a namespace problem. * * @param systemId the resource that cannot be read. * @param expectedNamespace the expected namespace. * @param actualNamespace the namespace that has actually been encountered. * @return a message bean signaling a namespace problem. */ public static ConfigMessageBean namespace(final String systemId, final String expectedNamespace, final String actualNamespace) { return new ConfigMessageBean(ConfigCode.WRONG_NAMESPACE, null, systemId, new DuplicateKeys(), new InvalidNamespace(expectedNamespace, actualNamespace)); }
/** * Creates a message bean signaling a duplicate key problem. * * @param systemId the resource that cannot be read. * @param currentDefaultKey the key that has already been recognized as * default. * @param duplicateDefaultKey the second key that has been recognized as * default. * @return a message bean signaling a duplicate key problem. */ public static ConfigMessageBean duplicate(final String systemId, final String currentDefaultKey, final String duplicateDefaultKey) { return new ConfigMessageBean(ConfigCode.DUPLICATE_DEFAULT_KEY, null, systemId, new DuplicateKeys(currentDefaultKey, duplicateDefaultKey), new InvalidNamespace()); }
/** * Creates a message bean without namespace information. * * @param code the error or exception code of the exception. * @param cause the cause (which is saved for later retrieval by the * {@link #getCause()} method). (A <tt>null</tt> value is permitted, * and indicates that the cause is nonexistent or unknown.) * @param systemId the resource that cannot be read. * @return a message bean without namespace information. */ public static ConfigMessageBean systemId(final ConfigCode code, final Throwable cause, final String systemId) { return new ConfigMessageBean(code, cause, systemId, new DuplicateKeys(), new InvalidNamespace()); }