FileDocCategorySizeDatePackage
Display.javaAPI DocGlassfish v2 API4604Fri May 04 22:35:00 BST 2007com.sun.enterprise.tools.common.validation.util

Display

public class Display extends Object
Display is a class that provides utiltiy methods for displaying validation failures.
author
Rajeshwar Patil
version
%I%, %G%

Fields Summary
Constructors Summary
public Display()
Creates a new instance of Display.

    
Methods Summary
public voidgui(java.util.Collection collection)
Displays validation failures in a GUI mode.

        assert false : 
                (BundleReader.getValue("MSG_not_yet_implemented"));     //NOI18N
    
protected booleanisFailureObject(java.lang.Object object)
Determines whether the given object is of type {@link Failure}

param
object the given object to determine the type of
return
true only if the given object is of type Failure

        return (object instanceof Failure);
    
protected voidreportError(java.lang.Object object)
Reports an error message.

param
object the given object which is not of type {@link Failure}

        String format = BundleReader.getValue(
            "MSG_does_not_support_displaying_of");                      //NOI18N
        Class classObject = object.getClass();
        Object[] arguments = new Object[]{"Display",                    //NOI18N
            classObject.getName()};

        String message = 
            MessageFormat.format(format, arguments);

        assert false : message;
    
protected voidreportFailure(java.lang.String message)
Systems out the failure message.

param
message the failure message to report.

        System.out.println(message);
    
public voidtext(java.util.Collection collection)
Displays validation failures in a command mode. It systems out the failure messages.

        Object object = null;
        Failure failure = null;

        if(collection != null){
            Iterator iterator = collection.iterator();
            while(iterator.hasNext()){
                object = iterator.next();
                boolean failureObect = isFailureObject(object);
                if(failureObect){
                    failure = (Failure) object;
                    reportFailure(failure.failureMessage());
                } else {
                    reportError(object);
                }
            }
        }