Package com.helger.html.js.tostring
Class JSType
- java.lang.Object
-
- com.helger.html.js.tostring.JSType
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
JSArrayType,JSListType,JSMapType
@Immutable @MustImplementEqualsAndHashcode public class JSType extends Object implements Serializable
Wrapper around JavaScript types.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static JSTypeAUTO_DETECTSpecial JS type for type auto detection - in this casegetType()returnsnull!!static JSTypeBOOLEANConstant basic type for Double.static JSTypeDOUBLEConstant basic type for Double.static JSTypeHTMLConstant basic type for HTML.static JSTypeINTConstant basic type for Integer.static JSTypeJSConstant basic type for objects already having JS code present.static JSTypeJSONConstant basic type for objects already having JSON code present.static JSTypeSTRINGConstant basic type for String.static JSTypeVOIDConstant basic type for Void.
-
Constructor Summary
Constructors Modifier Constructor Description protectedJSType(com.helger.html.js.tostring.EJSType eType)The constructor is protected to avoid outside instantiation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)com.helger.html.js.tostring.EJSTypegetType()Get the contained base type.inthashCode()StringtoString()
-
-
-
Field Detail
-
AUTO_DETECT
public static final JSType AUTO_DETECT
Special JS type for type auto detection - in this casegetType()returnsnull!!
-
HTML
public static final JSType HTML
Constant basic type for HTML. In contrast toSTRINGvalues, HTML values are neither quoted not escaped!
-
STRING
public static final JSType STRING
Constant basic type for String. Values will be quoted and escaped!
-
INT
public static final JSType INT
Constant basic type for Integer.
-
DOUBLE
public static final JSType DOUBLE
Constant basic type for Double.
-
BOOLEAN
public static final JSType BOOLEAN
Constant basic type for Double.
-
VOID
public static final JSType VOID
Constant basic type for Void.
-
JS
public static final JSType JS
Constant basic type for objects already having JS code present.- See Also:
IHasJSCode
-
JSON
public static final JSType JSON
Constant basic type for objects already having JSON code present.- See Also:
IHasJSCode
-
-
Constructor Detail
-
JSType
protected JSType(@Nonnull com.helger.html.js.tostring.EJSType eType)
The constructor is protected to avoid outside instantiation. Use only the above constants.- Parameters:
eType- The basic type. May not benull.
-
-
Method Detail
-
getType
@Nullable public final com.helger.html.js.tostring.EJSType getType()
Get the contained base type.- Returns:
- The base type. Is only
nullfor theAUTO_DETECTtype.
-
-