public class TagInfo extends Object
Class contains information about single HTML tag.
It also contains rules for tag balancing. For each tag, list of dependant
tags may be defined. There are several kinds of dependancies used to reorder
tags:
<a href="#"><div>....
tag A must be closed before DIV but
copied again inside DIV.
<i><b>at</i> first</b> text
tag B must be closed before closing I, but it must be copied again after resulting
finally in sequence: <i><b>at</b></i><b> first</b> text
.
Tag TR for instance (table row) may define the following dependancies:
table
tbody
td,th
thead,tfoot
tr,td,th,caption,colgroup
tr
must be in context of table
, otherwise it will be ignored,tr
may can be directly inside tbody
, tfoot
and thead
,
otherwise tbody
will be implicitely created in front of it.tr
can contain td
and th
, all other tags and content will be pushed out of current
limiting context, in the case of html tables, in front of enclosing table
tag.tr
, caption
or colgroup
, it will be implicitely closed.Modifier and Type | Field and Description |
---|---|
protected static int |
BODY |
protected static int |
CONTENT_ALL |
protected static int |
CONTENT_NONE |
protected static int |
CONTENT_TEXT |
protected static int |
HEAD |
protected static int |
HEAD_AND_BODY |
Constructor and Description |
---|
TagInfo(String name,
int contentType,
int belongsTo,
boolean depricated,
boolean unique,
boolean ignorePermitted) |
Modifier and Type | Method and Description |
---|---|
void |
defineAllowedChildrenTags(String commaSeparatedListOfTags) |
void |
defineCloseBeforeCopyInsideTags(String commaSeparatedListOfTags) |
void |
defineCloseBeforeTags(String commaSeparatedListOfTags) |
void |
defineCloseInsideCopyAfterTags(String commaSeparatedListOfTags) |
void |
defineFatalTags(String commaSeparatedListOfTags) |
void |
defineForbiddenTags(String commaSeparatedListOfTags) |
void |
defineHigherLevelTags(String commaSeparatedListOfTags) |
void |
defineRequiredEnclosingTags(String commaSeparatedListOfTags) |
int |
getBelongsTo() |
Set |
getChildTags() |
int |
getContentType() |
Set |
getContinueAfterTags() |
Set |
getCopyTags() |
String |
getFatalTag() |
Set |
getHigherTags() |
Set |
getMustCloseTags() |
String |
getName() |
Set |
getPermittedTags() |
String |
getRequiredParent() |
boolean |
isDeprecated() |
boolean |
isEmptyTag() |
boolean |
isIgnorePermitted() |
boolean |
isUnique() |
void |
setBelongsTo(int belongsTo) |
void |
setChildTags(Set childTags) |
void |
setContinueAfterTags(Set continueAfterTags) |
void |
setCopyTags(Set copyTags) |
void |
setDeprecated(boolean deprecated) |
void |
setFatalTag(String fatalTag) |
void |
setHigherTags(Set higherTags) |
void |
setIgnorePermitted(boolean ignorePermitted) |
void |
setMustCloseTags(Set mustCloseTags) |
void |
setName(String name) |
void |
setPermittedTags(Set permittedTags) |
void |
setRequiredParent(String requiredParent) |
void |
setUnique(boolean unique) |
protected static final int HEAD_AND_BODY
protected static final int HEAD
protected static final int BODY
protected static final int CONTENT_ALL
protected static final int CONTENT_NONE
protected static final int CONTENT_TEXT
public TagInfo(String name, int contentType, int belongsTo, boolean depricated, boolean unique, boolean ignorePermitted)
public void defineFatalTags(String commaSeparatedListOfTags)
public void defineRequiredEnclosingTags(String commaSeparatedListOfTags)
public void defineForbiddenTags(String commaSeparatedListOfTags)
public void defineAllowedChildrenTags(String commaSeparatedListOfTags)
public void defineHigherLevelTags(String commaSeparatedListOfTags)
public void defineCloseBeforeCopyInsideTags(String commaSeparatedListOfTags)
public void defineCloseInsideCopyAfterTags(String commaSeparatedListOfTags)
public void defineCloseBeforeTags(String commaSeparatedListOfTags)
public String getName()
public void setName(String name)
public int getContentType()
public Set getMustCloseTags()
public void setMustCloseTags(Set mustCloseTags)
public Set getHigherTags()
public void setHigherTags(Set higherTags)
public Set getChildTags()
public void setChildTags(Set childTags)
public Set getPermittedTags()
public void setPermittedTags(Set permittedTags)
public Set getCopyTags()
public void setCopyTags(Set copyTags)
public Set getContinueAfterTags()
public void setContinueAfterTags(Set continueAfterTags)
public String getRequiredParent()
public void setRequiredParent(String requiredParent)
public int getBelongsTo()
public void setBelongsTo(int belongsTo)
public String getFatalTag()
public void setFatalTag(String fatalTag)
public boolean isDeprecated()
public void setDeprecated(boolean deprecated)
public boolean isUnique()
public void setUnique(boolean unique)
public boolean isIgnorePermitted()
public boolean isEmptyTag()
public void setIgnorePermitted(boolean ignorePermitted)
Copyright © 2006–2014. All rights reserved.