001    /**
002     * Copyright (c) 2000-present 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.portal.kernel.templateparser;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.kernel.xml.Document;
020    
021    import java.util.Map;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     */
026    public abstract class BaseTransformerListener implements TransformerListener {
027    
028            @Override
029            public String onOutput(
030                    String output, String languageId, Map<String, String> tokens) {
031    
032                    if (_log.isDebugEnabled()) {
033                            _log.debug("onOutput");
034                    }
035    
036                    return output;
037            }
038    
039            @Override
040            public String onScript(
041                    String script, Document document, String languageId,
042                    Map<String, String> tokens) {
043    
044                    if (_log.isDebugEnabled()) {
045                            _log.debug("onScript");
046                    }
047    
048                    return script;
049            }
050    
051            @Override
052            public Document onXml(
053                    Document document, String languageId, Map<String, String> tokens) {
054    
055                    if (_log.isDebugEnabled()) {
056                            _log.debug("onXml");
057                    }
058    
059                    return document;
060            }
061    
062            private static final Log _log = LogFactoryUtil.getLog(
063                    BaseTransformerListener.class);
064    
065    }