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. |
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, setValue
isPdfACompliant, isSimpleToken
public static char[] PDFDOCENCODING
public void appendHex(int ch) throws PdfException
ch
- The integer 8-bit code for a hex characterPdfException
public long processLiteral(Tokenizer tok) throws 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.IOException
public void convertHex() throws PdfException
PdfException
public 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 Date parseDate()
public boolean isPDFACompliant()
true
if this token doesn't violate any
PDF/A rules, false
if it does.Copyright © 2008–2017 The Open Preservation Foundation. All rights reserved.