T - generic type of chronological entity to be formattedpublic interface ChronoPrinter<T>
Prints a chronological entity.
ChronoEntity| Modifier and Type | Method and Description |
|---|---|
default String |
format(T formattable)
Prints given chronological entity as formatted text.
|
default AttributeQuery |
getAttributes()
Returns the global format attributes which are active if they are not
overridden by sectional attributes.
|
<R> R |
print(T formattable,
Appendable buffer,
AttributeQuery attributes,
ChronoFunction<ChronoDisplay,R> query)
Deprecated.
Beginning with v5.0, this method will be removed. Implementors are asked to override
print(T, StringBuilder, AttributeQuery
as soon as possible in order to simplify the future migration. |
default Set<ElementPosition> |
print(T formattable,
StringBuilder buffer)
Prints given chronological entity as formatted text and writes
the text into given buffer.
|
default Set<ElementPosition> |
print(T formattable,
StringBuilder buffer,
AttributeQuery attributes)
Prints given chronological entity as formatted text and writes
the text into given buffer.
|
@Deprecated <R> R print(T formattable, Appendable buffer, AttributeQuery attributes, ChronoFunction<ChronoDisplay,R> query) throws IOException
print(T, StringBuilder, AttributeQuery
as soon as possible in order to simplify the future migration.Creates a text output and writes it into given buffer.
Note: Implementations have to call query.apply(...)
at the end to return a possibly meaningful result. An example
would be a query which produces just the identical input so
the result of printing a Moment will be the formatted
form of the original Moment.
R - generic result typeformattable - chronological entity to be formattedbuffer - format buffer any text output will be sent toattributes - control attributesquery - custom query returning any kind of resultIllegalArgumentException - if the object is not formattableIOException - if writing into buffer failsdefault String format(T formattable)
Prints given chronological entity as formatted text.
formattable - object to be formattedIllegalArgumentException - if given object is not formattabledefault Set<ElementPosition> print(T formattable, StringBuilder buffer)
Prints given chronological entity as formatted text and writes the text into given buffer.
Equivalent to print(formattable, buffer, getAttributes()).
formattable - object to be formattedbuffer - text output bufferIllegalArgumentException - if given object is not formattabledefault Set<ElementPosition> print(T formattable, StringBuilder buffer, AttributeQuery attributes)
Prints given chronological entity as formatted text and writes the text into given buffer.
Starting with v5.0, this method will become the SAM-method of this interface and has to be implemented in any suitable way.
formattable - object to be formattedbuffer - text output bufferattributes - format attributes which can control formattingIllegalArgumentException - if given object is not formattabledefault AttributeQuery getAttributes()
Returns the global format attributes which are active if they are not overridden by sectional attributes.
Copyright © 2014–2017. All rights reserved.