public class HttpConstraintElement {
private static final String LSTRING_FILE = "javax.servlet.LocalStrings";
- protected static final ResourceBundle lStrings =
+ private static final ResourceBundle lStrings =
ResourceBundle.getBundle(LSTRING_FILE);
private EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
*/
package javax.servlet;
+import java.util.ResourceBundle;
+
/**
* @since Servlet 3.0
* TODO SERVLET3 - Add comments
*/
public class HttpMethodConstraintElement extends HttpConstraintElement {
-
+
+ // Can't inherit from HttpConstraintElement as API does not allow it
+ private static final String LSTRING_FILE = "javax.servlet.LocalStrings";
+ private static final ResourceBundle lStrings =
+ ResourceBundle.getBundle(LSTRING_FILE);
+
private String methodName;
public HttpMethodConstraintElement(String methodName) {
* <p>In lieu of this method, servlets can share information using the
* <code>ServletContext</code> class and can perform shared business logic
* by invoking methods on common non-servlet classes.
- *
+ *
+ * @deprecated
*/
-
- @Deprecated
+ @SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public Servlet getServlet(String name) throws ServletException;
* remains only to preserve binary compatibility. This method
* will be permanently removed in a future version of the Java
* Servlet API.
- *
+ *
+ * @deprecated
*/
-
- @Deprecated
+ @SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public Enumeration<Servlet> getServlets();
* this method always returns an empty <code>Enumeration</code> and
* remains only to preserve binary compatibility. This method will
* be permanently removed in a future version of the Java Servlet API.
- *
+ *
+ * @deprecated
*/
-
- @Deprecated
+ @SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public Enumeration<String> getServletNames();
* <p>This method was originally defined to write an
* exception's stack trace and an explanatory error message
* to the servlet log file.
- *
+ *
+ * @deprecated
*/
-
- @Deprecated
+ @SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public void log(Exception exception, String msg);
/**
- *
* @deprecated As of Version 2.1 of the Java Servlet API,
* use {@link ServletContext#getRealPath} instead.
- *
*/
-
- @Deprecated
+ @SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public String getRealPath(String path);
* on the wrapped request object.
* @deprecated As of Version 3.0 of the Java Servlet API
*/
-
- @Deprecated
+ @SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public String getRealPath(String path) {
return this.request.getRealPath(path);
}
* @since Servlet 3.0
* TODO SERVLET3 - Add comments
*/
- public boolean isWrapperFor(Class<? extends ServletRequest> wrappedType) {
+ @SuppressWarnings("unchecked") // Spec API does not use generics
+ public boolean isWrapperFor(Class wrappedType) {
if (wrappedType.isAssignableFrom(request.getClass())) {
return true;
}
* @since Servlet 3.0
* TODO SERVLET3 - Add comments
*/
- public boolean isWrapperFor(Class<? extends ServletResponse> wrappedType) {
+ @SuppressWarnings("unchecked") // Spec API does not use generics
+ public boolean isWrapperFor(Class wrappedType) {
if (wrappedType.isAssignableFrom(response.getClass())) {
return true;
}
* @deprecated As of Java Servlet API 2.4, with no direct
* replacement.
*/
-
-@Deprecated
+@SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public interface SingleThreadModel {
// No methods
}
private int seconds; // unavailability estimate
/**
- *
- * @deprecated As of Java Servlet API 2.2, use {@link
- * #UnavailableException(String)} instead.
- *
* @param servlet the <code>Servlet</code> instance that is
* unavailable
*
* @param msg a <code>String</code> specifying the
* descriptive message
- *
+ *
+ * @deprecated As of Java Servlet API 2.2, use {@link
+ * #UnavailableException(String)} instead.
*/
-
- @Deprecated
+ @SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public UnavailableException(Servlet servlet, String msg) {
super(msg);
this.servlet = servlet;
}
/**
- * @deprecated As of Java Servlet API 2.2, use {@link
- * #UnavailableException(String, int)} instead.
*
* @param seconds an integer specifying the number of seconds
* the servlet expects to be unavailable; if
* @param msg a <code>String</code> specifying the descriptive
* message, which can be written to a log file or
* displayed for the user.
- *
+ *
+ * @deprecated As of Java Servlet API 2.2, use {@link
+ * #UnavailableException(String, int)} instead.
*/
-
- @Deprecated
+ @SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public UnavailableException(int seconds, Servlet servlet, String msg) {
super(msg);
this.servlet = servlet;
}
/**
- * @deprecated As of Java Servlet API 2.2, with no replacement.
- *
* Returns the servlet that is reporting its unavailability.
*
* @return the <code>Servlet</code> object that is
* throwing the <code>UnavailableException</code>
*
+ * @deprecated As of Java Servlet API 2.2, with no replacement.
*/
-
- @Deprecated
+ @SuppressWarnings("dep-ann") // Spec API does not use dep-ann
public Servlet getServlet() {
return servlet;
}
*/
package javax.servlet.annotation;
-import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
-@Documented
+@SuppressWarnings("unchecked") // Spec API does not use generics
public @interface HandlesTypes {
- Class<?>[] value();
+ Class[] value();
}
*/
package javax.servlet.annotation;
-import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
-@Documented
public @interface MultipartConfig {
String location() default "";
long maxFileSize() default -1L;