| 1 | /** |
| 2 | * Copyright (C) 2006 NetMind Consulting Bt. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 3 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | */ |
| 18 | |
| 19 | package hu.netmind.beankeeper.parser; |
| 20 | |
| 21 | /** |
| 22 | * A constant term has only a value. |
| 23 | * @author Brautigam Robert |
| 24 | * @version Revision: $Revision$ |
| 25 | */ |
| 26 | public class ConstantTerm |
| 27 | { |
| 28 | private Object value; |
| 29 | private boolean id = false; |
| 30 | |
| 31 | public boolean isId() |
| 32 | { |
| 33 | return id; |
| 34 | } |
| 35 | |
| 36 | public void setId() |
| 37 | { |
| 38 | this.id=true; |
| 39 | } |
| 40 | |
| 41 | public ConstantTerm(Object value) |
| 42 | { |
| 43 | setValue(value); |
| 44 | } |
| 45 | |
| 46 | public Object getValue() |
| 47 | { |
| 48 | return value; |
| 49 | } |
| 50 | public void setValue(Object value) |
| 51 | { |
| 52 | this.value=value; |
| 53 | } |
| 54 | |
| 55 | public String toString() |
| 56 | { |
| 57 | if ( value == null ) |
| 58 | return "null"; |
| 59 | return value.toString(); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | |