|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.hul.ois.jhove.module.pdf.Token
edu.harvard.hul.ois.jhove.module.pdf.StringValuedToken
edu.harvard.hul.ois.jhove.module.pdf.Literal
public class Literal
Class for Tokens which represent PDF strings. The class maintains a field for determining whether the string is encoded as PDF encoding or UTF-16. This is determined in the course of analyzing the characters for the token.
Field Summary | |
---|---|
static char[] |
PDFDOCENCODING
Mapping between PDFDocEncoding and Unicode code points. |
Fields inherited from class edu.harvard.hul.ois.jhove.module.pdf.StringValuedToken |
---|
_rawBytes, _value |
Constructor Summary | |
---|---|
Literal()
Creates an instance of a string literal |
Method Summary | |
---|---|
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. |
Methods inherited from class edu.harvard.hul.ois.jhove.module.pdf.StringValuedToken |
---|
getRawBytes, getValue, setValue |
Methods inherited from class edu.harvard.hul.ois.jhove.module.pdf.Token |
---|
isPdfACompliant, isSimpleToken |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static char[] PDFDOCENCODING
Constructor Detail |
---|
public Literal()
Method Detail |
---|
public void appendHex(int ch) throws PdfException
ch
- The integer 8-bit code for a hex character
PdfException
public 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.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 java.util.Date parseDate()
public boolean isPDFACompliant()
true
if this token doesn't violate any
PDF/A rules, false
if it does.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |