Package org.smooks.support
Class MultiLineToStringBuilder
- java.lang.Object
-
- org.smooks.support.MultiLineToStringBuilder
-
public class MultiLineToStringBuilder extends Object
Static utility class for generating JSON like multi line Strings from Maps, List, Arrays and the ExecutionContext.These methods do traverse sub Maps/Collections/Arrays. They can handle references to parent nodes or to them selfs.
- Author:
- maurice_zeijen
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static String
repeat(String str, int repeat)
static String
toString(Object[] array)
Creates a multi line JSON like string representation from an Arraystatic String
toString(Object[] array, List<?> filterKeyList)
Creates a multi line JSON like string representation from an Arraystatic String
toString(Collection<?> collection)
Creates a multi line JSON like string representation from a Collection.static String
toString(Collection<?> collection, List<?> filterKeyList)
Creates a multi line JSON like string representation from a Collectionstatic String
toString(Map<?,?> map)
Creates a multi line JSON like string representation from a Mapstatic String
toString(Map<?,?> map, List<?> filterKeyList)
Creates a multi line JSON like string representation from a Mapstatic String
toString(ExecutionContext executionContext)
Creates a multi line JSON like string for the execution context
-
-
-
Method Detail
-
toString
public static String toString(ExecutionContext executionContext)
Creates a multi line JSON like string for the execution context- Parameters:
executionContext
- The ExecutionContext- Returns:
- The String representation
-
toString
public static String toString(Map<?,?> map)
Creates a multi line JSON like string representation from a Map- Parameters:
map
- The Map to create the string from- Returns:
- The String representation of the Map
-
toString
public static String toString(Map<?,?> map, List<?> filterKeyList)
Creates a multi line JSON like string representation from a Map- Parameters:
map
- The Map to create the string fromfilterKeyList
- A list of objects that are ignored when encountered as keys- Returns:
- The String representation of the Map
-
toString
public static String toString(Collection<?> collection)
Creates a multi line JSON like string representation from a Collection.- Parameters:
map
- The Map to create the string from- Returns:
- The String representation of the Map
-
toString
public static String toString(Collection<?> collection, List<?> filterKeyList)
Creates a multi line JSON like string representation from a Collection- Parameters:
map
- The Map to create the string fromfilterKeyList
- A list of objects that are ignored when encountered as keys- Returns:
- The String representation of the Map
-
toString
public static String toString(Object[] array)
Creates a multi line JSON like string representation from an Array- Parameters:
map
- The Map to create the string from- Returns:
- The String representation of the Map
-
toString
public static String toString(Object[] array, List<?> filterKeyList)
Creates a multi line JSON like string representation from an Array- Parameters:
map
- The Map to create the string fromfilterKeyList
- A list of objects that are ignored when encountered as keys- Returns:
- The String representation of the Map
-
-