class FDFAnnotationPolyline extends FDFAnnotation
{
    private static final Logger LOG = LogManager.getLogger(FDFAnnotationPolyline.class);
    /**
     * COS Model value for SubType entry.
     */
    public static final String SUBTYPE = "Polyline";

    /**
     * Default constructor.
     */
    public FDFAnnotationPolyline()
    {
        super();
        annot.setName(COSName.SUBTYPE, SUBTYPE);
    }

    /**
     * Constructor.
     *
     * @param a An existing FDF Annotation.
     */
    public FDFAnnotationPolyline(COSDictionary a)
    {
        super(a);
    }

    /**
     * Constructor.
     *
     * @param element An XFDF element.
     *
     * @throws IOException If there is an error extracting information from the element.
     */
    public FDFAnnotationPolyline(Element element) throws IOException
    {
        super(element);
        annot.setName(COSName.SUBTYPE, SUBTYPE);

        initVertices(element);
        initStyles(element);
    }

    private void initVertices(Element element) throws IOException
    {
        XPath xpath = XPathFactory.newInstance().newXPath();
        try
        {
            String vertices = xpath.evaluate("vertices[1]", element);
            if (vertices == null || vertices.isEmpty())
            {
                throw new IOException("Error: missing element 'vertices'");
            }
            String[] verticesValues = vertices.split(",|;");
            float[] values = new float[verticesValues.length];
            for (int i = 0; i < verticesValues.length; i++)
            {
                values[i] = Float.parseFloat(verticesValues[i]);
            }
            setVertices(values);
        }
        catch (XPathExpressionException e)
        {
            LOG.debug("Error while evaluating XPath expression for polyline vertices", e);
        }
    }

    private void initStyles(Element element)
    {
        String startStyle = element.getAttribute("head");
        if (startStyle != null && !startStyle.isEmpty())
        {
            setStartPointEndingStyle(startStyle);
        }
        String endStyle = element.getAttribute("tail");
        if (endStyle != null && !endStyle.isEmpty())
        {
            setEndPointEndingStyle(endStyle);
        }

        String color = element.getAttribute("interior-color");
        if (color != null && color.length() == 7 && color.charAt(0) == '#')
        {
            int colorValue = Integer.parseInt(color.substring(1, 7), 16);
            setInteriorColor(new Color(colorValue));
        }
    }

    /**
     * This will set the coordinates of the the vertices.
     *
     * @param vertices array of floats [x1, y1, x2, y2, ...] vertex coordinates in default user space.
     */
    public void setVertices(float[] vertices)
    {
        annot.setItem(COSName.VERTICES, COSArray.of(vertices));
    }

    /**
     * This will get the coordinates of the the vertices.
     *
     * @return array of floats [x1, y1, x2, y2, ...] vertex coordinates in default user space.
     */
    public float[] getVertices()
    {
        COSArray array = annot.getCOSArray(COSName.VERTICES);
        return array != null ? array.toFloatArray() : null;
    }

    /**
     * This will set the line ending style for the start point, see the LE_ constants for the possible values.
     *
     * @param style The new style.
     */
    public void setStartPointEndingStyle(String style)
    {<FILL_FUNCTION_BODY>}

    /**
     * This will retrieve the line ending style for the start point, possible values shown in the LE_ constants section.
     *
     * @return The ending style for the start point.
     */
    public String getStartPointEndingStyle()
    {
        COSArray array = annot.getCOSArray(COSName.LE);
        return array != null ? array.getName(0) : PDAnnotationLine.LE_NONE;
    }

    /**
     * This will set the line ending style for the end point, see the LE_ constants for the possible values.
     *
     * @param style The new style.
     */
    public void setEndPointEndingStyle(String style)
    {
        String actualStyle = style == null ? PDAnnotationLine.LE_NONE : style;
        COSArray array = annot.getCOSArray(COSName.LE);
        if (array == null)
        {
            array = new COSArray();
            array.add(COSName.getPDFName(PDAnnotationLine.LE_NONE));
            array.add(COSName.getPDFName(actualStyle));
            annot.setItem(COSName.LE, array);
        }
        else
        {
            array.setName(1, actualStyle);
        }
    }

    /**
     * This will retrieve the line ending style for the end point, possible values shown in the LE_ constants section.
     *
     * @return The ending style for the end point.
     */
    public String getEndPointEndingStyle()
    {
        COSArray array = annot.getCOSArray(COSName.LE);
        return array != null ? array.getName(1) : PDAnnotationLine.LE_NONE;
    }

    /**
     * This will set interior color of the line endings defined in the LE entry.
     *
     * @param color The interior color of the line endings.
     */
    public void setInteriorColor(Color color)
    {
        COSArray array = null;
        if (color != null)
        {
            array = COSArray.of(color.getRGBColorComponents(null));
        }
        annot.setItem(COSName.IC, array);
    }

    /**
     * This will retrieve the interior color of the line endings defined in the LE entry.
     *
     * @return object representing the color.
     */
    public Color getInteriorColor()
    {
        Color retval = null;
        COSArray array = annot.getCOSArray(COSName.IC);
        if (array != null)
        {
            float[] rgb = array.toFloatArray();
            if (rgb.length >= 3)
            {
                retval = new Color(rgb[0], rgb[1], rgb[2]);
            }
        }
        return retval;
    }
}

        String actualStyle = style == null ? PDAnnotationLine.LE_NONE : style;
        COSArray array = annot.getCOSArray(COSName.LE);
        if (array == null)
        {
            array = new COSArray();
            array.add(COSName.getPDFName(actualStyle));
            array.add(COSName.getPDFName(PDAnnotationLine.LE_NONE));
            annot.setItem(COSName.LE, array);
        }
        else
        {
            array.setName(0, actualStyle);
        }
    
<methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public void <init>(org.w3c.dom.Element) throws java.io.IOException,public static org.apache.pdfbox.pdmodel.fdf.FDFAnnotation create(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderEffectDictionary getBorderEffect() ,public org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary getBorderStyle() ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public java.awt.Color getColor() ,public java.lang.String getContents() ,public java.util.Calendar getCreationDate() throws java.io.IOException,public java.lang.String getDate() ,public java.lang.String getIntent() ,public java.lang.String getName() ,public float getOpacity() ,public java.lang.Integer getPage() ,public org.apache.pdfbox.pdmodel.common.PDRectangle getRectangle() ,public java.lang.String getRichContents() ,public java.lang.String getSubject() ,public java.lang.String getTitle() ,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 final void setBorderEffect(org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderEffectDictionary) ,public final void setBorderStyle(org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary) ,public final void setColor(java.awt.Color) ,public final void setContents(java.lang.String) ,public final void setCreationDate(java.util.Calendar) ,public final void setDate(java.lang.String) ,public final void setHidden(boolean) ,public final void setIntent(java.lang.String) ,public final void setInvisible(boolean) ,public final void setLocked(boolean) ,public void setLockedContents(boolean) ,public final void setName(java.lang.String) ,public final void setNoRotate(boolean) ,public final void setNoView(boolean) ,public final void setNoZoom(boolean) ,public final void setOpacity(float) ,public final void setPage(int) ,public final void setPrinted(boolean) ,public final void setReadOnly(boolean) ,public final void setRectangle(org.apache.pdfbox.pdmodel.common.PDRectangle) ,public final void setRichContents(java.lang.String) ,public final void setSubject(java.lang.String) ,public final void setTitle(java.lang.String) ,public final 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,protected final non-sealed org.apache.pdfbox.cos.COSDictionary annot