001    /* 
002     * Copyright 2008-2009 the original author or authors.
003     * The contents of this file are subject to the Mozilla Public License
004     * Version 1.1 (the "License"); you may not use this file except in
005     * compliance with the License. You may obtain a copy of the License at
006     * http://www.mozilla.org/MPL/
007     *
008     * Software distributed under the License is distributed on an "AS IS"
009     * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
010     * License for the specific language governing rights and limitations
011     * under the License.
012     */
013     
014    package com.mtgi.analytics;
015    
016    public class ImmutableEventDataElement extends EventDataElement {
017    
018            private static final long serialVersionUID = 2051877886306623711L;
019    
020            public ImmutableEventDataElement(String name) {
021                    super(name);
022            }
023    
024            @Override
025            public boolean isEmpty() {
026                    return true;
027            }
028            
029            @Override
030            public void add(String name, Object value) {
031                    throw new UnsupportedOperationException("Cannot add data to this element");
032            }
033    
034            @Override
035            public void addElement(EventDataElement child) {
036                    throw new UnsupportedOperationException("Cannot add data to this element");
037            }
038    
039            @Override
040            public EventDataElement addElement(String name) {
041                    throw new UnsupportedOperationException("Cannot add data to this element");
042            }
043    
044            @Override
045            protected void setNext(EventDataElement parent, EventDataElement next) {
046                    throw new UnsupportedOperationException("Cannot add data to this element");
047            }
048    
049            @Override
050            public void setText(String text) {
051                    throw new UnsupportedOperationException("Cannot add data to this element");
052            }
053    
054            
055    }