/** * Get a canonical array of tokens from a String entry that may contain * zero or more tokens separated by common delimiters {@code " ,;\n"}. * * @param entry a String that may contain zero or more * {@link #COMMON_DELIMITERS common delimiters} separated tokens. * @return the array of tokens, each tokens is trimmed, the array will * not contain any empty or {@code null} entries. */ public static String[] tokenize(final String entry) { return tokenize(entry, COMMON_DELIMITERS); }
/** * Determines whether the given {@code builderFactory} is from XDK package or not. * * @param builderFactory document builder factory to evaluate. * @return {@code true} if the given document builder factory is an XDK factory, {@code false} otherwise. */ public static boolean isXdkDocumentBuilderFactory(final DocumentBuilderFactory builderFactory) { return isXdkFactory(builderFactory, "oracle.xml.jaxp.JXDocumentBuilderFactory"); }
/** * Get the {@link Class} representation of the given type. * <p/> * This corresponds to the notion of the erasure in JSR-14. * * @param type type to provide the erasure for. * @return the given type's erasure. */ @SuppressWarnings("unchecked") public static <T> Class<T> erasure(final Type type) { return eraser.visit(type); }
private Type getParameterizedType(final Class<?> c) { final DeclaringClassInterfacePair p = ReflectionHelper.getClass( c, ContextResolver.class); final Type[] as = ReflectionHelper.getParameterizedTypeArguments(p); return (as != null) ? as[0] : Object.class; }
/** * Log a debug message using the configured debug level. * * This method appends thread name information to the end of the logged message. * * @param message debug message. */ public void debugLog(final String message) { debugLog(message, (Object[]) null); }
/** * Find the declaring class that implements or extends an interface. * * @param concrete the concrete class than directly or indirectly * implements or extends an interface class. * @param iface the interface class. * @return the tuple of the declaring class and the generic interface * type. */ public static DeclaringClassInterfacePair getClass(final Class<?> concrete, final Class<?> iface) { return getClass(concrete, iface, concrete); }
@Override public String toString() { return value(); } }
private static DeclaringClassInterfacePair getType(final Class<?> concrete, final Class<?> iface, final Class<?> c, final Type[] ts) { for (final Type t : ts) { final DeclaringClassInterfacePair p = getType(concrete, iface, c, t); if (p != null) { return p; } } return null; }
/** * On event callback, invoked whenever an event is received. * * @param inboundEvent received event. */ public void onEvent(final InboundSseEvent inboundEvent) { publisher.publish(inboundEvent); }
private Type getParameterizedType(final Class<?> c) { final DeclaringClassInterfacePair p = ReflectionHelper.getClass( c, ContextResolver.class); final Type[] as = ReflectionHelper.getParameterizedTypeArguments(p); return (as != null) ? as[0] : Object.class; }
/** * Get a canonical array of tokens from a String entry that may contain * zero or more tokens separated by common delimiters {@code " ,;\n"}. * * @param entry a String that may contain zero or more * {@link #COMMON_DELIMITERS common delimiters} separated tokens. * @return the array of tokens, each tokens is trimmed, the array will * not contain any empty or {@code null} entries. */ public static String[] tokenize(final String entry) { return tokenize(entry, COMMON_DELIMITERS); }
/** * Log a debug message using the configured debug level. * * This method appends thread name information to the end of the logged message. * * @param message debug message. */ public void debugLog(final String message) { debugLog(message, (Object[]) null); }
/** * Determines whether the given SAX {@code parserFactory} is from XDK package or not. * * @param parserFactory SAX parser factory to evaluate. * @return {@code true} if the given SAX parser factory is an XDK factory, {@code false} otherwise. */ public static boolean isXdkParserFactory(final SAXParserFactory parserFactory) { return isXdkFactory(parserFactory, "oracle.xml.jaxp.JXSAXParserFactory"); }
/** * Find the declaring class that implements or extends an interface. * * @param concrete the concrete class than directly or indirectly * implements or extends an interface class. * @param iface the interface class. * @return the tuple of the declaring class and the generic interface * type. */ public static DeclaringClassInterfacePair getClass(final Class<?> concrete, final Class<?> iface) { return getClass(concrete, iface, concrete); }
/** * Get the {@link Class} representation of the given type. * <p/> * This corresponds to the notion of the erasure in JSR-14. * * @param type type to provide the erasure for. * @return the given type's erasure. */ @SuppressWarnings("unchecked") public static <T> Class<T> erasure(final Type type) { return eraser.visit(type); }
@Override public String toString() { return value(); } }
private static DeclaringClassInterfacePair getType(final Class<?> concrete, final Class<?> iface, final Class<?> c, final Type[] ts) { for (final Type t : ts) { final DeclaringClassInterfacePair p = getType(concrete, iface, c, t); if (p != null) { return p; } } return null; }
/** * Get a canonical array of tokens from an array of String entries * where each entry may contain zero or more tokens separated by * common delimiters {@code " ,;\n"}. * * @param entries an array where each String entry may contain zero or more * {@link #COMMON_DELIMITERS common delimiters} separated tokens. * @return the array of tokens, each token is trimmed, the array will * not contain any empty or {@code null} entries. */ public static String[] tokenize(final String[] entries) { return tokenize(entries, COMMON_DELIMITERS); }
/** * Determines whether the given SAX {@code parserFactory} is from XDK package or not. * * @param parserFactory SAX parser factory to evaluate. * @return {@code true} if the given SAX parser factory is an XDK factory, {@code false} otherwise. */ public static boolean isXdkParserFactory(final SAXParserFactory parserFactory) { return isXdkFactory(parserFactory, "oracle.xml.jaxp.JXSAXParserFactory"); }
/** * Determines whether the given {@code builderFactory} is from XDK package or not. * * @param builderFactory document builder factory to evaluate. * @return {@code true} if the given document builder factory is an XDK factory, {@code false} otherwise. */ public static boolean isXdkDocumentBuilderFactory(final DocumentBuilderFactory builderFactory) { return isXdkFactory(builderFactory, "oracle.xml.jaxp.JXDocumentBuilderFactory"); }