KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > dtd > IAttribute


1 /*******************************************************************************
2  * Copyright (c) 2002, 2005 Object Factory Inc.
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  * Object Factory Inc. - Initial implementation
10  *******************************************************************************/

11 package org.eclipse.ant.internal.ui.dtd;
12
13 /**
14  * Schema attribute interface.
15  * @author Bob Foster
16  */

17 public interface IAttribute extends IAtom {
18
19     public static final String JavaDoc CDATA = "CDATA"; //$NON-NLS-1$
20
public static final String JavaDoc ID = "ID"; //$NON-NLS-1$
21
public static final String JavaDoc IDREF = "IDREF"; //$NON-NLS-1$
22
public static final String JavaDoc IDREFS = "IDREFS"; //$NON-NLS-1$
23
public static final String JavaDoc NMTOKEN = "NMTOKEN"; //$NON-NLS-1$
24
public static final String JavaDoc NMTOKENS = "NMTOKENS"; //$NON-NLS-1$
25
public static final String JavaDoc ENTITY = "ENTITY"; //$NON-NLS-1$
26
public static final String JavaDoc ENTITIES = "ENTITIES"; //$NON-NLS-1$
27
public static final String JavaDoc NOTATION = "NOTATION"; //$NON-NLS-1$
28
public static final String JavaDoc ENUMERATION = "enumeration"; //$NON-NLS-1$
29

30     /**
31      * @return the attribute type. This will be one of "CDATA", "ID", "IDREF",
32      * "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", "NOTATION" or
33      * "enumeration". The type is interned and may be compared to a constant
34      * with ==. For "NOTATION" or "enumeration", <code>getEnum()</code> will
35      * return a list of values.
36      */

37     public String JavaDoc getType();
38     
39     /**
40      *
41      * @return String[] or null if type is not "NOTATION" or "ENUMERATION".
42      */

43     public String JavaDoc[] getEnum();
44     
45     /**
46      * Return the element the attribute is defined in.
47      */

48     public IElement getElement();
49     
50     /**
51      * Return the default value or null if none.
52      */

53     public String JavaDoc getDefault();
54     
55     /**
56      * Return true if the default value is fixed.
57      */

58     public boolean isFixed();
59     
60     /**
61      * Return true if attribute is required, false if it is optional.
62      */

63     public boolean isRequired();
64 }
65
Popular Tags