public final class TagUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TagUtil.Tag |
static class |
TagUtil.TagInfo
A tuple containing
A tag's name
The tag's
TagUtil.TagType type
|
static class |
TagUtil.TagType
Indicates the type of a tag, e.g.:
<foo> = START
</foo> = END
<bar/> = SINGLE
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG_SEPARATOR_SENTINEL |
static char |
TEXT_REPLACEMENT |
Modifier and Type | Method and Description |
---|---|
static void |
addExtraTags(java.util.List<TagUtil.Tag> resultList,
java.util.List<TagUtil.Tag> srcTags,
java.lang.String str) |
static java.util.List<ProtectedPart> |
applyCustomProtectedParts(java.lang.String source,
java.util.regex.Pattern protectedPartsPatterns,
java.util.List<ProtectedPart> protectedParts)
Find some protected parts according to the given regular expression.
|
static java.util.List<TagUtil.Tag> |
buildTagList(java.lang.String str,
ProtectedPart[] protectedParts)
Builds a list of format tags within the supplied string.
|
static java.lang.String |
buildTagListForRemove(java.lang.String str)
Builds a list of format tags within the supplied string.
|
static boolean |
containsTag(java.util.List<TagUtil.Tag> tags,
java.lang.String tag)
Check whether a tag belongs to a list of tags
|
static java.util.List<TagUtil.Tag> |
getAllTagsInSource() |
static java.util.List<TagUtil.Tag> |
getAllTagsMissingFromTarget() |
static java.lang.String |
getFirstTag(java.lang.String str)
Find the first tag in a segment
|
static java.util.List<java.lang.String> |
getGroupedMissingTagsFromTarget() |
static java.lang.String |
stripXmlTags(java.lang.String xml)
Strips all XML tags (converts to plain text).
|
public static final java.lang.String TAG_SEPARATOR_SENTINEL
public static final char TEXT_REPLACEMENT
public static java.util.List<TagUtil.Tag> getAllTagsInSource()
public static java.util.List<TagUtil.Tag> getAllTagsMissingFromTarget()
public static java.util.List<java.lang.String> getGroupedMissingTagsFromTarget()
public static java.util.List<TagUtil.Tag> buildTagList(java.lang.String str, ProtectedPart[] protectedParts)
public static void addExtraTags(java.util.List<TagUtil.Tag> resultList, java.util.List<TagUtil.Tag> srcTags, java.lang.String str)
public static boolean containsTag(java.util.List<TagUtil.Tag> tags, java.lang.String tag)
tags
- tag
- public static java.lang.String buildTagListForRemove(java.lang.String str)
public static java.lang.String getFirstTag(java.lang.String str)
str
- A segmentpublic static java.util.List<ProtectedPart> applyCustomProtectedParts(java.lang.String source, java.util.regex.Pattern protectedPartsPatterns, java.util.List<ProtectedPart> protectedParts)
public static java.lang.String stripXmlTags(java.lang.String xml)