|
jPod PDF library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.intarsys.pdf.cos.COSDocumentElement
de.intarsys.pdf.cos.COSObject
de.intarsys.pdf.cos.COSPrimitiveObject
de.intarsys.pdf.cos.COSString
public class COSString
The string representation for a pdf document
| Field Summary |
|---|
| Fields inherited from class de.intarsys.pdf.cos.COSObject |
|---|
CONSTANT_CONTAINER, NULL_CONTAINER, SLOT_CONTAINER |
| Method Summary | |
|---|---|
Object |
accept(ICOSObjectVisitor visitor)
Accept a visitor object. |
COSString |
asString()
|
byte[] |
byteValue()
The bytes that make up this string. |
void |
clearBytes()
Reset the bytes for this COSString. |
void |
clearString()
Reset the string value for this COSString. |
int |
compareTo(Object o)
|
static COSString |
create(byte[] bytes)
Create a COSString from bytes. |
static COSString |
create(byte[] bytes,
String encoding)
Create a COSString from bytes. |
static COSString |
create(String string)
Create a COSString from string. |
static COSString |
create(String string,
String encoding)
Create a COSString from string. |
static COSString |
createHex(byte[] bytes)
Create a COSString from bytes in hex
representation. |
static COSString |
createHex(byte[] bytes,
String encoding)
Create a COSString from bytes in hex
representation. |
static COSString |
createHex(String string)
Create a COSString from string in hex
representation. |
static COSString |
createHex(String string,
String encoding)
Create a COSString from string in hex
representation. |
static COSString |
createMultiLine(String string)
Create a COSString from string, escaping all
newlines. |
boolean |
equals(Object o)
|
String |
getEncoding()
Lookup the custom encoding used by this string. |
int |
hashCode()
|
String |
hexStringValue()
Show a hex encoded representation of the strings content. |
boolean |
isHexMode()
true if this string has to be saved as hex representation |
String |
multiLineStringValue()
A Java String with correctly expanded newlines. |
void |
restoreState(Object object)
|
Object |
saveState()
|
void |
setEncoding(String encoding)
Set the Charset name to be used when decoding the
COSString bytes. |
void |
setHexMode(boolean newHexMode)
Set the flag if this is written in hex representation |
String |
stringValue()
The Java String representation of the receiver |
static String |
toJavaString(String value)
|
static String |
toPDFString(String value)
|
| Methods inherited from class de.intarsys.pdf.cos.COSPrimitiveObject |
|---|
addObjectListener, basicIterator, copyDeep, copyDeep, isDangling, isObjectListenerAvailable, isPrimitive, iterator, removeObjectListener |
| Methods inherited from class de.intarsys.pdf.cos.COSObject |
|---|
asArray, asBoolean, asDictionary, asFixed, asInteger, asName, asNull, asNumber, asStream, beConstant, beIndirect, containable, copyOptional, copyShallow, copySubGraph, dereference, getContainer, getDoc, getIndirectObject, getValueBoolean, getValueBytes, getValueFloat, getValueInteger, getValueString, harden, isIndirect, isNull, isNumber, isSwapped, mayBeSwapped, soften, toString |
| Methods inherited from class de.intarsys.pdf.cos.COSDocumentElement |
|---|
handleException, isReference |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static COSString create(byte[] bytes)
COSString from bytes.
bytes -
COSString
public static COSString create(byte[] bytes,
String encoding)
COSString from bytes.
bytes -
COSStringpublic static COSString create(String string)
COSString from string.
string -
COSString
public static COSString create(String string,
String encoding)
COSString from string.
string -
COSStringpublic static COSString createHex(byte[] bytes)
COSString from bytes in hex
representation.
bytes -
COSString
public static COSString createHex(byte[] bytes,
String encoding)
COSString from bytes in hex
representation.
bytes -
COSStringpublic static COSString createHex(String string)
COSString from string in hex
representation.
string -
COSString
public static COSString createHex(String string,
String encoding)
COSString from string in hex
representation.
string -
COSStringpublic static COSString createMultiLine(String string)
COSString from string, escaping all
newlines.
string -
COSStringpublic static String toJavaString(String value)
public static String toPDFString(String value)
public Object accept(ICOSObjectVisitor visitor)
throws COSVisitorException
COSDocumentElementvisitor by "double dispatching".
accept in class COSDocumentElementvisitor - The object visiting the receiver.
COSVisitorException - An exception depending on the visitor semantics.public COSString asString()
asString in class COSObjectthis as a COSString or nullpublic byte[] byteValue()
public void clearBytes()
COSString. You may need this if the
encoding is changed during the COSString lifetime.
public void clearString()
COSString. You may need this if
the encoding is changed during the COSString lifetime.
public int compareTo(Object o)
compareTo in interface Comparablepublic boolean equals(Object o)
equals in class Objectpublic String getEncoding()
Be warned: If you use a custom encoding, there is no way for standard PDF tools to recover this information!
public int hashCode()
hashCode in class Objectpublic String hexStringValue()
public boolean isHexMode()
true if this string has to be saved as hex representation
true if this string has to be saved as hex
representationpublic String multiLineStringValue()
String with correctly expanded newlines.
String with correctly expanded newlines.public void restoreState(Object object)
restoreState in interface de.intarsys.tools.component.ISaveStateSupportrestoreState in class COSObjectpublic Object saveState()
saveState in interface de.intarsys.tools.component.ISaveStateSupportpublic void setEncoding(String encoding)
Charset name to be used when decoding the
COSString bytes. If no encoding is present, the default PDF
conventions are used.
Be warned: If you use a custom encoding, there is no way for standard PDF tools to recover this information!
encoding - public void setHexMode(boolean newHexMode)
newHexMode - true if this is written in hex representationpublic String stringValue()
String representation of the receiver
stringValue in class COSObjectString representation of the receiver
|
jPod PDF library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||