Package com.google.javascript.jscomp
Enum Requirement.Type
- java.lang.Object
-
- java.lang.Enum<Requirement.Type>
-
- com.google.javascript.jscomp.Requirement.Type
-
- All Implemented Interfaces:
com.google.protobuf.Internal.EnumLite
,com.google.protobuf.ProtocolMessageEnum
,java.io.Serializable
,java.lang.Comparable<Requirement.Type>
- Enclosing class:
- Requirement
public static enum Requirement.Type extends java.lang.Enum<Requirement.Type> implements com.google.protobuf.ProtocolMessageEnum
A classification of the requirement and how it is enforced.
Protobuf enumjscomp.Requirement.Type
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BANNED_CODE_PATTERN
A banned code pattern.BANNED_DEPENDENCY
A forbidden source fileBANNED_DEPENDENCY_REGEX
Forbidden dependency (source or generated files) expressed via regexp.BANNED_NAME
A forbidden fully distinguished name.BANNED_NAME_CALL
A banned function call.BANNED_PROPERTY
A banned instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned"BANNED_PROPERTY_CALL
A banned function call.BANNED_PROPERTY_NON_CONSTANT_WRITE
A banned write of a non-constant value to an instance property.BANNED_PROPERTY_READ
A banned reading from an instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans reads to the property, i.e.BANNED_PROPERTY_WRITE
A banned write to an instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans assignments to the property, i.e.CUSTOM
A requirement enforced with code a external java class.NO_OP
No-op requirement that never reports any violations.RESTRICTED_METHOD_CALL
A restricted call, for example: - The unsafe opt_html parameter must not be passed to createNode: goog.ui.tree.TreeControl.prototype.createNode:function()RESTRICTED_NAME_CALL
A restricted call, for example: - the "parseInt" call must be called with a radix: parseInt:function(string, int)RESTRICTED_PROPERTY_WRITE
A restricted write to an instance property.
-
Field Summary
Fields Modifier and Type Field Description static int
BANNED_CODE_PATTERN_VALUE
A banned code pattern.static int
BANNED_DEPENDENCY_REGEX_VALUE
Forbidden dependency (source or generated files) expressed via regexp.static int
BANNED_DEPENDENCY_VALUE
A forbidden source filestatic int
BANNED_NAME_CALL_VALUE
A banned function call.static int
BANNED_NAME_VALUE
A forbidden fully distinguished name.static int
BANNED_PROPERTY_CALL_VALUE
A banned function call.static int
BANNED_PROPERTY_NON_CONSTANT_WRITE_VALUE
A banned write of a non-constant value to an instance property.static int
BANNED_PROPERTY_READ_VALUE
A banned reading from an instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans reads to the property, i.e.static int
BANNED_PROPERTY_VALUE
A banned instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned"static int
BANNED_PROPERTY_WRITE_VALUE
A banned write to an instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans assignments to the property, i.e.static int
CUSTOM_VALUE
A requirement enforced with code a external java class.static int
NO_OP_VALUE
No-op requirement that never reports any violations.static int
RESTRICTED_METHOD_CALL_VALUE
A restricted call, for example: - The unsafe opt_html parameter must not be passed to createNode: goog.ui.tree.TreeControl.prototype.createNode:function()static int
RESTRICTED_NAME_CALL_VALUE
A restricted call, for example: - the "parseInt" call must be called with a radix: parseInt:function(string, int)static int
RESTRICTED_PROPERTY_WRITE_VALUE
A restricted write to an instance property.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Requirement.Type
forNumber(int value)
static com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor()
com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType()
int
getNumber()
com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor()
static com.google.protobuf.Internal.EnumLiteMap<Requirement.Type>
internalGetValueMap()
static Requirement.Type
valueOf(int value)
Deprecated.static Requirement.Type
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
Returns the enum constant of this type with the specified name.static Requirement.Type
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Requirement.Type[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CUSTOM
public static final Requirement.Type CUSTOM
A requirement enforced with code a external java class.
CUSTOM = 1;
-
NO_OP
public static final Requirement.Type NO_OP
No-op requirement that never reports any violations. This exists so that, if a requirement becomes obsolete but is extended by other requirements that can't all be simultaneously deleted, it can be changed to this rule, allowing it to be effectively removed without breaking downstream builds.
NO_OP = 15;
-
BANNED_DEPENDENCY
public static final Requirement.Type BANNED_DEPENDENCY
A forbidden source file
BANNED_DEPENDENCY = 2;
-
BANNED_DEPENDENCY_REGEX
public static final Requirement.Type BANNED_DEPENDENCY_REGEX
Forbidden dependency (source or generated files) expressed via regexp.
BANNED_DEPENDENCY_REGEX = 14;
-
BANNED_NAME
public static final Requirement.Type BANNED_NAME
A forbidden fully distinguished name. For example: - A global name like "eval" or "goog" - A namespaced value or type: namespace.Banned - A 'static' property: "namespace.Foo.banned" TODO(b/112325992): If namespace.Banned is a goog.module that does not call goog.declareModuleId, the rule will not match.
BANNED_NAME = 3;
-
BANNED_PROPERTY
public static final Requirement.Type BANNED_PROPERTY
A banned instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned"
BANNED_PROPERTY = 4;
-
BANNED_PROPERTY_READ
public static final Requirement.Type BANNED_PROPERTY_READ
A banned reading from an instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans reads to the property, i.e. its use as an rvalue.
BANNED_PROPERTY_READ = 5;
-
BANNED_PROPERTY_WRITE
public static final Requirement.Type BANNED_PROPERTY_WRITE
A banned write to an instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans assignments to the property, i.e. its use as an lvalue.
BANNED_PROPERTY_WRITE = 6;
-
RESTRICTED_NAME_CALL
public static final Requirement.Type RESTRICTED_NAME_CALL
A restricted call, for example: - the "parseInt" call must be called with a radix: parseInt:function(string, int)
RESTRICTED_NAME_CALL = 7;
-
RESTRICTED_METHOD_CALL
public static final Requirement.Type RESTRICTED_METHOD_CALL
A restricted call, for example: - The unsafe opt_html parameter must not be passed to createNode: goog.ui.tree.TreeControl.prototype.createNode:function()
RESTRICTED_METHOD_CALL = 8;
-
BANNED_CODE_PATTERN
public static final Requirement.Type BANNED_CODE_PATTERN
A banned code pattern. This check is done using against an AST. To ban a call to eval: "/** @param {?} a */ function template(a) {eval(a);}"
BANNED_CODE_PATTERN = 9;
-
BANNED_PROPERTY_CALL
public static final Requirement.Type BANNED_PROPERTY_CALL
A banned function call. for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans calls to the property i.e. using the property as a value is allowed.
BANNED_PROPERTY_CALL = 10;
-
BANNED_PROPERTY_NON_CONSTANT_WRITE
public static final Requirement.Type BANNED_PROPERTY_NON_CONSTANT_WRITE
A banned write of a non-constant value to an instance property. Unlike BANNED_PROPERTY_WRITE, this only bans assignments of a non-constant value.
BANNED_PROPERTY_NON_CONSTANT_WRITE = 11;
-
BANNED_NAME_CALL
public static final Requirement.Type BANNED_NAME_CALL
A banned function call. Unlike BANNED_NAME, this only bans calls to the property, i.e. using the property as a value is allowed.
BANNED_NAME_CALL = 12;
-
RESTRICTED_PROPERTY_WRITE
public static final Requirement.Type RESTRICTED_PROPERTY_WRITE
A restricted write to an instance property. Example: "Element.prototype.innerHTML:!TrustedHTML|string"
RESTRICTED_PROPERTY_WRITE = 13;
-
-
Field Detail
-
CUSTOM_VALUE
public static final int CUSTOM_VALUE
A requirement enforced with code a external java class.
CUSTOM = 1;
- See Also:
- Constant Field Values
-
NO_OP_VALUE
public static final int NO_OP_VALUE
No-op requirement that never reports any violations. This exists so that, if a requirement becomes obsolete but is extended by other requirements that can't all be simultaneously deleted, it can be changed to this rule, allowing it to be effectively removed without breaking downstream builds.
NO_OP = 15;
- See Also:
- Constant Field Values
-
BANNED_DEPENDENCY_VALUE
public static final int BANNED_DEPENDENCY_VALUE
A forbidden source file
BANNED_DEPENDENCY = 2;
- See Also:
- Constant Field Values
-
BANNED_DEPENDENCY_REGEX_VALUE
public static final int BANNED_DEPENDENCY_REGEX_VALUE
Forbidden dependency (source or generated files) expressed via regexp.
BANNED_DEPENDENCY_REGEX = 14;
- See Also:
- Constant Field Values
-
BANNED_NAME_VALUE
public static final int BANNED_NAME_VALUE
A forbidden fully distinguished name. For example: - A global name like "eval" or "goog" - A namespaced value or type: namespace.Banned - A 'static' property: "namespace.Foo.banned" TODO(b/112325992): If namespace.Banned is a goog.module that does not call goog.declareModuleId, the rule will not match.
BANNED_NAME = 3;
- See Also:
- Constant Field Values
-
BANNED_PROPERTY_VALUE
public static final int BANNED_PROPERTY_VALUE
A banned instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned"
BANNED_PROPERTY = 4;
- See Also:
- Constant Field Values
-
BANNED_PROPERTY_READ_VALUE
public static final int BANNED_PROPERTY_READ_VALUE
A banned reading from an instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans reads to the property, i.e. its use as an rvalue.
BANNED_PROPERTY_READ = 5;
- See Also:
- Constant Field Values
-
BANNED_PROPERTY_WRITE_VALUE
public static final int BANNED_PROPERTY_WRITE_VALUE
A banned write to an instance property, for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans assignments to the property, i.e. its use as an lvalue.
BANNED_PROPERTY_WRITE = 6;
- See Also:
- Constant Field Values
-
RESTRICTED_NAME_CALL_VALUE
public static final int RESTRICTED_NAME_CALL_VALUE
A restricted call, for example: - the "parseInt" call must be called with a radix: parseInt:function(string, int)
RESTRICTED_NAME_CALL = 7;
- See Also:
- Constant Field Values
-
RESTRICTED_METHOD_CALL_VALUE
public static final int RESTRICTED_METHOD_CALL_VALUE
A restricted call, for example: - The unsafe opt_html parameter must not be passed to createNode: goog.ui.tree.TreeControl.prototype.createNode:function()
RESTRICTED_METHOD_CALL = 8;
- See Also:
- Constant Field Values
-
BANNED_CODE_PATTERN_VALUE
public static final int BANNED_CODE_PATTERN_VALUE
A banned code pattern. This check is done using against an AST. To ban a call to eval: "/** @param {?} a */ function template(a) {eval(a);}"
BANNED_CODE_PATTERN = 9;
- See Also:
- Constant Field Values
-
BANNED_PROPERTY_CALL_VALUE
public static final int BANNED_PROPERTY_CALL_VALUE
A banned function call. for example: - An 'instance' property: "namespace.Foo.prototype.banned" - All properties of a given name "Object.prototype.banned" Unlike BANNED_PROPERTY, this only bans calls to the property i.e. using the property as a value is allowed.
BANNED_PROPERTY_CALL = 10;
- See Also:
- Constant Field Values
-
BANNED_PROPERTY_NON_CONSTANT_WRITE_VALUE
public static final int BANNED_PROPERTY_NON_CONSTANT_WRITE_VALUE
A banned write of a non-constant value to an instance property. Unlike BANNED_PROPERTY_WRITE, this only bans assignments of a non-constant value.
BANNED_PROPERTY_NON_CONSTANT_WRITE = 11;
- See Also:
- Constant Field Values
-
BANNED_NAME_CALL_VALUE
public static final int BANNED_NAME_CALL_VALUE
A banned function call. Unlike BANNED_NAME, this only bans calls to the property, i.e. using the property as a value is allowed.
BANNED_NAME_CALL = 12;
- See Also:
- Constant Field Values
-
RESTRICTED_PROPERTY_WRITE_VALUE
public static final int RESTRICTED_PROPERTY_WRITE_VALUE
A restricted write to an instance property. Example: "Element.prototype.innerHTML:!TrustedHTML|string"
RESTRICTED_PROPERTY_WRITE = 13;
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static Requirement.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Requirement.Type c : Requirement.Type.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Requirement.Type valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getNumber
public final int getNumber()
- Specified by:
getNumber
in interfacecom.google.protobuf.Internal.EnumLite
- Specified by:
getNumber
in interfacecom.google.protobuf.ProtocolMessageEnum
-
valueOf
@Deprecated public static Requirement.Type valueOf(int value)
Deprecated.Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
value
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
forNumber
public static Requirement.Type forNumber(int value)
- Parameters:
value
- The numeric wire value of the corresponding enum entry.- Returns:
- The enum associated with the given numeric wire value.
-
internalGetValueMap
public static com.google.protobuf.Internal.EnumLiteMap<Requirement.Type> internalGetValueMap()
-
getValueDescriptor
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
- Specified by:
getValueDescriptor
in interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptorForType
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptor
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
-
valueOf
public static Requirement.Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
desc
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-