Package org.apache.fop.pdf
Class PDFName
java.lang.Object
org.apache.fop.pdf.PDFObject
org.apache.fop.pdf.PDFName
- All Implemented Interfaces:
Serializable
,PDFWritable
Class representing a PDF name object.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
(package private) static String
escapeName
(String name) Escapes a PDF name.getName()
Returns the name without the leading slash.int
hashCode()
int
output
(OutputStream stream) Write the PDF represention of this objectvoid
outputInline
(OutputStream out, StringBuilder textBuffer) Writes a "direct object" (inline object) representation to the stream.private static void
toHex
(char ch, StringBuilder sb) toString()
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 Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
-
ESCAPED_NAME_CHARS
- See Also:
-
DIGITS
private static final char[] DIGITS
-
-
Constructor Details
-
PDFName
Creates a new PDF name object.- Parameters:
name
- the name value
-
-
Method Details
-
escapeName
Escapes a PDF name. It adds the leading slash and escapes characters as necessary.- Parameters:
name
- the name- Returns:
- the escaped name
-
toHex
-
toString
-
getName
Returns the name without the leading slash.- Returns:
- the name without the leading slash
-
equals
-
hashCode
public int hashCode() -
output
Description copied from class:PDFObject
Write the PDF represention of this object- Overrides:
output
in classPDFObject
- Parameters:
stream
- the stream to write the PDF to- Returns:
- the number of bytes written
- Throws:
IOException
- if there is an error writing to the stream
-
outputInline
Description copied from class:PDFObject
Writes 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:
outputInline
in interfacePDFWritable
- Overrides:
outputInline
in classPDFObject
- Parameters:
out
- the OutputStream (for binary content)textBuffer
- the text buffer for text content- Throws:
IOException
- if an I/O error occurs
-