Package eu.bandm.tools.format.spi
Class FormatServer<F>
java.lang.Object
eu.bandm.tools.format.spi.FormatProxy<F>
eu.bandm.tools.format.spi.FormatServer<F>
- Type Parameters:
F
- the type of format objects to produce
- All Implemented Interfaces:
FormatProvider<F>
A proxy provider that adds convenience methods for producing
format objects.
The main reason for the existence of this class is that methods with generic vararg parameters cannot be safely declared in an interface.
- See Also:
-
Field Summary
Fields inherited from class eu.bandm.tools.format.spi.FormatProxy
provider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal F
Returns a compound format object that concatenates the given elements horizontally with absolute indentation.final F
Returns a compound format object that concatenates the given elements vertically.final F
Returns a compound format object that concatenates the given elements horizontally with relative indentation.final F
Returns a compound format object that concatenates the given elements first horizontally and then vertically.Represents the given object as a format object.final F
Returns a compound format object that concatenates the given elements either horizontally or vertically.
-
Constructor Details
-
FormatServer
Creates a new instance.- Parameters:
provider
- the provider to delegate to- Throws:
NullPointerException
- ifprovider == null
-
-
Method Details
-
format
Represents the given object as a format object.Instances of
FormatClient
are represented by passingthis
to their methodFormatClient.format(eu.bandm.tools.format.spi.FormatServer<F>)
. Other objects, andnull
references, are represented by an atomic string according toString.valueOf(Object)
.- Parameters:
x
- the object to represent, ornull
- Returns:
- a format object representation
-
append
Returns a compound format object that concatenates the given elements horizontally with absolute indentation.- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-
beside
Returns a compound format object that concatenates the given elements horizontally with relative indentation.- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-
beneath
Returns a compound format object that concatenates the given elements vertically.- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-
line
Returns a compound format object that concatenates the given elements either horizontally or vertically.- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-
block
Returns a compound format object that concatenates the given elements first horizontally and then vertically.- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-