com.lowagie.text
public class: Meta [javadoc |
source]
java.lang.Object
com.lowagie.text.Meta
All Implemented Interfaces:
Element
Direct Known Subclasses:
Header
This is an
Element
that contains
some meta information about the document.
An object of type Meta
can not be constructed by the user.
User defined meta information should be placed in a Header
-object.
Meta
is reserved for: Subject, Keywords, Author, Title, Producer
and Creationdate information.
Constructor: |
Meta(int type,
String content) {
this.type = type;
this.content = new StringBuffer(content);
}
Parameters:
type - the type of meta-information
content - the content
|
public Meta(String tag,
String content) {
this.type = Meta.getType(tag);
this.content = new StringBuffer(content);
}
Parameters:
tag - the tagname of the meta-information
content - the content
|
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from com.lowagie.text.Meta Detail: |
public StringBuffer append(String string) {
return content.append(string);
}
appends some text to this Meta . |
public ArrayList getChunks() {
return new ArrayList();
}
Gets all the chunks in this element. |
public String getContent() {
return content.toString();
}
Returns the content of the meta information. |
public String getName() {
switch (type) {
case Element.SUBJECT:
return ElementTags.SUBJECT;
case Element.KEYWORDS:
return ElementTags.KEYWORDS;
case Element.AUTHOR:
return ElementTags.AUTHOR;
case Element.TITLE:
return ElementTags.TITLE;
case Element.PRODUCER:
return ElementTags.PRODUCER;
case Element.CREATIONDATE:
return ElementTags.CREATIONDATE;
default:
return ElementTags.UNKNOWN;
}
}
Returns the name of the meta information. |
public static int getType(String tag) {
if (ElementTags.SUBJECT.equals(tag)) {
return Element.SUBJECT;
}
if (ElementTags.KEYWORDS.equals(tag)) {
return Element.KEYWORDS;
}
if (ElementTags.AUTHOR.equals(tag)) {
return Element.AUTHOR;
}
if (ElementTags.TITLE.equals(tag)) {
return Element.TITLE;
}
if (ElementTags.PRODUCER.equals(tag)) {
return Element.PRODUCER;
}
if (ElementTags.CREATIONDATE.equals(tag)) {
return Element.CREATIONDATE;
}
return Element.HEADER;
}
Returns the name of the meta information. |
public boolean isContent() {
return false;
}
|
public boolean isNestable() {
return false;
}
|
public boolean process(ElementListener listener) {
try {
return listener.add(this);
}
catch(DocumentException de) {
return false;
}
}
Processes the element by adding it (or the different parts) to a
ElementListener . |
public int type() {
return type;
}
Gets the type of the text element. |