All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.harvard.hul.ois.jhove.module.pdf.Token Maven / Gradle / Ivy

There is a newer version: 1.12.7
Show newest version
/**********************************************************************
 * Jhove - JSTOR/Harvard Object Validation Environment
 * Copyright 2003 by JSTOR and the President and Fellows of Harvard College
 **********************************************************************/

package edu.harvard.hul.ois.jhove.module.pdf;

/**
 *  Abstract class to encapsulate lexical tokens from a PDF
 *  file.  Tokens include numbers, strings, names, delimiters (the
 *  open and close markers for dictionaries and arrays), and streams.
 *  There are a variety of subclasses for specific kinds of tokens.
 */
public abstract class Token
{

    /** Superclass constructor */
    public Token ()
    {
    }
    
    /**
     *  Returns true if the token is one which the Parser
     *  treats as a unitary object.  Everything but arrays and dictionaries
     *  are considered "simple" tokens for our purposes. 
     */
    public boolean isSimpleToken ()
    {
        return (! (this instanceof ArrayStart) &&
                ! (this instanceof ArrayEnd) &&
                ! (this instanceof DictionaryStart) &&
                ! (this instanceof DictionaryEnd));
    }
    
    /** Returns true if this token is within PDF/A implementation
     *  limits. Always returns true unless overridden. */
    public boolean isPdfACompliant () 
    {
        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy