Class CMapParser


  • public class CMapParser
    extends java.lang.Object
    Parses a CMap stream.
    Author:
    Ben Litchfield
    • Constructor Summary

      Constructors 
      Constructor Description
      CMapParser()
      Creates a new instance of CMapParser.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.io.InputStream getExternalCMap​(java.lang.String name)
      Returns an input stream containing the given "use" CMap.
      CMap parse​(java.io.File file)
      Parse a CMAP file on the file system.
      CMap parse​(java.io.InputStream input)
      This will parse the stream and create a cmap object.
      CMap parsePredefined​(java.lang.String name)
      Parses a predefined CMap.
      • Methods inherited from class java.lang.Object

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

      • CMapParser

        public CMapParser()
        Creates a new instance of CMapParser.
    • Method Detail

      • parse

        public CMap parse​(java.io.File file)
                   throws java.io.IOException
        Parse a CMAP file on the file system.
        Parameters:
        file - The file to parse.
        Returns:
        A parsed CMAP file.
        Throws:
        java.io.IOException - If there is an issue while parsing the CMAP.
      • parsePredefined

        public CMap parsePredefined​(java.lang.String name)
                             throws java.io.IOException
        Parses a predefined CMap.
        Parameters:
        name - CMap name.
        Returns:
        The parsed predefined CMap as a java object, never null.
        Throws:
        java.io.IOException - If the CMap could not be parsed.
      • parse

        public CMap parse​(java.io.InputStream input)
                   throws java.io.IOException
        This will parse the stream and create a cmap object.
        Parameters:
        input - The CMAP stream to parse.
        Returns:
        The parsed stream as a java object, never null.
        Throws:
        java.io.IOException - If there is an error parsing the stream.
      • getExternalCMap

        protected java.io.InputStream getExternalCMap​(java.lang.String name)
                                               throws java.io.IOException
        Returns an input stream containing the given "use" CMap.
        Parameters:
        name - Name of the given "use" CMap resource.
        Throws:
        java.io.IOException - if the CMap resource doesn't exist or if there is an error opening its stream.