blob: 435c08abd8e089d77b89923e5fdab6baed3e5c95 [file] [log] [blame]
rsrinivasancf824322008-05-02 19:51:19 +00001/*******************************************************************************
2 * Copyright (c) 2001, 2008 Oracle Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Oracle Corporation - initial API and implementation
10 *******************************************************************************/
cbatemane4b50312008-01-09 21:03:59 +000011package org.eclipse.jst.jsf.common.runtime.internal.view.model.common;
12
13import java.io.Serializable;
14
15/**
16 * An abstraction of a tag element that maps to a JSF artifact (i.e. component, validator)
17 *
18 * @author cbateman
19 *
20 */
21public interface IJSFTagElement extends ITagElement
22{
cbateman80ebf972008-01-09 22:35:20 +000023 /**
24 * An enumeration of different kinds of tags.
25 *
26 * @author cbateman
27 *
28 */
cbatemane4b50312008-01-09 21:03:59 +000029 static class TagType implements Serializable
30 {
31 /**
32 * serializable id
33 */
34 private static final long serialVersionUID = -2845327764902349963L;
35 private final static int TYPE_COMPONENT = 0;
36 private final static int TYPE_CONVERTER = 1;
37 private final static int TYPE_VALIDATOR = 2;
38 private final static int TYPE_HANDLER = 3;
39 //private final static int TYPE_UNKNOWN = 4;
40
41 private final static String[] strValues =
rsrinivasan888a18e2008-04-24 00:22:54 +000042 {"component", "converter", "validator", "handler"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
cbatemane4b50312008-01-09 21:03:59 +000043
44 private final int _intValue;
45
46 public TagType(int intValue)
47 {
48 _intValue = intValue;
49 }
50
51 public String toString()
52 {
53 return strValues[_intValue];
54 }
55
56 protected final int intValue()
57 {
58 return _intValue;
59 }
60
61 public final static TagType COMPONENT =
62 new TagType(TYPE_COMPONENT);
63 public final static TagType CONVERTER =
64 new TagType(TYPE_CONVERTER);
65 public final static TagType VALIDATOR =
66 new TagType(TYPE_VALIDATOR);
67 public final static TagType HANDLER =
68 new TagType(TYPE_HANDLER);
69 }
70
71 /**
72 * @return the type of tag as distinguished by how it may affect the
73 * view at runtime.
74 */
75 TagType getType();
76}