Package org.htmlunit.platform
Class Platform
- java.lang.Object
-
- org.htmlunit.platform.Platform
-
public final class Platform extends java.lang.Object
Singleton to handle JDK specific stuff. This is required to support at least the differences with android.
-
-
Field Summary
Fields Modifier and Type Field Description private static FontUtil
FontUtil_
private static XmlUtilsHelperAPI
HelperSunXerces_
private static XmlUtilsHelperAPI
HelperXerces_
-
Constructor Summary
Constructors Modifier Constructor Description private
Platform()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ImageData
buildImageData(java.io.InputStream inputStream)
static java.util.Map<java.lang.Integer,java.util.List<java.lang.String>>
getAttributesOrderMap(org.w3c.dom.Document document)
Returns internal Xerces details about all elements in the specified document.static FontUtil
getFontUtil()
static int
getIndex(org.w3c.dom.NamedNodeMap namedNodeMap, java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> attributesOrderMap, org.w3c.dom.Node element, int requiredIndex)
Forward the call to the correct helper.static RenderingBackend
getRenderingBackend(int imageWidth, int imageHeight)
-
-
-
Field Detail
-
FontUtil_
private static FontUtil FontUtil_
-
HelperXerces_
private static XmlUtilsHelperAPI HelperXerces_
-
HelperSunXerces_
private static XmlUtilsHelperAPI HelperSunXerces_
-
-
Method Detail
-
getIndex
public static int getIndex(org.w3c.dom.NamedNodeMap namedNodeMap, java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> attributesOrderMap, org.w3c.dom.Node element, int requiredIndex)
Forward the call to the correct helper.- Parameters:
namedNodeMap
- the node mapattributesOrderMap
- the order mapelement
- the noderequiredIndex
- the required index- Returns:
- the index or requiredIndex
-
getAttributesOrderMap
public static java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> getAttributesOrderMap(org.w3c.dom.Document document)
Returns internal Xerces details about all elements in the specified document. The id of the returnedMap
is thenodeIndex
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 forimageHeight
- the height of the image this backend is for- Returns:
- a new
RenderingBackend
. If theAwtRenderingBackend
can't be used aNoOpRenderingBackend
is used instead.
-
getFontUtil
public static FontUtil getFontUtil()
- Returns:
- a new
FontUtil
. If theAwtFontUtil
can't be used aNoOpFontUtil
is used instead.
-
buildImageData
public static ImageData buildImageData(java.io.InputStream inputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
-