Package com.helger.html.js.tostring
Class JSToString
- java.lang.Object
-
- com.helger.html.js.tostring.JSToString
-
public final class JSToString extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringobjectToJSString(Object aObject)Auto-detect the type of the passed object and convert it to a JS string.static StringobjectToJSString(Object aObject, JSType aType)static StringobjectToJSString(Object aObject, JSType aType, boolean bWithSurroundingVar)
-
-
-
Method Detail
-
objectToJSString
@Nonnull public static String objectToJSString(@Nullable Object aObject)
Auto-detect the type of the passed object and convert it to a JS string. If the type detection failed, anIllegalArgumentExceptionis thrown.- Parameters:
aObject- The object to be converted. May benull. Note: works for atomic types and arrays, but not for collection types!- Returns:
- The string representation of the passed object.
-
objectToJSString
@Nonnull public static String objectToJSString(@Nullable Object aObject, @Nonnull JSType aType)
-
-