//# 0 errors, 186 messages
//#
/*
    //#RollerMessages.java:1:1: class: org.apache.roller.weblogger.util.RollerMessages
    //#RollerMessages.java:1:1: method: org.apache.roller.weblogger.util.RollerMessages.org.apache.roller.weblogger.util.RollerMessages__static_init
    //#RollerMessages.java:1:1: class: org.apache.roller.weblogger.util.RollerMessages$RollerMessage
    //#RollerMessages.java:1:1: method: org.apache.roller.weblogger.util.RollerMessages$RollerMessage.org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init
* Licensed to the Apache Software Foundation (ASF) under one or more
*  contributor license agreements.  The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.  For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
package org.apache.roller.weblogger.util;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Holds collection of error messages and collection of status messages.
 * @author David M Johnson
 */
public class RollerMessages
{
    private List mErrors = new ArrayList();
    private List mMessages = new ArrayList();
    
    public RollerMessages() 
    {
    //#RollerMessages.java:34: method: void org.apache.roller.weblogger.util.RollerMessages.org.apache.roller.weblogger.util.RollerMessages()
    //#input(void org.apache.roller.weblogger.util.RollerMessages()): this
    //#output(void org.apache.roller.weblogger.util.RollerMessages()): new ArrayList(RollerMessages#1) num objects
    //#output(void org.apache.roller.weblogger.util.RollerMessages()): new ArrayList(RollerMessages#2) num objects
    //#output(void org.apache.roller.weblogger.util.RollerMessages()): this.mErrors
    //#output(void org.apache.roller.weblogger.util.RollerMessages()): this.mMessages
    //#new obj(void org.apache.roller.weblogger.util.RollerMessages()): new ArrayList(RollerMessages#1)
    //#new obj(void org.apache.roller.weblogger.util.RollerMessages()): new ArrayList(RollerMessages#2)
    //#post(void org.apache.roller.weblogger.util.RollerMessages()): this.mErrors == &new ArrayList(RollerMessages#1)
    //#post(void org.apache.roller.weblogger.util.RollerMessages()): this.mMessages == &new ArrayList(RollerMessages#2)
    //#post(void org.apache.roller.weblogger.util.RollerMessages()): new ArrayList(RollerMessages#1) num objects == 1
    //#post(void org.apache.roller.weblogger.util.RollerMessages()): new ArrayList(RollerMessages#2) num objects == 1
    }
    //#RollerMessages.java:35: end of method: void org.apache.roller.weblogger.util.RollerMessages.org.apache.roller.weblogger.util.RollerMessages()
    public void addError(String key)
    {
        mErrors.add(new RollerMessage(key, null));
    //#RollerMessages.java:38: method: void org.apache.roller.weblogger.util.RollerMessages.addError(String)
    //#input(void addError(String)): key
    //#input(void addError(String)): this
    //#input(void addError(String)): this.mErrors
    //#pre[3] (void addError(String)): this.mErrors != null
    }
    //#RollerMessages.java:39: end of method: void org.apache.roller.weblogger.util.RollerMessages.addError(String)
    public void addError(String key, String arg)
    {
        mErrors.add(new RollerMessage(key, new String[]{arg}));
    //#RollerMessages.java:42: method: void org.apache.roller.weblogger.util.RollerMessages.addError(String, String)
    //#input(void addError(String, String)): arg
    //#input(void addError(String, String)): key
    //#input(void addError(String, String)): this
    //#input(void addError(String, String)): this.mErrors
    //#pre[4] (void addError(String, String)): this.mErrors != null
    }
    //#RollerMessages.java:43: end of method: void org.apache.roller.weblogger.util.RollerMessages.addError(String, String)
    public void addError(String key, String[] args)
    {
        mErrors.add(new RollerMessage(key, args));
    //#RollerMessages.java:46: method: void org.apache.roller.weblogger.util.RollerMessages.addError(String, String[])
    //#input(void addError(String, String[])): args
    //#input(void addError(String, String[])): key
    //#input(void addError(String, String[])): this
    //#input(void addError(String, String[])): this.mErrors
    //#pre[4] (void addError(String, String[])): this.mErrors != null
    }
    //#RollerMessages.java:47: end of method: void org.apache.roller.weblogger.util.RollerMessages.addError(String, String[])
    public void addMessage(String key)
    {
        mMessages.add(new RollerMessage(key, null));
    //#RollerMessages.java:50: method: void org.apache.roller.weblogger.util.RollerMessages.addMessage(String)
    //#input(void addMessage(String)): key
    //#input(void addMessage(String)): this
    //#input(void addMessage(String)): this.mMessages
    //#pre[3] (void addMessage(String)): this.mMessages != null
    }
    //#RollerMessages.java:51: end of method: void org.apache.roller.weblogger.util.RollerMessages.addMessage(String)
    public void addMessage(String key, String arg)
    {
        mMessages.add(new RollerMessage(key, new String[]{arg}));
    //#RollerMessages.java:54: method: void org.apache.roller.weblogger.util.RollerMessages.addMessage(String, String)
    //#input(void addMessage(String, String)): arg
    //#input(void addMessage(String, String)): key
    //#input(void addMessage(String, String)): this
    //#input(void addMessage(String, String)): this.mMessages
    //#pre[4] (void addMessage(String, String)): this.mMessages != null
    }
    //#RollerMessages.java:55: end of method: void org.apache.roller.weblogger.util.RollerMessages.addMessage(String, String)
    public void addMessage(String key, String[] args)
    {
        mMessages.add(new RollerMessage(key, args));
    //#RollerMessages.java:58: method: void org.apache.roller.weblogger.util.RollerMessages.addMessage(String, String[])
    //#input(void addMessage(String, String[])): args
    //#input(void addMessage(String, String[])): key
    //#input(void addMessage(String, String[])): this
    //#input(void addMessage(String, String[])): this.mMessages
    //#pre[4] (void addMessage(String, String[])): this.mMessages != null
    }
    //#RollerMessages.java:59: end of method: void org.apache.roller.weblogger.util.RollerMessages.addMessage(String, String[])
    public Iterator getErrors()
    {
        return mErrors.iterator();
    //#RollerMessages.java:62: method: Iterator org.apache.roller.weblogger.util.RollerMessages.getErrors()
    //#input(Iterator getErrors()): this
    //#input(Iterator getErrors()): this.mErrors
    //#output(Iterator getErrors()): return_value
    //#pre[2] (Iterator getErrors()): this.mErrors != null
    //#post(Iterator getErrors()): return_value != null
    //#RollerMessages.java:62: end of method: Iterator org.apache.roller.weblogger.util.RollerMessages.getErrors()
    }
    public Iterator getMessages()
    {
        return mMessages.iterator();
    //#RollerMessages.java:66: method: Iterator org.apache.roller.weblogger.util.RollerMessages.getMessages()
    //#input(Iterator getMessages()): this
    //#input(Iterator getMessages()): this.mMessages
    //#output(Iterator getMessages()): return_value
    //#pre[2] (Iterator getMessages()): this.mMessages != null
    //#post(Iterator getMessages()): return_value != null
    //#RollerMessages.java:66: end of method: Iterator org.apache.roller.weblogger.util.RollerMessages.getMessages()
    }
    public int getErrorCount() 
    {
        return mErrors.size();
    //#RollerMessages.java:70: method: int org.apache.roller.weblogger.util.RollerMessages.getErrorCount()
    //#input(int getErrorCount()): this
    //#input(int getErrorCount()): this.mErrors
    //#output(int getErrorCount()): return_value
    //#pre[2] (int getErrorCount()): this.mErrors != null
    //#post(int getErrorCount()): init'ed(return_value)
    //#RollerMessages.java:70: end of method: int org.apache.roller.weblogger.util.RollerMessages.getErrorCount()
    }
    public int getMessageCount() 
    {
        return mMessages.size();
    //#RollerMessages.java:74: method: int org.apache.roller.weblogger.util.RollerMessages.getMessageCount()
    //#input(int getMessageCount()): this
    //#input(int getMessageCount()): this.mMessages
    //#output(int getMessageCount()): return_value
    //#pre[2] (int getMessageCount()): this.mMessages != null
    //#post(int getMessageCount()): init'ed(return_value)
    //#RollerMessages.java:74: end of method: int org.apache.roller.weblogger.util.RollerMessages.getMessageCount()
    }
    public String toString() 
    {
        StringBuffer sb = new StringBuffer();
    //#RollerMessages.java:78: method: String org.apache.roller.weblogger.util.RollerMessages.toString()
    //#input(String toString()): " : "._tainted
    //#input(String toString()): org/apache/roller/weblogger/util/RollerMessages$RollerMessage.__Descendant_Table[org/apache/roller/weblogger/util/RollerMessages$RollerMessage]
    //#input(String toString()): org/apache/roller/weblogger/util/RollerMessages$RollerMessage.__Descendant_Table[others]
    //#input(String toString()): org/apache/roller/weblogger/util/RollerMessages$RollerMessage.__Dispatch_Table.getKey()Ljava/lang/String;
    //#input(String toString()): this
    //#input(String toString()): this.mErrors
    //#input(String toString()): this.mMessages
    //#output(String toString()): java.lang.StringBuffer:toString(...)._tainted
    //#output(String toString()): return_value
    //#new obj(String toString()): java.lang.StringBuffer:toString(...)
    //#pre[2] (String toString()): this.mErrors != null
    //#pre[3] (String toString()): this.mMessages != null
    //#presumption(String toString()): java.util.Iterator:next(...).__Tag@82 == org/apache/roller/weblogger/util/RollerMessages$RollerMessage
    //#presumption(String toString()): java.util.Iterator:next(...).__Tag@89 == org/apache/roller/weblogger/util/RollerMessages$RollerMessage
    //#presumption(String toString()): java.util.Iterator:next(...)@82 != null
    //#presumption(String toString()): java.util.Iterator:next(...)@89 != null
    //#post(String toString()): java.lang.StringBuffer:toString(...)._tainted == 0
    //#post(String toString()): return_value == &java.lang.StringBuffer:toString(...)
    //#test_vector(String toString()): java.util.Iterator:hasNext(...)@80: {0}, {1}
    //#test_vector(String toString()): java.util.Iterator:hasNext(...)@87: {0}, {1}
        Iterator msgs = mMessages.iterator();
        while (msgs.hasNext())
        {
            RollerMessage msg = (RollerMessage) msgs.next();
            sb.append(msg.getKey());
            sb.append(" : ");
        }
        Iterator errs = mErrors.iterator();
        while (errs.hasNext())
        {
            RollerMessage msg = (RollerMessage) errs.next();
            sb.append(msg.getKey());
            sb.append(" : ");
        }
        return sb.toString();
    //#RollerMessages.java:93: end of method: String org.apache.roller.weblogger.util.RollerMessages.toString()
    }
    public static class RollerMessage
    {
        private String mKey;
        private String[] mArgs;
        public RollerMessage(String key, String[] args)
        {
    //#RollerMessages.java:100: method: void org.apache.roller.weblogger.util.RollerMessages$RollerMessage.org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])
    //#input(void org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])): args
    //#input(void org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])): key
    //#input(void org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])): this
    //#output(void org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])): this.mArgs
    //#output(void org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])): this.mKey
    //#post(void org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])): this.mArgs == args
    //#post(void org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])): init'ed(this.mArgs)
    //#post(void org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])): this.mKey == key
    //#post(void org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])): init'ed(this.mKey)
            mKey = key;
            mArgs = args;
        }
    //#RollerMessages.java:103: end of method: void org.apache.roller.weblogger.util.RollerMessages$RollerMessage.org.apache.roller.weblogger.util.RollerMessages$RollerMessage(String, String[])
        public String[] getArgs()
        {
            return mArgs;
    //#RollerMessages.java:106: method: String[] org.apache.roller.weblogger.util.RollerMessages$RollerMessage.getArgs()
    //#input(String[] getArgs()): this
    //#input(String[] getArgs()): this.mArgs
    //#output(String[] getArgs()): return_value
    //#pre[2] (String[] getArgs()): init'ed(this.mArgs)
    //#post(String[] getArgs()): return_value == this.mArgs
    //#post(String[] getArgs()): init'ed(return_value)
    //#RollerMessages.java:106: end of method: String[] org.apache.roller.weblogger.util.RollerMessages$RollerMessage.getArgs()
        }
        public void setArgs(String[] args)
        {
            mArgs = args;
    //#RollerMessages.java:110: method: void org.apache.roller.weblogger.util.RollerMessages$RollerMessage.setArgs(String[])
    //#input(void setArgs(String[])): args
    //#input(void setArgs(String[])): this
    //#output(void setArgs(String[])): this.mArgs
    //#post(void setArgs(String[])): this.mArgs == args
    //#post(void setArgs(String[])): init'ed(this.mArgs)
        }
    //#RollerMessages.java:111: end of method: void org.apache.roller.weblogger.util.RollerMessages$RollerMessage.setArgs(String[])
        public String getKey()
        {
            return mKey;
    //#RollerMessages.java:114: method: String org.apache.roller.weblogger.util.RollerMessages$RollerMessage.getKey()
    //#input(String getKey()): this
    //#input(String getKey()): this.mKey
    //#output(String getKey()): return_value
    //#pre[2] (String getKey()): init'ed(this.mKey)
    //#post(String getKey()): return_value == this.mKey
    //#post(String getKey()): init'ed(return_value)
    //#RollerMessages.java:114: end of method: String org.apache.roller.weblogger.util.RollerMessages$RollerMessage.getKey()
        }
        public void setKey(String key)
        {
            mKey = key;
    //#RollerMessages.java:118: method: void org.apache.roller.weblogger.util.RollerMessages$RollerMessage.setKey(String)
    //#input(void setKey(String)): key
    //#input(void setKey(String)): this
    //#output(void setKey(String)): this.mKey
    //#post(void setKey(String)): this.mKey == key
    //#post(void setKey(String)): init'ed(this.mKey)
        }
    //#RollerMessages.java:119: end of method: void org.apache.roller.weblogger.util.RollerMessages$RollerMessage.setKey(String)
    }
}
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Descendant_Table[org/apache/roller/weblogger/util/RollerMessages]
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addError(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addError(Ljava/lang/String;Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addError(Ljava/lang/String;[Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;[Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.getErrorCount()I
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.getErrors()Ljava/util/Iterator;
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.getMessageCount()I
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.getMessages()Ljava/util/Iterator;
    //#output(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.toString()Ljava/lang/String;
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Descendant_Table[org/apache/roller/weblogger/util/RollerMessages] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addError(Ljava/lang/String;)V == &addError
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addError(Ljava/lang/String;Ljava/lang/String;)V == &addError
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addError(Ljava/lang/String;[Ljava/lang/String;)V == &addError
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;)V == &addMessage
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;Ljava/lang/String;)V == &addMessage
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;[Ljava/lang/String;)V == &addMessage
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.getErrorCount()I == &getErrorCount
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.getErrors()Ljava/util/Iterator; == &getErrors
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.getMessageCount()I == &getMessageCount
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.getMessages()Ljava/util/Iterator; == &getMessages
    //#post(org.apache.roller.weblogger.util.RollerMessages__static_init): __Dispatch_Table.toString()Ljava/lang/String; == &toString
    //#RollerMessages.java:: end of method: org.apache.roller.weblogger.util.RollerMessages.org.apache.roller.weblogger.util.RollerMessages__static_init
    //#RollerMessages.java:: end of class: org.apache.roller.weblogger.util.RollerMessages
    //#output(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Descendant_Table[org/apache/roller/weblogger/util/RollerMessages$RollerMessage]
    //#output(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Dispatch_Table.getArgs()[Ljava/lang/String;
    //#output(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Dispatch_Table.getKey()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Dispatch_Table.setArgs([Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Dispatch_Table.setKey(Ljava/lang/String;)V
    //#post(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Descendant_Table[org/apache/roller/weblogger/util/RollerMessages$RollerMessage] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Dispatch_Table.getArgs()[Ljava/lang/String; == &getArgs
    //#post(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Dispatch_Table.getKey()Ljava/lang/String; == &getKey
    //#post(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Dispatch_Table.setArgs([Ljava/lang/String;)V == &setArgs
    //#post(org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init): __Dispatch_Table.setKey(Ljava/lang/String;)V == &setKey
    //#RollerMessages.java:: end of method: org.apache.roller.weblogger.util.RollerMessages$RollerMessage.org.apache.roller.weblogger.util.RollerMessages$RollerMessage__static_init
    //#RollerMessages.java:: end of class: org.apache.roller.weblogger.util.RollerMessages$RollerMessage
