public class Literal extends StringValuedToken
| Modifier and Type | Field and Description |
|---|---|
static char[] |
PDFDOCENCODING
Mapping between PDFDocEncoding and Unicode code points.
|
_rawBytes, _value| Constructor and Description |
|---|
Literal()
Creates an instance of a string literal
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendHex(int ch)
Append a hex character.
|
void |
convertHex()
Convert the raw hex data.
|
boolean |
isDate()
Returns
true if the string value is a parsable date. |
boolean |
isPDFACompliant()
Returns
true if this token doesn't violate any
PDF/A rules, false if it does. |
boolean |
isPDFDocEncoding()
Returns
true if this string is in PDFDocEncoding,
false if UTF-16. |
java.util.Date |
parseDate()
Parse the string value to a date.
|
long |
processLiteral(Tokenizer tok)
Process the incoming characters into a string literal.
|
void |
setPDFDocEncoding(boolean pdfDocEncoding)
Sets the value of pDFDocEncoding.
|
getRawBytes, getValue, setValueisPdfACompliant, isSimpleTokenpublic static char[] PDFDOCENCODING
public void appendHex(int ch)
throws PdfException
ch - The integer 8-bit code for a hex characterPdfExceptionpublic long processLiteral(Tokenizer tok) throws java.io.IOException
tok - The tokenizer, passed to give access to its getChar
function.true if the character was processed
normally, false if a terminating
parenthesis was reached.java.io.IOExceptionpublic void convertHex()
throws PdfException
PdfExceptionpublic boolean isPDFDocEncoding()
true if this string is in PDFDocEncoding,
false if UTF-16.public void setPDFDocEncoding(boolean pdfDocEncoding)
public boolean isDate()
true if the string value is a parsable date.
Conforms to the ASN.1 date format: D:YYYYMMDDHHmmSSOHH'mm'
where everything before and after YYYY is optional.
If we take this literally, the format is frighteningly ambiguous
(imagine, for instance, leaving out hours but not minutes and
seconds), so the checking is a bit loose.public java.util.Date parseDate()
public boolean isPDFACompliant()
true if this token doesn't violate any
PDF/A rules, false if it does.