Class EntityResolver
java.lang.Object
de.pdark.decentxml.EntityResolver
- Direct Known Subclasses:
DocTypeEntityResolver, HTMLEntityResolver
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEscape for "invalid input: '&'" (ampersand)static final StringEscape for "'" (single quote or apostrophe)private CharValidatorstatic final StringEscape for ">" (greater than)static final StringEscape for "invalid input: '<'" (less than)private EntityResolverstatic final StringEscape for '"' (double quote) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new entityvoidclear()Remove all definitions from the map except the standard XML entities (<, >, ...)Replace text in a string with entity referencesExpand an entity reference.intexpandNumericEntity(String entity) Returns the character value of a numeric entity.booleanCheck if an entity is defined.Resolve an entity reference.setCharValidator(CharValidator charValidator) protected StringvoidvalidateEntity(String entity)
-
Field Details
-
AMP_ESCAPE
-
LT_ESCAPE
-
GT_ESCAPE
-
QUOT_ESCAPE
-
APOS_ESCAPE
-
parent
-
resolveMap
-
charValidator
-
-
Constructor Details
-
EntityResolver
public EntityResolver() -
EntityResolver
-
-
Method Details
-
getParent
-
getCharValidator
-
setCharValidator
-
clear
public void clear()Remove all definitions from the map except the standard XML entities (<, >, ...) -
add
-
isDefined
Check if an entity is defined.- Parameters:
name- The name of an entity ("lt" or "<").- Returns:
- the value of the entity or
null
-
resolve
-
stripName
-
expand
-
encode
-
expandNumericEntity
Returns the character value of a numeric entity.NOTE: This method returns a "code point", not a character. One "code point" can map to one or two Java characters!
- Throws:
IllegalArgumentException- if the numeric entity has the wrong format, or the value is too low or high.
-
validateEntity
-