Interface InterceptorContext

    • Method Detail

      • getSource

        @Deprecated
        java.lang.Object getSource​(java.lang.Object model)
        Deprecated.
        since ages
        Parameters:
        model - passed in
        Returns:
        source for model 'cached' into context instance, see also DefaultModelService.get(Object)
      • getAllRegisteredElements

        @Deprecated
        java.util.Set<java.lang.Object> getAllRegisteredElements()
        Returns:
        unmodifiable set of models registered using the default operation
      • getElementsRegisteredFor

        java.util.Set<java.lang.Object> getElementsRegisteredFor​(PersistenceOperation operation)
        Returns:
        unmodifiable set of models registered for the given operation
      • registerElement

        @Deprecated
        void registerElement​(java.lang.Object model,
                             java.lang.Object source)
        Register the given model to this InterceptorContext using the InterceptorContext's default operation.
        Parameters:
        model - the model to be registered.
        source - the source of the model (optional)
      • registerElement

        void registerElement​(java.lang.Object model)
        Register the given model to this InterceptorContext using the InterceptorContext's default operation.
        Parameters:
        model - the model to be registered.
      • registerElementFor

        void registerElementFor​(java.lang.Object model,
                                PersistenceOperation operation)
        Register the given model to this InterceptorContext using the given operation.
        Parameters:
        model - the model to be registered.
        operation - the operation to be performed with the given model
      • contains

        @Deprecated
        boolean contains​(java.lang.Object model)
        Checks is the given model is already registered in this InterceptorContext with the default operation.
        Parameters:
        model - model instance to be searched for
        Returns:
        true if context interceptor contains model
      • contains

        boolean contains​(java.lang.Object model,
                         PersistenceOperation operation)
        Checks is the given model is already registered in this InterceptorContext with the given operation.
        Parameters:
        model - model instance to be searched for
        operation - the operation to be searched for
        Returns:
        true if context interceptor contains model
      • isNew

        boolean isNew​(java.lang.Object model)
        Tells if the model has been created and has not been saved yet.
        Parameters:
        model - model instance to be searched for
        Returns:
        result of the ModelConverter.isNew(Object) for registered model converter for passed model
      • exists

        boolean exists​(java.lang.Object model)
        Parameters:
        model - model instance to be searched for
        Returns:
        result of the ModelConverter.exists(Object) for registered model converter for passed model
      • isModified

        boolean isModified​(java.lang.Object model)
        Parameters:
        model - model instance to be searched for
        Returns:
        result of the ModelConverter.isModified(Object) for registered model converter for passed model
      • isModified

        boolean isModified​(java.lang.Object model,
                           java.lang.String attribute)
        Parameters:
        model - model instance to be searched for
        attribute - attribute name to be searched for
        Returns:
        result of the ModelConverter.isModified(Object, String) for registered model converter for passed model , attribute
      • isRemoved

        boolean isRemoved​(java.lang.Object model)
        Parameters:
        model - model instance to be searched for
        Returns:
        result of the ModelConverter.isRemoved(Object) for registered model converter for passed model
      • getModelService

        ModelService getModelService()
        Returns:
        model service instance for context instance
      • getAttribute

        java.lang.Object getAttribute​(java.lang.String key)
        Parameters:
        key - attribute name
        Returns:
        attribute for key
      • setAttribute

        void setAttribute​(java.lang.String key,
                          java.lang.Object value)
        Parameters:
        key - attribute name
        value - attribute passed into context
      • getDirtyAttributes

        java.util.Map<java.lang.String,​java.util.Set<java.util.Locale>> getDirtyAttributes​(java.lang.Object model)
        Returns a map with all modified attribute qualifiers for the given model. The keys are all localized and non-localized attribute qualifier which were modified. If the map value is null the key is a non-localized attribute qualifier else the map value contains the locale in which language the localized attribute was modified.
        Parameters:
        model - the new (not saved) model
        Returns:
        a map with all modified attribute qualifier.