class PDAnnotationSquare extends PDAnnotationSquareCircle
{
    /**
     * The type of annotation.
     */
    public static final String SUB_TYPE = "Square";

    private PDAppearanceHandler customAppearanceHandler;
    
    public PDAnnotationSquare()
    {
        super(SUB_TYPE);
    }

    /**
     * Creates a square annotation from a COSDictionary, expected to be a correct object definition.
     *
     * @param field the PDF object to represent as a field.
     */
    public PDAnnotationSquare(COSDictionary field)
    {
        super(field);
    }

    /**
     * Set a custom appearance handler for generating the annotations appearance streams.
     * 
     * @param appearanceHandler custom appearance handler
     */
    public void setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)
    {
        customAppearanceHandler = appearanceHandler;
    }

    @Override
    public void constructAppearances()
    {
        this.constructAppearances(null);
    }

    @Override
    public void constructAppearances(PDDocument document)
    {<FILL_FUNCTION_BODY>}
}

        if (customAppearanceHandler == null)
        {
            PDSquareAppearanceHandler appearanceHandler = new PDSquareAppearanceHandler(this, document);
            appearanceHandler.generateAppearanceStreams();
        }
        else
        {
            customAppearanceHandler.generateAppearanceStreams();
        }
    
<methods>public abstract void constructAppearances() ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderEffectDictionary getBorderEffect() ,public org.apache.pdfbox.pdmodel.graphics.color.PDColor getInteriorColor() ,public org.apache.pdfbox.pdmodel.common.PDRectangle getRectDifference() ,public float[] getRectDifferences() ,public void setBorderEffect(org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderEffectDictionary) ,public void setInteriorColor(org.apache.pdfbox.pdmodel.graphics.color.PDColor) ,public void setRectDifference(org.apache.pdfbox.pdmodel.common.PDRectangle) ,public void setRectDifferences(float) ,public void setRectDifferences(float, float, float, float) <variables>