Class HyperlinkUtil
- java.lang.Object
-
- net.sf.jasperreports.engine.export.HyperlinkUtil
-
public final class HyperlinkUtil extends Object
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
LINK_PARAM_NAME_GROUP
protected static Pattern
LINK_PATTERN
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Boolean
getIgnoreHyperlink(String propName, JRPrintHyperlink link)
static String
makeLinkParameterName(JRPrintHyperlink hyperlink)
Returns the name of the parameter to be used for a hyperlink, as used bymakeLinkPlaceholder(JRPrintHyperlink)
andresolveLinks(String, JRGenericPrintElement, JRHyperlinkProducer, boolean)
.static String
makeLinkPlaceholder(String linkId)
Returns a placeholder to be used in a Flash variable for a hyperlink.static String
makeLinkPlaceholder(JRPrintHyperlink hyperlink)
Returns a placeholder to be used in a Flash variable for a hyperlink.static String
resolveLinks(String text, JRGenericPrintElement element, JRHyperlinkProducer linkProducer, boolean prepareForSerialization)
Resolves hyperlink placeholders to URLs in a Flash variable.
-
-
-
Field Detail
-
LINK_PATTERN
protected static final Pattern LINK_PATTERN
-
LINK_PARAM_NAME_GROUP
protected static final int LINK_PARAM_NAME_GROUP
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIgnoreHyperlink
public static Boolean getIgnoreHyperlink(String propName, JRPrintHyperlink link)
-
makeLinkParameterName
public static String makeLinkParameterName(JRPrintHyperlink hyperlink)
Returns the name of the parameter to be used for a hyperlink, as used bymakeLinkPlaceholder(JRPrintHyperlink)
andresolveLinks(String, JRGenericPrintElement, JRHyperlinkProducer, boolean)
.- Parameters:
hyperlink
- the hyperlink- Returns:
- the hyperlink parameter name
- See Also:
makeLinkPlaceholder(JRPrintHyperlink)
-
makeLinkPlaceholder
public static String makeLinkPlaceholder(JRPrintHyperlink hyperlink)
Returns a placeholder to be used in a Flash variable for a hyperlink.This method uses
System.identityHashCode(hyperlink)
as link Id.- Parameters:
hyperlink
- the hyperlink- Returns:
- the link placeholder
- See Also:
makeLinkPlaceholder(String)
-
makeLinkPlaceholder
public static String makeLinkPlaceholder(String linkId)
Returns a placeholder to be used in a Flash variable for a hyperlink.The placeholders will be resolved to links at export time by
resolveLinks(String, JRGenericPrintElement, JRHyperlinkProducer, boolean)
.- Parameters:
linkId
- the Id of the link, which needs to be used as hyperlink parameter name- Returns:
- the link placeholder
-
resolveLinks
public static String resolveLinks(String text, JRGenericPrintElement element, JRHyperlinkProducer linkProducer, boolean prepareForSerialization)
Resolves hyperlink placeholders to URLs in a Flash variable.- Parameters:
text
- the text in which hyperlink placeholders are to be replacedelement
- the print element where hyperlink parameters will be looked forlinkProducer
- the hyperlink producer which transforms hyperlink objects to String URLs- Returns:
- the text with hyperlink placeholders replaced by URLs
- See Also:
makeLinkPlaceholder(String)
-
-