com.google.javascript.jscomp
Class ClosureCodingConvention.AssertFunctionByTypeName

java.lang.Object
  extended by com.google.javascript.jscomp.CodingConvention.AssertionFunctionSpec
      extended by com.google.javascript.jscomp.ClosureCodingConvention.AssertFunctionByTypeName
Enclosing class:
ClosureCodingConvention

public static class ClosureCodingConvention.AssertFunctionByTypeName
extends CodingConvention.AssertionFunctionSpec

A function that will throw an exception when the value is not an instanceof the given type name, for instance "Element".


Field Summary
 
Fields inherited from class com.google.javascript.jscomp.CodingConvention.AssertionFunctionSpec
assertedType, functionName
 
Constructor Summary
ClosureCodingConvention.AssertFunctionByTypeName(String functionName, String typeName)
           
 
Method Summary
 JSType getAssertedType(Node call, JSTypeRegistry registry)
          Returns the type for a type assertion, or null if the function asserts that the node must not be null or undefined.
 
Methods inherited from class com.google.javascript.jscomp.CodingConvention.AssertionFunctionSpec
getAssertedParam, getFunctionName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClosureCodingConvention.AssertFunctionByTypeName

public ClosureCodingConvention.AssertFunctionByTypeName(String functionName,
                                                        String typeName)
Method Detail

getAssertedType

public JSType getAssertedType(Node call,
                              JSTypeRegistry registry)
Returns the type for a type assertion, or null if the function asserts that the node must not be null or undefined.

Overrides:
getAssertedType in class CodingConvention.AssertionFunctionSpec
Parameters:
call - The asserting call