Package org.htmlunit.platform
Class Platform
java.lang.Object
org.htmlunit.platform.Platform
Singleton to handle JDK specific stuff.
This is required to support at least the differences with android.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static FontUtil
private static XmlUtilsHelperAPI
private static XmlUtilsHelperAPI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageData
buildImageData
(InputStream inputStream) getAttributesOrderMap
(Document document) Returns internal Xerces details about all elements in the specified document.static FontUtil
static int
getIndex
(NamedNodeMap namedNodeMap, Map<Integer, List<String>> attributesOrderMap, Node element, int requiredIndex) Forward the call to the correct helper.static RenderingBackend
getRenderingBackend
(int imageWidth, int imageHeight)
-
Field Details
-
FontUtil_
-
HelperXerces_
-
HelperSunXerces_
-
-
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 mapattributesOrderMap
- the order mapelement
- the noderequiredIndex
- the required index- Returns:
- the index or requiredIndex
-
getAttributesOrderMap
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
- 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
- Returns:
- a new
FontUtil
. If theAwtFontUtil
can't be used aNoOpFontUtil
is used instead.
-
buildImageData
- Throws:
IOException
-