001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet;
016    
017    import com.liferay.portal.kernel.util.Base64;
018    
019    import java.io.Serializable;
020    
021    import javax.portlet.Event;
022    
023    import javax.xml.namespace.QName;
024    
025    /**
026     * @author Brian Wing Shun Chan
027     */
028    public class EventImpl implements Event {
029    
030            public EventImpl(String name, QName qName, Serializable value) {
031                    _name = name;
032                    _qName = qName;
033                    _value = value;
034            }
035    
036            public String getBase64Value() {
037                    if (_base64Value != null) {
038                            return _base64Value;
039                    }
040                    else {
041                            _base64Value = Base64.objectToString(_value);
042    
043                            return _base64Value;
044                    }
045            }
046    
047            public String getName() {
048                    return _name;
049            }
050    
051            public QName getQName() {
052                    return _qName;
053            }
054    
055            public Serializable getValue() {
056                    return _value;
057            }
058    
059            private String _base64Value;
060            private String _name;
061            private QName _qName;
062            private Serializable _value;
063    
064    }