@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; }
/** * <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); }
@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); } }
@com.google.gwt.core.shared.GwtIncompatible private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { JreJsonString instance = parseJson(stream); this.string = instance.string; }
@com.google.gwt.core.shared.GwtIncompatible private void writeObject(ObjectOutputStream stream) throws IOException { stream.writeObject(toJson()); } }
@Override @GwtIncompatible("incompatible method") protected void appendFieldStart(final StringBuffer buffer, final String fieldName) { if (fieldName == null) { throw new UnsupportedOperationException( "Field names are mandatory when using JsonToStringStyle"); } super.appendFieldStart(buffer, FIELD_NAME_QUOTE + StringEscapeUtils.escapeJson(fieldName) + FIELD_NAME_QUOTE); }
@Override @GwtIncompatible("incompatible method") public void appendDetail(final StringBuffer buffer, final String fieldName, final Object value) { if (!ClassUtils.isPrimitiveWrapper(value.getClass()) && !String.class.equals(value.getClass()) && accept(value.getClass())) { buffer.append(ReflectionToStringBuilder.toString(value, this)); } else { super.appendDetail(buffer, fieldName, value); } }
/** * {@inheritDoc} */ @Override @GwtIncompatible("incompatible method") protected void appendDetail(final StringBuffer buffer, final String fieldName, Object value) { if (value instanceof Annotation) { value = AnnotationUtils.toString((Annotation) value); } super.appendDetail(buffer, fieldName, value); }