org.apache.wicket.settings
Interface IMarkupSettings

All Known Implementing Classes:
Settings

public interface IMarkupSettings

Interface for markup related settings.

compressWhitespace (defaults to false) - Causes pages to render with redundant whitespace removed. Whitespace stripping is not HTML or JavaScript savvy and can conceivably break pages, but should provide significant performance improvements.

stripComments (defaults to false) - Set to true to strip HTML comments during markup loading

Author:
Igor Vaynberg (ivaynberg)

Method Summary
 boolean getAutomaticLinking()
          If true, automatic link resolution is enabled.
 boolean getCompressWhitespace()
           
 java.lang.String getDefaultAfterDisabledLink()
           
 java.lang.String getDefaultBeforeDisabledLink()
           
 java.lang.String getDefaultMarkupEncoding()
           
 IMarkupCache getMarkupCache()
          The markup cache also loads the markup if not yet available in the cache.
 IMarkupParserFactory getMarkupParserFactory()
           
 boolean getStripComments()
           
 boolean getStripWicketTags()
          Gets whether to remove wicket tags from the output.
 boolean getStripXmlDeclarationFromOutput()
           
 boolean getThrowExceptionOnMissingXmlDeclaration()
           
 void setAutomaticLinking(boolean automaticLinking)
          Application default for automatic link resolution.
 void setCompressWhitespace(boolean compressWhitespace)
          Turns on whitespace compression.
 void setDefaultAfterDisabledLink(java.lang.String defaultAfterDisabledLink)
           
 void setDefaultBeforeDisabledLink(java.lang.String defaultBeforeDisabledLink)
           
 void setDefaultMarkupEncoding(java.lang.String encoding)
          Set default encoding for markup files.
 void setMarkupCache(IMarkupCache markupCache)
          Sets a new markup cache which will also be used to load markup if not yet available in the cache.
 void setMarkupParserFactory(IMarkupParserFactory factory)
          Sets the markup parser factory that will be used to generate parsers for markup.
 void setStripComments(boolean stripComments)
          Enables stripping of markup comments denoted in markup by HTML comment tagging.
 void setStripWicketTags(boolean stripWicketTags)
          Sets whether to remove wicket tags from the output.
 void setStripXmlDeclarationFromOutput(boolean strip)
           
 void setThrowExceptionOnMissingXmlDeclaration(boolean throwException)
          If true, an exception is thrown if the markup file does not contain a xml declaration
 

Method Detail

getAutomaticLinking

boolean getAutomaticLinking()
If true, automatic link resolution is enabled. Disabled by default.

Returns:
Returns the automaticLinking.
See Also:
AutoLinkResolver, WicketLinkTagHandler

getCompressWhitespace

boolean getCompressWhitespace()
Returns:
Returns the compressWhitespace.
See Also:
setCompressWhitespace(boolean)

getDefaultAfterDisabledLink

java.lang.String getDefaultAfterDisabledLink()
Returns:
Returns the defaultAfterDisabledLink.

getDefaultBeforeDisabledLink

java.lang.String getDefaultBeforeDisabledLink()
Returns:
Returns the defaultBeforeDisabledLink.

getDefaultMarkupEncoding

java.lang.String getDefaultMarkupEncoding()
Returns:
Returns default encoding of markup files. If null, the operating system provided encoding will be used.
Since:
1.1

getMarkupParserFactory

IMarkupParserFactory getMarkupParserFactory()
Returns:
markup parser factory

getMarkupCache

IMarkupCache getMarkupCache()
The markup cache also loads the markup if not yet available in the cache.

Returns:
markup cache

getStripComments

boolean getStripComments()
Returns:
Returns the stripComments.
See Also:
setStripComments(boolean)

getStripWicketTags

boolean getStripWicketTags()
Gets whether to remove wicket tags from the output.

Returns:
whether to remove wicket tags from the output

getStripXmlDeclarationFromOutput

boolean getStripXmlDeclarationFromOutput()
Returns:
if true, xml declaration will be removed.
Since:
1.1

getThrowExceptionOnMissingXmlDeclaration

boolean getThrowExceptionOnMissingXmlDeclaration()
Returns:
if true, an exception is thrown if the markup file does not contain a xml declaration
Since:
1.3

setAutomaticLinking

void setAutomaticLinking(boolean automaticLinking)
Application default for automatic link resolution. Please

Parameters:
automaticLinking - The automaticLinking to set.
See Also:
and, for more details.

setCompressWhitespace

void setCompressWhitespace(boolean compressWhitespace)
Turns on whitespace compression. Multiple occurrences of space/tab characters will be compressed to a single space. Multiple line breaks newline/carriage-return will also be compressed to a single newline.

Compression is currently not HTML aware and so it may be possible for whitespace compression to break pages. For this reason, whitespace compression is off by default and you should test your application thoroughly after turning whitespace compression on.

Spaces are removed from markup at markup load time and there should be no effect on page rendering speed. In fact, your pages should render faster with whitespace compression enabled.

Parameters:
compressWhitespace - The compressWhitespace to set.

setDefaultAfterDisabledLink

void setDefaultAfterDisabledLink(java.lang.String defaultAfterDisabledLink)
Parameters:
defaultAfterDisabledLink - The defaultAfterDisabledLink to set.

setDefaultBeforeDisabledLink

void setDefaultBeforeDisabledLink(java.lang.String defaultBeforeDisabledLink)
Parameters:
defaultBeforeDisabledLink - The defaultBeforeDisabledLink to set.

setDefaultMarkupEncoding

void setDefaultMarkupEncoding(java.lang.String encoding)
Set default encoding for markup files. If null, the encoding provided by the operating system will be used.

Parameters:
encoding -
Since:
1.1

setMarkupParserFactory

void setMarkupParserFactory(IMarkupParserFactory factory)
Sets the markup parser factory that will be used to generate parsers for markup. By default MarkupParserFactory will be used.

Parameters:
factory - new factory

setMarkupCache

void setMarkupCache(IMarkupCache markupCache)
Sets a new markup cache which will also be used to load markup if not yet available in the cache.

Parameters:
markupCache - new markup cache

setStripComments

void setStripComments(boolean stripComments)
Enables stripping of markup comments denoted in markup by HTML comment tagging.

Parameters:
stripComments - True to strip markup comments from rendered pages

setStripWicketTags

void setStripWicketTags(boolean stripWicketTags)
Sets whether to remove wicket tags from the output.

Parameters:
stripWicketTags - whether to remove wicket tags from the output

setStripXmlDeclarationFromOutput

void setStripXmlDeclarationFromOutput(boolean strip)
Parameters:
strip - if true, xml declaration will be stripped from output
Since:
1.1

setThrowExceptionOnMissingXmlDeclaration

void setThrowExceptionOnMissingXmlDeclaration(boolean throwException)
If true, an exception is thrown if the markup file does not contain a xml declaration

Parameters:
throwException -
Since:
1.3


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.