Package Torello.Browser
Class CommandDescriptor<T>
- java.lang.Object
-
- Torello.Browser.AbstractDescriptor
-
- Torello.Browser.CommandDescriptor<T>
-
- Type Parameters:
T- The Java type returned by theScriptcreated for this command. This type parameter allowsCommandDescriptor<T>to work together withCommandBuilder<T>.
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<AbstractDescriptor>
public class CommandDescriptor<T> extends AbstractDescriptor implements java.io.Serializable
Reflected information / data which has been extracted from one of the generated CDP domain command methods.
A "Domain Command" is any static method generated inside one of the primary browser domain classes. For example:
RunTime.evaluate(java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean, java.lang.Integer, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.Number, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.String, Torello.Browser.JavaScriptAPI.RunTime.SerializationOptions)
is a command method declared inside theRunTimedomain class. It accepts 16 input parameters, most of which are optional. Its correspondingCommandDescriptorsingleton is created and stored inside the generated command-helper class for that domain:
RunTime$$Commands
The descriptor stores the command name, browser domain, parameter names, CDP type constants, optional-parameter flags, experimental-parameter flags, and the JavaClassreturned by the command. This metadata is used byCommandBuilderto construct aScriptwithout requiring the user to write long method invocations filled withnullplaceholders.- See Also:
- Serialized Form
Hi-Lited Source-Code:- View Here: Torello/Browser/CommandDescriptor.java
- Open New Browser-Tab: Torello/Browser/CommandDescriptor.java
File Size: 8,440 Bytes Line Count: 216 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field protected static longserialVersionUIDjava.lang.Class of the Command's Return Value Modifier and Type Field Class<T>returnClass-
Fields inherited from class Torello.Browser.AbstractDescriptor
domain, experimentals, name, names, optionals, size, types
-
-
Constructor Summary
Constructors Constructor CommandDescriptor(String name, Domains domain, ReadOnlyList<String> names, ReadOnlyList<Byte> types, ReadOnlyList<Boolean> optionals, ReadOnlyList<Boolean> experimentals, Class<T> returnClass)
-
Method Summary
Methods: class java.lang.Object Modifier and Type Method StringtoString()-
Methods inherited from class Torello.Browser.AbstractDescriptor
compareTo, equals, hashCode, nameToIndex
-
-
-
-
Field Detail
-
serialVersionUID
protected static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable. Using theSerializableImplementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final long serialVersionUID = 1L;
-
returnClass
public final java.lang.Class<T> returnClass
The JavaClassreturned by the command.- Code:
- Exact Field Declaration Expression:
public final Class<T> returnClass;
-
-
Constructor Detail
-
CommandDescriptor
public CommandDescriptor(java.lang.String name, Domains domain, ReadOnlyList<java.lang.String> names, ReadOnlyList<java.lang.Byte> types, ReadOnlyList<java.lang.Boolean> optionals, ReadOnlyList<java.lang.Boolean> experimentals, java.lang.Class<T> returnClass)
This is a public constructor, but it's primarily intended for internal use.- Parameters:
name- The name of the CDP type described by this descriptor.domain- The Browser Domain containing the described CDP type.names- Parallel list of CDP property names.types- Parallel list ofCDP Type Constants.optionals- Parallel list indicating which properties areoptional.experimentals- Parallel list indicating which properties areexperimental.returnClass- The JavaClassreturned by the command.
-
-
Method Detail
-
toString
public java.lang.String toString()
Generates a reasonableStringrepresentation of'this'instance.- Overrides:
toStringin classAbstractDescriptor- Returns:
- A Java
String - See Also:
NestedDescriptor.toString(),toString()- Code:
- Exact Method Body:
return "CommandDescriptor:\n" + "{\n" + super.toString() + '\n' + I4 + "returnClass: " + this.returnClass.getCanonicalName() + '\n' + "}\n";
-
-