public final class MRulesUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getContent(InputStream instream)
Reads text content of a stream resource.
|
static String |
getContent(Reader reader)
Reads text content of a character resource.
|
static String |
getContent(String resource)
Reads text content of a resources in classpath.
|
static Iterator<?> |
getIterator(Object value)
calls
getIterator(Object, boolean) with simulateForSingleValue at false. |
static Iterator<?> |
getIterator(Object value,
boolean simulateForSingleValue)
Gets an iterator over the provided object, which can be an array, an
Iterator , an Enumeration or an Iterable . |
static String |
getSpaces(int level) |
static String |
getSpaces(int level,
Integer maxLevel) |
public static String getSpaces(int level)
public static Iterator<?> getIterator(Object value) throws MAccessorException
getIterator(Object, boolean)
with simulateForSingleValue at false.MAccessorException
public static Iterator<?> getIterator(Object value, boolean simulateForSingleValue) throws MAccessorException
Iterator
, an Enumeration
or an Iterable
.
If the value is not iterable, an exception will be raised or a UniqueIterator
will be returned, depending on simulateForSingleValue.MAccessorException
public static String getContent(String resource) throws IOException
resource
- Resource to readIOException
- If a problem occurred while opening resource or reading.public static String getContent(InputStream instream) throws IOException
instream
- Stream to readIOException
- If a problem occurred while reading.public static String getContent(Reader reader) throws IOException
reader
- Reader to readIOException
- If a problem occurred while reading.