Package org.dlese.dpc.schemedit.input
Class ReferenceResolver
java.lang.Object
org.dlese.dpc.schemedit.input.ReferenceResolver
Resolves numeric and character references (e.g, or δ) into
their unicode representations.
- Author:
- ostwald
$Id $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassReturned by ReferenceResolver.resolve storing the resolved input string and a list of errors describing references that could not be resolved. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MapGets a mapping from HTML 4 character entity references to their numeric equivalents (see http://www.w3.org/TR/REC-html40/sgml/entities.html#h-24.3.1)static voidThe main program for the ReferenceResolver classResolves a string by replacing numeric (e.g., ©) and character references (e.g., δ) with thier equivalent unicode representation.static StringEscape all escaped ampersands (&) as a preprocessing step in resolution of entity references.
-
Field Details
-
charEntityMap
Description of the Field
-
-
Constructor Details
-
ReferenceResolver
public ReferenceResolver()Constructor for the ReferenceResolver object
-
-
Method Details
-
resolve
Resolves a string by replacing numeric (e.g., ©) and character references (e.g., δ) with thier equivalent unicode representation. Returns results as a ResolverResult instance, which contains the resolved string, as well as errors encountered, if any- Parameters:
in- Description of the Parameter- Returns:
- Description of the Return Value
-
unescapeAmpersands
Escape all escaped ampersands (&) as a preprocessing step in resolution of entity references. For example, "©" and "©" both become "invalid input: '©'". Even "&" is contracted.- Parameters:
in- String to be processed- Returns:
- processed string
-
main
The main program for the ReferenceResolver class- Parameters:
args- The command line arguments- Throws:
Exception- Description of the Exception
-
getCharEntityMap
Gets a mapping from HTML 4 character entity references to their numeric equivalents (see http://www.w3.org/TR/REC-html40/sgml/entities.html#h-24.3.1)- Returns:
- The charEntityMap value
-