public class TagNode extends TagToken implements PlainTextConvertable
XML node node tag - it is produced during cleaning process when all start and end tokens are removed and replaced by instances of TagNode.
Created by: Vladimir Nikic| Modifier and Type | Field and Description |
|---|---|
static String[] |
ALLOWED_ATTRIBUTES
Allowed attributes
Note: the 'style' attribute isn't allowed by default because of XSS
risks; if you need this attribute (or other attributes not listed here) you
can add it with the
static addAllowedAttribute() method. |
protected static HashSet<String> |
ALLOWED_ATTRIBUTES_SET |
name, originalSource| Modifier and Type | Method and Description |
|---|---|
static boolean |
addAllowedAttribute(String key)
Add an additional allowed attribute name
Note: the 'style' attribute isn't allowed by default because of XSS
risks; if you need this attribute (or other attributes not listed here) you
can add it with this method.
|
boolean |
addAttribute(String attName,
String attValue,
boolean checkXSS)
Add an attribute to this tag.
|
void |
addChild(Object child) |
void |
addChildren(List<?> children) |
void |
addItemForMoving(BaseToken item) |
void |
addObjectAttribute(String attName,
Object attValue)
Add a special object to this TagNode which contains original information
from the parsed wiki object (for example the ImageFormat or original wiki
topic string)
|
Object |
clone() |
static Set<String> |
getAllowedAttributes() |
Map<String,String> |
getAttributes() |
String |
getBodyString()
Get the pure content text without the tags from this HTMLTag
|
List<Object> |
getChildren() |
List<BaseToken> |
getItemsToMove() |
Map<String,Object> |
getObjectAttributes()
Get a special object for this TagNode which contains original information
from the parsed wiki object (for example the ImageFormat or original wiki
topic string).
|
TagNode |
getParent() |
String |
getParents()
Get the allowed parent tags for this tag
|
boolean |
isAllowedAttribute(String attName)
Check, if the attName is allowed.
|
boolean |
isFormed() |
TagNode |
makeCopy() |
void |
renderPlainText(ITextConverter converter,
Appendable buf,
IWikiModel wikiModel) |
void |
serialize(XmlSerializer xmlSerializer) |
void |
setFormed() |
void |
setItemsToMove(List<BaseToken> itemsToMove) |
void |
setParent(TagNode parent) |
equals, getName, getOriginalSource, hashCode, isReduceTokenStack, setName, setOriginalSource, toStringpublic static final String[] ALLOWED_ATTRIBUTES
static addAllowedAttribute() method.public TagNode()
public TagNode(String name)
public static boolean addAllowedAttribute(String key)
public Map<String,Object> getObjectAttributes()
attName - the attribute nameattValue - the attribute valueaddObjectAttribute(String, Object),
ImageFormatpublic TagNode getParent()
public void setParent(TagNode parent)
public boolean addAttribute(String attName, String attValue, boolean checkXSS)
TagTokenaddAttribute in class TagTokenattName - the attribute nameattValue - the attribute's value stringcheckXSS - check the attributes for allowed names to avoid cross side
scriptingpublic boolean isAllowedAttribute(String attName)
TagTokenisAllowedAttribute in class TagTokenpublic void addObjectAttribute(String attName, Object attValue)
attName - the attribute nameattValue - the attribute valuegetObjectAttributes(),
ImageFormatpublic void addChild(Object child)
public void addChildren(List<?> children)
public void addItemForMoving(BaseToken item)
public boolean isFormed()
public void setFormed()
public void serialize(XmlSerializer xmlSerializer) throws IOException
serialize in interface BaseTokenIOExceptionpublic TagNode makeCopy()
public String getParents()
TagTokengetParents in class TagTokennull if no parent tags are allowedpublic void renderPlainText(ITextConverter converter, Appendable buf, IWikiModel wikiModel) throws IOException
renderPlainText in interface PlainTextConvertableIOExceptionpublic String getBodyString()
Copyright © 2017 Java Wikipedia API (Bliki engine). All rights reserved.