public interface XMLDialect
Modifier and Type | Field and Description |
---|---|
static int |
CONSTRAINT_DOCTYPE
Constraint on Doctype name.
|
static int |
CONSTRAINT_DOCTYPE_UNBOXED
Unboxed (of primitive type int) constraint on Doctype name.
|
static int |
CONSTRAINT_PUBLIC_DOCTYPE
Constraint on PUBLIC Doctype declaration.
|
static int |
CONSTRAINT_PUBLIC_DOCTYPE_UNBOXED
Unboxed (of primitive type int) constraint on PUBLIC
Doctype declaration.
|
static int |
CONSTRAINT_ROOT
Constraint on root tag name.
|
static int |
CONSTRAINT_ROOT_UNBOXED
Unboxed (of primitive type int) constraint on root tag
name.
|
static int |
CONSTRAINT_SYSTEM_DOCTYPE
Constraint on SYSTEM Doctype declaration.
|
static int |
CONSTRAINT_SYSTEM_DOCTYPE_UNBOXED
Unboxed (of primitive type int) constraint on SYSTEM
Doctype declaration.
|
static int |
CONSTRAINT_XMLNS
Constraint on xmlns declaration.
|
static int |
CONSTRAINT_XMLNS_UNBOXED
Unboxed (of primitive type int) constraint on xmlns
declaration.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
constructShortcuts(java.util.List<Element> elements,
java.util.List<ProtectedPart> protectedParts)
Returns shortcut string representation of the entry source.
|
java.lang.Boolean |
getClosingTagRequired()
Gives the value of closingTagRequired.
|
java.util.Map<java.lang.Integer,java.util.regex.Pattern> |
getConstraints()
Returns defined constraints to restrict supported subset of XML files.
|
java.util.Map<java.lang.String,Tag.Type> |
getContentBasedTags()
Returns the map of content based tags where key is tag name, value is tag type.
|
java.lang.Boolean |
getForceSpacePreserving()
Gives the value of forceSpacePreserving;
|
java.util.Set<java.lang.String> |
getIntactTags()
Returns the set of tags that surround intact portions of document, that
should not be translated at all.
|
java.util.Set<java.lang.String> |
getOutOfTurnTags()
Returns the set of "out-of-turn" tags.
|
java.util.Set<java.lang.String> |
getParagraphTags()
Returns the set of paragraph tags.
|
java.util.Set<java.lang.String> |
getPreformatTags()
Returns the set of tags that surround preformatted text.
|
java.util.Map<java.lang.String,java.lang.String> |
getShortcuts()
Returns the map of tags to their shortcuts.
|
java.lang.Boolean |
getTagsAggregationEnabled()
Gives the value of tagsAggregationEnabled.
|
java.util.Set<java.lang.String> |
getTranslatableAttributes()
Returns the set of translatable attributes (no matter what tag they
belong to).
|
MultiMap<java.lang.String,java.lang.String> |
getTranslatableTagAttributes()
Returns the multimap of translatable attributes of each tag.
|
void |
handleXMLTag(XMLTag tag,
boolean translated)
Implement general purpose function to handle XML tag/attributes when necessary.
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Resolves external entites if child filter needs it.
|
void |
setClosingTagRequired(boolean onOff)
Sets closingTag to
true or false |
void |
setForceSpacePreserving(boolean onOff)
Set forceSpacePreserving.
|
void |
setTagsAggregationEnabled(boolean onOff)
Sets tagsAggregationEnabled to
true or false |
java.lang.Boolean |
validateContentBasedTag(java.lang.String tag,
Attributes atts)
For a given tag, return wether the content of this tag should be
translated, depending on the content of one attribute and the presence or
absence of other attributes.
|
java.lang.Boolean |
validateIntactTag(java.lang.String tag,
Attributes atts)
For a given tag, return wether the content of this tag should be
translated, depending on the content of one attribute and the presence or
absence of other attributes.
|
java.lang.Boolean |
validateParagraphTag(java.lang.String tag,
Attributes atts)
For a given tag, return wether the content of this tag is a paragraph
tag, depending on the content of one attribute (and/or the presence or
absence of other attributes).
|
java.lang.Boolean |
validatePreformatTag(java.lang.String tag,
Attributes atts)
For a given tag, return wether the content of this tag is a preformat
tag, depending on the content of one attribute (and/or the presence or
absence of other attributes).
|
java.lang.Boolean |
validateTranslatableTag(java.lang.String tag,
Attributes atts)
For a given tag, return wether the content of this tag should be
translated, depending on the content of one attribute and the presence or
absence of other attributes.
|
java.lang.Boolean |
validateTranslatableTagAttribute(java.lang.String tag,
java.lang.String attribute,
Attributes atts)
Returns for a given attribute of a given tag if the attribute should be
translated with the given other attributes present.
|
static final int CONSTRAINT_DOCTYPE_UNBOXED
static final int CONSTRAINT_PUBLIC_DOCTYPE_UNBOXED
static final int CONSTRAINT_SYSTEM_DOCTYPE_UNBOXED
static final int CONSTRAINT_ROOT_UNBOXED
static final int CONSTRAINT_XMLNS_UNBOXED
static final int CONSTRAINT_DOCTYPE
static final int CONSTRAINT_PUBLIC_DOCTYPE
static final int CONSTRAINT_SYSTEM_DOCTYPE
static final int CONSTRAINT_ROOT
static final int CONSTRAINT_XMLNS
java.util.Set<java.lang.String> getParagraphTags()
Each entry in a set should be a String class.
java.util.Set<java.lang.String> getPreformatTags()
Each entry in a set should be a String class.
java.util.Map<java.lang.String,Tag.Type> getContentBasedTags()
java.util.Set<java.lang.String> getIntactTags()
Each entry in a set should be a String class.
java.util.Set<java.lang.String> getOutOfTurnTags()
Each entry in a set should be a String class.
java.lang.String constructShortcuts(java.util.List<Element> elements, java.util.List<ProtectedPart> protectedParts)
Here's <b>bold text</b>
should return
Here's <b0>bold text</b0>
.MultiMap<java.lang.String,java.lang.String> getTranslatableTagAttributes()
Each entry should map from a String to a set of Strings.
java.lang.Boolean validateTranslatableTagAttribute(java.lang.String tag, java.lang.String attribute, Attributes atts)
java.lang.Boolean validateIntactTag(java.lang.String tag, Attributes atts)
tag
- The tag that could be translatedatts
- The list of the tag attributestrue
or false
java.lang.Boolean validateContentBasedTag(java.lang.String tag, Attributes atts)
tag
- The tag that could be translatedatts
- The list of the tag attributestrue
or false
java.lang.Boolean validateTranslatableTag(java.lang.String tag, Attributes atts)
tag
- The tag that could be translatedatts
- The list of the tag attributestrue
or false
java.lang.Boolean validateParagraphTag(java.lang.String tag, Attributes atts)
tag
- The tag that could be a paragraph tagatts
- The list of the tag attributestrue
or false
java.lang.Boolean validatePreformatTag(java.lang.String tag, Attributes atts)
tag
- The tag that could be a preformat tagatts
- The list of the tag attributestrue
or false
java.util.Set<java.lang.String> getTranslatableAttributes()
Each entry in a set should be a String class.
java.util.Map<java.lang.String,java.lang.String> getShortcuts()
Each entry should map a String
to a String
-- a tag to
its shortcut.
java.util.Map<java.lang.Integer,java.util.regex.Pattern> getConstraints()
Each entry should map an Integer
to a Pattern
-- regular
expression for a specified constrained string.
org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
null
if it doesn't or cannot.void setClosingTagRequired(boolean onOff)
true
or false
onOff
- The parameter setting wether closing tags should be used or
not for empty tags.java.lang.Boolean getClosingTagRequired()
void setTagsAggregationEnabled(boolean onOff)
true
or false
onOff
- The parameter setting whether tags aggregation can be enabled
in order to reduce the number of tags shown to the user.java.lang.Boolean getTagsAggregationEnabled()
java.lang.Boolean getForceSpacePreserving()
void setForceSpacePreserving(boolean onOff)
void handleXMLTag(XMLTag tag, boolean translated)
tag
-