Code example for SAXException

0
            else if (style.equals("ITALIC"))
                fontData.style = Font.ITALIC;
            else if (style.equals("BOLD_ITALIC"))
                fontData.style = Font.BOLD | Font.ITALIC;
            else 
                throw new SAXException("invalid font style");
            break; 
        } 
    } 
 
    private static final int ELEMENT_NONE = 0;
    private static final int ELEMENT_NAME = 1;
    private static final int ELEMENT_FORMAT = 2;
    private static final int ELEMENT_FILENAME = 3;
    private static final int ELEMENT_SIZE = 4;
    private static final int ELEMENT_STYLE = 5;
 
    private boolean inDocument = false;
    private int element = ELEMENT_NONE;
    private FontIndexData fontData = null;