|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.japaki.text.MultiLineTransformer
public class MultiLineTransformer
Transforms a single line into multiple lines of a defined maximum size.
| Constructor Summary | |
|---|---|
MultiLineTransformer(int linesize)
Creates a new multiline transformer. |
|
| Method Summary | ||
|---|---|---|
boolean |
isRetrievable(List<String> input)
Indicates if the origin of the specified object can be calculated. |
|
static
|
newMultiLineParser(Format format,
Property<B,String> property,
String name,
int linesize)
Creates a parser for a multline string field. |
|
String |
retransform(List<String> input)
Concatenates the strings from the list into a single string. |
|
List<String> |
transform(String input)
Breaks a string into multiple lines, so that each line except the last has the predefined linesize. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiLineTransformer(int linesize)
linesize - the maximum size of an output line
IllegalArgumentException - if linesize is smaller than one.| Method Detail |
|---|
public List<String> transform(String input)
transform in interface TwoWayTransformer<String,List<String>>input - the text in a single string
public String retransform(List<String> input)
retransform in interface TwoWayTransformer<String,List<String>>input - the text in multiple strings
public boolean isRetrievable(List<String> input)
TwoWayTransformerretransform is implemented for this object and does
not throw an exception.x returned by retransform
is unique, or more formally:
transform(o1).equals(transform(o2)) ⇒ o1.equals(o2)
retransform(transform(input)).equals(input)for all objects where the retransformation is defined.
isRetrievable in interface TwoWayTransformer<String,List<String>>input - the object for which the transformation origin is searched.
true if the origin of the specified object can
be calculated.
public static <B> Parser<B> newMultiLineParser(Format format,
Property<B,String> property,
String name,
int linesize)
format - base format (see LeafParser)property - the rule how to retrieve and store the value for
parsing and formatting, respectively.name - name of the line parser for logging purposeslinesize - the maximum size of an output line
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||