001/* 002 * The contents of this file are subject to the license and copyright 003 * detailed in the LICENSE and NOTICE files at the root of the source 004 * tree. 005 */ 006package org.fcrepo.http.commons.webxml.bind; 007 008import static java.util.Collections.emptyList; 009 010import java.util.List; 011 012import javax.xml.bind.annotation.XmlElement; 013import javax.xml.bind.annotation.XmlElements; 014import javax.xml.bind.annotation.XmlRootElement; 015 016/** 017 * <p>Servlet class.</p> 018 * 019 * @author awoods 020 */ 021@XmlRootElement(namespace = "http://java.sun.com/xml/ns/javaee", 022 name = "listener") 023public class Servlet extends Displayable { 024 025 @XmlElements(value = {@XmlElement( 026 namespace = "http://java.sun.com/xml/ns/javaee", 027 name = "init-param")}) 028 List<InitParam> initParams; 029 030 @XmlElements(value = {@XmlElement( 031 namespace = "http://java.sun.com/xml/ns/javaee", 032 name = "servlet-name")}) 033 String servletName; 034 035 @XmlElements(value = {@XmlElement( 036 namespace = "http://java.sun.com/xml/ns/javaee", 037 name = "servlet-class")}) 038 String servletClass; 039 040 @XmlElements(value = {@XmlElement( 041 namespace = "http://java.sun.com/xml/ns/javaee", 042 name = "load-on-startup")}) 043 String loadOnStartUp; 044 045 public String servletName() { 046 return this.servletName; 047 } 048 049 public String servletClass() { 050 return this.servletClass; 051 } 052 053 public List<InitParam> initParams() { 054 if (initParams != null) { 055 return initParams; 056 } 057 return emptyList(); 058 } 059}