public class InternetTags extends Test
Test.TagTest
Modifier and Type | Field and Description |
---|---|
private static java.lang.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 java.lang.String[] |
URL_KEYS
List of keys subject to URL validation.
|
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, 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,
java.lang.String k,
java.lang.String[] keys,
AbstractValidator validator,
int code)
Potentially validates a given primitive key against a given validator.
|
private TestError |
doValidateTag(OsmPrimitive p,
java.lang.String k,
java.lang.String v,
AbstractValidator validator,
int code)
Validates a given primitive tag against a given validator.
|
private void |
test(OsmPrimitive p) |
TestError |
validateTag(OsmPrimitive p,
java.lang.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, compareTo, deletePrimitivesIfNeeded, endTest, equals, fixError, getErrors, getName, hashCode, initialize, isBuilding, isCanceled, isFixable, isPrimitiveUsable, ok, setBeforeUpload, setPartialSelection, startTest, testBeforeUpload, visit
public static final int INVALID_URL
public static final int INVALID_EMAIL
private static final java.lang.String[] URL_KEYS
private static final java.lang.String[] EMAIL_KEYS
public InternetTags()
InternetTags
test.private boolean doTest(OsmPrimitive p, java.lang.String k, java.lang.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, java.lang.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, java.lang.String k, java.lang.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)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
visit
in class Test
n
- The node to inspect.public void visit(Way w)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
visit
in class Test
w
- The way to inspect.public void visit(Relation r)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
visit
in class Test
r
- The relation to inspect.