Class Platform

java.lang.Object
org.htmlunit.platform.Platform

public final class Platform extends Object
Singleton to handle JDK specific stuff. This is required to support at least the differences with android.
  • Field Details

  • Constructor Details

    • Platform

      private Platform()
  • Method Details

    • getIndex

      public static int getIndex(NamedNodeMap namedNodeMap, Map<Integer,List<String>> attributesOrderMap, Node element, int requiredIndex)
      Forward the call to the correct helper.
      Parameters:
      namedNodeMap - the node map
      attributesOrderMap - the order map
      element - the node
      requiredIndex - the required index
      Returns:
      the index or requiredIndex
    • getAttributesOrderMap

      public static Map<Integer,List<String>> getAttributesOrderMap(Document document)
      Returns internal Xerces details about all elements in the specified document. The id of the returned Map is the nodeIndex of an element, and the list is the array of ordered attributes names.
      Parameters:
      document - the document
      Returns:
      the map of an element index with its ordered attribute names
    • getRenderingBackend

      public static RenderingBackend getRenderingBackend(int imageWidth, int imageHeight)
      Parameters:
      imageWidth - the width of the image this backend is for
      imageHeight - the height of the image this backend is for
      Returns:
      a new RenderingBackend. If the AwtRenderingBackend can't be used a NoOpRenderingBackend is used instead.
    • getFontUtil

      public static FontUtil getFontUtil()
      Returns:
      a new FontUtil. If the AwtFontUtil can't be used a NoOpFontUtil is used instead.
    • buildImageData

      public static ImageData buildImageData(InputStream inputStream) throws IOException
      Throws:
      IOException