org.apache.fop.pdf

Class PDFDictionary

Implemented Interfaces:
PDFWritable
Known Direct Subclasses:
AbstractPDFStream, PDFEncoding, PDFFont, PDFFontDescriptor, PDFNames, PDFNameTreeNode, PDFNumberTreeNode, PDFResourceContext, PDFRoot, TransitionDictionary

public class PDFDictionary
extends PDFObject

Class representing a PDF dictionary object

Field Summary

protected Map
entries
the entry map
protected List
order
maintains the order of the entries added to the entry map.

Fields inherited from class org.apache.fop.pdf.PDFObject

DATE_FORMAT, log

Constructor Summary

PDFDictionary()
Create a new dictionary object.
PDFDictionary(PDFObject parent)
Create a new dictionary object.

Method Summary

Object
get(String name)
Returns the value given a name.
protected int
output(OutputStream stream)
void
put(String name, Object value)
Puts a new name/value pair.
void
put(String name, int value)
Puts a new name/value pair.
protected void
writeDictionary(OutputStream out, Writer writer)
Writes the contents of the dictionary to a StringBuffer.

Methods inherited from class org.apache.fop.pdf.PDFObject

encode, encodeBinaryToHexString, encodeString, encodeText, formatDateTime, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setParent, toPDF, toPDFString

Field Details

entries

protected Map entries
the entry map

order

protected List order
maintains the order of the entries added to the entry map. Whenever you modify "entries", always make sure you adjust this list accordingly.

Constructor Details

PDFDictionary

public PDFDictionary()
Create a new dictionary object.

PDFDictionary

public PDFDictionary(PDFObject parent)
Create a new dictionary object.
Parameters:
parent - the object's parent if any

Method Details

get

public Object get(String name)
Returns the value given a name.
Parameters:
name - the name of the value
Returns:
the value or null, if there's no value with the given name.

output

protected int output(OutputStream stream)
            throws IOException
Overrides:
output in interface PDFObject

put

public void put(String name,
                Object value)
Puts a new name/value pair.
Parameters:
name - the name
value - the value

put

public void put(String name,
                int value)
Puts a new name/value pair.
Parameters:
name - the name
value - the value

writeDictionary

protected void writeDictionary(OutputStream out,
                               Writer writer)
            throws IOException
Writes the contents of the dictionary to a StringBuffer.
Parameters:
out - the OutputStream (for binary content)
writer - the Writer (for text content, wraps the above OutputStream)

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.