Coverage Report - net.sourceforge.acelogger.appender.EmptyAppender
 
Classes in this File Line Coverage Branch Coverage Complexity
EmptyAppender
46%
6/13
50%
1/2
1,125
 
 1  
 /*
 2  
  * This file is part of AceLogger.
 3  
  * 
 4  
  * AceLogger is free software: you can redistribute it and/or modify it under the terms of the GNU
 5  
  * Lesser General Public License as published by the Free Software Foundation, either version 3 of
 6  
  * the License, or (at your option) any later version.
 7  
  * 
 8  
  * AceLogger is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 9  
  * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 10  
  * Lesser General Public License for more details.
 11  
  * 
 12  
  * You should have received a copy of the GNU Lesser General Public License along with AceLogger.
 13  
  * If not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
 14  
  */
 15  
 package net.sourceforge.acelogger.appender;
 16  
 
 17  
 import net.sourceforge.acelogger.LogEvent;
 18  
 
 19  
 /**
 20  
  * A implementation of {@link Appender} that do nothing.
 21  
  * 
 22  
  * @author Zardi (https://sourceforge.net/users/daniel_zardi)
 23  
  * @version 1.0.0
 24  
  * @since 1.0.0
 25  
  */
 26  
 public final class EmptyAppender implements Appender {
 27  
 
 28  
         /**
 29  
          * The identifier of this appender.
 30  
          * 
 31  
          * @since 1.0.0
 32  
          */
 33  
         private String identifier;
 34  
 
 35  
         /**
 36  
          * Constructs a EmptyAppender using the supplied identifier.
 37  
          * 
 38  
          * @param identifier
 39  
          *            The identifier of this appender.
 40  
          * @since 1.0.0
 41  
          */
 42  2
         public EmptyAppender(String identifier) {
 43  2
                 setIdentifier(identifier);
 44  2
         }
 45  
 
 46  
         /** {@inheritDoc} */
 47  
         public String getIdentifier() {
 48  0
                 return identifier;
 49  
         }
 50  
 
 51  
         /**
 52  
          * Sets the string that identifies this object.
 53  
          * 
 54  
          * @param identifier
 55  
          *            The identifier of this object.
 56  
          * @since 1.0.0
 57  
          */
 58  
         private void setIdentifier(String identifier) {
 59  2
                 if (identifier == null) {
 60  0
                         this.identifier = "";
 61  
                 } else {
 62  2
                         this.identifier = identifier;
 63  
                 }
 64  2
         }
 65  
 
 66  
         /** {@inheritDoc} */
 67  
         public void appendLog(LogEvent call) {
 68  
                 // REMARK: Intentionally left blank.
 69  0
         }
 70  
 
 71  
         /** {@inheritDoc} */
 72  
         public void appendFooter() {
 73  
                 // REMARK: Intentionally left blank.
 74  0
         }
 75  
 
 76  
         /** {@inheritDoc} */
 77  
         public void appendHeader() {
 78  
                 // REMARK: Intentionally left blank.
 79  0
         }
 80  
 
 81  
         /** {@inheritDoc} */
 82  
         public void close() {
 83  
                 // REMARK: Intentionally left blank.
 84  0
         }
 85  
 
 86  
         /** {@inheritDoc} */
 87  
         public void open() {
 88  
                 // REMARK: Intentionally left blank.
 89  0
         }
 90  
 
 91  
 }