Class PSDictionary.Maker

java.lang.Object
org.apache.xmlgraphics.ps.PSDictionary.Maker
Enclosing class:
PSDictionary

private static class PSDictionary.Maker extends Object
This class is used to parse dictionary strings.
  • Field Details

  • Constructor Details

    • Maker

      private Maker()
  • Method Details

    • nextToken

      protected PSDictionary.Maker.Token nextToken(String str, int fromIndex)
      Returns a Token containing the start, end index and value of the next token found in a given string
      Parameters:
      str - string to search
      fromIndex - search from index
      Returns:
      Token containing the start, end index and value of the next token
    • indexOfMatchingBrace

      private int indexOfMatchingBrace(String str, String[] braces, int fromIndex) throws PSDictionaryFormatException
      Returns the closing brace index from a given string searches from a given index
      Parameters:
      str - string to search
      braces - string array of opening and closing brace
      fromIndex - searches from index
      Returns:
      matching brace index
      Throws:
      PSDictionaryFormatException - thrown in the event that a parsing error occurred
    • stripBraces

      private String stripBraces(String str, String[] braces) throws PSDictionaryFormatException
      Strips braces from complex object string
      Parameters:
      str - String to parse
      braces - String array containing opening and closing braces
      Returns:
      String with braces stripped
      Throws:
      PSDictionaryFormatException - thrown in the event that a parsing error occurred
    • parseDictionary

      public PSDictionary parseDictionary(String str) throws PSDictionaryFormatException
      Parses a dictionary string and provides a dictionary object
      Parameters:
      str - a dictionary string
      Returns:
      A postscript dictionary object
      Throws:
      PSDictionaryFormatException - thrown in the event that a parsing error occurred