com.topcoder.shared.problem
Interface Renderer

All Known Subinterfaces:
ElementRenderer

public interface Renderer

Interface for rendering an element (like a problem component) to HTML or plain text. The underlying renderer has already been linked to the appropriate element. Simply call the toHTML method with the appropriate language to render to.

Version:
1.0
Author:
Tim "Pops" Roberts

Method Summary
 java.lang.String toHTML(Language language)
          A Renderer capable of transforming the information in its corresponding problem component into a language-specific HTML fragment.
 java.lang.String toPlainText(Language language)
          Deprecated.  
 

Method Detail

toHTML

public java.lang.String toHTML(Language language)
                        throws java.lang.Exception
A Renderer capable of transforming the information in its corresponding problem component into a language-specific HTML fragment.

Parameters:
language - The language for which the HTML fragment should be generated. E.g., if the language is C++, references to array types should be generated as vector template instantiations (a transformation the Language object is intended to perform).
Returns:
A fragment of HTML.
Throws:
java.lang.Exception - if there is a problem instantiating one of the necessary renderers.
See Also:
Language, JavaLanguage, CPPLanguage, CSharpLanguage

toPlainText

public java.lang.String toPlainText(Language language)
                             throws java.lang.Exception
Deprecated.  

A Renderer capable of transforming the information in its corresponding element into a language-specific plain text fragment. Note: the all html tags are stripped from the problem statement. This may result in an incorrect plain text problem statement if the problem statement depends on those tags.

Parameters:
language - The language for which the plain test should be generated. E.g., if the language is C++, references to array types would be generated as vector template instantiations (a transformation the Language object is intended to perform).
Returns:
A plain text description of the problem.
Throws:
java.lang.Exception - if there is a problem instantiating one of the necessary renderers.
See Also:
Language, JavaLanguage, CPPLanguage, CSharpLanguage