Package org.apache.fop.pdf
Class PDFDictionary
- java.lang.Object
-
- org.apache.fop.pdf.PDFObject
-
- org.apache.fop.pdf.PDFDictionary
-
- All Implemented Interfaces:
PDFWritable
- Direct Known Subclasses:
PDFDPart,PDFDPartRoot,PDFEncoding,PDFFileSpec,PDFFont,PDFFontDescriptor,PDFIdentifiedDictionary,PDFNames,PDFNameTreeNode,PDFNumberTreeNode,PDFResourceContext,PDFResources,PDFRoot,StructureHierarchyMember,TransitionDictionary
public class PDFDictionary extends PDFObject
Class representing a PDF dictionary object
-
-
Constructor Summary
Constructors Constructor Description PDFDictionary()Create a new dictionary object.PDFDictionary(PDFObject parent)Create a new dictionary object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(java.lang.String name)java.lang.Objectget(java.lang.String name)Returns the value given a name.static voidgetChildren(java.util.Collection<java.lang.Object> values, java.util.Set<PDFObject> children)voidgetChildren(java.util.Set<PDFObject> children)java.util.Set<java.lang.String>keySet()intoutput(java.io.OutputStream stream)Write the PDF represention of this objectvoidput(java.lang.String name, int value)Puts a new name/value pair.voidput(java.lang.String name, java.lang.Object value)Puts a new name/value pair.voidremove(java.lang.String name)Removes the mapping for the specified keyprotected voidwriteDictionary(java.io.OutputStream out, java.lang.StringBuilder textBuffer)Writes the contents of the dictionary to a StringBuffer.-
Methods inherited from class org.apache.fop.pdf.PDFObject
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
-
-
-
-
Constructor Detail
-
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 Detail
-
put
public void put(java.lang.String name, java.lang.Object value)Puts a new name/value pair.- Parameters:
name- the namevalue- the value
-
put
public void put(java.lang.String name, int value)Puts a new name/value pair.- Parameters:
name- the namevalue- the value
-
get
public java.lang.Object get(java.lang.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
public int output(java.io.OutputStream stream) throws java.io.IOExceptionWrite the PDF represention of this object
-
writeDictionary
protected void writeDictionary(java.io.OutputStream out, java.lang.StringBuilder textBuffer) throws java.io.IOExceptionWrites the contents of the dictionary to a StringBuffer.- Parameters:
out- the OutputStream (for binary content)textBuffer- the text buffer for text output- Throws:
java.io.IOException- if an I/O error occurs
-
getChildren
public void getChildren(java.util.Set<PDFObject> children)
- Overrides:
getChildrenin classPDFObject
-
getChildren
public static void getChildren(java.util.Collection<java.lang.Object> values, java.util.Set<PDFObject> children)
-
keySet
public java.util.Set<java.lang.String> keySet()
-
containsKey
public boolean containsKey(java.lang.String name)
- Parameters:
name- The key to find in the map.- Returns:
- true if the map contains this key.
- See Also:
Map.containsKey(Object)
-
remove
public void remove(java.lang.String name)
Removes the mapping for the specified key- Parameters:
name- key whose mapping is to be removed
-
-