Package Torello.Browser
Class CDPToString
- java.lang.Object
-
- Torello.Browser.CDPToString
-
public class CDPToString extends java.lang.Object
⚠️ This class is designated as an "internal use only class." While there is nothing detrimental about using this class, it is actually only declared 'public' because it's methods & fields are indeed needed in packages outside ofTorello.Browser. Classes which are declared 'public' are automatically documented by'javadoc'. Therefore this page is included for viewing, even though Java-HTML Library users probably don't actually need to know about it!
💡 Feel free to review it's contents. Perhaps there are explanations which might be of interest.Converts Chrome DevTools Protocol data objects and builders into readable diagnostic text.
This class provides the shared implementation used byBaseType.toString()and byAbstractBuilder.toString(). It walks the descriptor metadata associated with a CDP data-carrier object or builder, retrieves each field or assigned value, and prints the result using the compact type information defined byCDPTypes.
The implementation is intentionally split across three small internal-support classes:
CDPToStringcontrols the overall formatting process.-
ParamRecstores the current object, descriptor, indentation, padding, and value-retrieval function for one formatting pass. -
ValSwitchperforms the type-byte dispatch needed to print primitive values, strings, arrays, raw JSON values, and nested CDP data types.
💡 The important design point is that bothBaseType<?>instances andAbstractBuilder<?>instances can be printed through the same descriptor-driven pathway. The only meaningful difference is how the value for each descriptor entry is retrieved.
Hi-Lited Source-Code:This File's Source Code:
- View Here: Torello/Browser/CDPToString.java
- Open New Browser-Tab: Torello/Browser/CDPToString.java
File Size: 7,467 Bytes Line Count: 193 '\n' Characters Found
Helper Class:
- View Here: ParamRec.java
- Open New Browser-Tab: ParamRec.java
File Size: 6,820 Bytes Line Count: 185 '\n' Characters Found
Helper Class:
- View Here: ValSwitch.java
- Open New Browser-Tab: ValSwitch.java
File Size: 8,937 Bytes Line Count: 240 '\n' Characters Found
Example Printing:
- View Here: ExamplePrinting.java
- Open New Browser-Tab: ExamplePrinting.java
File Size: 2,252 Bytes Line Count: 82 '\n' Characters Found