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.tag;
020
021import lucee.runtime.type.Collection.Key;
022import lucee.runtime.type.KeyImpl;
023import lucee.runtime.type.util.ListUtil;
024
025public class MissingAttribute {
026        
027
028        private final Key name;
029        private final String type;
030        private final String[] alias;
031
032        public MissingAttribute(Key name, String type, String[] alias) {
033                this.name=name;
034                this.type=type;
035                this.alias=alias;
036        }
037
038        public static MissingAttribute newInstance(Key name,String type){
039                return new MissingAttribute(name,type,null);
040        }
041        public static MissingAttribute newInstance(String name,String type){
042                return newInstance(KeyImpl.init(name),type,null);
043        }
044
045        public static MissingAttribute newInstance(Key name,String type, String[] alias){
046                return new MissingAttribute(name,type,alias);
047        }
048        public static MissingAttribute newInstance(String name,String type, String[] alias){
049                return newInstance(KeyImpl.init(name),type);
050        }
051
052        public String[] getAlias() {
053                return alias;
054        }
055
056        /**
057         * @return the name
058         */
059        public Key getName() {
060                return name;
061        }
062
063        /**
064         * @return the type
065         */
066        public String getType() {
067                return type;
068        }
069        
070
071        @Override
072        public String toString() {
073                return "name:"+name+";type:"+type+";alias:"+(alias==null?"null":ListUtil.arrayToList(alias, ","))+";";
074        }
075}