Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
MailtoLinkValidator |
|
| 2.0;2 |
1 | package org.apache.maven.doxia.linkcheck.validation; | |
2 | ||
3 | /* | |
4 | * Licensed to the Apache Software Foundation (ASF) under one | |
5 | * or more contributor license agreements. See the NOTICE file | |
6 | * distributed with this work for additional information | |
7 | * regarding copyright ownership. The ASF licenses this file | |
8 | * to you under the Apache License, Version 2.0 (the | |
9 | * "License"); you may not use this file except in compliance | |
10 | * with the License. You may obtain a copy of the License at | |
11 | * | |
12 | * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | * | |
14 | * Unless required by applicable law or agreed to in writing, | |
15 | * software distributed under the License is distributed on an | |
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
17 | * KIND, either express or implied. See the License for the | |
18 | * specific language governing permissions and limitations | |
19 | * under the License. | |
20 | */ | |
21 | ||
22 | import org.apache.maven.doxia.linkcheck.model.LinkcheckFileResult; | |
23 | ||
24 | /** | |
25 | * Validates mailto links. | |
26 | * | |
27 | * @author <a href="mailto:bwalding@apache.org">Ben Walding</a> | |
28 | * @author <a href="mailto:aheritier@apache.org">Arnaud Heritier</a> | |
29 | * @version $Id: MailtoLinkValidator.java 799838 2009-08-01 11:23:24Z vsiveton $ | |
30 | */ | |
31 | 4 | public final class MailtoLinkValidator |
32 | implements LinkValidator | |
33 | { | |
34 | /** The (unique) LinkValidationResult to be returned by this LinkValidator. */ | |
35 | 2 | private static final LinkValidationResult LVR = |
36 | new LinkValidationResult( LinkcheckFileResult.VALID_LEVEL, false, "" ); | |
37 | ||
38 | /** {@inheritDoc} */ | |
39 | public LinkValidationResult validateLink( LinkValidationItem lvi ) | |
40 | { | |
41 | 2 | return LVR; |
42 | } | |
43 | ||
44 | /** {@inheritDoc} */ | |
45 | public Object getResourceKey( LinkValidationItem lvi ) | |
46 | { | |
47 | 1590 | if ( lvi.getLink().indexOf( '@' ) != -1 ) |
48 | { | |
49 | 6 | return lvi.getLink(); |
50 | } | |
51 | ||
52 | 1584 | return null; |
53 | } | |
54 | } |