Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jpaoletti.jpm.core.monitor;
 
This class is executed by PM for each line generated by the monitor. This must return an HTML formatted String to output.
By default, the formatter returns the line "as is". Programmer can extend this class and redefine format method to change the output.

Author(s):
jpaoletti
public class MonitorFormatter {
    private Properties properties;

    
Called for each line generated by the monitor before output it on the result HTML.

Parameters:
line Monitor line
Returns:
Formatted monitor lin
    public String format(MonitorLine line){
        return line.getValue().toString();
    }
    
    
Getter for a specific property with a default value in case its not defined. Only works for string.

Parameters:
name Property name
def Default value
Returns:
Property value only if its a string
    public String getConfig (String nameString def) {
        if ( != null) {
            Object obj = .get (name);
            if (obj instanceof String)
                return obj.toString();
        } 
        return def;
    }
    
    
Getter for any property in the properties object

Parameters:
name The property name
Returns:
The property value
    public String getConfig (String name) {
        return getConfig (namenull);
    }

    

Parameters:
properties the properties to set
    public void setProperties(Properties properties) {
        this. = properties;
    }

    

Returns:
the properties
    public Properties getProperties() {
        return ;
    }
New to GrepCode? Check out our FAQ X