FormatterToken.java :  » Development » jLo » org » jzonic » jlo » formatter » tokens » Java Open Source

Java Open Source » Development » jLo 
jLo » org » jzonic » jlo » formatter » tokens » FormatterToken.java
package org.jzonic.jlo.formatter.tokens;

import org.jzonic.jlo.LogRecord;

/**
 * This interface defines all methods that every token must implement. They
 * are used by the TokenParser to replace all occurences of a text like ${xxx}
 * with the output of the defined token.
 *
 * @author Andreas Mecky
 * @author Terry Dye
 */
public interface FormatterToken {

    /**
     * This method should take the LogRecord and return the desired output
     * as String. The token itself will then be replaced in the format String
     * with this output
     *
     * @param lr the LogRecord
     * @return the formatted String 
     */
    public String format(LogRecord lr);

    /**
     * This method returns the name of the token. This name will
     * be used during by the parser to detect a FormatterToken
     * within the text
     *
     * @return the name of the FormatterToken
     */
    public String getName();

    public void setParameterString(String txt);
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.