Package lumis.portal.presentation.core
Class AbstractLayoutFileMarkupFilter
- java.lang.Object
-
- org.apache.wicket.markup.parser.AbstractMarkupFilter
-
- lumis.portal.presentation.core.AbstractLayoutFileMarkupFilter
-
- All Implemented Interfaces:
org.apache.wicket.markup.parser.IMarkupFilter
- Direct Known Subclasses:
ELMarkupFilter
,PageMarkupFilter
public abstract class AbstractLayoutFileMarkupFilter extends org.apache.wicket.markup.parser.AbstractMarkupFilter
Abstract markup filter used as base implementation used to help other implementations of markup filters for layout file.- Since:
- 6.0.0
- Version:
- $Revision: 13093 $ $Date: 2011-05-28 18:40:18 -0300 (Sat, 28 May 2011) $
-
-
Constructor Summary
Constructors Constructor Description AbstractLayoutFileMarkupFilter(boolean stripLayoutFileTagsAndAttributes)
Creates a new markup filter for processing layout file tags.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
afterProcessTag(org.apache.wicket.markup.ComponentTag componentTag)
Allow to manipulate a tag after theprocessTag(ComponentTag)
method.protected org.apache.wicket.markup.ComponentTag
beforeProcessTag(org.apache.wicket.markup.ComponentTag componentTag)
Allow to manipulate a tag before theprocessTag(ComponentTag)
method.protected org.apache.wicket.markup.ComponentTag
createComponentTag(org.apache.wicket.markup.ComponentTag base, String namespace, String name, org.apache.wicket.markup.parser.XmlTag.Type type)
Creates a new component tag that can be included in the markup.protected String
extractAttribute(org.apache.wicket.markup.ComponentTag componentTag, String attributeName)
Extracts an attribute from the tag.protected String
generateId(String title)
Utility method for generating a unique identifier for a component.protected abstract String
getDefaultNamespacePrefix()
Returns the default namespace prefix for the tags processed by this filter.protected abstract String
getGenerateIdPrefix()
Returns the prefix to be used bygenerateId(String)
.protected String
getNamespacePrefix()
Returns the namespace prefix used forgetNamespaceURI()
in the current markup.protected abstract String
getNamespaceURI()
Returns the namespace URI whose prefix will be determined to be returned bygetNamespacePrefix()
.protected boolean
isStripLayoutFileTagsAndAttributes()
Returns whether layout file built-in tags and attributes are to be removed from the output.org.apache.wicket.markup.MarkupElement
nextTag()
protected org.apache.wicket.markup.ComponentTag
processTag(org.apache.wicket.markup.ComponentTag componentTag)
Processes the tag.protected void
pushTag(org.apache.wicket.markup.ComponentTag componentTag)
Pushes a tag to a stack to be returned in the next call tonextTag()
.
-
-
-
Constructor Detail
-
AbstractLayoutFileMarkupFilter
public AbstractLayoutFileMarkupFilter(boolean stripLayoutFileTagsAndAttributes)
Creates a new markup filter for processing layout file tags.- Parameters:
stripLayoutFileTagsAndAttributes
- indicates whether layout file built-in tags and attributes are to be removed from the output.- Since:
- 6.0.0
-
-
Method Detail
-
isStripLayoutFileTagsAndAttributes
protected boolean isStripLayoutFileTagsAndAttributes()
Returns whether layout file built-in tags and attributes are to be removed from the output.- Returns:
true
if they are to be stripped,false
otherwise.- Since:
- 6.0.0
-
getNamespaceURI
protected abstract String getNamespaceURI()
Returns the namespace URI whose prefix will be determined to be returned bygetNamespacePrefix()
.- Returns:
- the namespace URI.
- Since:
- 6.0.0
-
getDefaultNamespacePrefix
protected abstract String getDefaultNamespacePrefix()
Returns the default namespace prefix for the tags processed by this filter. This is the prefix that will be used if the namespace is not defined in the markup.- Returns:
- the default namespace prefix.
- Since:
- 6.0.0
- See Also:
getNamespacePrefix()
-
getNamespacePrefix
protected String getNamespacePrefix()
Returns the namespace prefix used forgetNamespaceURI()
in the current markup.- Since:
- 6.0.0
-
getGenerateIdPrefix
protected abstract String getGenerateIdPrefix()
Returns the prefix to be used bygenerateId(String)
.- Returns:
- the prefix.
- Since:
- 6.0.0
-
generateId
protected String generateId(String title)
Utility method for generating a unique identifier for a component.- Parameters:
title
- the title for the component. Will be used as part of the identifier.- Returns:
- the identifier.
- Since:
- 6.0.0
-
pushTag
protected void pushTag(org.apache.wicket.markup.ComponentTag componentTag)
Pushes a tag to a stack to be returned in the next call tonextTag()
.- Parameters:
componentTag
- the tag.- Since:
- 6.0.0
-
nextTag
public org.apache.wicket.markup.MarkupElement nextTag() throws ParseException
- Throws:
ParseException
-
createComponentTag
protected org.apache.wicket.markup.ComponentTag createComponentTag(org.apache.wicket.markup.ComponentTag base, String namespace, String name, org.apache.wicket.markup.parser.XmlTag.Type type)
Creates a new component tag that can be included in the markup.- Parameters:
base
- the base component tag, used to obtain the position to be used for the new tag.namespace
- the namespace for the tag.name
- the name for the tag.type
- the type for the tag.- Returns:
- the tag.
- Since:
- 6.0.0
-
beforeProcessTag
protected org.apache.wicket.markup.ComponentTag beforeProcessTag(org.apache.wicket.markup.ComponentTag componentTag)
Allow to manipulate a tag before theprocessTag(ComponentTag)
method.- Parameters:
componentTag
- the tag to be processed.- Returns:
- the tag that will actually be processed.
- Since:
- 6.0.0
- See Also:
processTag(ComponentTag)
,afterProcessTag(ComponentTag)
-
afterProcessTag
protected void afterProcessTag(org.apache.wicket.markup.ComponentTag componentTag)
Allow to manipulate a tag after theprocessTag(ComponentTag)
method.- Parameters:
componentTag
- the tag processed.- Since:
- 6.0.0
- See Also:
beforeProcessTag(ComponentTag)
,processTag(ComponentTag)
-
processTag
protected org.apache.wicket.markup.ComponentTag processTag(org.apache.wicket.markup.ComponentTag componentTag) throws ParseException
Processes the tag.- Parameters:
componentTag
- the tag to process.- Returns:
- the resulting tag.
- Throws:
ParseException
- if a invalid situation was detected at the markup.- Since:
- 6.0.0
- See Also:
beforeProcessTag(ComponentTag)
,afterProcessTag(ComponentTag)
-
extractAttribute
protected String extractAttribute(org.apache.wicket.markup.ComponentTag componentTag, String attributeName)
Extracts an attribute from the tag. It is removed ifstripLayoutFileTagsAndAttributes
istrue
.- Parameters:
componentTag
- the tag.attributeName
- the attribute name, without the namespace (it will be applied automatically).- Returns:
- the attribute value, or
null
if it is not present. - Since:
- 6.0.0
-
-