Class XfdfObjectUtils


  • final class XfdfObjectUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private XfdfObjectUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static float[] convertColorFloatsFromString​(java.lang.String colorHexString)
      Converts string containing hex color code into an array of 3 integer values representing rgb color.
      private static java.lang.String convertColorFloatToHex​(float colorFloat)
      Converts float representation of the rgb color into a hex string representing the rgb color.
      (package private) static Color convertColorFromString​(java.lang.String hexColor)
      Converts string containing hex color code to Color object.
      (package private) static java.lang.String convertColorToString​(float[] colors)
      Converts an array of 3 floats into a hex string representing the rgb color.
      (package private) static java.lang.String convertColorToString​(Color color)
      Converts a Color object into a hex string representing the rgb color.
      (package private) static PdfString convertDashesFromArray​(PdfArray dashesArray)
      Converts a PdfArray, representing a pattern of dashes and gaps to be used in drawing a dashed border, into a string containing float values.
      (package private) static PdfArray convertDashesFromString​(java.lang.String dashesString)
      Converts a string containing float values into a PdfArray, representing a pattern of dashes and gaps to be used in drawing a dashed border.
      (package private) static int convertFlagsFromString​(java.lang.String flagsString)
      Converts a string containing a comma separated list of names of the flags into an integer representation of the flags.
      (package private) static java.lang.String convertFlagsToString​(PdfAnnotation pdfAnnotation)
      Converts an integer representation of the flags into a string with a comma separated list of names of the flags.
      (package private) static java.lang.String convertFloatToString​(float coord)
      Converts float value to string with UTF-8 encoding.
      (package private) static PdfArray convertFringeFromString​(java.lang.String fringeString)
      Converts a string containing 4 float values into a PdfArray, representing rectangle fringe.
      (package private) static java.lang.String convertFringeToString​(float[] fringeArray)
      Converts to string an array of floats representing the fringe.
      (package private) static java.lang.String convertIdToHexString​(java.lang.String idString)
      Converts string containing id from decimal to hexadecimal format.
      (package private) static java.lang.String convertJustificationFromIntegerToString​(int justification)
      Converts an integer value representing a code specifying the form of quadding (justification) into a string containing justification value.
      (package private) static int convertJustificationFromStringToInteger​(java.lang.String attributeValue)
      Converts a string containing justification value into an integer value representing a code specifying the form of quadding (justification).
      (package private) static java.lang.String convertLineEndToString​(float[] line)
      Returns a string representation of the end point of the line (x_2, y_2) based on given line array.
      (package private) static java.lang.String convertLineStartToString​(float[] line)
      Returns a string representation of the start point of the line (x_1, y_1) based on given line array.
      (package private) static float[] convertQuadPointsFromCoordsString​(java.lang.String coordsString)
      Converts a string containing 8*n float values into a float array, representing quadPoints.
      (package private) static java.lang.String convertQuadPointsToCoordsString​(float[] quadPoints)
      Converts a float array, representing quadPoints into a string containing 8*n float values.
      (package private) static Rectangle convertRectFromString​(java.lang.String rectString)
      Converts a string containing 2 or 4 float values into a Rectangle.
      (package private) static java.lang.String convertRectToString​(Rectangle rect)
      Converts a Rectangle to a string containing 4 float values.
      (package private) static float[] convertVerticesFromString​(java.lang.String verticesString)
      Converts a string into an array of floats representing vertices.
      (package private) static java.lang.String convertVerticesToString​(float[] vertices)
      Converts an array of float vertices to string.
      (package private) static PdfName getHighlightFullValue​(PdfName highlightMode)
      Converts H key value in the link annotation dictionary to Highlight value of xfdf link annotation attribute.
      (package private) static PdfName getStyleFullValue​(PdfName style)
      Converts style (S key value) in the pdf annotation dictionary to style value of xfdf annotation attribute.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XfdfObjectUtils

        private XfdfObjectUtils()
    • Method Detail

      • convertRectFromString

        static Rectangle convertRectFromString​(java.lang.String rectString)
        Converts a string containing 2 or 4 float values into a Rectangle.
        Parameters:
        rectString - the annotation rectangle, defining the location of the annotation on the page in default user space units. The value is four comma separated real numbers which may be positive or negative: (xLeft, yBottom, xRight, yTop). If only two coordinates are present, they should represent Rectangle width and height.
      • convertFringeFromString

        static PdfArray convertFringeFromString​(java.lang.String fringeString)
        Converts a string containing 4 float values into a PdfArray, representing rectangle fringe. If the number of floats in the string is not equal to 4, returns and PdfArray with empty values.
      • convertDashesFromString

        static PdfArray convertDashesFromString​(java.lang.String dashesString)
        Converts a string containing float values into a PdfArray, representing a pattern of dashes and gaps to be used in drawing a dashed border.
      • convertDashesFromArray

        static PdfString convertDashesFromArray​(PdfArray dashesArray)
        Converts a PdfArray, representing a pattern of dashes and gaps to be used in drawing a dashed border, into a string containing float values.
      • convertJustificationFromStringToInteger

        static int convertJustificationFromStringToInteger​(java.lang.String attributeValue)
        Converts a string containing justification value into an integer value representing a code specifying the form of quadding (justification).
      • convertJustificationFromIntegerToString

        static java.lang.String convertJustificationFromIntegerToString​(int justification)
        Converts an integer value representing a code specifying the form of quadding (justification) into a string containing justification value.
      • getHighlightFullValue

        static PdfName getHighlightFullValue​(PdfName highlightMode)
        Converts H key value in the link annotation dictionary to Highlight value of xfdf link annotation attribute.
      • getStyleFullValue

        static PdfName getStyleFullValue​(PdfName style)
        Converts style (S key value) in the pdf annotation dictionary to style value of xfdf annotation attribute.
      • convertRectToString

        static java.lang.String convertRectToString​(Rectangle rect)
        Converts a Rectangle to a string containing 4 float values.
      • convertFloatToString

        static java.lang.String convertFloatToString​(float coord)
        Converts float value to string with UTF-8 encoding.
      • convertQuadPointsFromCoordsString

        static float[] convertQuadPointsFromCoordsString​(java.lang.String coordsString)
        Converts a string containing 8*n float values into a float array, representing quadPoints. If the number of floats in the string is not a multiple of 8, returns an empty float array.
      • convertQuadPointsToCoordsString

        static java.lang.String convertQuadPointsToCoordsString​(float[] quadPoints)
        Converts a float array, representing quadPoints into a string containing 8*n float values.
      • convertFlagsFromString

        static int convertFlagsFromString​(java.lang.String flagsString)
        Converts a string containing a comma separated list of names of the flags into an integer representation of the flags.
      • convertFlagsToString

        static java.lang.String convertFlagsToString​(PdfAnnotation pdfAnnotation)
        Converts an integer representation of the flags into a string with a comma separated list of names of the flags.
      • convertColorToString

        static java.lang.String convertColorToString​(float[] colors)
        Converts an array of 3 floats into a hex string representing the rgb color.
      • convertColorToString

        static java.lang.String convertColorToString​(Color color)
        Converts a Color object into a hex string representing the rgb color.
      • convertColorFloatToHex

        private static java.lang.String convertColorFloatToHex​(float colorFloat)
        Converts float representation of the rgb color into a hex string representing the rgb color.
      • convertIdToHexString

        static java.lang.String convertIdToHexString​(java.lang.String idString)
        Converts string containing id from decimal to hexadecimal format.
      • convertColorFromString

        static Color convertColorFromString​(java.lang.String hexColor)
        Converts string containing hex color code to Color object.
      • convertColorFloatsFromString

        static float[] convertColorFloatsFromString​(java.lang.String colorHexString)
        Converts string containing hex color code into an array of 3 integer values representing rgb color.
      • convertVerticesToString

        static java.lang.String convertVerticesToString​(float[] vertices)
        Converts an array of float vertices to string.
      • convertFringeToString

        static java.lang.String convertFringeToString​(float[] fringeArray)
        Converts to string an array of floats representing the fringe. If the number of floats doesn't equal 4, an empty string is returned.
      • convertVerticesFromString

        static float[] convertVerticesFromString​(java.lang.String verticesString)
        Converts a string into an array of floats representing vertices.
      • convertLineStartToString

        static java.lang.String convertLineStartToString​(float[] line)
        Returns a string representation of the start point of the line (x_1, y_1) based on given line array. If the line array doesn't contain 4 floats, returns an empty string.
        Parameters:
        line - an array of 4 floats representing the line (x_1, y_1, x_2, y_2)
      • convertLineEndToString

        static java.lang.String convertLineEndToString​(float[] line)
        Returns a string representation of the end point of the line (x_2, y_2) based on given line array. If the line array doesn't contain 4 floats, returns an empty string.
        Parameters:
        line - an array of 4 floats representing the line (x_1, y_1, x_2, y_2)