001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.runtime.err;
020
021import lucee.runtime.PageSource;
022/**
023 * 
024 */
025public final class ErrorPageImpl implements ErrorPage {
026        
027        /** Type of exception. Required if type = "exception" or "monitor". */
028        private String exception="any";
029
030        /** The relative path to the custom error page. */
031        private PageSource template;
032
033        /** The e-mail address of the administrator to notify of the error. The value
034        **      is available to your custom error page in the MailTo property of the error object. */
035        private String mailto="";
036
037        private short type;
038        
039        
040
041        
042        @Override
043        public void setMailto(String mailto) {
044                this.mailto = mailto;
045        }
046        
047        @Override
048        public void setTemplate(PageSource template) {
049                this.template = template;
050        }
051        
052        @Override
053        public void setTypeAsString(String exception) {
054                setException(exception);
055        }       
056        
057        @Override
058        public void setException(String exception) {
059                this.exception = exception;
060        }       
061        
062        @Override
063        public String getMailto() {
064                return mailto;
065        }
066        @Override
067        public PageSource getTemplate() {
068                return template;
069        }
070        
071        @Override
072        public String getTypeAsString() {
073                return getException();
074        }
075        public String getException() {
076                return exception;
077        }
078
079        @Override
080        public void setType(short type) {
081                this.type=type;
082        }
083
084        @Override
085        public short getType() {
086                return type;
087        }       
088}