KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > ischema > ISchemaAttribute


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM 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  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.core.ischema;
12
13 /**
14  * Objects that implement this interface hold data about attributes of schema
15  * elements.
16  */

17 public interface ISchemaAttribute extends ISchemaObject, IMetaAttribute {
18     /**
19      * This attribute can be omitted by the extension element.
20      */

21     public static final int OPTIONAL = 0;
22
23     /**
24      * This attribute must be defined in the extension element.
25      */

26     public static final int REQUIRED = 1;
27
28     /**
29      * This attribute can be omitted by the extension element, and if it is, its
30      * value will be set to the value defined in the "value" field.
31      */

32     public static final int DEFAULT = 2;
33
34     /**
35      * Table of the 'use' clause choices.
36      */

37     public static final String JavaDoc[] useTable = {
38             "optional", "required", "default" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
39

40     /**
41      * Returns the type of this attribute. Attributes can only have simple
42      * types.
43      */

44     public ISchemaSimpleType getType();
45
46     /**
47      * Returns the 'use' mode of this attribute (OPTIONAL, REQUIRED or DEFAULT).
48      */

49     public int getUse();
50
51     /**
52      * Returns the default value of this attribute when 'use' clause is DEFAULT.
53      */

54     public Object JavaDoc getValue();
55     
56 }
57
Popular Tags