rsrinivasan | cf82432 | 2008-05-02 19:51:19 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 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 | *******************************************************************************/ |
cbateman | e4b5031 | 2008-01-09 21:03:59 +0000 | [diff] [blame] | 11 | package org.eclipse.jst.jsf.common.runtime.internal.view.model.common; |
| 12 | |
| 13 | import 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 | */ |
| 21 | public interface IJSFTagElement extends ITagElement |
| 22 | { |
cbateman | 80ebf97 | 2008-01-09 22:35:20 +0000 | [diff] [blame] | 23 | /** |
| 24 | * An enumeration of different kinds of tags. |
| 25 | * |
| 26 | * @author cbateman |
| 27 | * |
| 28 | */ |
cbateman | e4b5031 | 2008-01-09 21:03:59 +0000 | [diff] [blame] | 29 | 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 = |
rsrinivasan | 888a18e | 2008-04-24 00:22:54 +0000 | [diff] [blame] | 42 | {"component", "converter", "validator", "handler"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
cbateman | e4b5031 | 2008-01-09 21:03:59 +0000 | [diff] [blame] | 43 | |
| 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 | } |