public boolean isWrapperFor(ServletRequest instance) { if (instance == this.request) { return true; } if (this.request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper)this.request).isWrapperFor(instance); } return false; }
/** * Checks (recursively) if this ServletRequestWrapper wraps the given * {@link ServletRequest} instance. * * @param wrapped the ServletRequest instance to search for * * @return true if this ServletRequestWrapper wraps the * given ServletRequest instance, false otherwise * * @since Servlet 3.0 */ public boolean isWrapperFor(ServletRequest wrapped) { if (request == wrapped) { return true; } else if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrapped); } else { return false; } }
public boolean isWrapperFor(Class wrappedType) { if (this.request.getClass().isAssignableFrom(wrappedType)) { return true; } if (this.request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper)this.request).isWrapperFor(wrappedType); } return false; }
/** * Checks (recursively) if this ServletRequestWrapper wraps a * {@link ServletRequest} of the given class type. * * @param wrappedType the ServletRequest class type to * search for * * @return true if this ServletRequestWrapper wraps a * ServletRequest of the given class type, false otherwise * * @throws IllegalArgumentException if the given class does not * implement {@link ServletRequest} * * @since Servlet 3.0 */ public boolean isWrapperFor(Class wrappedType) { if (!ServletRequest.class.isAssignableFrom(wrappedType)) { throw new IllegalArgumentException("Given class " + wrappedType.getName() + " not a subinterface of " + ServletRequest.class.getName()); } if (wrappedType.isAssignableFrom(request.getClass())) { return true; } else if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrappedType); } else { return false; } }
/** * @since Servlet 3.0 */ public boolean isWrapperFor(ServletRequest wrapped) { if (_request == wrapped) return true; else if (_request instanceof ServletRequestWrapper) return ((ServletRequestWrapper) _request).isWrapperFor(wrapped); else return false; }
@Override @SuppressWarnings("rawtypes") public boolean isWrapperFor(Class wrappedType) { synchronized(lock) { return super.isWrapperFor(wrappedType); } }
@Override public boolean isWrapperFor(ServletRequest wrapped) { synchronized(lock) { return super.isWrapperFor(wrapped); } }
public boolean isWrapperFor(ServletRequest instance) { if (instance == this.request) { return true; } if (this.request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper)this.request).isWrapperFor(instance); } return false; }
/** * @param wrapped * @since Servlet 3.0 TODO SERVLET3 - Add comments */ public boolean isWrapperFor(ServletRequest wrapped) { if (request == wrapped) { return true; } if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrapped); } return false; }
/** * @param wrapped * @since Servlet 3.0 TODO SERVLET3 - Add comments */ public boolean isWrapperFor(ServletRequest wrapped) { if (request == wrapped) { return true; } if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrapped); } return false; }
/** * TODO SERVLET3 - Add comments * @param wrapped The request to compare to the wrapped request * @return <code>true</code> if the request wrapped by this wrapper (or * series of wrappers) is the same as the supplied request, * otherwise <code>false</code> * @since Servlet 3.0 */ public boolean isWrapperFor(ServletRequest wrapped) { if (request == wrapped) { return true; } if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrapped); } return false; }
/** * TODO SERVLET3 - Add comments * @param wrapped The request to compare to the wrapped request * @return <code>true</code> if the request wrapped by this wrapper (or * series of wrappers) is the same as the supplied request, * otherwise <code>false</code> * @since Servlet 3.0 */ public boolean isWrapperFor(ServletRequest wrapped) { if (request == wrapped) { return true; } if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrapped); } return false; }
/** * Checks (recursively) if this ServletRequestWrapper wraps the given * {@link ServletRequest} instance. * * @param wrapped the ServletRequest instance to search for * * @return true if this ServletRequestWrapper wraps the * given ServletRequest instance, false otherwise * * @since Servlet 3.0 */ public boolean isWrapperFor(ServletRequest wrapped) { if (request == wrapped) { return true; } else if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrapped); } else { return false; } }
/** * TODO SERVLET3 - Add comments * @param wrapped The request to compare to the wrapped request * @return <code>true</code> if the request wrapped by this wrapper (or * series of wrappers) is the same as the supplied request, * otherwise <code>false</code> * @since Servlet 3.0 */ public boolean isWrapperFor(ServletRequest wrapped) { if (request == wrapped) { return true; } if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrapped); } return false; }
public boolean isWrapperFor(Class wrappedType) { if (this.request.getClass().isAssignableFrom(wrappedType)) { return true; } if (this.request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper)this.request).isWrapperFor(wrappedType); } return false; }
/** * @param wrappedType * @since Servlet 3.0 TODO SERVLET3 - Add comments */ public boolean isWrapperFor(Class<?> wrappedType) { if (wrappedType.isAssignableFrom(request.getClass())) { return true; } if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrappedType); } return false; }
/** * @param wrappedType * @since Servlet 3.0 TODO SERVLET3 - Add comments */ @SuppressWarnings("unchecked") // Spec API does not use generics public boolean isWrapperFor(@SuppressWarnings("rawtypes") Class wrappedType) { if (wrappedType.isAssignableFrom(request.getClass())) { return true; } if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrappedType); } return false; }
/** * TODO SERVLET3 - Add comments * @param wrappedType The class to compare to the class of the wrapped * request * @return <code>true</code> if the request wrapped by this wrapper (or * series of wrappers) is the same type as the supplied type, * otherwise <code>false</code> * @since Servlet 3.0 */ public boolean isWrapperFor(Class<?> wrappedType) { if (wrappedType.isAssignableFrom(request.getClass())) { return true; } if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrappedType); } return false; }
/** * TODO SERVLET3 - Add comments * @param wrappedType The class to compare to the class of the wrapped * request * @return <code>true</code> if the request wrapped by this wrapper (or * series of wrappers) is the same type as the supplied type, * otherwise <code>false</code> * @since Servlet 3.0 */ public boolean isWrapperFor(Class<?> wrappedType) { if (wrappedType.isAssignableFrom(request.getClass())) { return true; } if (request instanceof ServletRequestWrapper) { return ((ServletRequestWrapper) request).isWrapperFor(wrappedType); } return false; }
/** * @since Servlet 3.0 */ public boolean isWrapperFor(Class wrappedType) { if (!ServletRequest.class.isAssignableFrom(wrappedType)) throw new IllegalArgumentException( "expected instance of javax.servlet.ServletRequest at `" + wrappedType + "'"); else if (wrappedType.isAssignableFrom(_request.getClass())) return true; else if (_request instanceof ServletRequestWrapper) return ((ServletRequestWrapper) _request).isWrapperFor(wrappedType); else return false; } }