001// =================== DO NOT EDIT THIS FILE ====================
002// Generated by Modello 1.8.3,
003// any modifications will be overwritten.
004// ==============================================================
005
006package org.apache.maven.usability.plugin;
007
008/**
009 * The root of a parameter plugin expression document.
010 * 
011 * @version $Revision$ $Date$
012 */
013@SuppressWarnings( "all" )
014public class ExpressionDocumentation
015    implements java.io.Serializable
016{
017
018      //--------------------------/
019     //- Class/Member Variables -/
020    //--------------------------/
021
022    /**
023     * Field expressions.
024     */
025    private java.util.List<Expression> expressions;
026
027    /**
028     * Field modelEncoding.
029     */
030    private String modelEncoding = "UTF-8";
031
032
033      //-----------/
034     //- Methods -/
035    //-----------/
036
037    /**
038     * Method addExpression.
039     * 
040     * @param expression
041     */
042    public void addExpression( Expression expression )
043    {
044        getExpressions().add( expression );
045    } //-- void addExpression( Expression )
046
047    /**
048     * Method getExpressions.
049     * 
050     * @return List
051     */
052    public java.util.List<Expression> getExpressions()
053    {
054        if ( this.expressions == null )
055        {
056            this.expressions = new java.util.ArrayList<Expression>();
057        }
058
059        return this.expressions;
060    } //-- java.util.List<Expression> getExpressions()
061
062    /**
063     * Get the modelEncoding field.
064     * 
065     * @return String
066     */
067    public String getModelEncoding()
068    {
069        return this.modelEncoding;
070    } //-- String getModelEncoding()
071
072    /**
073     * Method removeExpression.
074     * 
075     * @param expression
076     */
077    public void removeExpression( Expression expression )
078    {
079        getExpressions().remove( expression );
080    } //-- void removeExpression( Expression )
081
082    /**
083     * Set the list of plugin parameter expressions described by
084     * this
085     *             document.
086     * 
087     * @param expressions
088     */
089    public void setExpressions( java.util.List<Expression> expressions )
090    {
091        this.expressions = expressions;
092    } //-- void setExpressions( java.util.List )
093
094    /**
095     * Set the modelEncoding field.
096     * 
097     * @param modelEncoding
098     */
099    public void setModelEncoding( String modelEncoding )
100    {
101        this.modelEncoding = modelEncoding;
102    } //-- void setModelEncoding( String )
103
104        private java.util.Map expressionsBySyntax;
105
106    public java.util.Map getExpressionsBySyntax()
107    {
108        if ( expressionsBySyntax == null )
109        {
110            expressionsBySyntax = new java.util.HashMap();
111
112            java.util.List expressions = getExpressions();
113
114            if ( expressions != null && !expressions.isEmpty() )
115            {
116                for ( java.util.Iterator it = expressions.iterator(); it.hasNext(); )
117                {
118                    Expression expr = (Expression) it.next();
119
120                    expressionsBySyntax.put( expr.getSyntax(), expr );
121                }
122            }
123        }
124
125        return expressionsBySyntax;
126    }
127
128    public void flushExpressionsBySyntax()
129    {
130        expressionsBySyntax = null;
131    }
132
133}