01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.core.ischema;
11:
12: /**
13: * Objects that implement this interface hold data about attributes of schema
14: * elements.
15: */
16: public interface ISchemaAttribute extends ISchemaObject, IMetaAttribute {
17: /**
18: * This attribute can be omitted by the extension element.
19: */
20: public static final int OPTIONAL = 0;
21:
22: /**
23: * This attribute must be defined in the extension element.
24: */
25: public static final int REQUIRED = 1;
26:
27: /**
28: * This attribute can be omitted by the extension element, and if it is, its
29: * value will be set to the value defined in the "value" field.
30: */
31: public static final int DEFAULT = 2;
32:
33: /**
34: * Table of the 'use' clause choices.
35: */
36: public static final String[] USE_TABLE = {
37: "optional", "required", "default" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
38:
39: public static final int BOOL_IND = 0;
40: public static final int STR_IND = 1;
41: public static final int JAVA_IND = 2;
42: public static final int RES_IND = 3;
43: public static final String[] TYPES = { "boolean", //$NON-NLS-1$
44: "string", //$NON-NLS-1$
45: "java", //$NON-NLS-1$
46: "resource" //$NON-NLS-1$
47: };
48:
49: /**
50: * Returns the type of this attribute. Attributes can only have simple
51: * types.
52: */
53: public ISchemaSimpleType getType();
54:
55: /**
56: * Returns the 'use' mode of this attribute (OPTIONAL, REQUIRED or DEFAULT).
57: */
58: public int getUse();
59:
60: /**
61: * Returns the default value of this attribute when 'use' clause is DEFAULT.
62: */
63: public Object getValue();
64:
65: }
|