Skip to main content
summaryrefslogtreecommitdiffstats
blob: 6cc7830a6cde30a669d69b533ac3183b1271a191 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package org.eclipse.jst.jsf.common.runtime.internal.view.model.common;

import java.io.Serializable;

/**
 * An abstraction of a tag element that maps to a JSF artifact (i.e. component, validator)
 *
 * @author cbateman
 *
 */
public interface IJSFTagElement extends ITagElement
{
    /**
     * An enumeration of different kinds of tags.
     * 
     * @author cbateman
     *
     */
    static class TagType implements Serializable
    {
        /**
         * serializable id
         */
        private static final long serialVersionUID = -2845327764902349963L;
        private final static int TYPE_COMPONENT = 0;
        private final static int TYPE_CONVERTER = 1;
        private final static int TYPE_VALIDATOR = 2;
        private final static int TYPE_HANDLER = 3;
        //private final static int TYPE_UNKNOWN = 4;

        private final static String[]  strValues =
            {"component", "converter", "validator", "handler"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$

        private final int _intValue;
        
        public TagType(int intValue)
        {
            _intValue = intValue;
        }

        public String toString()
        {
            return strValues[_intValue];
        }

        protected final int intValue()
        {
            return _intValue;
        }
       
        public final static TagType COMPONENT = 
            new TagType(TYPE_COMPONENT);
        public final static TagType CONVERTER = 
            new TagType(TYPE_CONVERTER);
        public final static TagType VALIDATOR = 
            new TagType(TYPE_VALIDATOR);
        public final static TagType HANDLER = 
            new TagType(TYPE_HANDLER);
    }
    
    /**
     * @return the type of tag as distinguished by how it may affect the
     * view at runtime.
     */
    TagType getType();
}

Back to the top