Class DtoDisplay
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
org.vaadin.firitin.rad.DtoDisplay
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasStyle
,Serializable
public class DtoDisplay
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
A simple component to display a DTO in a human-readable way with minimal amount of code.
Can be used to display simple results on the UI or in RAD (Rapid Application Development)
to quickly see the content of a complex DTO coming from some API.
Note, this is very early draft and likely the formatting will change in upcoming versions. Current version uses Jackson to read the first level of data, but in future versions it might use some other library or custom reflection code and might display deeper object trees.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDtoDisplay
(Object dto) Creates a new instance of DtoDisplay.DtoDisplay
(List<PropertyPrinter> propertyPrinters, ValueContext context) -
Method Summary
Modifier and TypeMethodDescriptionstatic List
<PropertyPrinter> protected void
onAttach
(com.vaadin.flow.component.AttachEvent attachEvent) withPropertyPrinter
(PropertyPrinter printer) Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContent
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
SHORT_STRING_THRESHOLD
public static final int SHORT_STRING_THRESHOLD- See Also:
-
-
Constructor Details
-
DtoDisplay
Creates a new instance of DtoDisplay.- Parameters:
dto
- the DTO to display
-
DtoDisplay
-
-
Method Details
-
getDefaultPropertyPrinters
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttach
in classcom.vaadin.flow.component.Component
-
withDefaultHeader
-
withPropertyPrinter
-
withPropertyHeaderPrinter
-