org.barracudamvc.contrib.sam.models
Class ErrorModel

java.lang.Object
  extended byorg.barracudamvc.core.comp.AbstractTemplateModel
      extended byorg.barracudamvc.contrib.dbroggisch.display.IterativeCollectionModel
          extended byorg.barracudamvc.contrib.sam.models.ErrorModel
All Implemented Interfaces:
Contextual, IterativeModel, Model, TemplateModel

public class ErrorModel
extends IterativeCollectionModel

ErrorModel is a special Model for displaying form validation errors. During the control events, the model if filled by calling the static create(org.barracudamvc.core.event.EventContext, java.lang.Exception) methods with the form validation exceptions
During the view phase, the model acts as a IterativeModel and displays the error messages.


Field Summary
static String DEFAULT_ERRORMODEL
           
static String DIRECTIVE_VISIBLE
           
protected static org.apache.log4j.Logger logger
           
 
Fields inherited from class org.barracudamvc.contrib.dbroggisch.display.IterativeCollectionModel
_current
 
Fields inherited from class org.barracudamvc.core.comp.AbstractTemplateModel
listeners, UNDEFINED, viewContext
 
Constructor Summary
ErrorModel(String name, ViewContext vc)
           
ErrorModel(ViewContext vc)
           
 
Method Summary
static void create(EventContext context, Exception ex)
           
static void create(String name, EventContext context, Exception ex)
           
static boolean exists(EventContext context)
           
static boolean exists(String name, EventContext context)
           
 Object getItem(String key)
          Convenience method to get an item based on the key name (extracted from the TemplateDirective).
 boolean processDirective(TemplateDirective td)
          process any directives. return false to indicate a the node containing this directive should be skipped.
static void remove(EventContext context)
           
static void remove(String name, EventContext context)
           
 
Methods inherited from class org.barracudamvc.contrib.dbroggisch.display.IterativeCollectionModel
add, getModels, getName, hasNext, loadNext, postIterate, preIterate, setModels, setName
 
Methods inherited from class org.barracudamvc.core.comp.AbstractTemplateModel
addModelListener, fireModelChanged, getItem, getViewContext, removeModelListener, setViewContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

DEFAULT_ERRORMODEL

public static final String DEFAULT_ERRORMODEL
See Also:
Constant Field Values

DIRECTIVE_VISIBLE

public static final String DIRECTIVE_VISIBLE
See Also:
Constant Field Values
Constructor Detail

ErrorModel

public ErrorModel(ViewContext vc)

ErrorModel

public ErrorModel(String name,
                  ViewContext vc)
Method Detail

getItem

public Object getItem(String key)
Description copied from class: AbstractTemplateModel
Convenience method to get an item based on the key name (extracted from the TemplateDirective).

Overrides:
getItem in class AbstractTemplateModel

processDirective

public boolean processDirective(TemplateDirective td)
Description copied from class: AbstractTemplateModel
process any directives. return false to indicate a the node containing this directive should be skipped.

Specified by:
processDirective in interface TemplateModel
Overrides:
processDirective in class AbstractTemplateModel

create

public static void create(EventContext context,
                          Exception ex)

create

public static void create(String name,
                          EventContext context,
                          Exception ex)

remove

public static void remove(EventContext context)

remove

public static void remove(String name,
                          EventContext context)

exists

public static boolean exists(EventContext context)

exists

public static boolean exists(String name,
                             EventContext context)


Copyright © 2004 BarracudaMVC.org All Rights Reserved.