001/** 002 * Copyright 2015 DuraSpace, Inc. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.fcrepo.http.commons.webxml.bind; 017 018import static java.util.Collections.emptyList; 019 020import java.util.List; 021 022import javax.xml.bind.annotation.XmlElement; 023import javax.xml.bind.annotation.XmlElements; 024import javax.xml.bind.annotation.XmlRootElement; 025 026/** 027 * <p>Servlet class.</p> 028 * 029 * @author awoods 030 */ 031@XmlRootElement(namespace = "http://java.sun.com/xml/ns/javaee", 032 name = "listener") 033public class Servlet extends Displayable { 034 035 @XmlElements(value = {@XmlElement( 036 namespace = "http://java.sun.com/xml/ns/javaee", 037 name = "init-param")}) 038 List<InitParam> initParams; 039 040 @XmlElements(value = {@XmlElement( 041 namespace = "http://java.sun.com/xml/ns/javaee", 042 name = "servlet-name")}) 043 String servletName; 044 045 @XmlElements(value = {@XmlElement( 046 namespace = "http://java.sun.com/xml/ns/javaee", 047 name = "servlet-class")}) 048 String servletClass; 049 050 @XmlElements(value = {@XmlElement( 051 namespace = "http://java.sun.com/xml/ns/javaee", 052 name = "load-on-startup")}) 053 String loadOnStartUp; 054 055 public String servletName() { 056 return this.servletName; 057 } 058 059 public String servletClass() { 060 return this.servletClass; 061 } 062 063 public List<InitParam> initParams() { 064 if (initParams != null) { 065 return initParams; 066 } 067 return emptyList(); 068 } 069}