//The MIT License
//
//Copyright (c) 2003 Ron Alford, Mike Grove, Bijan Parsia, Evren Sirin
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to
//deal in the Software without restriction, including without limitation the
//sell copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in
//all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
//IN THE SOFTWARE.
/*
* Created on Sep 3, 2003
*
*/
/**
* A simple class to ease the the process of printing on console and printing an HTML output. By
* setting one variable the format of the output printed is changed, e.g. HTML tags will not
* be printed when the output is being printed to console.
*
* @author Evren Sirin
*
*/
public class OutputFormatter {
boolean formatHTML;
public OutputFormatter() {
this(false);
}
}
}
this.formatHTML = formatHTML;
this.qnames = new QNameProvider();
}
public boolean isFormatHTML() {
return formatHTML;
}
this.formatHTML = formatHTML;
}
return out;
}
public void flush() {
}
if(formatHTML)
else
return this;
}
return this;
}
return this;
}
return this;
}
print(o);
println();
return this;
}
println();
return this;
}
printHTML("<br>");
return this;
}
if(formatHTML)
else
return this;
}
if(formatHTML)
else
return this;
}
if(formatHTML)
else
return this;
}
if(formatHTML) {
}
else
return this;
}
return printInsideTag(s, "b");
}
return printInsideTag(s, "i");
}
if(formatHTML) {
}
else
return this;
}
/**
* Print an HTML tag that will be ignored if the output format is not
* HTML.
*
* @param tag
* @return
*/
if(formatHTML)
return this;
}
/**
* @return Returns the qnames.
*/
return qnames;
}
/**
* @param qnames The qnames to set.
*/
}
}