@GwtIncompatible public boolean isExceptionOf(Class<?> expectedException) { try { return thrown == null ? false : expectedException.isAssignableFrom(Class.forName(thrown.getDesignatedType())); } catch (Exception e) { return false; } }
/** * Create or retrieve a format instance. * * @param name The format type name * @param arguments Arguments used to create the format instance. This allows the * <code>FormatFactory</code> to implement the "format style" * concept from <code>java.text.MessageFormat</code>. * @param locale The locale, may be null * @return The format instance */ @GwtIncompatible("incompatible method") Format getFormat(String name, String arguments, Locale locale);
/** * Set the class loader to be used for instantiating application objects * when required. * * @param classLoader The new class loader to use, or <code>null</code> * to revert to the standard rules */ @GwtIncompatible("incompatible method") public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; }
@com.google.gwt.core.shared.GwtIncompatible private Object readResolve() throws ObjectStreamException { return NULL_INSTANCE; } }
/** * <p> * Returns the registry of objects being traversed by the reflection methods in the current thread. * </p> * * @return Set the registry of objects being traversed * @since 2.3 */ @GwtIncompatible("incompatible method") static Set<IDKey> getRegistry() { return REGISTRY.get(); }
/** * <p>Is the specified class an inner class or static nested class.</p> * * @param cls the class to check, may be null * @return {@code true} if the class is an inner or static nested class, * false if not or {@code null} */ @GwtIncompatible("incompatible method") public static boolean isInnerClass(final Class<?> cls) { return cls != null && cls.getEnclosingClass() != null; }
/** * Get the default formatted representation of the specified * {@code Formattable}. * * @param formattable the instance to convert to a string, not null * @return the resulting string, not null */ @GwtIncompatible("incompatible method") public static String toString(final Formattable formattable) { return String.format(SIMPLEST_FORMAT, formattable); }
/** * Returns the computed <code>hashCode</code>. * * @return <code>hashCode</code> based on the fields appended * * @since 3.0 */ @Override @GwtIncompatible("incompatible method") public Integer build() { return Integer.valueOf(toHashCode()); }
@GwtIncompatible private void writeArray(DataOutputStream daos) throws IOException { daos.writeInt(values.length); for (int i = 0; i < values.length; i++) { String value = values[i]; if(value == null) { daos.writeUTF(""); } else { daos.writeUTF(value); } } }
@GwtIncompatible private void readArray(DataInputStream input) throws IOException { int count = input.readInt(); this.values = new String[count]; for (int i = 0; i < count; i++) { String s = input.readUTF(); if(!s.isEmpty()) { values[i] = s; } } } }
@GwtIncompatible private static String extractDateTime(@Nonnull String dateTime) { if(dateTime.startsWith(ISODATE_PREFIX)) { return dateTime.substring(ISODATE_PREFIX.length(), dateTime.length() - ISODATE_SUFFIX.length()); } else { return dateTime; } }
@JsonProperty(MODIFIED_AT) @GwtIncompatible protected Instant modifiedAt() { return Instant.ofEpochMilli(getLastModifiedAt()); }
/** * Creates a fresh tag with a new UUID. Note that this only works on the server. */ @GwtIncompatible public static TagId createTagId() { return getId(UUID.randomUUID().toString()); }
/** * <p>Append to the <code>toString</code> an <code>Object</code> * value.</p> * * @param obj the value to add to the <code>toString</code> * @return this */ @GwtIncompatible("incompatible method") public ToStringBuilder append(final Object obj) { style.append(buffer, null, obj, null); return this; }
@Override @GwtIncompatible("incompatible method") protected void appendDetail(final StringBuffer buffer, final String fieldName, final char value) { appendValueAsString(buffer, String.valueOf(value)); }
/** * Appends the given String enclosed in double-quotes to the given StringBuffer. * * @param buffer the StringBuffer to append the value to. * @param value the value to append. */ @GwtIncompatible("incompatible method") private void appendValueAsString(final StringBuffer buffer, final String value) { buffer.append('"').append(StringEscapeUtils.escapeJson(value)).append('"'); }
/** * {@inheritDoc} */ @Override @GwtIncompatible("incompatible method") public String getFormattedExceptionMessage(final String baseMessage) { return exceptionContext.getFormattedExceptionMessage(baseMessage); }
/** * <p>Uses <code>ReflectionToStringBuilder</code> to generate a * <code>toString</code> for the specified object.</p> * * @param object the Object to be output * @return the String result * @see ReflectionToStringBuilder#toString(Object) */ @GwtIncompatible("incompatible method") public static String reflectionToString(final Object object) { return ReflectionToStringBuilder.toString(object); }
/** * Provides the message explaining the exception, including the contextual data. * * @see java.lang.Throwable#getMessage() * @return the message, never null */ @Override @GwtIncompatible("incompatible method") public String getMessage(){ return getFormattedExceptionMessage(super.getMessage()); }
/** * {@inheritDoc} */ @Override @GwtIncompatible("incompatible method") public String getFormattedExceptionMessage(final String baseMessage) { return exceptionContext.getFormattedExceptionMessage(baseMessage); } }