Package com.helger.html.js.tostring
Class JSToStringConverter
- java.lang.Object
-
- com.helger.html.js.tostring.JSToStringConverter
-
- All Implemented Interfaces:
IJSToStringConverter
@Immutable public class JSToStringConverter extends Object implements IJSToStringConverter
Default implementation of theIJSToStringConverterinterface, usingJSMarshallerto convert an object to a string representation.- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_WITH_SURROUNDING_VARBy default a surrounding variable is created
-
Constructor Summary
Constructors Constructor Description JSToStringConverter()JSToStringConverter(boolean bWithSurroundingVar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()booleanisWithSurroundingVar()StringobjectToJSString(Object aObject, JSType aType)Convert an arbitrary JS object to a string.StringtoString()
-
-
-
Field Detail
-
DEFAULT_WITH_SURROUNDING_VAR
public static final boolean DEFAULT_WITH_SURROUNDING_VAR
By default a surrounding variable is created- See Also:
- Constant Field Values
-
-
Method Detail
-
isWithSurroundingVar
public boolean isWithSurroundingVar()
-
objectToJSString
@Nullable public String objectToJSString(@Nullable Object aObject, @Nonnull JSType aType)
Description copied from interface:IJSToStringConverterConvert an arbitrary JS object to a string.- Specified by:
objectToJSStringin interfaceIJSToStringConverter- Parameters:
aObject- The object to be converted. May benull.aType- The JS type to use. May not benull.- Returns:
nullif the passed object isnull.
-
-