public class HTMLHead extends HTMLTagAttributes implements java.io.Serializable
This example creates an HTMLHead tag:
// Create an HTMLHead with a title. HTMLHead head = new HTMLHead("My HTML Document"); // Create an HTMLMeta. HTMLMeta meta = new HTMLMeta("expires", "Mon, 01 Jun 2000 12:00:00 CST"); HTMLMeta meta2 = new HTMLMeta("refresh", "5", "http://www.sample.com/next.html"); // Add the meta information to the HTMLHead head.addMetaInformation(meta); head.addMetaInformation(meta2);
Here is the output of the HTMLHead tag:
Using XSL Formatting Objects, the head tag represents a page header.<head> <meta http-equiv="expired" content="Mon, 06 Jun 2000 12:00:00 CST" /> <meta http-equiv="refresh" content="5; URL=http://www.sample.com/next.html" /> <title>My HTML Document</title> </head>
Calling getFOTag() would produce the following.
<fo:static-content flow-name='xsl-region-before'> <fo:block-container> My HTML Document</fo:block-container> </fo:static-content>
HTMLHead objects generate the following events:
Constructor and Description |
---|
HTMLHead()
Constructs a default HTMLHead object.
|
HTMLHead(java.lang.String title)
Constructs an HTMLHead object with the specified title.
|
HTMLHead(java.lang.String title,
HTMLMeta meta)
Constructs an HTMLHead object with the specified title and meta information.
|
Modifier and Type | Method and Description |
---|---|
void |
addMetaInformation(HTMLMeta meta)
Adds HTMLMeta information to the HTMLHead.
|
void |
addMetaInformationElementListener(ElementListener listener)
Adds an ElementListener.
|
java.lang.String |
getDirection()
Returns the direction of the text interpretation.
|
java.lang.String |
getFOTag()
Returns the tag for the XSL-FO header.
|
java.lang.String |
getLanguage()
Returns the language of the head element.
|
java.lang.String |
getTag()
Returns the tag for the HTML alignment.
|
java.lang.String |
getTitle()
Returns the title of the HTMLHead object.
|
boolean |
isUseFO()
Returns if Formatting Object tags are outputted.
|
void |
removeMetaInformation(HTMLMeta meta)
Removes an HTMLMeta from the HTMLHead.
|
void |
removeMetaInformationElementListener(ElementListener listener)
Removes this ElementListener.
|
void |
setDirection(java.lang.String dir)
Sets the direction of the text interpretation.
|
void |
setLanguage(java.lang.String lang)
Sets the language of the HTMLHead tag.
|
void |
setTitle(java.lang.String title)
Sets the title of the HTML document.
|
void |
setUseFO(boolean useFO)
Sets if Formatting Object tags should be used.
|
java.lang.String |
toString()
Returns a String representation for the HTMLHead tag.
|
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
public HTMLHead()
public HTMLHead(java.lang.String title)
title
- The title of the HTML document.public HTMLHead(java.lang.String title, HTMLMeta meta)
title
- The title of the HTML document.meta
- The HTML meta information.public void addMetaInformation(HTMLMeta meta)
meta
- The meta information to add.public void addMetaInformationElementListener(ElementListener listener)
listener
- The ElementListener.public java.lang.String getDirection()
public java.lang.String getLanguage()
public java.lang.String getTag()
getTag
in interface HTMLTagElement
public java.lang.String getFOTag()
getFOTag
in interface HTMLTagElement
public java.lang.String getTitle()
public boolean isUseFO()
public void removeMetaInformationElementListener(ElementListener listener)
listener
- The ElementListener.public void removeMetaInformation(HTMLMeta meta)
meta
- The meta information to remove.public void setDirection(java.lang.String dir)
dir
- The direction. One of the following constants
defined in HTMLConstants: LTR or RTL.HTMLConstants
public void setLanguage(java.lang.String lang)
lang
- The language. Example language tags include:
en and en-US.public void setTitle(java.lang.String title)
title
- The title of the HTML document.public void setUseFO(boolean useFO)
useFO
- - true if output generated is an XSL formatting object, false if the output generated is HTML.public java.lang.String toString()
toString
in class java.lang.Object