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.transformer.bytecode.statement.tag;
020
021import lucee.transformer.bytecode.expression.Expression;
022
023public final class Attribute {
024
025        final String nameOC;
026        final String nameLC;
027        final Expression value;
028        private final String type;
029        private final boolean dynamicType;
030        private boolean defaultAttribute;
031        private String setterName;
032        
033        public Attribute(boolean dynamicType,String name, Expression value, String type) {
034                this.dynamicType = dynamicType;
035                this.nameOC = name;
036                this.nameLC = name.toLowerCase();
037                this.value = value;
038                this.type = type;
039        }
040        
041        public boolean isDefaultAttribute() {
042                return defaultAttribute;
043        }
044
045        public void setDefaultAttribute(boolean defaultAttribute) {
046                this.defaultAttribute = defaultAttribute;
047        }
048
049        /**
050         * @return the name
051         */
052        public String getName() {
053                return nameLC;
054        }
055        // TODO make this method obsolete
056        public String getNameOC() {
057                return nameOC;
058        }
059
060        /**
061         * @return the value
062         */
063        public Expression getValue() {
064                return value;
065        }
066
067        /**
068         * @return the type
069         */
070        public String getType() {
071                return type;
072        }
073
074        /**
075         * @return the dynamicType
076         */
077        public boolean isDynamicType() {
078                return dynamicType;
079        }
080        
081        public String toString(){
082                return "name:"+this.nameOC
083                +";value:"+this.value
084                +";type:"+this.type
085                +";dynamicType:"+this.dynamicType
086                +";setterName:"+this.setterName;
087        }
088}