class PDAnnotationPopup extends PDAnnotation
{
    private static final Logger LOG = LogManager.getLogger(PDAnnotationPopup.class);

    /**
     * The type of annotation.
     */
    public static final String SUB_TYPE = "Popup";

    /**
     * Constructor.
     */
    public PDAnnotationPopup()
    {
        getCOSObject().setName(COSName.SUBTYPE, SUB_TYPE);
    }

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

    /**
     * This will set the initial state of the annotation, open or closed.
     *
     * @param open Boolean value, true = open false = closed.
     */
    public void setOpen(boolean open)
    {
        getCOSObject().setBoolean("Open", open);
    }

    /**
     * This will retrieve the initial state of the annotation, open Or closed (default closed).
     *
     * @return The initial state, true = open false = closed.
     */
    public boolean getOpen()
    {
        return getCOSObject().getBoolean("Open", false);
    }

    /**
     * This will set the markup annotation which this popup relates to.
     *
     * @param annot the markup annotation.
     */
    public void setParent(PDAnnotationMarkup annot)
    {
        getCOSObject().setItem(COSName.PARENT, annot.getCOSObject());
    }

    /**
     * This will retrieve the markup annotation which this popup relates to.
     *
     * @return The parent markup annotation.
     */
    public PDAnnotationMarkup getParent()
    {<FILL_FUNCTION_BODY>}

}

        try
        {
            PDAnnotation ann = PDAnnotation.createAnnotation(getCOSObject()
                    .getDictionaryObject(COSName.PARENT, COSName.P));
            if (!(ann instanceof PDAnnotationMarkup))
            {
                LOG.error("parent annotation is of type {} but should be of type PDAnnotationMarkup", 
                        ann.getClass().getSimpleName());
                return null;
            }
            return (PDAnnotationMarkup) ann;
        }
        catch (IOException ioe)
        {
            LOG.debug("An exception while trying to get the parent markup - ignoring", ioe);
            // Couldn't construct the annotation, so return null i.e. do nothing
            return null;
        }
    
<methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public void constructAppearances(org.apache.pdfbox.pdmodel.PDDocument) ,public void constructAppearances() ,public static org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation createAnnotation(org.apache.pdfbox.cos.COSBase) throws java.io.IOException,public boolean equals(java.lang.Object) ,public int getAnnotationFlags() ,public java.lang.String getAnnotationName() ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary getAppearance() ,public org.apache.pdfbox.cos.COSName getAppearanceState() ,public org.apache.pdfbox.cos.COSArray getBorder() ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public org.apache.pdfbox.pdmodel.graphics.color.PDColor getColor() ,public java.lang.String getContents() ,public java.lang.String getModifiedDate() ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceStream getNormalAppearanceStream() ,public org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList getOptionalContent() ,public org.apache.pdfbox.pdmodel.PDPage getPage() ,public org.apache.pdfbox.pdmodel.common.PDRectangle getRectangle() ,public int getStructParent() ,public final java.lang.String getSubtype() ,public int hashCode() ,public boolean isHidden() ,public boolean isInvisible() ,public boolean isLocked() ,public boolean isLockedContents() ,public boolean isNoRotate() ,public boolean isNoView() ,public boolean isNoZoom() ,public boolean isPrinted() ,public boolean isReadOnly() ,public boolean isToggleNoView() ,public void setAnnotationFlags(int) ,public void setAnnotationName(java.lang.String) ,public void setAppearance(org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary) ,public void setAppearanceState(java.lang.String) ,public void setBorder(org.apache.pdfbox.cos.COSArray) ,public void setColor(org.apache.pdfbox.pdmodel.graphics.color.PDColor) ,public void setContents(java.lang.String) ,public void setHidden(boolean) ,public void setInvisible(boolean) ,public void setLocked(boolean) ,public void setLockedContents(boolean) ,public void setModifiedDate(java.lang.String) ,public void setModifiedDate(java.util.Calendar) ,public void setNoRotate(boolean) ,public void setNoView(boolean) ,public void setNoZoom(boolean) ,public void setOptionalContent(org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList) ,public void setPage(org.apache.pdfbox.pdmodel.PDPage) ,public void setPrinted(boolean) ,public void setReadOnly(boolean) ,public void setRectangle(org.apache.pdfbox.pdmodel.common.PDRectangle) ,public void setStructParent(int) ,public void setToggleNoView(boolean) <variables>private static final int FLAG_HIDDEN,private static final int FLAG_INVISIBLE,private static final int FLAG_LOCKED,private static final int FLAG_LOCKED_CONTENTS,private static final int FLAG_NO_ROTATE,private static final int FLAG_NO_VIEW,private static final int FLAG_NO_ZOOM,private static final int FLAG_PRINTED,private static final int FLAG_READ_ONLY,private static final int FLAG_TOGGLE_NO_VIEW,private static final Logger LOG,private final non-sealed org.apache.pdfbox.cos.COSDictionary dictionary