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 **/
019/*
020 * Created on Jan 20, 2005
021 *
022 * To change the template for this generated file go to
023 * Window>Preferences>Java>Code Generation>Code and Comments
024 */
025package lucee.runtime.cfx.customtag;
026
027import lucee.runtime.cfx.CFXTagException;
028
029import com.allaire.cfx.CustomTag;
030
031/**
032 *
033 *
034 * To change the template for this generated type comment go to
035 * Window>Preferences>Java>Code Generation>Code and Comments
036 */
037public final class CPPCFXTagClass implements CFXTagClass {
038        
039        private String name;
040        private boolean readonly=false;
041    private String serverLibrary;
042    private String procedure;
043    private boolean keepAlive;
044
045    /**
046     * @param name
047     * @param readonly
048     * @param serverLibrary
049     * @param procedure
050     * @param keepAlive
051     */
052    private CPPCFXTagClass(String name, boolean readonly, String serverLibrary,
053            String procedure, boolean keepAlive) {
054        super();
055        this.name = name;
056        this.readonly = readonly;
057        this.serverLibrary = serverLibrary;
058        this.procedure = procedure;
059        this.keepAlive = keepAlive;
060    }
061
062        public CPPCFXTagClass(String name, String serverLibrary, String procedure, boolean keepAlive) {
063                if(name.startsWith("cfx_"))name=name.substring(4);
064                this.name=name;
065                this.serverLibrary=serverLibrary;
066                this.procedure=procedure;
067                this.keepAlive=keepAlive;
068        }
069        
070        /**
071         * @return the serverLibrary
072         */
073        public String getServerLibrary() {
074                return serverLibrary;
075        }
076
077        /**
078         * @return the procedure
079         */
080        public String getProcedure() {
081                return procedure;
082        }
083
084        @Override
085        public CustomTag newInstance() throws CFXTagException {
086                return new CPPCustomTag(serverLibrary,procedure,keepAlive);
087                
088        }
089
090    @Override
091    public boolean isReadOnly() {
092        return readonly;
093    }
094
095    @Override
096    public CFXTagClass cloneReadOnly() {
097        return new CPPCFXTagClass(name,true,serverLibrary,procedure,keepAlive);
098    }
099
100    @Override
101    public String getDisplayType() {
102        return "cpp";
103    }
104
105    @Override
106    public String getSourceName() {
107        return serverLibrary;
108    }
109
110    @Override
111    public boolean isValid() {
112        return false;
113    }
114    
115        /**
116         * @return the name
117         */
118        public String getName() {
119                return name;
120        }
121
122        /**
123         * @return the keepAlive
124         */
125        public boolean getKeepAlive() {
126                return keepAlive;
127        }
128        
129}