Class 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 of Torello.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 by BaseType.toString() and by AbstractBuilder.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 by CDPTypes.

    The implementation is intentionally split across three small internal-support classes:

    • CDPToString controls the overall formatting process.
    • ParamRec stores the current object, descriptor, indentation, padding, and value-retrieval function for one formatting pass.
    • ValSwitch performs 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 both BaseType<?> instances and AbstractBuilder<?> instances can be printed through the same descriptor-driven pathway. The only meaningful difference is how the value for each descriptor entry is retrieved.


    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait