//# 0 errors, 53 messages
//#
/*
    //#ObfuscateEmailPlugin.java:1:1: class: org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin
 * Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  The ASF licenses this file to You
 * under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.  For additional information regarding
 * copyright in this work, please see the NOTICE file in the top level
 * directory of this distribution.
 */

package org.apache.roller.weblogger.business.plugins.entry;

import java.util.Map;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.plugins.entry.WeblogEntryPlugin;
import org.apache.roller.weblogger.pojos.WeblogEntry;
import org.apache.roller.weblogger.pojos.Weblog;
import org.apache.roller.util.RegexUtil;


/**
 * Obfuscate email addresses in entry text.
 */
public class ObfuscateEmailPlugin implements WeblogEntryPlugin {
    
    private static Log mLogger = LogFactory.getLog(ObfuscateEmailPlugin.class);
    //#ObfuscateEmailPlugin.java:37: method: org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init
    //#ObfuscateEmailPlugin.java:37: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin
    //#    method: org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Descendant_Table[org/apache/roller/weblogger/business/plugins/entry/ObfuscateEmailPlugin]
    //#output(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Dispatch_Table.getDescription()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Dispatch_Table.getName()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Dispatch_Table.init(Lorg/apache/roller/weblogger/pojos/Weblog;)V
    //#output(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Dispatch_Table.render(Lorg/apache/roller/weblogger/pojos/WeblogEntry;Ljava/lang/String;)Ljava/lang/String;
    //#output(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): mLogger
    //#output(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): org/apache/roller/weblogger/business/plugins/entry/WeblogEntryPlugin.__Descendant_Table[org/apache/roller/weblogger/business/plugins/entry/ObfuscateEmailPlugin]
    //#post(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Descendant_Table[org/apache/roller/weblogger/business/plugins/entry/ObfuscateEmailPlugin] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): org/apache/roller/weblogger/business/plugins/entry/WeblogEntryPlugin.__Descendant_Table[org/apache/roller/weblogger/business/plugins/entry/ObfuscateEmailPlugin] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Dispatch_Table.getDescription()Ljava/lang/String; == &getDescription
    //#post(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Dispatch_Table.getName()Ljava/lang/String; == &getName
    //#post(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Dispatch_Table.init(Lorg/apache/roller/weblogger/pojos/Weblog;)V == &init
    //#post(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): __Dispatch_Table.render(Lorg/apache/roller/weblogger/pojos/WeblogEntry;Ljava/lang/String;)Ljava/lang/String; == &render
    //#post(org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init): init'ed(mLogger)
    //#ObfuscateEmailPlugin.java:37: end of method: org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin__static_init
    
    protected String name = "Email Scrambler";
    
    protected String description = "Automatically converts email addresses " +
            "to me-AT-mail-DOT-com format.  Also &quot;scrambles&quot; mailto: links.";
    
    
    public ObfuscateEmailPlugin() {
    //#ObfuscateEmailPlugin.java:45: method: void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()
    //#input(void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()): mLogger
    //#input(void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()): this
    //#output(void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()): this.description
    //#output(void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()): this.name
    //#pre[1] (void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()): mLogger != null
    //#post(void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()): this.description == &"Automatically converts email addresses to me-AT-mail-DOT-com format.  Also &amp;quot;scrambles&amp;quot; mailto: links."
    //#post(void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()): this.name == &"Email Scrambler"
        mLogger.debug("ObfuscateEmailPlugin instantiated.");
    //#ObfuscateEmailPlugin.java:46: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin
    //#    method: void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
    }
    //#ObfuscateEmailPlugin.java:47: end of method: void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin()
    
    
    public String getName() {
        return name;
    //#ObfuscateEmailPlugin.java:51: method: String org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.getName()
    //#input(String getName()): this
    //#input(String getName()): this.name
    //#output(String getName()): return_value
    //#pre[2] (String getName()): init'ed(this.name)
    //#post(String getName()): return_value == this.name
    //#post(String getName()): init'ed(return_value)
    //#ObfuscateEmailPlugin.java:51: end of method: String org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.getName()
    }
    
    
    public String getDescription() {
        return StringEscapeUtils.escapeJavaScript(description);
    //#ObfuscateEmailPlugin.java:56: method: String org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.getDescription()
    //#ObfuscateEmailPlugin.java:56: Warning: method not available
    //#    -- call on String org.apache.commons.lang.StringEscapeUtils:escapeJavaScript(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin
    //#    method: String getDescription()
    //#    unanalyzed callee: String org.apache.commons.lang.StringEscapeUtils:escapeJavaScript(String)
    //#input(String getDescription()): this
    //#input(String getDescription()): this.description
    //#output(String getDescription()): return_value
    //#pre[2] (String getDescription()): init'ed(this.description)
    //#post(String getDescription()): init'ed(return_value)
    //#ObfuscateEmailPlugin.java:56: end of method: String org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.getDescription()
    }
    
    
    public void init(Weblog website) throws WebloggerException {}
    //#ObfuscateEmailPlugin.java:60: method: void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.init(Weblog)
    //#ObfuscateEmailPlugin.java:60: end of method: void org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.init(Weblog)
    
    
    public String render(WeblogEntry entry, String str) {
        return RegexUtil.encodeEmail(str);
    //#ObfuscateEmailPlugin.java:64: method: String org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.render(WeblogEntry, String)
    //#ObfuscateEmailPlugin.java:64: Warning: method not available
    //#    -- call on String org.apache.roller.util.RegexUtil:encodeEmail(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin
    //#    method: String render(WeblogEntry, String)
    //#    unanalyzed callee: String org.apache.roller.util.RegexUtil:encodeEmail(String)
    //#input(String render(WeblogEntry, String)): str
    //#output(String render(WeblogEntry, String)): return_value
    //#post(String render(WeblogEntry, String)): init'ed(return_value)
    //#ObfuscateEmailPlugin.java:64: end of method: String org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin.render(WeblogEntry, String)
    }
    
}
    //#ObfuscateEmailPlugin.java:: end of class: org.apache.roller.weblogger.business.plugins.entry.ObfuscateEmailPlugin
