Class VegaUiObject<D extends DtObject>

  • Type Parameters:
    D - DtObject type
    All Implemented Interfaces:
    UiObject<D>, Serializable

    public class VegaUiObject<D extends DtObject>
    extends Object
    implements UiObject<D>
    UiObject is used as an Input buffer from client. It managed to : - merge a serverSideObject and an inputBufferObject - check validators - return merged Object
    Author:
    pchretien, npiedeloup
    See Also:
    Serialized Form
    • Field Detail

      • fieldIndex

        protected final Set<String> fieldIndex
    • Constructor Detail

      • VegaUiObject

        public VegaUiObject​(D inputDto,
                            Set<String> modifiedFields)
        Constructor.
        Parameters:
        inputDto - partial object translated from input
        modifiedFields - modified fieldNames
    • Method Detail

      • setServerSideToken

        public void setServerSideToken​(String serverSideToken)
        Specified by:
        setServerSideToken in interface UiObject<D extends DtObject>
        Parameters:
        serverSideToken - Server Side Token
      • setServerSideObject

        public void setServerSideObject​(D serverSideDto)
        Description copied from interface: UiObject
        Affect the server's version.
        Specified by:
        setServerSideObject in interface UiObject<D extends DtObject>
        Parameters:
        serverSideDto - Object keep server side
      • setInputKey

        public void setInputKey​(String inputKey)
        Specified by:
        setInputKey in interface UiObject<D extends DtObject>
        Parameters:
        inputKey - Object reference keep in this request context (for error handling)
      • getInputKey

        public String getInputKey()
        Specified by:
        getInputKey in interface UiObject<D extends DtObject>
        Returns:
        Object reference keep in this request context (for error handling)
      • checkFormat

        public boolean checkFormat​(UiMessageStack uiMessageStack)
        Vérifie les UiObjects de la liste et remplis la pile d'erreur.
        Specified by:
        checkFormat in interface UiObject<D extends DtObject>
        Parameters:
        uiMessageStack - Pile des messages qui sera mise à jour
        Returns:
        if the object is valid (no format errors) if it's not valid you must not call mergeAndCheckInput
      • mergeAndCheckInput

        public D mergeAndCheckInput​(List<DtObjectValidator<D>> dtObjectValidators,
                                    UiMessageStack uiMessageStack)
        Merge et Valide l'objet d'IHM et place les erreurs rencontrées dans la stack.
        Specified by:
        mergeAndCheckInput in interface UiObject<D extends DtObject>
        Parameters:
        dtObjectValidators - Validateurs à utiliser, peut-être spécifique à l'objet.
        uiMessageStack - Pile des messages qui sera mise à jour
        Returns:
        Objet métier mis à jour
      • getDtField

        protected final DtField getDtField​(String camelField)
      • isModified

        public boolean isModified​(String fieldName)
        Specified by:
        isModified in interface UiObject<D extends DtObject>
        Parameters:
        fieldName - Champs
        Returns:
        Si le champs à été modifié dans le UiObject
      • getSingleInputValue

        public String getSingleInputValue​(String fieldName)
        Get the value in the buffer for a know monovalued field.
        Specified by:
        getSingleInputValue in interface UiObject<D extends DtObject>
        Parameters:
        fieldName - name of the field (camelCase)
        Returns:
        the value in the buffer (can be null, if no data and not multiple)
      • getInputValue

        public String[] getInputValue​(String fieldName)
        Get the value in the buffer.
        Specified by:
        getInputValue in interface UiObject<D extends DtObject>
        Parameters:
        fieldName - name of the field (camelCase)
        Returns:
        the value in the buffer (can be null, if no data and not multiple)
      • setInputValue

        public void setInputValue​(String fieldName,
                                  String... stringValue)
        Set the value in the buffer.
        Specified by:
        setInputValue in interface UiObject<D extends DtObject>
        Parameters:
        fieldName - name of the field (camelCase)
        stringValue - the value as String
      • setTypedValue

        public final void setTypedValue​(String fieldName,
                                        Serializable value)
        Description copied from interface: UiObject
        Set a typed value in the buffer.
        Specified by:
        setTypedValue in interface UiObject<D extends DtObject>
        Parameters:
        fieldName - name of the field (camelCase)
        value - the typed value
      • isModified

        public boolean isModified()
        Specified by:
        isModified in interface UiObject<D extends DtObject>
        Returns:
        Si des champs ont été modifiés dans le UiObject
      • hasFormatError

        protected boolean hasFormatError​(String fieldName)
        Parameters:
        dtField - Champs
        Returns:
        Si le champs a une erreur de formatage
      • getLong

        public Long getLong​(String fieldName)
        Specified by:
        getLong in interface UiObject<D extends DtObject>
        Parameters:
        fieldName - Nom du champs
        Returns:
        Valeur typée