public class InternetTags extends Test
Test.TagTest
Modifier and Type | Field and Description |
---|---|
private static Pattern |
ASCII_PATTERN |
private static String[] |
EMAIL_KEYS
List of keys subject to email validation.
|
static int |
INVALID_EMAIL
Error code for an invalid e-mail
|
static int |
INVALID_URL
Error code for an invalid URL
|
private static String[] |
URL_KEYS
List of keys subject to URL validation.
|
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, startTime, testBeforeUpload
Constructor and Description |
---|
InternetTags()
Constructs a new
InternetTags test. |
Modifier and Type | Method and Description |
---|---|
private boolean |
doTest(OsmPrimitive p,
String k,
String[] keys,
AbstractValidator validator,
int code)
Potentially validates a given primitive key against a given validator.
|
private TestError |
doValidateTag(OsmPrimitive p,
String k,
String v,
AbstractValidator validator,
int code)
Validates a given primitive tag against a given validator.
|
private void |
test(OsmPrimitive p) |
TestError |
validateTag(OsmPrimitive p,
String k,
AbstractValidator validator,
int code)
Validates a given primitive tag against a given validator.
|
void |
visit(Node n)
Visiting call for points.
|
void |
visit(Relation r)
Visiting call for relations.
|
void |
visit(Way w)
Visiting call for lines.
|
addGui, deletePrimitivesIfNeeded, endTest, equals, fixError, getErrors, getName, hashCode, initialize, isBuilding, isCanceled, isFixable, isPrimitiveUsable, ok, setBeforeUpload, setPartialSelection, startTest, testBeforeUpload, visit
visit
public static final int INVALID_URL
public static final int INVALID_EMAIL
private static final Pattern ASCII_PATTERN
private static String[] EMAIL_KEYS
public InternetTags()
InternetTags
test.private boolean doTest(OsmPrimitive p, String k, String[] keys, AbstractValidator validator, int code)
p
- The OSM primitive to testk
- The key to validatekeys
- The list of keys to check. If k
is not inside this collection, do nothingvalidator
- The validator to run if k
is inside keys
code
- The error code to set if the validation failstrue
if the validation fails. In this case, a new error has been created.public TestError validateTag(OsmPrimitive p, String k, AbstractValidator validator, int code)
p
- The OSM primitive to testk
- The key to validatevalidator
- The validator to runcode
- The error code to set if the validation failsnull
otherwiseprivate TestError doValidateTag(OsmPrimitive p, String k, String v, AbstractValidator validator, int code)
p
- The OSM primitive to testk
- The key to validatev
- The value to validate. May be null
to use p.get(k)
validator
- The validator to runcode
- The error code to set if the validation failsnull
otherwiseprivate void test(OsmPrimitive p)
public void visit(Node n)
Visitor