Package eu.bandm.tools.format.spi
Class FormatProxy<F>
java.lang.Object
eu.bandm.tools.format.spi.FormatProxy<F>
- Type Parameters:
F
- the type of format objects to produce
- All Implemented Interfaces:
FormatProvider<F>
- Direct Known Subclasses:
FormatServer
A proxy provider that delegates creation of format objects to some
other provider.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
FormatProxy
(FormatProvider<F> provider) Creates a new instancce. -
Method Summary
Modifier and TypeMethodDescriptionReturns a compound format object that concatenates the given elements horizontally with absolute indentation.Returns a compound format object that concatenates the given elements vertically.Returns a compound format object that concatenates the given elements horizontally with relative indentation.Returns a compound format object that concatenates the given elements first horizontally and then vertically.Returns a compound format object that concatenates the given elements either horizontally or vertically.Returns an atomic format object that displays the given string.space
(int width) Returns an atomic format object that displays breakable whitespace.
-
Field Details
-
provider
The provider to delegate to.
-
-
Constructor Details
-
FormatProxy
Creates a new instancce.- Parameters:
provider
- the provider to delegate to- Throws:
NullPointerException
- ifprovider == null
-
-
Method Details
-
literal
Returns an atomic format object that displays the given string.If the given string contains whitespace, that will not be considered for line breaks.
The default implementation just delegates to
provider
.- Specified by:
literal
in interfaceFormatProvider<F>
- Parameters:
text
- the string to display- Returns:
- an atomic format object that displays the given string
-
space
Returns an atomic format object that displays breakable whitespace.The default implementation just delegates to
provider
.- Specified by:
space
in interfaceFormatProvider<F>
- Parameters:
width
- the number of whitespace characters to display- Returns:
- an atomic format object that displays breakable whitespace of the given width
-
append
Returns a compound format object that concatenates the given elements horizontally with absolute indentation.The default implementation just delegates to
provider
.- Specified by:
append
in interfaceFormatProvider<F>
- 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.The default implementation just delegates to
provider
.- Specified by:
beside
in interfaceFormatProvider<F>
- 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.The default implementation just delegates to
provider
.- Specified by:
beneath
in interfaceFormatProvider<F>
- 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.The default implementation just delegates to
provider
.- Specified by:
line
in interfaceFormatProvider<F>
- 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.The default implementation just delegates to
provider
.- Specified by:
block
in interfaceFormatProvider<F>
- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-