Package org.apache.fop.pdf
Class PDFName
- java.lang.Object
-
- org.apache.fop.pdf.PDFObject
-
- org.apache.fop.pdf.PDFName
-
- All Implemented Interfaces:
java.io.Serializable,PDFWritable
public class PDFName extends PDFObject implements java.io.Serializable
Class representing a PDF name object.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static char[]DIGITSprivate static java.lang.StringESCAPED_NAME_CHARSprivate java.lang.Stringnameprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description PDFName(java.lang.String name)Creates a new PDF name object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)(package private) static java.lang.StringescapeName(java.lang.String name)Escapes a PDF name.java.lang.StringgetName()Returns the name without the leading slash.inthashCode()intoutput(java.io.OutputStream stream)Write the PDF represention of this objectvoidoutputInline(java.io.OutputStream out, java.lang.StringBuilder textBuffer)Writes a "direct object" (inline object) representation to the stream.private static voidtoHex(char ch, java.lang.StringBuilder sb)java.lang.StringtoString()-
Methods inherited from class org.apache.fop.pdf.PDFObject
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getChildren, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
name
private java.lang.String name
-
ESCAPED_NAME_CHARS
private static final java.lang.String ESCAPED_NAME_CHARS
- See Also:
- Constant Field Values
-
DIGITS
private static final char[] DIGITS
-
-
Method Detail
-
escapeName
static java.lang.String escapeName(java.lang.String name)
Escapes a PDF name. It adds the leading slash and escapes characters as necessary.- Parameters:
name- the name- Returns:
- the escaped name
-
toHex
private static void toHex(char ch, java.lang.StringBuilder sb)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getName
public java.lang.String getName()
Returns the name without the leading slash.- Returns:
- the name without the leading slash
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
output
public int output(java.io.OutputStream stream) throws java.io.IOExceptionDescription copied from class:PDFObjectWrite the PDF represention of this object
-
outputInline
public void outputInline(java.io.OutputStream out, java.lang.StringBuilder textBuffer) throws java.io.IOExceptionDescription copied from class:PDFObjectWrites a "direct object" (inline object) representation to the stream. A text buffer is given for optimized encoding of text content.IMPORTANT: If you need to write out binary output, call
PDFDocument.flushTextBuffer(StringBuilder, OutputStream)before writing any content to theOutputStream!- Specified by:
outputInlinein interfacePDFWritable- Overrides:
outputInlinein classPDFObject- Parameters:
out- the OutputStream (for binary content)textBuffer- the text buffer for text content- Throws:
java.io.IOException- if an I/O error occurs
-
-