net.sf.jett.tag
Class HyperlinkTag

java.lang.Object
  extended by net.sf.jett.tag.BaseTag
      extended by net.sf.jett.tag.HyperlinkTag
All Implemented Interfaces:
Tag

public class HyperlinkTag
extends BaseTag

A HyperlinkTag represents a Cell that needs to have a hyperlink on the cell. It controls Hyperlink properties such link type, the link address, and the link label. Because Excel won't allow other text besides the Hyperlink in the Cell, any text in the Cell but outside of the Hyperlink tag will be removed when the Hyperlink is created.


Attributes:

Since:
0.2.0
Author:
Randy Gettman

Field Summary
static java.lang.String ATTR_ADDRESS
          Attribute that specifies the address of the link, e.g.
static java.lang.String ATTR_TYPE
          Attribute that specifies the link type to be created, which could be a web address, an email address, a document reference, or a file reference.
static java.lang.String ATTR_VALUE
          Attribute that specifies the value of the cell, which is the label for the link.
static java.lang.String TYPE_DOC
          The "type" value indicating a document link, with a cell reference.
static java.lang.String TYPE_EMAIL
          The "type" value indicating an email link with an email address.
static java.lang.String TYPE_FILE
          The "type" value indicating a file link with a pathname.
static java.lang.String TYPE_URL
          The "type" value indicating a web address with a URL.
 
Fields inherited from class net.sf.jett.tag.BaseTag
ATTR_ON_PROCESSED, SPEC_SEP
 
Constructor Summary
HyperlinkTag()
           
 
Method Summary
 java.lang.String getName()
          Returns this Tag's name.
protected  java.util.List<java.lang.String> getOptionalAttributes()
          Returns a List of optional attribute names.
protected  java.util.List<java.lang.String> getRequiredAttributes()
          Returns a List of required attribute names.
 boolean process()
          Place the Hyperlink in the Cell, which replaces any other value left behind in the Cell.
 void validateAttributes()
          Validates the attributes for this Tag.
 
Methods inherited from class net.sf.jett.tag.BaseTag
checkAttributes, clearBlock, deleteBlock, getAttributes, getContext, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setWorkbookContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_TYPE

public static final java.lang.String ATTR_TYPE
Attribute that specifies the link type to be created, which could be a web address, an email address, a document reference, or a file reference. This defaults to a URL link.

See Also:
TYPE_URL, TYPE_EMAIL, TYPE_FILE, TYPE_DOC, Constant Field Values

ATTR_ADDRESS

public static final java.lang.String ATTR_ADDRESS
Attribute that specifies the address of the link, e.g. a web address, an email address, a document reference ("'Some Sheet'!A1"), or a filename ("test.xlsx").

See Also:
Constant Field Values

ATTR_VALUE

public static final java.lang.String ATTR_VALUE
Attribute that specifies the value of the cell, which is the label for the link.

See Also:
Constant Field Values

TYPE_URL

public static final java.lang.String TYPE_URL
The "type" value indicating a web address with a URL.

See Also:
Constant Field Values

TYPE_EMAIL

public static final java.lang.String TYPE_EMAIL
The "type" value indicating an email link with an email address.

See Also:
Constant Field Values

TYPE_FILE

public static final java.lang.String TYPE_FILE
The "type" value indicating a file link with a pathname.

See Also:
Constant Field Values

TYPE_DOC

public static final java.lang.String TYPE_DOC
The "type" value indicating a document link, with a cell reference.

See Also:
Constant Field Values
Constructor Detail

HyperlinkTag

public HyperlinkTag()
Method Detail

getName

public java.lang.String getName()
Returns this Tag's name.

Returns:
This Tag's name.

getRequiredAttributes

protected java.util.List<java.lang.String> getRequiredAttributes()
Returns a List of required attribute names.

Overrides:
getRequiredAttributes in class BaseTag
Returns:
A List of required attribute names.

getOptionalAttributes

protected java.util.List<java.lang.String> getOptionalAttributes()
Returns a List of optional attribute names.

Overrides:
getOptionalAttributes in class BaseTag
Returns:
A List of optional attribute names.

validateAttributes

public void validateAttributes()
                        throws TagParseException
Validates the attributes for this Tag. This tag must be bodiless. The type must be valid.

Overrides:
validateAttributes in class BaseTag
Throws:
TagParseException - If the attribute values are illegal or unacceptable.

process

public boolean process()

Place the Hyperlink in the Cell, which replaces any other value left behind in the Cell.

Specified by:
process in class BaseTag
Returns:
Whether the first Cell in the Block associated with this Tag was processed.


Copyright © 2012-2013 Jett Team. All Rights Reserved.