net.sf.jasperreports.engine
Class JRHyperlinkHelper

java.lang.Object
  extended by net.sf.jasperreports.engine.JRHyperlinkHelper

public class JRHyperlinkHelper
extends java.lang.Object

Utility class that manages built-in hyperlink types.

Version:
$Id: JRHyperlinkHelper.java 1720 2007-05-07 10:02:56Z lucianc $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)

Field Summary
static java.lang.String HYPERLINK_TYPE_LOCAL_ANCHOR
          "LocalAnchor" link type, equivalent to JRHyperlink.HYPERLINK_LOCAL_ANCHOR.
static java.lang.String HYPERLINK_TYPE_LOCAL_PAGE
          "LocalPage" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_LOCAL_PAGE.
static java.lang.String HYPERLINK_TYPE_NONE
          "None" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_NONE.
static java.lang.String HYPERLINK_TYPE_REFERENCE
          "Reference" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_REFERENCE.
static java.lang.String HYPERLINK_TYPE_REMOTE_ANCHOR
          "RemoteAnchor" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_REMOTE_ANCHOR.
static java.lang.String HYPERLINK_TYPE_REMOTE_PAGE
          "RemotePage" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_REMOTE_PAGE.
 
Constructor Summary
JRHyperlinkHelper()
           
 
Method Summary
static byte getHyperlinkType(JRHyperlink hyperlink)
          Returns the built-in hyperlink type, or JRHyperlink.HYPERLINK_TYPE_CUSTOM if the type is not a built-in type.
static byte getHyperlinkType(java.lang.String linkType)
          Returns the built-in hyperlink type, or JRHyperlink.HYPERLINK_TYPE_CUSTOM if the type is not a built-in type.
static java.lang.String getLinkType(byte hyperlinkType)
          Returns the link type associated with a built-in type.
static boolean isEmpty(JRHyperlink hyperlink)
          Decides whether a hyperlink is empty or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HYPERLINK_TYPE_NONE

public static final java.lang.String HYPERLINK_TYPE_NONE
"None" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_NONE.

See Also:
Constant Field Values

HYPERLINK_TYPE_REFERENCE

public static final java.lang.String HYPERLINK_TYPE_REFERENCE
"Reference" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_REFERENCE.

See Also:
Constant Field Values

HYPERLINK_TYPE_LOCAL_ANCHOR

public static final java.lang.String HYPERLINK_TYPE_LOCAL_ANCHOR
"LocalAnchor" link type, equivalent to JRHyperlink.HYPERLINK_LOCAL_ANCHOR.

See Also:
Constant Field Values

HYPERLINK_TYPE_LOCAL_PAGE

public static final java.lang.String HYPERLINK_TYPE_LOCAL_PAGE
"LocalPage" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_LOCAL_PAGE.

See Also:
Constant Field Values

HYPERLINK_TYPE_REMOTE_ANCHOR

public static final java.lang.String HYPERLINK_TYPE_REMOTE_ANCHOR
"RemoteAnchor" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_REMOTE_ANCHOR.

See Also:
Constant Field Values

HYPERLINK_TYPE_REMOTE_PAGE

public static final java.lang.String HYPERLINK_TYPE_REMOTE_PAGE
"RemotePage" link type, equivalent to JRHyperlink.HYPERLINK_TYPE_REMOTE_PAGE.

See Also:
Constant Field Values
Constructor Detail

JRHyperlinkHelper

public JRHyperlinkHelper()
Method Detail

getHyperlinkType

public static byte getHyperlinkType(JRHyperlink hyperlink)
Returns the built-in hyperlink type, or JRHyperlink.HYPERLINK_TYPE_CUSTOM if the type is not a built-in type.

Parameters:
hyperlink - the hyperlink object
Returns:
the hyperlink type

getHyperlinkType

public static byte getHyperlinkType(java.lang.String linkType)
Returns the built-in hyperlink type, or JRHyperlink.HYPERLINK_TYPE_CUSTOM if the type is not a built-in type.

Parameters:
linkType - the link type
Returns:
the hyperlink type

getLinkType

public static java.lang.String getLinkType(byte hyperlinkType)
Returns the link type associated with a built-in type.

Parameters:
hyperlinkType - the built-in type
Returns:
the String link type

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 is HYPERLINK_TYPE_NONE and it doesn't include a tooltip expression

Parameters:
hyperlink - the hyperlink
Returns:
whether the hyperlink is empty


© 2001-2006 JasperSoft Corporation www.jaspersoft.com