Package com.google.javascript.rhino
Class NominalTypeBuilder
java.lang.Object
com.google.javascript.rhino.NominalTypeBuilder
Builder interface for declaring properties on class-like (nominal) types. Nominal types consist
primarily of three separate object types, which may each have their own properties declared on
them separately: (1) the constructor function, (2) the instance type, and (3) the prototype
object.
This builder is used during the first part of type checking, while the type checker builds up the set of known types. Thus, this interface serves as a placeholder to allow operating on (i.e. both assigning properties to, and referencing the yet-to-exist type) these not-yet-available types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the constructor as a JSType.voiddeclareConstructorProperty(String name, JSType type, Node defSite) Declares a static property on the nominal type's constructor.voiddeclareInstanceProperty(String name, JSType type, Node defSite) Declares an instance property on the nominal type.voiddeclarePrototypeProperty(String name, JSType type, Node defSite) Declares a property on the nominal type's prototype.instance()Returns the instance type as a JSType.Returns the type of the prototype object (OTI).@Nullable NominalTypeBuilderReturns a NominalTypeBuilder for this type's superclass.
-
Constructor Details
-
NominalTypeBuilder
-
-
Method Details
-
declarePrototypeProperty
Declares a property on the nominal type's prototype. -
declareInstanceProperty
Declares an instance property on the nominal type. -
declareConstructorProperty
Declares a static property on the nominal type's constructor. -
superClass
Returns a NominalTypeBuilder for this type's superclass. -
constructor
Returns the constructor as a JSType. -
instance
Returns the instance type as a JSType. -
prototypeOrInstance
Returns the type of the prototype object (OTI).
-