au.id.jericho.lib.html
Class EndTagTypeGenericImplementation
public class EndTagTypeGenericImplementation
Provides a generic implementation of the abstract
EndTagType class based on the most common end tag behaviour.
This class is only of interest to users who wish to create
custom tag types.
The differences between this class and its abstract superclass
EndTagType are:
- The introduction of the
IsStatic property.
- The
constructTagAt(Source, int pos) method has a default implementation.
Most of the
predefined end tag types are implemented using this class or a subclass of it.
EndTagTypeGenericImplementation(String description, String startDelimiter, String closingDelimiter, boolean isServerTag, boolean isStatic)- Constructs a new
EndTagTypeGenericImplementation object based on the specified properties.
|
constructTagAt, deregister, getClosingDelimiter, getDescription, getNamePrefix, getRegisteredTagTypes, getStartDelimiter, getTagTypesIgnoringEnclosedMarkup, isServerTag, isValidPosition, register, setTagTypesIgnoringEnclosedMarkup, tagEncloses, toString |
EndTagTypeGenericImplementation
protected EndTagTypeGenericImplementation(String description,
String startDelimiter,
String closingDelimiter,
boolean isServerTag,
boolean isStatic) Constructs a new
EndTagTypeGenericImplementation object based on the specified properties.
(
implementation assistance method)
The purpose of the
isStatic parameter is explained in the
IsStatic property description.
description - a description of the new end tag type useful for debugging purposes.startDelimiter - the start delimiter of the new end tag type.closingDelimiter - the closing delimiter of the new end tag type.isServerTag - indicates whether the new end tag type is a server tag.isStatic - determines whether the end tag text is static.
constructTagAt
protected Tag constructTagAt(Source source,
int pos) Constructs a tag of this type at the specified position in the specified source document if it matches all of the required features.
(
default implementation method)
This default implementation ensures that the source text matches the possible output of the
generateHTML(String startTagName) method.
If the value of the
IsStatic property is
false, this implementation ensures that the
source text matches the expression:
getStartTagDelimiter()+"name"+getClosingDelimiter()
where
name is a valid
XML tag name.
The
name of the constructed end tag becomes
getNamePrefix()+"name".
If the value of the
IsStatic property is
true, this implementation ensures that the
source text matches the static expression:
getStartTagDelimiter()+getClosingDelimiter()
The
name of the constructed end tag is the value of the
getNamePrefix() method.
See
TagType.constructTagAt(Source, int pos) for more important information about this method.
- constructTagAt in interface TagType
source - the Source document.pos - the position in the source document.
- a tag of this type at the specified position in the specified source document if it meets all of the required features, or
null if it does not meet the criteria.
isStatic
protected final boolean isStatic()