public class ValueChecker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,Pattern> |
replacements |
Constructor and Description |
---|
ValueChecker()
Constructs a ValueChecker object that will be used for checking (and possibly correcting) literals for specific anomalies before issuing RDF triples
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
cleanupURL(java.lang.String val)
Restores the given string value as a URL
|
java.lang.String |
findReplacePattern(java.lang.String val,
Pattern p)
Find a given pattern (i.e., regular expression) and replace it with another string in a literal.
|
java.lang.String |
findReplaceSubstring(java.lang.String val,
Pattern p)
Find a given substring and replace it with another string in a literal.
|
java.lang.String |
removeDelimiter(java.lang.String val)
Eliminates any appearance of the delimiter character in the given string value (literal)
|
java.lang.String |
removeIllegalChars(java.lang.String val)
Eliminates illegal characters from the given string value (literal)
|
java.lang.String |
replaceWhiteSpace(java.lang.String val)
Remove whitespace characters from a string literal
|
private java.util.Map<java.lang.String,Pattern> replacements
public ValueChecker()
public java.lang.String removeIllegalChars(java.lang.String val)
val
- A string value.public java.lang.String removeDelimiter(java.lang.String val)
val
- A string value.public java.lang.String cleanupURL(java.lang.String val)
val
- A string value representing a URLpublic java.lang.String replaceWhiteSpace(java.lang.String val)
val
- A string value that possibly contains whitespacepublic java.lang.String findReplaceSubstring(java.lang.String val, Pattern p)
val
- A literal value to be searched for the substring.p
- A pattern specifying a search and a replacement string (specified in the external resource XML file).public java.lang.String findReplacePattern(java.lang.String val, Pattern p)
val
- A literal value to be searched for the pattern.p
- A pattern specifying a search regular expression and a replacement string (specified in the external resource XML file).