Class HeadersImpl
- java.lang.Object
-
- com.github.bordertech.wcomponents.HeadersImpl
-
-
Field Summary
-
Fields inherited from interface com.github.bordertech.wcomponents.Headers
CSS_HEADLINE, JAVASCRIPT_HEADLINE, UNTYPED_HEADLINE
-
-
Constructor Summary
Constructors Constructor Description HeadersImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeadLine(String aLine)
Records a "shared" line for inclusion in the output.void
addHeadLine(String type, String aLine)
Records a "shared" line (of a specified type) for inclusion in the output.void
addUniqueHeadLine(String aLine)
Records a line for inclusion in the html/head, if it has not already been included.void
addUniqueHeadLine(String type, String aLine)
Records a line for inclusion in the html/head, if it has not already been included.String
getContentType()
Get the content type (usually text/html).List<String>
getHeadLines()
Gets the "un-typed" head lines.List<String>
getHeadLines(String type)
Gets the head lines, of a specified type.void
reset()
Clears the headers.void
setContentType(String type)
Sets the content type for the response.
-
-
-
Method Detail
-
addHeadLine
public void addHeadLine(String aLine)
Records a "shared" line for inclusion in the output.- Specified by:
addHeadLine
in interfaceHeaders
- Parameters:
aLine
- the line to include.
-
addHeadLine
public void addHeadLine(String type, String aLine)
Records a "shared" line (of a specified type) for inclusion in the output.- Specified by:
addHeadLine
in interfaceHeaders
- Parameters:
type
- the type of line.aLine
- the line to include.
-
addUniqueHeadLine
public void addUniqueHeadLine(String aLine)
Records a line for inclusion in the html/head, if it has not already been included.- Specified by:
addUniqueHeadLine
in interfaceHeaders
- Parameters:
aLine
- the line to include.
-
addUniqueHeadLine
public void addUniqueHeadLine(String type, String aLine)
Records a line for inclusion in the html/head, if it has not already been included.- Specified by:
addUniqueHeadLine
in interfaceHeaders
- Parameters:
type
- the type of line.aLine
- the line to include.
-
getHeadLines
public List<String> getHeadLines()
Gets the "un-typed" head lines.- Specified by:
getHeadLines
in interfaceHeaders
- Returns:
- a list of headlines, or null if there are no headlines.
-
getHeadLines
public List<String> getHeadLines(String type)
Gets the head lines, of a specified type.- Specified by:
getHeadLines
in interfaceHeaders
- Parameters:
type
- the type of lines to retrieve.- Returns:
- a list of headlines, or null if there are no headlines of the given type.
-
getContentType
public String getContentType()
Description copied from interface:Headers
Get the content type (usually text/html).- Specified by:
getContentType
in interfaceHeaders
- Returns:
- the content type for the response. The default type is
text/html
.
-
setContentType
public void setContentType(String type)
Sets the content type for the response. The default type istext/html
.- Specified by:
setContentType
in interfaceHeaders
- Parameters:
type
- The content type.
-
-