public class AptUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
encodeAnchor(String id)
Construct a valid anchor.
|
static String |
encodeFragment(String text)
Deprecated.
This method was used for the original apt format, which
removed all non alphanumeric characters from anchors.
Use
encodeAnchor(String) instead. |
static boolean |
isExternalLink(String link)
Checks if the given string corresponds to an external URI,
ie is not a link within the same document nor a link to another
document within the same site.
|
static boolean |
isInternalLink(String link)
Checks if the given string corresponds to an internal link,
ie it is a link to an anchor within the same document.
|
static boolean |
isLocalLink(String link)
Checks if the given string corresponds to a relative link to another document
within the same site.
|
static String |
linkToKey(String text)
Deprecated.
This method was used for the original apt format, which
removed all non alphanumeric characters from anchors.
Use
encodeAnchor(String) instead. |
public static String encodeFragment(String text)
encodeAnchor(String) instead.AptTools.encodeFragment( null ) = null AptTools.encodeFragment( "" ) = "" AptTools.encodeFragment( "http://www.google.com" ) = "httpwwwgooglecom"
text - the String to check, may be null.public static boolean isExternalLink(String link)
DoxiaUtils.isExternalLink(String).link - The link to check.DoxiaUtils.isExternalLink(String),
isInternalLink(String),
isLocalLink(String)public static boolean isInternalLink(String link)
link - The link to check.external
nor a local link.DoxiaUtils.isInternalLink(String),
isExternalLink(String),
isLocalLink(String)public static boolean isLocalLink(String link)
link - The link to check.DoxiaUtils.isLocalLink(String),
isExternalLink(String),
isInternalLink(String)public static String linkToKey(String text)
encodeAnchor(String) instead.text - The text to transform.public static String encodeAnchor(String id)
DoxiaUtils.encodeId(String)
to ensure the anchor is a valid Doxia id.
The procedure is identical to the one in
HtmlTools.encodeId(String):
id - The id to be encoded.Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.