Package net.sf.jasperreports.engine
Class JRHyperlinkHelper
- java.lang.Object
-
- net.sf.jasperreports.engine.JRHyperlinkHelper
-
public final class JRHyperlinkHelper extends Object
Utility class that manages built-in hyperlink types.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_TARGET_BYTE_CONSTANT_USED
static String
EXCEPTION_MESSAGE_KEY_TYPE_BYTE_CONSTANT_USED
static String
EXCEPTION_MESSAGE_KEY_UNKNOWN_HYPERLINK_TARGET
static String
EXCEPTION_MESSAGE_KEY_UNKNOWN_HYPERLINK_TYPE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HyperlinkTargetEnum
getHyperlinkTarget(String linkTarget)
Returns the built-in hyperlink target, orHyperlinkTargetEnum.CUSTOM
if the target name is not a built-in one.static HyperlinkTargetEnum
getHyperlinkTarget(JRHyperlink hyperlink)
Returns the built-in hyperlink target, orHyperlinkTargetEnum.CUSTOM
if the target name is not a built-in one.static HyperlinkTypeEnum
getHyperlinkType(String linkType)
Returns the built-in hyperlink type, orHyperlinkTypeEnum.CUSTOM
if the type is not a built-in type.static HyperlinkTypeEnum
getHyperlinkType(JRHyperlink hyperlink)
Returns the built-in hyperlink type, orHyperlinkTypeEnum.CUSTOM
if the type is not a built-in type.static String
getLinkTarget(HyperlinkTargetEnum hyperlinkTarget)
Returns the link target associated with a built-in target.static String
getLinkType(HyperlinkTypeEnum hyperlinkType)
Returns the link type associated with a built-in type.static boolean
isEmpty(JRHyperlink hyperlink)
Decides whether a hyperlink is empty or not.
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_TARGET_BYTE_CONSTANT_USED
public static final String EXCEPTION_MESSAGE_KEY_TARGET_BYTE_CONSTANT_USED
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_TYPE_BYTE_CONSTANT_USED
public static final String EXCEPTION_MESSAGE_KEY_TYPE_BYTE_CONSTANT_USED
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_UNKNOWN_HYPERLINK_TARGET
public static final String EXCEPTION_MESSAGE_KEY_UNKNOWN_HYPERLINK_TARGET
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_UNKNOWN_HYPERLINK_TYPE
public static final String EXCEPTION_MESSAGE_KEY_UNKNOWN_HYPERLINK_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getHyperlinkType
public static HyperlinkTypeEnum getHyperlinkType(JRHyperlink hyperlink)
Returns the built-in hyperlink type, orHyperlinkTypeEnum.CUSTOM
if the type is not a built-in type.- Parameters:
hyperlink
- the hyperlink object- Returns:
- the hyperlink type
-
getHyperlinkType
public static HyperlinkTypeEnum getHyperlinkType(String linkType)
Returns the built-in hyperlink type, orHyperlinkTypeEnum.CUSTOM
if the type is not a built-in type.- Parameters:
linkType
- the link type- Returns:
- the hyperlink type
-
getHyperlinkTarget
public static HyperlinkTargetEnum getHyperlinkTarget(JRHyperlink hyperlink)
Returns the built-in hyperlink target, orHyperlinkTargetEnum.CUSTOM
if the target name is not a built-in one.- Parameters:
hyperlink
- the hyperlink object- Returns:
- the hyperlink target
-
getHyperlinkTarget
public static HyperlinkTargetEnum getHyperlinkTarget(String linkTarget)
Returns the built-in hyperlink target, orHyperlinkTargetEnum.CUSTOM
if the target name is not a built-in one.- Parameters:
linkTarget
- the link target type- Returns:
- the hyperlink target
-
getLinkType
public static String getLinkType(HyperlinkTypeEnum hyperlinkType)
Returns the link type associated with a built-in type.- Parameters:
hyperlinkType
- the built-in type- Returns:
- the String link type
-
getLinkTarget
public static String getLinkTarget(HyperlinkTargetEnum hyperlinkTarget)
Returns the link target associated with a built-in target.- Parameters:
hyperlinkTarget
- the built-in target type- Returns:
- the String link target
-
isEmpty
public static boolean isEmpty(JRHyperlink hyperlink)
Decides whether a hyperlink is empty or not.The hyperlink is considered empty when it's
null
or when its type isNONE
and it doesn't include a tooltip expression- Parameters:
hyperlink
- the hyperlink- Returns:
- whether the hyperlink is empty
-
-